Public report of apollohg/react-native-rich-text-editor, 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, 14:38 UTC · Survey ID cd_64aee80479244e25a514109e04480cb0
apollohg/react-native-rich-text-editor
Measured 17 November 2026, 14:33 UTC, at code version e68f39b
First survey, so nothing to compare with yet
CAI scoreAt risk
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: 318,900 lines of product code in 9 projects, tests not counted · Estimated rebuild effort: about 4.0 person-years · Weakest lens: Event-Driven, 10.0
Findings by how serious they are
128 critical1800 serious85 minor
19 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, 14:33 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 ▸
73of 73 dimensions measured by tools.
2006of 2013 findings point to an exact file and line, so you can open each one in the code. The other 7 concern the repository as a whole, such as missing documentation.
73dimensions across 9 lenses, read from 318,900 lines of product code in 9 projects.
apollohg/react-native-rich-text-editor is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 33.9 out of 100, which the At risk rating leaves unchanged.
Event-Driven, at 10.0, is the weakest lens and counts most in the score. The best first step is stopping the event handlers from waiting on other services, worth about 19.9 points. Raising Event-Driven to 70 would lift the score to about 53.4.
103 pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Fifteen known security holes in the packages the code depends on can be used by attackers, and one automatic update takes new releases before a bad one can be spotted. Pinning each tool to an exact version, updating the vulnerable packages and setting a waiting period for automatic updates would close these risks. The four loops of files that import each other need breaking.
The product code is 318,900 lines, about €570,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 Event-Driven rose from 10.0 to 70, the lowest score rated Strong, the score would rise from 33.9 to about 53.4.
Code composition: what the lines of code are
Product code 57%Tests 43%
Rebuild cost: about €570,000 · Estimate
Cost to rebuild
€190,000 to €960,000, for 3,182 to 10,094 hours of work, about 4.0 person-years for 2 to 8 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 34. 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: 318,900 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
Replace the synchronous wait with `async`/`await` so the handler never blocks on a peer/resource.
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.
Raises the score by about 4.7 points · Medium effort · Text alternatives
3
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 4.7 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 €570,000 to build again, about 4.0 person-years of work. Its weakest lens is Event-Driven, at 10.0 (Critical). Event-Driven is about whether the parts of the system can rely on the messages they send each other. Because the weakest lens counts most in the score, work on Event-Driven also moves the score most.
Based on: the rebuild estimate · the Event-Driven grade · how much each lens counts
What to do: Start with the Event-Driven actions in Top priorities.
If you do one thing first · First action
Replace the synchronous wait with `async`/`await` so the handler never blocks on a peer/resource. Of all the actions in this report, it raises the score most for the work it takes: about 19.9 points for medium effort. 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 6.7 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 7% on every change. The history of the code shows how much it changes: about 985,429 lines over the last 90 days, which is about 3,996,462 lines a year. At that pace, the extra work comes to an estimated 319.2 to 1915.5 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.
613 modules, with 1878 dependencies between them. 13 loops run through 164 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 573 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.
com.apollohg.editor.viewer uses uniffi.editor_core, so a change to uniffi.editor_core can break com.apollohg.editor.viewer, while a change to com.apollohg.editor.viewer can't break uniffi.editor_core.
Position
Below the diagonal: com.apollohg.editor.viewer uses a module listed above it, which is the healthy direction.
7→11 com.apollohg.editor.viewer uses com.apollohg.editor.tablespart of a loop✕
Connections
41 pairs of types, where a type in com.apollohg.editor.viewer uses a type in com.apollohg.editor.tables. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
com.apollohg.editor.viewer uses com.apollohg.editor.tables, so a change to com.apollohg.editor.tables can break com.apollohg.editor.viewer, while a change to com.apollohg.editor.viewer can't break com.apollohg.editor.tables.
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.
7→13 com.apollohg.editor.viewer uses com.apollohg.editorpart of a loop✕
Connections
26 pairs of types, where a type in com.apollohg.editor.viewer uses a type in com.apollohg.editor. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
com.apollohg.editor.viewer uses com.apollohg.editor, so a change to com.apollohg.editor can break com.apollohg.editor.viewer, while a change to com.apollohg.editor.viewer can't break com.apollohg.editor.
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.
editor_core.model uses editor_core.model.node, so a change to editor_core.model.node can break editor_core.model, while a change to editor_core.model can't break editor_core.model.node.
Position
Below the diagonal: editor_core.model uses a module listed above it, which is the healthy direction.
yrs.types.xml uses yrs.transaction, so a change to yrs.transaction can break yrs.types.xml, while a change to yrs.types.xml can't break yrs.transaction.
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.
10→18 yrs.types.xml uses yrs.branchpart of a loop✕
Connections
20 pairs of types, where a type in yrs.types.xml uses a type in yrs.branch.
com.apollohg.editor.tables uses uniffi.editor_core, so a change to uniffi.editor_core can break com.apollohg.editor.tables, while a change to com.apollohg.editor.tables can't break uniffi.editor_core.
Position
Below the diagonal: com.apollohg.editor.tables uses a module listed above it, which is the healthy direction.
35 pairs of types, where a type in com.apollohg.editor.tables uses a type in com.apollohg.editor.viewer. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
com.apollohg.editor.tables uses com.apollohg.editor.viewer, so a change to com.apollohg.editor.viewer can break com.apollohg.editor.tables, while a change to com.apollohg.editor.tables can't break com.apollohg.editor.viewer.
Position
Below the diagonal: com.apollohg.editor.tables uses a module listed above it, which is the healthy direction.
11→13 com.apollohg.editor.tables uses com.apollohg.editorpart of a loop✕
Connections
14 pairs of types, where a type in com.apollohg.editor.tables uses a type in com.apollohg.editor.
com.apollohg.editor.tables uses com.apollohg.editor, so a change to com.apollohg.editor can break com.apollohg.editor.tables, while a change to com.apollohg.editor.tables can't break com.apollohg.editor.
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.
com.apollohg.editor uses uniffi.editor_core, so a change to uniffi.editor_core can break com.apollohg.editor, while a change to com.apollohg.editor can't break uniffi.editor_core.
Position
Below the diagonal: com.apollohg.editor uses a module listed above it, which is the healthy direction.
com.apollohg.editor uses com.apollohg.editor.viewer, so a change to com.apollohg.editor.viewer can break com.apollohg.editor, while a change to com.apollohg.editor can't break com.apollohg.editor.viewer.
Position
Below the diagonal: com.apollohg.editor uses a module listed above it, which is the healthy direction.
com.apollohg.editor uses com.apollohg.editor.tables, so a change to com.apollohg.editor.tables can break com.apollohg.editor, while a change to com.apollohg.editor can't break com.apollohg.editor.tables.
Position
Below the diagonal: com.apollohg.editor uses a module listed above it, which is the healthy direction.
yrs.types.map uses yrs.transaction, so a change to yrs.transaction can break yrs.types.map, while a change to yrs.types.map can't break yrs.transaction.
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.
14→18 yrs.types.map uses yrs.branchpart of a loop✕
Connections
8 pairs of types, where a type in yrs.types.map uses a type in yrs.branch.
The types involved
yrs.types.map.Keys → yrs.branch.Branch
yrs.types.map.MapEvent → yrs.branch.BranchPtr
yrs.types.map.MapIntoIter → yrs.branch.BranchPtr
yrs.types.map.MapIter → yrs.branch.Branch
yrs.types.map.MapPrelim → yrs.branch.BranchPtr
yrs.types.map.MapRef → yrs.branch.Branch
yrs.types.map.MapRef → yrs.branch.BranchPtr
yrs.types.map.Values → yrs.branch.Branch
Direction
yrs.types.map uses yrs.branch, so a change to yrs.branch can break yrs.types.map, while a change to yrs.types.map can't break yrs.branch.
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.
yrs.transaction uses yrs.types.xml, so a change to yrs.types.xml can break yrs.transaction, while a change to yrs.transaction can't break yrs.types.xml.
Position
Below the diagonal: yrs.transaction uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in yrs.transaction uses a type in yrs.types.map.
The types involved
yrs.transaction.ReadTxn → yrs.types.map.MapRef
yrs.transaction.WriteTxn → yrs.types.map.MapRef
Direction
yrs.transaction uses yrs.types.map, so a change to yrs.types.map can break yrs.transaction, while a change to yrs.transaction can't break yrs.types.map.
Position
Below the diagonal: yrs.transaction uses a module listed above it, which is the healthy direction.
15→16 yrs.transaction uses yrs.storepart of a loop✕
Connections
8 pairs of types, where a type in yrs.transaction uses a type in yrs.store.
editor_core.yrs_engine.mutation.plan.model uses yrs.types.xml, so a change to yrs.types.xml can break editor_core.yrs_engine.mutation.plan.model, while a change to editor_core.yrs_engine.mutation.plan.model can't break yrs.types.xml.
Position
Below the diagonal: editor_core.yrs_engine.mutation.plan.model uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.mutation.plan.model uses yrs.transaction, so a change to yrs.transaction can break editor_core.yrs_engine.mutation.plan.model, while a change to editor_core.yrs_engine.mutation.plan.model can't break yrs.transaction.
Position
Below the diagonal: editor_core.yrs_engine.mutation.plan.model uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.mutation.plan.model uses yrs.branch, so a change to yrs.branch can break editor_core.yrs_engine.mutation.plan.model, while a change to editor_core.yrs_engine.mutation.plan.model can't break yrs.branch.
Position
Below the diagonal: editor_core.yrs_engine.mutation.plan.model uses a module listed above it, which is the healthy direction.
editor_core.schema uses editor_core.boundary.limits, so a change to editor_core.boundary.limits can break editor_core.schema, while a change to editor_core.schema can't break editor_core.boundary.limits.
Position
Below the diagonal: editor_core.schema uses a module listed above it, which is the healthy direction.
editor_core.schema uses editor_core.model.node, so a change to editor_core.model.node can break editor_core.schema, while a change to editor_core.schema can't break editor_core.model.node.
Position
Below the diagonal: editor_core.schema uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in editor_core.schema uses a type in yrs.types.map.
The types involved
editor_core.schema.Schema → yrs.types.map.Map
Direction
editor_core.schema uses yrs.types.map, so a change to yrs.types.map can break editor_core.schema, while a change to editor_core.schema can't break yrs.types.map.
Position
Below the diagonal: editor_core.schema uses a module listed above it, which is the healthy direction.
editor_core.position uses editor_core.model.node, so a change to editor_core.model.node can break editor_core.position, while a change to editor_core.position can't break editor_core.model.node.
Position
Below the diagonal: editor_core.position uses a module listed above it, which is the healthy direction.
editor_core.position uses editor_core.model, so a change to editor_core.model can break editor_core.position, while a change to editor_core.position can't break editor_core.model.
Position
Below the diagonal: editor_core.position uses a module listed above it, which is the healthy direction.
editor_core.position uses editor_core.schema, so a change to editor_core.schema can break editor_core.position, while a change to editor_core.position can't break editor_core.schema.
Position
Below the diagonal: editor_core.position uses a module listed above it, which is the healthy direction.
editor_core.tables.admission uses editor_core.boundary.limits, so a change to editor_core.boundary.limits can break editor_core.tables.admission, while a change to editor_core.tables.admission can't break editor_core.boundary.limits.
Position
Below the diagonal: editor_core.tables.admission uses a module listed above it, which is the healthy direction.
editor_core.tables.admission uses editor_core.model.node, so a change to editor_core.model.node can break editor_core.tables.admission, while a change to editor_core.tables.admission can't break editor_core.model.node.
Position
Below the diagonal: editor_core.tables.admission uses a module listed above it, which is the healthy direction.
editor_core.tables.admission uses editor_core.model, so a change to editor_core.model can break editor_core.tables.admission, while a change to editor_core.tables.admission can't break editor_core.model.
Position
Below the diagonal: editor_core.tables.admission uses a module listed above it, which is the healthy direction.
editor_core.tables.admission uses editor_core.schema, so a change to editor_core.schema can break editor_core.tables.admission, while a change to editor_core.tables.admission can't break editor_core.schema.
Position
Below the diagonal: editor_core.tables.admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.canonical uses editor_core.model.node, so a change to editor_core.model.node can break editor_core.yrs_engine.canonical, while a change to editor_core.yrs_engine.canonical can't break editor_core.model.node.
Position
Below the diagonal: editor_core.yrs_engine.canonical uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.canonical uses editor_core.model, so a change to editor_core.model can break editor_core.yrs_engine.canonical, while a change to editor_core.yrs_engine.canonical can't break editor_core.model.
Position
Below the diagonal: editor_core.yrs_engine.canonical uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.canonical uses editor_core.schema, so a change to editor_core.schema can break editor_core.yrs_engine.canonical, while a change to editor_core.yrs_engine.canonical can't break editor_core.schema.
Position
Below the diagonal: editor_core.yrs_engine.canonical uses a module listed above it, which is the healthy direction.
editor_core.render.incremental uses editor_core.boundary.limits, so a change to editor_core.boundary.limits can break editor_core.render.incremental, while a change to editor_core.render.incremental can't break editor_core.boundary.limits.
Position
Below the diagonal: editor_core.render.incremental uses a module listed above it, which is the healthy direction.
editor_core.render.incremental uses editor_core.model.node, so a change to editor_core.model.node can break editor_core.render.incremental, while a change to editor_core.render.incremental can't break editor_core.model.node.
Position
Below the diagonal: editor_core.render.incremental uses a module listed above it, which is the healthy direction.
editor_core.render.incremental uses editor_core.model, so a change to editor_core.model can break editor_core.render.incremental, while a change to editor_core.render.incremental can't break editor_core.model.
Position
Below the diagonal: editor_core.render.incremental uses a module listed above it, which is the healthy direction.
editor_core.render.incremental uses editor_core.schema, so a change to editor_core.schema can break editor_core.render.incremental, while a change to editor_core.render.incremental can't break editor_core.schema.
Position
Below the diagonal: editor_core.render.incremental uses a module listed above it, which is the healthy direction.
editor_core.render.incremental uses editor_core.tables.admission, so a change to editor_core.tables.admission can break editor_core.render.incremental, while a change to editor_core.render.incremental can't break editor_core.tables.admission.
Position
Below the diagonal: editor_core.render.incremental uses a module listed above it, which is the healthy direction.
editor_core.selection uses editor_core.model, so a change to editor_core.model can break editor_core.selection, while a change to editor_core.selection can't break editor_core.model.
Position
Below the diagonal: editor_core.selection uses a module listed above it, which is the healthy direction.
editor_core.selection uses editor_core.position, so a change to editor_core.position can break editor_core.selection, while a change to editor_core.selection can't break editor_core.position.
Position
Below the diagonal: editor_core.selection uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.validation uses editor_core.boundary.limits, so a change to editor_core.boundary.limits can break editor_core.yrs_engine.derived_state.validation, while a change to editor_core.yrs_engine.derived_state.validation can't break editor_core.boundary.limits.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.validation uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.validation uses editor_core.model.node, so a change to editor_core.model.node can break editor_core.yrs_engine.derived_state.validation, while a change to editor_core.yrs_engine.derived_state.validation can't break editor_core.model.node.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.validation uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.validation uses editor_core.yrs_engine.editing_limits, so a change to editor_core.yrs_engine.editing_limits can break editor_core.yrs_engine.derived_state.validation, while a change to editor_core.yrs_engine.derived_state.validation can't break editor_core.yrs_engine.editing_limits.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.validation uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.validation uses editor_core.model, so a change to editor_core.model can break editor_core.yrs_engine.derived_state.validation, while a change to editor_core.yrs_engine.derived_state.validation can't break editor_core.model.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.validation uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.validation uses yrs.types.xml, so a change to yrs.types.xml can break editor_core.yrs_engine.derived_state.validation, while a change to editor_core.yrs_engine.derived_state.validation can't break yrs.types.xml.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.validation uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.validation uses yrs.branch, so a change to yrs.branch can break editor_core.yrs_engine.derived_state.validation, while a change to editor_core.yrs_engine.derived_state.validation can't break yrs.branch.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.validation uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.validation uses editor_core.schema, so a change to editor_core.schema can break editor_core.yrs_engine.derived_state.validation, while a change to editor_core.yrs_engine.derived_state.validation can't break editor_core.schema.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.validation uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.validation uses editor_core.tables.admission, so a change to editor_core.tables.admission can break editor_core.yrs_engine.derived_state.validation, while a change to editor_core.yrs_engine.derived_state.validation can't break editor_core.tables.admission.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.validation uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.validation uses editor_core.yrs_engine.canonical, so a change to editor_core.yrs_engine.canonical can break editor_core.yrs_engine.derived_state.validation, while a change to editor_core.yrs_engine.derived_state.validation can't break editor_core.yrs_engine.canonical.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.validation uses a module listed above it, which is the healthy direction.
28→33 editor_core.yrs_engine.derived_state.validation uses editor_core.yrs_engine.derived_state.insert_admissionpart of a loop✕
Connections
1 pair of types, where a type in editor_core.yrs_engine.derived_state.validation uses a type in editor_core.yrs_engine.derived_state.insert_admission.
editor_core.yrs_engine.derived_state.validation uses editor_core.yrs_engine.derived_state.insert_admission, so a change to editor_core.yrs_engine.derived_state.insert_admission can break editor_core.yrs_engine.derived_state.validation, while a change to editor_core.yrs_engine.derived_state.validation can't break editor_core.yrs_engine.derived_state.insert_admission.
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.
28→37 editor_core.yrs_engine.derived_state.validation uses editor_core.yrs_engine.compilerpart of a loop✕
Connections
1 pair of types, where a type in editor_core.yrs_engine.derived_state.validation uses a type in editor_core.yrs_engine.compiler.
editor_core.yrs_engine.derived_state.validation uses editor_core.yrs_engine.compiler, so a change to editor_core.yrs_engine.compiler can break editor_core.yrs_engine.derived_state.validation, while a change to editor_core.yrs_engine.derived_state.validation can't break editor_core.yrs_engine.compiler.
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.
editor_core.command_planner uses editor_core.boundary.limits, so a change to editor_core.boundary.limits can break editor_core.command_planner, while a change to editor_core.command_planner can't break editor_core.boundary.limits.
Position
Below the diagonal: editor_core.command_planner uses a module listed above it, which is the healthy direction.
editor_core.command_planner uses editor_core.model, so a change to editor_core.model can break editor_core.command_planner, while a change to editor_core.command_planner can't break editor_core.model.
Position
Below the diagonal: editor_core.command_planner uses a module listed above it, which is the healthy direction.
editor_core.command_planner uses editor_core.schema, so a change to editor_core.schema can break editor_core.command_planner, while a change to editor_core.command_planner can't break editor_core.schema.
Position
Below the diagonal: editor_core.command_planner uses a module listed above it, which is the healthy direction.
editor_core.command_planner uses editor_core.selection, so a change to editor_core.selection can break editor_core.command_planner, while a change to editor_core.command_planner can't break editor_core.selection.
Position
Below the diagonal: editor_core.command_planner uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.operation uses editor_core.render.incremental, so a change to editor_core.render.incremental can break editor_core.yrs_engine.operation, while a change to editor_core.yrs_engine.operation can't break editor_core.render.incremental.
Position
Below the diagonal: editor_core.yrs_engine.operation uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.operation uses editor_core.selection, so a change to editor_core.selection can break editor_core.yrs_engine.operation, while a change to editor_core.yrs_engine.operation can't break editor_core.selection.
Position
Below the diagonal: editor_core.yrs_engine.operation uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.history uses editor_core.yrs_engine.editing_limits, so a change to editor_core.yrs_engine.editing_limits can break editor_core.yrs_engine.history, while a change to editor_core.yrs_engine.history can't break editor_core.yrs_engine.editing_limits.
Position
Below the diagonal: editor_core.yrs_engine.history uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.history uses yrs.id_set, so a change to yrs.id_set can break editor_core.yrs_engine.history, while a change to editor_core.yrs_engine.history can't break yrs.id_set.
Position
Below the diagonal: editor_core.yrs_engine.history uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.history uses yrs.types.xml, so a change to yrs.types.xml can break editor_core.yrs_engine.history, while a change to editor_core.yrs_engine.history can't break yrs.types.xml.
Position
Below the diagonal: editor_core.yrs_engine.history uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.history uses yrs.transaction, so a change to yrs.transaction can break editor_core.yrs_engine.history, while a change to editor_core.yrs_engine.history can't break yrs.transaction.
Position
Below the diagonal: editor_core.yrs_engine.history uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.history uses yrs.doc, so a change to yrs.doc can break editor_core.yrs_engine.history, while a change to editor_core.yrs_engine.history can't break yrs.doc.
Position
Below the diagonal: editor_core.yrs_engine.history uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.history uses editor_core.yrs_engine.canonical, so a change to editor_core.yrs_engine.canonical can break editor_core.yrs_engine.history, while a change to editor_core.yrs_engine.history can't break editor_core.yrs_engine.canonical.
Position
Below the diagonal: editor_core.yrs_engine.history uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.history uses editor_core.yrs_engine.operation, so a change to editor_core.yrs_engine.operation can break editor_core.yrs_engine.history, while a change to editor_core.yrs_engine.history can't break editor_core.yrs_engine.operation.
Position
Below the diagonal: editor_core.yrs_engine.history uses a module listed above it, which is the healthy direction.
31→37 editor_core.yrs_engine.history uses editor_core.yrs_engine.compilerpart of a loop✕
Connections
2 pairs of types, where a type in editor_core.yrs_engine.history uses a type in editor_core.yrs_engine.compiler.
editor_core.yrs_engine.history uses editor_core.yrs_engine.compiler, so a change to editor_core.yrs_engine.compiler can break editor_core.yrs_engine.history, while a change to editor_core.yrs_engine.history can't break editor_core.yrs_engine.compiler.
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.
editor_core.yrs_engine.mutation.lowering.model uses editor_core.boundary.limits, so a change to editor_core.boundary.limits can break editor_core.yrs_engine.mutation.lowering.model, while a change to editor_core.yrs_engine.mutation.lowering.model can't break editor_core.boundary.limits.
Position
Below the diagonal: editor_core.yrs_engine.mutation.lowering.model uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.mutation.lowering.model uses editor_core.model.node, so a change to editor_core.model.node can break editor_core.yrs_engine.mutation.lowering.model, while a change to editor_core.yrs_engine.mutation.lowering.model can't break editor_core.model.node.
Position
Below the diagonal: editor_core.yrs_engine.mutation.lowering.model uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.mutation.lowering.model uses editor_core.yrs_engine.editing_limits, so a change to editor_core.yrs_engine.editing_limits can break editor_core.yrs_engine.mutation.lowering.model, while a change to editor_core.yrs_engine.mutation.lowering.model can't break editor_core.yrs_engine.editing_limits.
Position
Below the diagonal: editor_core.yrs_engine.mutation.lowering.model uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.mutation.lowering.model uses editor_core.model, so a change to editor_core.model can break editor_core.yrs_engine.mutation.lowering.model, while a change to editor_core.yrs_engine.mutation.lowering.model can't break editor_core.model.
Position
Below the diagonal: editor_core.yrs_engine.mutation.lowering.model uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.mutation.lowering.model uses yrs.types.xml, so a change to yrs.types.xml can break editor_core.yrs_engine.mutation.lowering.model, while a change to editor_core.yrs_engine.mutation.lowering.model can't break yrs.types.xml.
Position
Below the diagonal: editor_core.yrs_engine.mutation.lowering.model uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.mutation.lowering.model uses yrs.branch, so a change to yrs.branch can break editor_core.yrs_engine.mutation.lowering.model, while a change to editor_core.yrs_engine.mutation.lowering.model can't break yrs.branch.
Position
Below the diagonal: editor_core.yrs_engine.mutation.lowering.model uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.mutation.lowering.model uses editor_core.yrs_engine.mutation.plan.model, so a change to editor_core.yrs_engine.mutation.plan.model can break editor_core.yrs_engine.mutation.lowering.model, while a change to editor_core.yrs_engine.mutation.lowering.model can't break editor_core.yrs_engine.mutation.plan.model.
Position
Below the diagonal: editor_core.yrs_engine.mutation.lowering.model uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.mutation.lowering.model uses editor_core.schema, so a change to editor_core.schema can break editor_core.yrs_engine.mutation.lowering.model, while a change to editor_core.yrs_engine.mutation.lowering.model can't break editor_core.schema.
Position
Below the diagonal: editor_core.yrs_engine.mutation.lowering.model uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.mutation.lowering.model uses editor_core.position, so a change to editor_core.position can break editor_core.yrs_engine.mutation.lowering.model, while a change to editor_core.yrs_engine.mutation.lowering.model can't break editor_core.position.
Position
Below the diagonal: editor_core.yrs_engine.mutation.lowering.model uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.mutation.lowering.model uses editor_core.yrs_engine.canonical, so a change to editor_core.yrs_engine.canonical can break editor_core.yrs_engine.mutation.lowering.model, while a change to editor_core.yrs_engine.mutation.lowering.model can't break editor_core.yrs_engine.canonical.
Position
Below the diagonal: editor_core.yrs_engine.mutation.lowering.model uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.mutation.lowering.model uses editor_core.yrs_engine.derived_state.validation, so a change to editor_core.yrs_engine.derived_state.validation can break editor_core.yrs_engine.mutation.lowering.model, while a change to editor_core.yrs_engine.mutation.lowering.model can't break editor_core.yrs_engine.derived_state.validation.
Position
Below the diagonal: editor_core.yrs_engine.mutation.lowering.model uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.mutation.lowering.model uses editor_core.yrs_engine.operation, so a change to editor_core.yrs_engine.operation can break editor_core.yrs_engine.mutation.lowering.model, while a change to editor_core.yrs_engine.mutation.lowering.model can't break editor_core.yrs_engine.operation.
Position
Below the diagonal: editor_core.yrs_engine.mutation.lowering.model uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.insert_admission uses editor_core.boundary.limits, so a change to editor_core.boundary.limits can break editor_core.yrs_engine.derived_state.insert_admission, while a change to editor_core.yrs_engine.derived_state.insert_admission can't break editor_core.boundary.limits.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.insert_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.insert_admission uses editor_core.yrs_engine.editing_limits, so a change to editor_core.yrs_engine.editing_limits can break editor_core.yrs_engine.derived_state.insert_admission, while a change to editor_core.yrs_engine.derived_state.insert_admission can't break editor_core.yrs_engine.editing_limits.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.insert_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.insert_admission uses editor_core.model, so a change to editor_core.model can break editor_core.yrs_engine.derived_state.insert_admission, while a change to editor_core.yrs_engine.derived_state.insert_admission can't break editor_core.model.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.insert_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.insert_admission uses yrs.types.xml, so a change to yrs.types.xml can break editor_core.yrs_engine.derived_state.insert_admission, while a change to editor_core.yrs_engine.derived_state.insert_admission can't break yrs.types.xml.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.insert_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.insert_admission uses editor_core.schema, so a change to editor_core.schema can break editor_core.yrs_engine.derived_state.insert_admission, while a change to editor_core.yrs_engine.derived_state.insert_admission can't break editor_core.schema.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.insert_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.insert_admission uses editor_core.yrs_engine.canonical, so a change to editor_core.yrs_engine.canonical can break editor_core.yrs_engine.derived_state.insert_admission, while a change to editor_core.yrs_engine.derived_state.insert_admission can't break editor_core.yrs_engine.canonical.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.insert_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.insert_admission uses editor_core.render.incremental, so a change to editor_core.render.incremental can break editor_core.yrs_engine.derived_state.insert_admission, while a change to editor_core.yrs_engine.derived_state.insert_admission can't break editor_core.render.incremental.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.insert_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.insert_admission uses editor_core.yrs_engine.derived_state.validation, so a change to editor_core.yrs_engine.derived_state.validation can break editor_core.yrs_engine.derived_state.insert_admission, while a change to editor_core.yrs_engine.derived_state.insert_admission can't break editor_core.yrs_engine.derived_state.validation.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.insert_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.insert_admission uses editor_core.yrs_engine.operation, so a change to editor_core.yrs_engine.operation can break editor_core.yrs_engine.derived_state.insert_admission, while a change to editor_core.yrs_engine.derived_state.insert_admission can't break editor_core.yrs_engine.operation.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.insert_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state.insert_admission uses editor_core.yrs_engine.mutation.lowering.model, so a change to editor_core.yrs_engine.mutation.lowering.model can break editor_core.yrs_engine.derived_state.insert_admission, while a change to editor_core.yrs_engine.derived_state.insert_admission can't break editor_core.yrs_engine.mutation.lowering.model.
Position
Below the diagonal: editor_core.yrs_engine.derived_state.insert_admission uses a module listed above it, which is the healthy direction.
33→34 editor_core.yrs_engine.derived_state.insert_admission uses editor_core.yrs_engine.derived_statepart of a loop✕
Connections
2 pairs of types, where a type in editor_core.yrs_engine.derived_state.insert_admission uses a type in editor_core.yrs_engine.derived_state.
editor_core.yrs_engine.derived_state.insert_admission uses editor_core.yrs_engine.derived_state, so a change to editor_core.yrs_engine.derived_state can break editor_core.yrs_engine.derived_state.insert_admission, while a change to editor_core.yrs_engine.derived_state.insert_admission can't break editor_core.yrs_engine.derived_state.
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.
33→35 editor_core.yrs_engine.derived_state.insert_admission uses editor_core.yrs_engine.prepared_admissionpart of a loop✕
Connections
1 pair of types, where a type in editor_core.yrs_engine.derived_state.insert_admission uses a type in editor_core.yrs_engine.prepared_admission.
editor_core.yrs_engine.derived_state.insert_admission uses editor_core.yrs_engine.prepared_admission, so a change to editor_core.yrs_engine.prepared_admission can break editor_core.yrs_engine.derived_state.insert_admission, while a change to editor_core.yrs_engine.derived_state.insert_admission can't break editor_core.yrs_engine.prepared_admission.
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.
33→37 editor_core.yrs_engine.derived_state.insert_admission uses editor_core.yrs_engine.compilerpart of a loop✕
Connections
1 pair of types, where a type in editor_core.yrs_engine.derived_state.insert_admission uses a type in editor_core.yrs_engine.compiler.
editor_core.yrs_engine.derived_state.insert_admission uses editor_core.yrs_engine.compiler, so a change to editor_core.yrs_engine.compiler can break editor_core.yrs_engine.derived_state.insert_admission, while a change to editor_core.yrs_engine.derived_state.insert_admission can't break editor_core.yrs_engine.compiler.
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.
editor_core.yrs_engine.derived_state uses editor_core.boundary.limits, so a change to editor_core.boundary.limits can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.boundary.limits.
Position
Below the diagonal: editor_core.yrs_engine.derived_state uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state uses editor_core.yrs_engine.editing_limits, so a change to editor_core.yrs_engine.editing_limits can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.yrs_engine.editing_limits.
Position
Below the diagonal: editor_core.yrs_engine.derived_state uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state uses editor_core.model, so a change to editor_core.model can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.model.
Position
Below the diagonal: editor_core.yrs_engine.derived_state uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state uses yrs.types.xml, so a change to yrs.types.xml can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break yrs.types.xml.
Position
Below the diagonal: editor_core.yrs_engine.derived_state uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state uses editor_core.schema, so a change to editor_core.schema can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.schema.
Position
Below the diagonal: editor_core.yrs_engine.derived_state uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state uses editor_core.position, so a change to editor_core.position can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.position.
Position
Below the diagonal: editor_core.yrs_engine.derived_state uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state uses editor_core.tables.admission, so a change to editor_core.tables.admission can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.tables.admission.
Position
Below the diagonal: editor_core.yrs_engine.derived_state uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state uses editor_core.yrs_engine.canonical, so a change to editor_core.yrs_engine.canonical can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.yrs_engine.canonical.
Position
Below the diagonal: editor_core.yrs_engine.derived_state uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state uses editor_core.render.incremental, so a change to editor_core.render.incremental can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.render.incremental.
Position
Below the diagonal: editor_core.yrs_engine.derived_state uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state uses editor_core.selection, so a change to editor_core.selection can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.selection.
Position
Below the diagonal: editor_core.yrs_engine.derived_state uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state uses editor_core.yrs_engine.derived_state.validation, so a change to editor_core.yrs_engine.derived_state.validation can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.yrs_engine.derived_state.validation.
Position
Below the diagonal: editor_core.yrs_engine.derived_state uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state uses editor_core.yrs_engine.operation, so a change to editor_core.yrs_engine.operation can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.yrs_engine.operation.
Position
Below the diagonal: editor_core.yrs_engine.derived_state uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state uses editor_core.yrs_engine.mutation.lowering.model, so a change to editor_core.yrs_engine.mutation.lowering.model can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.yrs_engine.mutation.lowering.model.
Position
Below the diagonal: editor_core.yrs_engine.derived_state uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.derived_state uses editor_core.yrs_engine.derived_state.insert_admission, so a change to editor_core.yrs_engine.derived_state.insert_admission can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.yrs_engine.derived_state.insert_admission.
Position
Below the diagonal: editor_core.yrs_engine.derived_state uses a module listed above it, which is the healthy direction.
34→35 editor_core.yrs_engine.derived_state uses editor_core.yrs_engine.prepared_admissionpart of a loop✕
Connections
1 pair of types, where a type in editor_core.yrs_engine.derived_state uses a type in editor_core.yrs_engine.prepared_admission.
editor_core.yrs_engine.derived_state uses editor_core.yrs_engine.prepared_admission, so a change to editor_core.yrs_engine.prepared_admission can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.yrs_engine.prepared_admission.
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.
34→37 editor_core.yrs_engine.derived_state uses editor_core.yrs_engine.compilerpart of a loop✕
Connections
2 pairs of types, where a type in editor_core.yrs_engine.derived_state uses a type in editor_core.yrs_engine.compiler.
editor_core.yrs_engine.derived_state uses editor_core.yrs_engine.compiler, so a change to editor_core.yrs_engine.compiler can break editor_core.yrs_engine.derived_state, while a change to editor_core.yrs_engine.derived_state can't break editor_core.yrs_engine.compiler.
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.
editor_core.yrs_engine.prepared_admission uses editor_core.boundary.limits, so a change to editor_core.boundary.limits can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.boundary.limits.
Position
Below the diagonal: editor_core.yrs_engine.prepared_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.prepared_admission uses editor_core.model.node, so a change to editor_core.model.node can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.model.node.
Position
Below the diagonal: editor_core.yrs_engine.prepared_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.prepared_admission uses editor_core.yrs_engine.editing_limits, so a change to editor_core.yrs_engine.editing_limits can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.yrs_engine.editing_limits.
Position
Below the diagonal: editor_core.yrs_engine.prepared_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.prepared_admission uses editor_core.model, so a change to editor_core.model can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.model.
Position
Below the diagonal: editor_core.yrs_engine.prepared_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.prepared_admission uses yrs.types.xml, so a change to yrs.types.xml can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break yrs.types.xml.
Position
Below the diagonal: editor_core.yrs_engine.prepared_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.prepared_admission uses editor_core.schema, so a change to editor_core.schema can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.schema.
Position
Below the diagonal: editor_core.yrs_engine.prepared_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.prepared_admission uses editor_core.yrs_engine.canonical, so a change to editor_core.yrs_engine.canonical can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.yrs_engine.canonical.
Position
Below the diagonal: editor_core.yrs_engine.prepared_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.prepared_admission uses editor_core.render.incremental, so a change to editor_core.render.incremental can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.render.incremental.
Position
Below the diagonal: editor_core.yrs_engine.prepared_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.prepared_admission uses editor_core.selection, so a change to editor_core.selection can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.selection.
Position
Below the diagonal: editor_core.yrs_engine.prepared_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.prepared_admission uses editor_core.yrs_engine.operation, so a change to editor_core.yrs_engine.operation can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.yrs_engine.operation.
Position
Below the diagonal: editor_core.yrs_engine.prepared_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.prepared_admission uses editor_core.yrs_engine.history, so a change to editor_core.yrs_engine.history can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.yrs_engine.history.
Position
Below the diagonal: editor_core.yrs_engine.prepared_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.prepared_admission uses editor_core.yrs_engine.mutation.lowering.model, so a change to editor_core.yrs_engine.mutation.lowering.model can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.yrs_engine.mutation.lowering.model.
Position
Below the diagonal: editor_core.yrs_engine.prepared_admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.prepared_admission uses editor_core.yrs_engine.derived_state, so a change to editor_core.yrs_engine.derived_state can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.yrs_engine.derived_state.
Position
Below the diagonal: editor_core.yrs_engine.prepared_admission uses a module listed above it, which is the healthy direction.
35→36 editor_core.yrs_engine.prepared_admission uses editor_core.yrs_engine.compiler.admissionpart of a loop✕
Connections
3 pairs of types, where a type in editor_core.yrs_engine.prepared_admission uses a type in editor_core.yrs_engine.compiler.admission.
editor_core.yrs_engine.prepared_admission uses editor_core.yrs_engine.compiler.admission, so a change to editor_core.yrs_engine.compiler.admission can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.yrs_engine.compiler.admission.
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.
35→37 editor_core.yrs_engine.prepared_admission uses editor_core.yrs_engine.compilerpart of a loop✕
Connections
3 pairs of types, where a type in editor_core.yrs_engine.prepared_admission uses a type in editor_core.yrs_engine.compiler.
editor_core.yrs_engine.prepared_admission uses editor_core.yrs_engine.compiler, so a change to editor_core.yrs_engine.compiler can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.yrs_engine.compiler.
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.
35→38 editor_core.yrs_engine.prepared_admission uses editor_core.yrs_engine.commandspart of a loop✕
Connections
1 pair of types, where a type in editor_core.yrs_engine.prepared_admission uses a type in editor_core.yrs_engine.commands.
editor_core.yrs_engine.prepared_admission uses editor_core.yrs_engine.commands, so a change to editor_core.yrs_engine.commands can break editor_core.yrs_engine.prepared_admission, while a change to editor_core.yrs_engine.prepared_admission can't break editor_core.yrs_engine.commands.
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.
editor_core.yrs_engine.compiler.admission uses editor_core.boundary.limits, so a change to editor_core.boundary.limits can break editor_core.yrs_engine.compiler.admission, while a change to editor_core.yrs_engine.compiler.admission can't break editor_core.boundary.limits.
Position
Below the diagonal: editor_core.yrs_engine.compiler.admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler.admission uses editor_core.yrs_engine.editing_limits, so a change to editor_core.yrs_engine.editing_limits can break editor_core.yrs_engine.compiler.admission, while a change to editor_core.yrs_engine.compiler.admission can't break editor_core.yrs_engine.editing_limits.
Position
Below the diagonal: editor_core.yrs_engine.compiler.admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler.admission uses editor_core.model, so a change to editor_core.model can break editor_core.yrs_engine.compiler.admission, while a change to editor_core.yrs_engine.compiler.admission can't break editor_core.model.
Position
Below the diagonal: editor_core.yrs_engine.compiler.admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler.admission uses editor_core.schema, so a change to editor_core.schema can break editor_core.yrs_engine.compiler.admission, while a change to editor_core.yrs_engine.compiler.admission can't break editor_core.schema.
Position
Below the diagonal: editor_core.yrs_engine.compiler.admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler.admission uses editor_core.position, so a change to editor_core.position can break editor_core.yrs_engine.compiler.admission, while a change to editor_core.yrs_engine.compiler.admission can't break editor_core.position.
Position
Below the diagonal: editor_core.yrs_engine.compiler.admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler.admission uses editor_core.yrs_engine.canonical, so a change to editor_core.yrs_engine.canonical can break editor_core.yrs_engine.compiler.admission, while a change to editor_core.yrs_engine.compiler.admission can't break editor_core.yrs_engine.canonical.
Position
Below the diagonal: editor_core.yrs_engine.compiler.admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler.admission uses editor_core.render.incremental, so a change to editor_core.render.incremental can break editor_core.yrs_engine.compiler.admission, while a change to editor_core.yrs_engine.compiler.admission can't break editor_core.render.incremental.
Position
Below the diagonal: editor_core.yrs_engine.compiler.admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler.admission uses editor_core.selection, so a change to editor_core.selection can break editor_core.yrs_engine.compiler.admission, while a change to editor_core.yrs_engine.compiler.admission can't break editor_core.selection.
Position
Below the diagonal: editor_core.yrs_engine.compiler.admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler.admission uses editor_core.yrs_engine.operation, so a change to editor_core.yrs_engine.operation can break editor_core.yrs_engine.compiler.admission, while a change to editor_core.yrs_engine.compiler.admission can't break editor_core.yrs_engine.operation.
Position
Below the diagonal: editor_core.yrs_engine.compiler.admission uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler.admission uses editor_core.yrs_engine.prepared_admission, so a change to editor_core.yrs_engine.prepared_admission can break editor_core.yrs_engine.compiler.admission, while a change to editor_core.yrs_engine.compiler.admission can't break editor_core.yrs_engine.prepared_admission.
Position
Below the diagonal: editor_core.yrs_engine.compiler.admission uses a module listed above it, which is the healthy direction.
36→37 editor_core.yrs_engine.compiler.admission uses editor_core.yrs_engine.compilerpart of a loop✕
Connections
1 pair of types, where a type in editor_core.yrs_engine.compiler.admission uses a type in editor_core.yrs_engine.compiler.
editor_core.yrs_engine.compiler.admission uses editor_core.yrs_engine.compiler, so a change to editor_core.yrs_engine.compiler can break editor_core.yrs_engine.compiler.admission, while a change to editor_core.yrs_engine.compiler.admission can't break editor_core.yrs_engine.compiler.
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.
editor_core.yrs_engine.compiler uses editor_core.boundary.limits, so a change to editor_core.boundary.limits can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break editor_core.boundary.limits.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler uses editor_core.model.node, so a change to editor_core.model.node can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break editor_core.model.node.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler uses editor_core.yrs_engine.editing_limits, so a change to editor_core.yrs_engine.editing_limits can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break editor_core.yrs_engine.editing_limits.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler uses editor_core.model, so a change to editor_core.model can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break editor_core.model.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler uses yrs.types.xml, so a change to yrs.types.xml can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break yrs.types.xml.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler uses yrs.branch, so a change to yrs.branch can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break yrs.branch.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler uses editor_core.yrs_engine.mutation.plan.model, so a change to editor_core.yrs_engine.mutation.plan.model can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break editor_core.yrs_engine.mutation.plan.model.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler uses editor_core.schema, so a change to editor_core.schema can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break editor_core.schema.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler uses editor_core.position, so a change to editor_core.position can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break editor_core.position.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler uses editor_core.yrs_engine.canonical, so a change to editor_core.yrs_engine.canonical can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break editor_core.yrs_engine.canonical.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler uses editor_core.selection, so a change to editor_core.selection can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break editor_core.selection.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler uses editor_core.yrs_engine.derived_state.validation, so a change to editor_core.yrs_engine.derived_state.validation can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break editor_core.yrs_engine.derived_state.validation.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler uses editor_core.yrs_engine.operation, so a change to editor_core.yrs_engine.operation can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break editor_core.yrs_engine.operation.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler uses editor_core.yrs_engine.derived_state.insert_admission, so a change to editor_core.yrs_engine.derived_state.insert_admission can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break editor_core.yrs_engine.derived_state.insert_admission.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.compiler uses editor_core.yrs_engine.compiler.admission, so a change to editor_core.yrs_engine.compiler.admission can break editor_core.yrs_engine.compiler, while a change to editor_core.yrs_engine.compiler can't break editor_core.yrs_engine.compiler.admission.
Position
Below the diagonal: editor_core.yrs_engine.compiler uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.commands uses editor_core.boundary.limits, so a change to editor_core.boundary.limits can break editor_core.yrs_engine.commands, while a change to editor_core.yrs_engine.commands can't break editor_core.boundary.limits.
Position
Below the diagonal: editor_core.yrs_engine.commands uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.commands uses editor_core.yrs_engine.editing_limits, so a change to editor_core.yrs_engine.editing_limits can break editor_core.yrs_engine.commands, while a change to editor_core.yrs_engine.commands can't break editor_core.yrs_engine.editing_limits.
Position
Below the diagonal: editor_core.yrs_engine.commands uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.commands uses editor_core.model, so a change to editor_core.model can break editor_core.yrs_engine.commands, while a change to editor_core.yrs_engine.commands can't break editor_core.model.
Position
Below the diagonal: editor_core.yrs_engine.commands uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.commands uses editor_core.schema, so a change to editor_core.schema can break editor_core.yrs_engine.commands, while a change to editor_core.yrs_engine.commands can't break editor_core.schema.
Position
Below the diagonal: editor_core.yrs_engine.commands uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.commands uses editor_core.position, so a change to editor_core.position can break editor_core.yrs_engine.commands, while a change to editor_core.yrs_engine.commands can't break editor_core.position.
Position
Below the diagonal: editor_core.yrs_engine.commands uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.commands uses editor_core.yrs_engine.canonical, so a change to editor_core.yrs_engine.canonical can break editor_core.yrs_engine.commands, while a change to editor_core.yrs_engine.commands can't break editor_core.yrs_engine.canonical.
Position
Below the diagonal: editor_core.yrs_engine.commands uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.commands uses editor_core.selection, so a change to editor_core.selection can break editor_core.yrs_engine.commands, while a change to editor_core.yrs_engine.commands can't break editor_core.selection.
Position
Below the diagonal: editor_core.yrs_engine.commands uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.commands uses editor_core.yrs_engine.derived_state.validation, so a change to editor_core.yrs_engine.derived_state.validation can break editor_core.yrs_engine.commands, while a change to editor_core.yrs_engine.commands can't break editor_core.yrs_engine.derived_state.validation.
Position
Below the diagonal: editor_core.yrs_engine.commands uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.commands uses editor_core.yrs_engine.operation, so a change to editor_core.yrs_engine.operation can break editor_core.yrs_engine.commands, while a change to editor_core.yrs_engine.commands can't break editor_core.yrs_engine.operation.
Position
Below the diagonal: editor_core.yrs_engine.commands uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.commands uses editor_core.yrs_engine.derived_state, so a change to editor_core.yrs_engine.derived_state can break editor_core.yrs_engine.commands, while a change to editor_core.yrs_engine.commands can't break editor_core.yrs_engine.derived_state.
Position
Below the diagonal: editor_core.yrs_engine.commands uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.commands uses editor_core.yrs_engine.prepared_admission, so a change to editor_core.yrs_engine.prepared_admission can break editor_core.yrs_engine.commands, while a change to editor_core.yrs_engine.commands can't break editor_core.yrs_engine.prepared_admission.
Position
Below the diagonal: editor_core.yrs_engine.commands uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.commands uses editor_core.yrs_engine.compiler, so a change to editor_core.yrs_engine.compiler can break editor_core.yrs_engine.commands, while a change to editor_core.yrs_engine.commands can't break editor_core.yrs_engine.compiler.
Position
Below the diagonal: editor_core.yrs_engine.commands uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.boundary.limits, so a change to editor_core.boundary.limits can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.boundary.limits.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.yrs_engine.editing_limits, so a change to editor_core.yrs_engine.editing_limits can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.yrs_engine.editing_limits.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.model, so a change to editor_core.model can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.model.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses yrs.types.xml, so a change to yrs.types.xml can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break yrs.types.xml.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses yrs.store, so a change to yrs.store can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break yrs.store.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses yrs.doc, so a change to yrs.doc can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break yrs.doc.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.schema, so a change to editor_core.schema can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.schema.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.position, so a change to editor_core.position can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.position.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.tables.admission, so a change to editor_core.tables.admission can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.tables.admission.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.yrs_engine.canonical, so a change to editor_core.yrs_engine.canonical can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.yrs_engine.canonical.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.render.incremental, so a change to editor_core.render.incremental can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.render.incremental.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.selection, so a change to editor_core.selection can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.selection.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.yrs_engine.operation, so a change to editor_core.yrs_engine.operation can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.yrs_engine.operation.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.yrs_engine.history, so a change to editor_core.yrs_engine.history can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.yrs_engine.history.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.yrs_engine.derived_state.insert_admission, so a change to editor_core.yrs_engine.derived_state.insert_admission can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.yrs_engine.derived_state.insert_admission.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.yrs_engine.derived_state, so a change to editor_core.yrs_engine.derived_state can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.yrs_engine.derived_state.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.yrs_engine.prepared_admission, so a change to editor_core.yrs_engine.prepared_admission can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.yrs_engine.prepared_admission.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.yrs_engine.compiler.admission, so a change to editor_core.yrs_engine.compiler.admission can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.yrs_engine.compiler.admission.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.yrs_engine.compiler, so a change to editor_core.yrs_engine.compiler can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.yrs_engine.compiler.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.yrs_engine.engine uses editor_core.yrs_engine.commands, so a change to editor_core.yrs_engine.commands can break editor_core.yrs_engine.engine, while a change to editor_core.yrs_engine.engine can't break editor_core.yrs_engine.commands.
Position
Below the diagonal: editor_core.yrs_engine.engine uses a module listed above it, which is the healthy direction.
editor_core.session uses editor_core.render.incremental, so a change to editor_core.render.incremental can break editor_core.session, while a change to editor_core.session can't break editor_core.render.incremental.
Position
Below the diagonal: editor_core.session uses a module listed above it, which is the healthy direction.
editor_core.session uses editor_core.yrs_engine.operation, so a change to editor_core.yrs_engine.operation can break editor_core.session, while a change to editor_core.session can't break editor_core.yrs_engine.operation.
Position
Below the diagonal: editor_core.session uses a module listed above it, which is the healthy direction.
editor_core.session uses editor_core.yrs_engine.engine, so a change to editor_core.yrs_engine.engine can break editor_core.session, while a change to editor_core.session can't break editor_core.yrs_engine.engine.
Position
Below the diagonal: editor_core.session uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 62.0 · Adequate · gated by D2, R3 ·
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
111
High / Critical
A03:2025 — Software Supply Chain Failures
41
High / Critical
Roadmap
Top priorities: Replace the synchronous wait with `async`/`await` so the handler never blocks on a peer/resource; 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; 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
Replace the synchronous wait with `async`/`await` so the handler never blocks on a peer/resource.
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.
Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
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 — 128
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 — 1800
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 — 85
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 19
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 73 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 — 73 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, 2006 of 2013 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 .ts, .tsx, .rs, .kt, and our analyzer cannot run the .rs, .kt 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 88.4% — 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 1,077 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 461 test source file(s) (.kt, .rs, .swift) 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 .rs, .kt, and the rust executor ran against the .rs half and did not finish re-running within its tier budget; the jvm executor ran against the .kt half and never executed — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (jest via `npm ci --ignore-scripts` in the repository root (1076 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 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 crate 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.
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 a Gradle build (build.gradle/build.gradle.kts), but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Gradle dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (2 contributor(s) across 948 commit(s) sampled, automation and bot accounts excluded). One of them holds 100% of the history; the other 1 hold 0% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — 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. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is 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.
D27 Navigability — 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D28 Secrets (history) — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The newest 750 of 948 commits were scanned for secrets, back to commit 4eded93582fe; older commits were not. `gitleaks` TIMED OUT after 81.9s against a 81.8s budget, so we killed its process tree. The budget is ours; the work may simply be larger than it allows. The working tree WAS scanned in full, and every row of the scanned ranges is reported. Nothing about the unscanned commits is asserted by the absence of a result; the budget is ours to raise.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `android/src/main/java/com/apollohg/editor/AndroidCollaborationTransport.kt`, `android/src/main/java/com/apollohg/editor/EditorEditTextAnnotations.kt`, `android/src/main/java/com/apollohg/editor/EditorEditTextRenderPatch.kt`, `android/src/main/java/com/apollohg/editor/EditorEditTextRendering.kt`, `android/src/main/java/com/apollohg/editor/EditorEditTextSelection.kt`, … (+28 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.
AX6 Interface segregation — 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.
AXB2 Runtime readiness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The dev server kept running but no port it opened served a page in the time allowed. (rule: no-answer). The renderer reported: the dev server (`npm run start` in example/) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> native-editor-example@2.2.3 start / > expo start / Starting project at <repo>/example / Starting Metro Bundler / Waiting on http://localhost:8081 / Logs for your project will appear below." No runtime evidence was gathered.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (start). the dev server (`npm run start` in example/) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> native-editor-example@2.2.3 start / > expo start / Starting project at <repo>/example / Starting Metro Bundler / Waiting on http://localhost:8081 / Logs for your project will appear below." No runtime evidence was gathered.
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
ED5 Idempotency — 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 decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
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 Kotlin, Python, Swift, c, cpp, objectivec is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Kotlin, Python, Swift, c, cpp, objectivec is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 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. 11 further occurrence(s) are not listed individually; the score already reflects all 51.
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. 107 further occurrence(s) are not listed individually; the score already reflects all 147.
S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 29 further occurrence(s) are not listed individually; the score already reflects all 69.
X2 Cancellation propagation — 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, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, 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.
X26 Unsynchronised callback handoff — 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 — 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.
X5 Nullable reference types — 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. 208 further occurrence(s) are not listed individually; the score already reflects all 248.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
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.
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.
D22 Internal API Consistency: API consistency compares the call shapes of members that play the same role on the exposed C# surface: whether the API suits its callers is not measured, and surfaces in other languages 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.
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 Dockerfile (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.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
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 YrsDocumentEngine::apply_compiled_transaction_with_history_and_context at 86. A further 7 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 TypedCommand::from at 41 — they are counted neither in the figure above nor in this dimension's score. 5 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: rust/editor-core/src/native_transaction_bridge/envelopes.rs (TypedCommand::from at 41), android/src/main/java/com/apollohg/editor/EditorEditTextInputTraits.kt (EditorEditTextInputTraitsKt.setKeyboardTypeImpl at 16), rust/editor-core/src/table_interop.rs (RustPeer::dispatch at 16), rust/editor-core/src/yrs_engine/commands/structure.rs (editor_core::yrs_engine::commands::structure::plan at 16), src/useTableToolbar.ts (useTableToolbar.useTableToolbar at 16). 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.
+ 232 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 10 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with YrsDocumentEngine::apply_compiled_transaction_with_history_and_context (cyclomatic 86), useEditorToolbarItems.useEditorToolbarItems (cyclomatic 84), CoreTextProseLayoutEngine.prepareBlock (cyclomatic 77). — 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 10 together lifts Cyclomatic Complexity from 5.6 to about 6.1/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.
+ 290 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 6 bodies over 120 down to 120 or less in Cognitive Complexity — start with RenderBridgeElementsKt.appendElements (cognitive 207), RenderBridge.renderElements (cognitive 157), CoreTextProseLayoutEngine.makePreparation (cognitive 133). — 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 6 together lifts Cognitive Complexity from 2.7 to about 3.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.3 / 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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 102 FileTooLong finding(s) in God Classes — start with text.rs (3), render.rs (2), commands.rs (2). — One of this dimension's main actionable groups (102 warning-level).
Resolve the 92 MethodTooLong finding(s) in God Classes — start with AndroidProseLayoutEngine.kt (5), CoreTextProseLayoutEngine.swift (4), text.rs (4). — One of this dimension's main actionable groups (92 warning-level).
Resolve the 53 FunctionTooLong finding(s) in God Classes — start with text.rs (3), clipboard.rs (3), preflight.rs (2). — One of this dimension's main actionable groups (53 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.
212 duplicated block group(s) detected. 3.0 % of the production lines (9,662 of 318,900) are in a reported copy. A further 169 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 32 of the 381 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.
Edited copy of a member (9 corresponding lines) · ×13rust/editor-core/src/tables/render/content_key.rs:61
Edited copy of a member (12 corresponding lines) · ×12ios/EditorTheme.swift:180
+ 118 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 21 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with candidate.rs (3), range.rs (2), structure.rs. — One of this dimension's main actionable groups (21 warning-level).
Resolve the 17 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with command_planner.rs (2), structure.rs, collaboration.rs. — One of this dimension's main actionable groups (17 warning-level).
Resolve the 16 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with text.rs (2), EditorV2Adapter+Mutation.swift (2), editor_state.rs. — One of this dimension's main actionable groups (16 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
9 production modules (Gradle+Cargo+npm), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 0 module(s) off the main sequence, with abstractness counted on 6 of the 9 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
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 4 Low cohesion finding(s) in Cohesion (LCOM4) — start with block.rs, editing_limits.rs, branch.rs. — One of this dimension's main actionable groups (4 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 Quality9.9 / 10Stronggated by 7 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.
0 skipped, 7 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1077 tests. Measured on the JavaScript/TypeScript suite only — at least 461 test source file(s) (.kt, .rs, .swift) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: TBL-21-P independently declared ${name} semantics · ×7scripts/table-interop/cases/presentation-semantics.test.ts:641
Mock-dominated test: coalesces pending provisional values and commits the final value · ×6src/__tests__/ExternalTextComposition.test.ts:79
What to do
Resolve the 7 No assertions finding(s) in Test Quality — start with presentation-semantics.test.ts (5), supplementary-continuity.test.ts (2). — One of this dimension's main actionable groups (7 warning-level).
Resolve the 6 Mock-dominated test finding(s) in Test Quality — start with ExternalTextComposition.test.ts, NativeProseViewer.test.tsx, NativeRichTextEditor.native-commits.test.tsx. — One of this dimension's main actionable groups (6 recommendation-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.
0 outdated direct SwiftPM dependencies, 0 pinning defect(s). SwiftPM has no package registry: a dependency is a repository URL and its releases are that repository's semver tags, so currency is answered by listing tags rather than by querying an index. Only a newer tag on the SAME MAJOR is reported — a `from:` requirement admits everything below the next major and nothing above it, so a major crossing needs a Package.swift edit rather than an update, and naming the update as its remedy would be wrong. Whether any dependency is DEPRECATED or ABANDONED is not graded and cannot be: a repository publishes no such marker, and there is no registry that could carry one. Known CVEs in this dependency graph are D30's question. 1 third-party CocoaPods resolved by a committed Podfile.lock were graded against the CocoaPods trunk (cdn.cocoapods.org): a pod is behind only when the trunk lists a newer release on the same major, which `pod update` reaches under a `~>` requirement. A pod sourced from a path, git URL or local podspec has no trunk release to compare and is not asked about. Carthage dependencies are not graded.
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 186 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json and a Gradle build (build.gradle/build.gradle.kts), and the licences of those dependency graphs 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: ios/RenderBridge.swift (23×69=1587); ios/Viewer/CoreTextProseLayoutEngine.swift (18×77=1386); android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt (16×66=1056) Repeated repair below the complexity floor: android/src/main/java/com/apollohg/editor/NativeEditorExpoView.kt (15 of 27 changes were fixes); android/src/main/java/com/apollohg/editor/RenderBridge.kt (12 of 21 changes were fixes); android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt (11 of 19 changes were fixes)
Resolve the 118 Hotspot finding(s) in Churn × Complexity Hotspots — start with text.rs (4), clipboard.rs (3), RenderBridge.swift. — One of this dimension's main actionable groups (118 warning-level).
Resolve the 12 Repeated repair finding(s) in Churn × Complexity Hotspots — start with NativeEditorExpoView.kt, RenderBridge.kt, EditorV2Adapter.kt. — One of this dimension's main actionable groups (12 warning-level).
Detailed fixes: d15_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.
0 deducted task-comment markers across 318900 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
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.
2 of 2 documentation facets pass in full. 4 document(s) read across 9 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.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 Cargo.toml. — 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.
Do you agree with this assessment?
D22 · Internal API Consistency10.0 / 10Exemplary○ Nothing flagged
What it measures: Whether the internal API surface is consistent and coherent.
Method: Call-shape rules (A1-A9) over the structured code model of the intentionally exposed C# surface: members of one type, overloads of one name and the same slot across sibling types are compared, and a member that makes a caller use a different convention for the same kind of operation is flagged. Deterministic, no model. 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.
3 of 7 build units (Cargo, Gradle, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion · ×3rust/editor-core/Cargo.toml:1
What to do
Resolve the 3 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with Cargo.toml, package.json, build.gradle. — One of this dimension's main actionable groups (3 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
gitleaks scanned the current working tree and the part of the history named below, and found no secrets. History coverage: The newest 750 of 948 commits were scanned for secrets, back to commit 4eded93582fe; older commits were not. `gitleaks` TIMED OUT after 81.9s against a 81.8s budget, so we killed its process tree. The budget is ours; the work may simply be larger than it allows.
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).
113 finding(s): 0 critical, 104 high, 5 medium, 4 low. 103 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 23 file(s) — `android/src/main/java/com/apollohg/editor/RenderImageLoader.kt` (line 859, line 861), `ios/Tests/EditorTableInputTests+CellElements.swift` (line 73, line 193, line 207), `ios/Tests/EditorTableInputTests.swift`, `ios/Tests/ViewerTableTests.swift`, `ios/editor_coreFFI/editor_coreFFI.h` (line 29, line 35, line 69, …), … (+18 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.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 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 warning-level).
No action in Static Analysis (SAST) — all 103 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (103 issue-level, 0 of them charged here).
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.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 13 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (13). — One of this dimension's main actionable groups (13 issue-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).
Resolve the 7 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (7). — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d30_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.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 721 of the 826 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 3 Change coupling finding(s) in Change Coupling — start with editor.rs, tests.rs, CoreTextProseLayoutEngine.swift. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with NativeRichTextEditor.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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
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 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 0 platform declaration(s) and 10 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 alternatives1.0 / 10Critical✓ 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. — src/schemaPresets.ts:72
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 & labels10.0 / 10Exemplary○ Nothing flagged
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.
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) — REDACTED:2, REDACTED:2
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×2) — REDACTED:2, REDACTED:2
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".
An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. — src/schemaPresets.ts:244
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
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.
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 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 the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Event-Driven — Whether event/message handlers avoid synchronous blocking waits — a blocking wait inside a handler stalls throughput and risks deadlock.
Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.
`NativeCollaborationTransport.onQueueSync` is an event/message handler that blocks on a synchronous wait (a semaphore/queue `.wait`/`.sync`) — it stalls the handler on a peer or resource and serialises throughput, and can deadlock under load. Await the work asynchronously (`async`/`await`) instead of blocking the handler. — ios/NativeCollaborationTransport.swift:320
What to do
Replace the synchronous wait with `async`/`await` so the handler never blocks on a peer/resource.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
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.
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.
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.
Do you agree with this assessment?
P2 · Observability4.8 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 1/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `packages/code-highlighting/rust`, `rust/editor-core`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Add a health-check endpoint (a /health route on your axum/actix router) so orchestrators and load balancers can probe liveness/readiness.
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 cargo-audit / cargo-deny (or clippy) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 2 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:19
`package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — package.json:116
What to do
Add a SAST step to CI running what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
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 · 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.
`existsSync` in `startPeer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/table-interop/controller.ts:462
What to do
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety8.9 / 10Strong✓ 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.
scripts/table-interop/continuity-evidence.ts:164 · scripts/table-interop/supplementary-evidence.ts:45 — the two spans are one implementation copied and then locally edited — 283 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. — scripts/table-interop/continuity-evidence.ts:164
src/NativeEditorDocumentBridge.ts:343 · src/NativeEditorDocumentBridge.ts:392 — 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. — src/NativeEditorDocumentBridge.ts:343
scripts/table-interop/checkpoint-io.ts:193 · scripts/table-interop/checkpoint-io.ts:226 — the two spans are one implementation copied and then locally edited — 134 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. — scripts/table-interop/checkpoint-io.ts:193
scripts/ktlint.mjs:37 · scripts/swiftlint.mjs:23 — the two spans are one implementation copied and then locally edited — 165 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. — scripts/ktlint.mjs:37
src/useRichTextEditorMentions.tsx:201 · src/useRichTextEditorUpdates.tsx:521 — 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. — src/useRichTextEditorMentions.tsx:201
scripts/table-interop/availability-evidence.ts:55 · scripts/table-interop/checkpoint-evidence.ts:123 — the two spans are one implementation copied and then locally edited — 131 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. — scripts/table-interop/availability-evidence.ts:55
scripts/table-interop/checkpoint-io.ts:44 · scripts/table-interop/run-continuations.ts:82 — the two spans are one implementation copied and then locally edited — 91 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. — scripts/table-interop/checkpoint-io.ts:44
src/ExternalTextComposition.ts:415 · src/ExternalTextComposition.ts:433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/ExternalTextComposition.ts:415
src/useRichTextEditorState.tsx:241 · src/useRichTextEditorState.tsx:271 — 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. — src/useRichTextEditorState.tsx:241
src/useNativeEditor.ts:559 · src/useNativeEditor.ts:607 — 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. — src/useNativeEditor.ts:559
src/NativeEditorCreateJson.ts:105 · src/NativeEditorCreateJson.ts:132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/NativeEditorCreateJson.ts:105
scripts/table-interop/assertions.ts:154 · scripts/table-interop/controller.ts:91 — 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. — scripts/table-interop/assertions.ts:154
scripts/table-interop/continuity-evidence.ts:303 · scripts/table-interop/continuity-evidence.ts:427 — 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. — scripts/table-interop/continuity-evidence.ts:303
scripts/table-interop/rust-peer.ts:131 · scripts/table-interop/web-peer.ts:177 — the two spans are one implementation copied and then locally edited — 68 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. — scripts/table-interop/rust-peer.ts:131
src/useRichTextEditorCommands.tsx:111 · src/useRichTextEditorCommands.tsx:233 — the two spans are one implementation copied and then locally edited — 60 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. — src/useRichTextEditorCommands.tsx:111
scripts/table-interop/corpus.ts:156 · scripts/table-interop/corpus.ts:184 — 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. — scripts/table-interop/corpus.ts:156
src/useNativeEditor.ts:323 · src/useNativeEditor.ts:343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/useNativeEditor.ts:323
src/NativeEditorCreateJson.ts:298 · src/NativeEditorCreateJson.ts:340 — 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. — src/NativeEditorCreateJson.ts:298
src/schemaNormalization.ts:200 · src/schemaNormalization.ts:257 — 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. — src/schemaNormalization.ts:200
scripts/table-interop/availability-evidence.ts:222 · scripts/table-interop/text-history-evidence.ts:28 — 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. — scripts/table-interop/availability-evidence.ts:222
scripts/table-interop/checkpoint-evidence.ts:149 · scripts/table-interop/corpus.ts:1393 — the two spans are one implementation copied and then locally edited — 63 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. — scripts/table-interop/checkpoint-evidence.ts:149
scripts/table-interop/corpus.ts:337 · scripts/table-interop/corpus.ts:975 — 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. — scripts/table-interop/corpus.ts:337
scripts/table-interop/corpus.ts:602 · scripts/table-interop/corpus.ts:619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — scripts/table-interop/corpus.ts:602
src/NativeEditorCreateJson.ts:433 · src/NativeEditorCreateJson.ts:671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/NativeEditorCreateJson.ts:433
src/NativeEditorResultNormalization.ts:240 · src/NativeEditorResultNormalization.ts:314 — 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. — src/NativeEditorResultNormalization.ts:240
src/RichTextEditorTypes.tsx:295 · src/useNativeEditor.ts:61 — the 2 copies are spread across 2 files, and the CITED SPAN is inside a TYPE DECLARATION, not executable code. There is no function to extract and no call site to call one from, so do not read this as an extract-a-helper row: the collapse a type offers is a generic — name the shape once, parameterised over the part that varies, and have each copy instantiate it. First check what actually differs between the copies: where they are a MATRIX of cases (one entry per input, differing precisely in the case each one pins), the repetition IS the enumeration and collapsing it would delete cases rather than de-duplicate anything — leave those alone. Reported because the copies that are not a matrix drift apart the first time only one of them is edited. — src/RichTextEditorTypes.tsx:295
src/schemaDocument.ts:31 · src/schemaResolution.ts:154 — 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. — src/schemaDocument.ts:31
src/useEditorToolbarPresentation.tsx:173 · src/useEditorToolbarPresentation.tsx:438 — 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. — src/useEditorToolbarPresentation.tsx:173
scripts/table-interop/corpus.ts:2009 · scripts/table-interop/supplementary-lifetime.ts:118 — 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. — scripts/table-interop/corpus.ts:2009
src/ExternalTextComposition.ts:238 · src/ExternalTextComposition.ts:255 — 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. — src/ExternalTextComposition.ts:238
src/ExternalTextComposition.ts:397 · src/ExternalTextComposition.ts:627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/ExternalTextComposition.ts:397
src/NativeProseViewer.tsx:134 · src/RichTextEditorSerialization.tsx:436 — the two spans are one implementation copied and then locally edited — 58 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. — src/NativeProseViewer.tsx:134
src/useNativeEditor.ts:619 · src/useNativeEditor.ts:631 — 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. — src/useNativeEditor.ts:619
src/EditorStyleSheetNormalization.ts:105 · src/NativeEditorCreateValidation.ts:136 · src/NativeEditorLocalAwareness.ts:85 — the 3 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. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — src/EditorStyleSheetNormalization.ts:105
src/ExternalTextComposition.ts:771 · src/ExternalTextComposition.ts:784 · src/ExternalTextComposition.ts:800 — 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. — src/ExternalTextComposition.ts:771
src/NativeEditorCreateValidation.ts:136 · src/NativeEditorLocalAwareness.ts:85 — 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. — src/NativeEditorCreateValidation.ts:136
src/atoms.ts:336 · src/attributeValidation.ts:38 — the two spans are one implementation copied and then locally edited — 62 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. — src/atoms.ts:336
src/useNativeEditor.ts:423 · src/useNativeEditor.ts:436 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/useNativeEditor.ts:423
scripts/table-interop/availability-evidence.ts:173 · scripts/table-interop/corpus.ts:1444 — 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. — scripts/table-interop/availability-evidence.ts:173
scripts/table-interop/corpus.ts:140 · scripts/table-interop/corpus.ts:199 — 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. — scripts/table-interop/corpus.ts:140
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.
scripts/table-interop/peer-build.ts:8 reaches into another package with a relative path (../../rust/editor-core/Cargo.toml) — import the package by name instead. — scripts/table-interop/peer-build.ts:8
What to do
Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
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.
assertEffectivePresentation has cyclomatic complexity 60 and cognitive complexity 132; 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. — scripts/table-interop/presentation-semantics.ts:217
observePresentation has cyclomatic complexity 52 and cognitive complexity 93; 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. — scripts/table-interop/browser/presentation-observer.ts:50
normalizeSchemaDefinition has cyclomatic complexity 49 and cognitive complexity 73; 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. — src/schemaNormalization.ts:352
useRichTextEditorPresentation has cyclomatic complexity 49 and cognitive complexity 39; 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. — src/useRichTextEditorPresentation.tsx:50
(anonymous) has cyclomatic complexity 48 and cognitive complexity 94; 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. — scripts/table-interop/corpus.ts:1642
assertFamilyEvidence has cyclomatic complexity 48 and cognitive complexity 80; 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. — scripts/table-interop/scenario-evidence.ts:628
resolveDocumentSchema has cyclomatic complexity 47 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. — src/schemaResolution.ts:127
continuationPassed has cyclomatic complexity 45 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 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. — scripts/table-interop/corpus.ts:1415
validLeafRenderElement has cyclomatic complexity 43 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 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. — src/NativeEditorRenderNormalization.ts:59
normalizeV2JsonValue has cyclomatic complexity 41 and cognitive complexity 81; 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. — src/NativeEditorCreateJson.ts:226
validateFallback has cyclomatic complexity 41 and cognitive complexity 59; 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. — scripts/table-interop/presentation-overlap.ts:85
(anonymous) has cyclomatic complexity 41 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 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. — src/useNativeEditor.ts:217
(anonymous) has cyclomatic complexity 41 and cognitive complexity 33; 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. — src/useEditorToolbarItems.tsx:89
(anonymous) has cyclomatic complexity 35 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. — src/useRichTextEditorMentions.tsx:272
stockLimitation has cyclomatic complexity 34 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. — scripts/table-interop/availability-evidence.ts:424
assertActionEvidence has cyclomatic complexity 34 and cognitive complexity 39; 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. — scripts/table-interop/scenario-evidence.ts:179
normalizeNativeCollaborationTransportEvent has cyclomatic complexity 32 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. — src/NativeEditorCollaborationTransport.ts:457
(anonymous) has cyclomatic complexity 31 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — src/__tests__/helpers/createFakeEditingModule.ts:140
resolveToolbarButtonVisuals has cyclomatic complexity 30 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. — src/EditorToolbarVisuals.tsx:136
serializeV2CreateEnvelope has cyclomatic complexity 29 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/NativeEditorCreateJson.ts:590
visit has cyclomatic complexity 29 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — scripts/table-interop/presentation-semantics.ts:432
(anonymous) has cyclomatic complexity 28 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/useNativeEditor.ts:380
parseNativeCompositionResult has cyclomatic complexity 28 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 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. — src/ExternalTextComposition.ts:149
buildV2CreateRequestUnchecked has cyclomatic complexity 27 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. — src/NativeEditorCreateConfig.ts:137
validateSample has cyclomatic complexity 27 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 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. — scripts/check-table-performance.mjs:120
useEditorToolbarPresentation 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. — src/useEditorToolbarPresentation.tsx:20
checkpointProof 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. — scripts/table-interop/checkpoint-evidence.ts:52
defineSchema has cyclomatic complexity 26 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — src/schemaDefinition.ts:343
handleReceive has cyclomatic complexity 26 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/__tests__/helpers/createFakeRuntimeState.ts:600
validateAttributeSpec has cyclomatic complexity 26 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/attributeValidation.ts:96
(anonymous) has cyclomatic complexity 26 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. — src/useViewerAtoms.tsx:95
normalizeNativeEditorV2PeersValue has cyclomatic complexity 25 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/NativeEditorResultNormalization.ts:487
evidenceCall has cyclomatic complexity 25 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/table-interop/evidence-observer.ts:98
(anonymous) has cyclomatic complexity 24 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — src/useEditorToolbarItems.tsx:227
(anonymous) has cyclomatic complexity 23 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/__tests__/helpers/createFakeEditingModule.ts:372
defineAtomNode 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. — src/atoms.ts:260
normalizeRenderSelection has cyclomatic complexity 21 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/NativeEditorRenderNormalization.ts:239
property has cyclomatic complexity 21 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/EditorStyleSheetNormalization.ts:175
(anonymous) has cyclomatic complexity 21 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. — src/useRichTextEditorEvents.tsx:386
collaborationProtocolAdapterDescriptor has cyclomatic complexity 21 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/NativeEditorCollaborationTransport.ts:189
Do you agree with this assessment?
R3 · Large Files2.6 / 10Weak✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
scripts/table-interop/corpus.ts has 1961 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/table-interop/corpus.ts:1
scripts/table-interop/browser/peer.ts has 985 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/table-interop/browser/peer.ts:1
scripts/table-interop/scenario-evidence.ts has 819 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/table-interop/scenario-evidence.ts:1
src/useRichTextEditorPresentation.tsx has 713 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/useRichTextEditorPresentation.tsx:1
src/YjsCollaboration.ts has 694 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/YjsCollaboration.ts:1
src/ExternalTextComposition.ts has 682 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/ExternalTextComposition.ts:1
scripts/table-interop/availability-evidence.ts has 638 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/table-interop/availability-evidence.ts:1
src/NativeEditorCreateJson.ts has 590 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/NativeEditorCreateJson.ts:1
src/NativeEditorResultNormalization.ts has 585 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/NativeEditorResultNormalization.ts:1
src/useViewerAtoms.tsx has 585 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/useViewerAtoms.tsx:1
src/useNativeEditor.ts has 578 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/useNativeEditor.ts:1
scripts/table-interop/presentation-semantics.ts has 570 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/table-interop/presentation-semantics.ts:1
src/useRichTextEditorState.tsx has 568 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/useRichTextEditorState.tsx:1
src/useRichTextEditorCommands.tsx has 564 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/useRichTextEditorCommands.tsx:1
src/useRichTextEditorUpdates.tsx has 556 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/useRichTextEditorUpdates.tsx:1
scripts/table-interop/controller.ts has 553 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/table-interop/controller.ts:1
src/NativeEditorDocumentBridge.ts has 534 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/NativeEditorDocumentBridge.ts:1
src/NativeEditorCollaborationTransport.ts has 494 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/NativeEditorCollaborationTransport.ts:1
src/NativeEditorRenderNormalization.ts has 492 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/NativeEditorRenderNormalization.ts:1
src/useRichTextEditorEvents.tsx has 470 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/useRichTextEditorEvents.tsx:1
scripts/table-interop/continuity-evidence.ts has 452 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/table-interop/continuity-evidence.ts:1
src/useRichTextEditorMentions.tsx has 445 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/useRichTextEditorMentions.tsx:1
src/useEditorToolbarPresentation.tsx has 442 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/useEditorToolbarPresentation.tsx:1
src/EditorToolbarVisuals.tsx has 419 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/EditorToolbarVisuals.tsx:1
src/RichTextEditorSerialization.tsx has 413 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/RichTextEditorSerialization.tsx:1
src/schemaDefinition.ts has 406 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/schemaDefinition.ts:1
src/schemaNormalization.ts has 405 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/schemaNormalization.ts: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.3 / 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. (×6) — example/App.tsx:1, example/theme.ts:1, example/components/LinkEditorModal.tsx:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
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.
The root package declares the lint script `validate:package` (`npm run prepare:example:native && npm run install:ios-test-pods && npm run lint:ios && npm run lint:kotlin && node scripts/tests/validate-prepared-prose-viewer-cutover.mjs && npm run validate:security -- --release --behavior && node scripts/tests/validate-security-contracts-negative.mjs && node scripts/tests/validate-publish-lifecycle.mjs && bash ./scripts/tests/validate-generated-bindings.sh && bash ./scripts/tests/validate-packed-xcframework.sh && node scripts/tests/validate-packed-package.test.mjs && bash ./scripts/validate-packed-package.sh`), but no step of this repository's CI runs it, by name, through another script, a Makefile target or a workspace runner, and no CI step runs the linter over the package itself. The rules it sets are enforced nowhere a pull request can fail. Run it in CI: a step that runs `npm run validate:package` in `.` (or the workspace's task runner). — package.json:90
Do you agree with this assessment?
R7 · Dead Code9.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 98 application, 23 tooling and 167 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (98 application, 23 tooling, 167 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) — example/App.tsx, src/listMarkers.ts
no import path from any entry point (98 application, 23 tooling, 167 test roots considered), but 3 in-repo import(s) from 3 other file(s) do name it (example/App.tsx, example/components/CounterCard.tsx, example/components/LinkEditorModal.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — example/theme.ts
no import path from any entry point (98 application, 23 tooling, 167 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (example/App.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×2) — example/components/LinkEditorModal.tsx, example/components/CounterCard.tsx
Nothing imports this binding — it is safe to review for removal. (×5) — src/EditorMentionThemeValidation.ts:17, src/EditorMentionThemeValidation.ts:23, src/NativeEditorCollaborationTransport.ts:179, …
Nothing ultimately consumes this binding: its only referrer is the re-export in src/EditorToolbar.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/EditorToolbar.tsx in the same commit, or the barrel will import a name that no longer exists. (×4) — src/EditorToolbarRegistry.tsx:173, src/EditorToolbarRegistry.tsx:254, src/EditorToolbarRegistry.tsx:272, …
Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect. (×2) — src/NativeEditorTypes.ts:46, src/NativeEditorTypes.ts:55
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. — scripts/table-interop/browser/peer.ts:46
Declared in scripts/table-interop/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. (×2) — scripts/table-interop/package.json:30, scripts/table-interop/package.json:35
Declared in scripts/tests/android-rn076-consumer/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. (×3) — scripts/tests/android-rn076-consumer/package.json:14, scripts/tests/android-rn076-consumer/package.json:15, scripts/tests/android-rn076-consumer/package.json:7
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
Do you agree with this assessment?
R9 · Circular Imports3.0 / 10Weak✓ Tool-verified
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
scripts/table-interop/assertions.ts → scripts/table-interop/controller.ts → scripts/table-interop/assertions.ts (one verified cycle inside a mutually-dependent group of 3 files) — scripts/table-interop/assertions.ts:2
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.
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.
`let _ = self.serialized_len.set(exact_len);` follows `{ return None; }` (line 828) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — rust/editor-core/src/yrs_engine/canonical.rs:831
`let next_document_revision = checked_operation_increment(request_id, self.rev…` follows `{ return Ok(HistoryPopPreparation::Unavailable); }` (line 203) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run. — rust/editor-core/src/yrs_engine/engine/undo_redo.rs:207
What to do
Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
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.
`validJsonValue` is exported and takes `value: unknown` from its caller, and it calls itself at line 472 (`validJsonValue`) with a piece of `value` (and at line 475) — and nowhere in `validJsonValue` 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 `validJsonValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/NativeEditorResultNormalization.ts:472
`validateAttribute` is exported, takes a document from its caller (line 67) and hands it to `validateJson`, which calls itself at line 32 (`validateJson`) with a piece of `value` — and nowhere in `validateJson` 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 `validateJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/attributeValidation.ts:32
`validateAttribute` is exported, takes a document from its caller (line 67) and hands it to `equal`, which calls itself at line 59 (`equal`) with a piece of `left` — and nowhere in `equal` 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 `equal` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/attributeValidation.ts:59
`node_text` is public and takes `node: &Node` from its caller, and it calls itself at line 223 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `node_text` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/editor-core/src/clipboard.rs:223
`document_node_count` is public and takes `node: &Node` from its caller, and it calls itself at line 562 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `document_node_count` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/editor-core/src/editor_state.rs:562
`node_text_bytes` is public and takes `node: &Node` from its caller, and it calls itself at line 445 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `node_text_bytes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/editor-core/src/yrs_engine/compiler.rs:445
`prepared_nodes_metrics` is public, takes a document from its caller (line 451) and hands it to `node_metrics`, which calls itself at line 506 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `node_metrics` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:506
`validate_fragment_marks` is public, takes a document from its caller (line 371) and hands it to `visit`, which calls itself at line 386 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `visit` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/editor-core/src/yrs_engine/compiler/input_limits.rs:386
`tables_flattened_into_blocks` is public, takes a document from its caller (line 143) and hands it to `flatten_tables`, which calls itself at line 161 with a piece of the document (and at line 167) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `flatten_tables` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/editor-core/src/tables/mutation_guard.rs:161
`clone` is public and takes a `TableRenderRecord` as its receiver from its caller, and it calls itself at line 171 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `clone` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/editor-core/src/tables/render.rs:171
`clone` is public and takes a `RenderElement` as its receiver from its caller, and it calls itself at line 123 with a piece of the document (and at line 127, line 128, line 135, line 144, line 155, line 156, line 169, line 170, line 182, line 183, line 185) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `clone` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/editor-core/src/render/mod.rs:123
`render_element_bytes` is public and takes `element: &RenderElement` from its caller, and it calls itself at line 24 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `render_element_bytes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/editor-core/src/render/output_bytes.rs:24
`iter` is public and takes a `Fragment` as its receiver from its caller, and it calls itself at line 46 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `iter` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/editor-core/src/model/fragment.rs:46
`clone` is public and takes a `NodeData` as its receiver from its caller, and it calls itself at line 56 with a piece of the document (and at line 57, line 60, line 61, line 68, line 69, line 70) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `clone` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/editor-core/src/model/node.rs:56
`child_count` is public and takes a `Node` as its receiver from its caller, and it calls itself at line 269 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `child_count` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/editor-core/src/model/node.rs:269
`child` is public and takes a `Node` as its receiver from its caller, and it calls itself at line 277 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `child` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/editor-core/src/model/node.rs:277
`replace_node_at_path` is public and takes a `Node` as its receiver from its caller, and it calls itself at line 325 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `replace_node_at_path` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — rust/editor-core/src/model/node.rs:325
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 type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
`transaction` (line 419) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends. — rust/editor-core/src/yrs_engine/engine/commands.rs:419
`transaction` (line 598) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends. — rust/editor-core/src/yrs_engine/engine/commands.rs:598
What to do
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
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 a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back. Also whether a `finally` that gives the primitive back unconditionally can run in a state where the method does not hold it: after a timed wait whose result was discarded, after an acquire inside the `try` that can fail, after the body already released it, or never, because a `return` left between the acquire and the `try`. In Rust, where a guard or permit releases when it is dropped, whether a release written BY HAND — `add_permits` after a forgotten permit, `force_unlock` after a leaked guard, a raw lock's `unlock` — matches the state the function's own acquisitions put the primitive in: not after a try or timed acquire whose failure does not leave, not from a cleanup set up before an acquire that can fail, not skipped by a `?`, `return`, `break` or `continue`, and not on top of a guard that still releases itself.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
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.
`LocalEmptyInitialization._kind` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rust/editor-core/src/ffi_v2/editor.rs:297
`LocalJsonInitialization._kind` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rust/editor-core/src/ffi_v2/editor.rs:304
`LocalHtmlInitialization._kind` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rust/editor-core/src/ffi_v2/editor.rs:315
`RoomInitialization._kind` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — rust/editor-core/src/ffi_v2/editor.rs:328
What to do
Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements 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.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
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 Rust's absent values are handled rather than forced — `Option` and `Result` make absence a value the caller must handle in every crate, and each `.unwrap()` or `.expect()` that no guard on its path proves present is a panic the first time the value is `None` or `Err`.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
`std::env::var("DEP_MIMALLOC_INCLUDE_DIR")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/build.rs:6
`current.checked_add(1)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `enter` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/boundary.rs:36
`built.len().checked_sub(len)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `clone_json_value_stack_safe` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/boundary.rs:265
`built.len().checked_sub(keys.len())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `clone_json_value_stack_safe` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/boundary.rs:273
`built.pop()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `clone_json_value_stack_safe` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/boundary.rs:281
`write_json_value_stack_safe(&mut output,value)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `serialize_json_value_stack_safe` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/boundary.rs:626
`chunk.try_into()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `string_requires_json_escape` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/boundary.rs:951
`left.pop()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `join_edges` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/clipboard.rs:327
`a.content()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `join_edges` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/clipboard.rs:330
`b.content()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `join_edges` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/clipboard.rs:331
`schema.mark(mark_type)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `validate_mark_request` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/command_planner.rs:262
`table_surface.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `command_applicability_with_known_node_count_impl` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/editor_state.rs:297
`map.block(block_index)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `submit_selection` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/native_transaction_bridge.rs:405
`self.get(index)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `iter` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/position_epoch.rs:317
`installation.replacing` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `install_update` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/position_epoch.rs:859
`serde_json::from_str(&serialized)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `parse_outcome` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/table_interop.rs:1047
`position_map.block(index)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `for_blocks` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/block_branch_index.rs:81
`builder.blocks[index].as_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `text` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/block_branch_index.rs:225
`crate::serialize::json_out::write_node_json(&mut counter,node,schema)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `measure_node_json_len` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/canonical.rs:73
`self.write_canonical_json(&mut serialized)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `canonical_json_bytes` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/canonical.rs:539
`projection_hash::projection_sha256(&serialized)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `sha256` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — rust/editor-core/src/yrs_engine/canonical.rs:559, rust/editor-core/src/yrs_engine/canonical.rs:759
`self.0.projection_sha256.get()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `projection_sha256` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/canonical.rs:573
`crate::serialize::json_out::write_node_json(&mut serialized,document.root(),&self.0.schema_context.0.schema,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `matches_document` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/canonical.rs:646
`self.projection_sha256.get()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `projection_sha256` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/canonical.rs:794
`state.canonical_artifact.write_canonical_json(&mut serialized)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `document_json_string` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/engine.rs:565
`String::from_utf8(serialized)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `document_json_string` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/engine.rs:566
`txn.get_xml_fragment(self.fragment_name.as_str())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `reset_history_binding` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/engine.rs:1201
`self.slots().after` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `set_after` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/history.rs:357
`self.targets.peek()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `resolve` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×2) — rust/editor-core/src/yrs_engine/position.rs:762, rust/editor-core/src/yrs_engine/position.rs:764
`chunk.try_into()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `scalar_prefix` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/position.rs:1226
`staged.materialized_identity()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `into_finalization_parts` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/prepared_admission/deferred.rs:652
`prepare_direct_root_wrap_batch(request_id,operation_index,list_node,schema,limits,true,)?.metrics` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `direct_root_wrap_metrics` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/mutation/lowering/prepared.rs:223
`self.ready_payload()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `prepare_authoritative_store_rebind` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/mutation/lowering/index/lookup_seed.rs:1037
`after_metadata_bytes.checked_add(if compatible{0}else{self.retained_before_metadata_bytes(&before,rolls)})` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `prepare_capture_with_limits` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/history/capture.rs:211
`self.pending_capture.lock().expect("pending history capture lock poisoned").take()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `finish_replay_capture` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/history/capture.rs:486
`self.replay_metadata_bytes.checked_add(metadata_increment)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `finish_capture` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/history/capture.rs:535
`replaced` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `exclude_protected_containers` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/history/deletion_filter.rs:328
`after_metadata_bytes.checked_add(if compatible{0}else{self.retained_before_metadata_bytes(&before,rolls)})` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `pre_admit_recorded` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — rust/editor-core/src/yrs_engine/history/recording.rs:82
What to do
Each row is a forced `Option`/`Result` no guard on its path proves present. Handle the absent case where it arises rather than forcing it: `?` to hand it to the caller, `if let` / `match` / `let … else` to branch on it, `unwrap_or` / `unwrap_or_default` / `unwrap_or_else` where a default is right. Where the value genuinely cannot be absent, say so in a way a reader can check from the line: test it first (`if x.is_none() { return … }`), look the key up with `contains_key` or the index against `len()`, or construct the value so it cannot be absent.
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 — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 52 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.
AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
AX1 Captive dependencies — Not applicable: this repository's Java imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Kotlin imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. No class in this Ruby code is a Rails controller, a Sinatra, Grape or Roda app, a Hanami action or a Rack app (an instance `call(env)`), so no request handler shares state between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
AX6 Interface segregation — AX6 reached only 41% of this repository's production lines — rust (187,339 lines), objectivec (1,178 lines), cpp (507 lines), c (277 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the dev server (`npm run start` in example/) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> native-editor-example@2.2.3 start / > expo start / Starting project at <repo>/example / Starting Metro Bundler / Waiting on http://localhost:8081 / Logs for your project will appear below." No runtime evidence was gathered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 15 candidate(s) found and not reported.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Aggregate roots were found in only one source directory (editor-core), which is a layered codebase, not two contexts. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 33 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
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 (3 signals for this style, 3 needed — the count is met but a required primary signal is absent): 1 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 514 value object(s); 9 domain event(s); its domain events are published by services or handlers — no domain entity raises one; no aggregate is declared and no domain structure surrounds the state-guarding types: not claimed as DDD
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — Not assessed, and this one is on us: 3 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
ES1 Fold determinism — not applicable — the code was read and holds no event-replay fold, so there is nothing for this check to judge
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JVM, JavaScript/TypeScript, Python, Rust, Swift source, so there is no service whose uptime a failing dependency could take down
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 90 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.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — 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
X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — X26 reached only 30% of this repository's production lines — rust (187,339 lines), typescript (33,914 lines), javascript (1,763 lines), objectivec (1,178 lines), cpp (507 lines), c (277 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X3 Exception handling — X3 reached only 41% of this repository's production lines — rust (187,339 lines), objectivec (1,178 lines), cpp (507 lines), c (277 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.
X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Rust was read, and it logs through none: the `log` crate's macros take one finished message (as log4net does in C#; its `kv` values are an opt-in its backends mostly drop), `println!`/`eprintln!` are not loggers, or it makes no log call outside its tests and examples at all. Calls through `tracing` (`tracing::info!`, or `info!` imported from it) would be judged.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
AC1 · Text alternatives· <img> without a text alternative · ×1
<img> without a text alternative src/schemaPresets.ts:72— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
Blocking wait inside a handler: NativeCollaborationTransport.onQueueSync ios/NativeCollaborationTransport.swift:320— `NativeCollaborationTransport.onQueueSync` is an event/message handler that blocks on a synchronous wait (a semaphore/queue `.wait`/`.sync`) — it stalls the handler on a peer or resource and serialises throughput, and can deadlock under load. Await the work asynchronously (`async`/`await`) instead of blocking the handler.
Unlisted import '@tiptap/y-tiptap' scripts/table-interop/browser/peer.ts:46— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Hotspot: ios/RenderBridge.swift ios/RenderBridge.swift:260— ios/RenderBridge.swift changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in RenderBridge.renderElements at line 260. 12 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- ios/RenderBridge.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: ios/Viewer/CoreTextProseLayoutEngine.swift ios/Viewer/CoreTextProseLayoutEngine.swift:1238— ios/Viewer/CoreTextProseLayoutEngine.swift changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in CoreTextProseLayoutEngine.prepareBlock at line 1238. 7 of those changes were fix/bug commits, 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-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- ios/Viewer/CoreTextProseLayoutEngine.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:499— android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in StaticLayoutAndroidProseLayoutEngine.prepareLayout at line 499. 4 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt`: 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: android/src/main/java/com/apollohg/editor/RenderBridgeElements.kt android/src/main/java/com/apollohg/editor/RenderBridgeElements.kt:10— android/src/main/java/com/apollohg/editor/RenderBridgeElements.kt changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in RenderBridgeElementsKt.appendElements at line 10. 5 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-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/RenderBridgeElements.kt`: 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: android/src/main/java/com/apollohg/editor/EditorEditText.kt android/src/main/java/com/apollohg/editor/EditorEditText.kt:419— android/src/main/java/com/apollohg/editor/EditorEditText.kt changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in EditorEditText.dispatchKeyEvent at line 419. 24 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/EditorEditText.kt`: 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: src/useRichTextEditorPresentation.tsx src/useRichTextEditorPresentation.tsx:50— src/useRichTextEditorPresentation.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in useRichTextEditorPresentation.useRichTextEditorPresentation at line 50. 3 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- src/useRichTextEditorPresentation.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: ios/Viewer/ViewerDocument.swift ios/Viewer/ViewerDocument.swift:435— ios/Viewer/ViewerDocument.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in ViewerDocument.lowerElements at line 435. 3 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-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- ios/Viewer/ViewerDocument.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: ios/EditorTextView+Rendering.swift ios/EditorTextView+Rendering.swift:331— ios/EditorTextView+Rendering.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in EditorTextView.applyUpdateJSON at line 331. 2 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- ios/EditorTextView+Rendering.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: android/src/main/java/com/apollohg/editor/RichTextEditorView.kt android/src/main/java/com/apollohg/editor/RichTextEditorView.kt:87— android/src/main/java/com/apollohg/editor/RichTextEditorView.kt changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in EditorScrollView.onInterceptTouchEvent at line 87. 16 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/RichTextEditorView.kt`: 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: src/useNativeEditor.ts src/useNativeEditor.ts:217— src/useNativeEditor.ts changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in useNativeEditor.useNativeEditorDocument.refresh at line 217. 4 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- src/useNativeEditor.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: src/useRichTextEditorState.tsx src/useRichTextEditorState.tsx:43— src/useRichTextEditorState.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in useRichTextEditorState.useRichTextEditorState at line 43. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- src/useRichTextEditorState.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: android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:1137— android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in PreparedProseDrawingView.drawTableNodes at line 1137. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt`: 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: ios/NativeToolbar.swift ios/NativeToolbar.swift:195— ios/NativeToolbar.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in EditorAccessoryToolbarView.apply at line 195. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- ios/NativeToolbar.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: ios/EditorTextView.swift ios/EditorTextView.swift:733— ios/EditorTextView.swift changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in EditorTextView.deleteBackward at line 733. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- ios/EditorTextView.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: ios/Viewer/PreparedProseDrawingView.swift ios/Viewer/PreparedProseDrawingView.swift:1341— ios/Viewer/PreparedProseDrawingView.swift changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in PreparedProseDrawingView.paint at line 1341. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- ios/Viewer/PreparedProseDrawingView.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: rust/editor-core/src/native_transaction_bridge.rs rust/editor-core/src/native_transaction_bridge.rs:83— rust/editor-core/src/native_transaction_bridge.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in NativeTransactionBridge::submit_native_intent at line 83. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- rust/editor-core/src/native_transaction_bridge.rs`: 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: android/src/main/java/com/apollohg/editor/RenderBridgeInlineAndAtoms.kt android/src/main/java/com/apollohg/editor/RenderBridgeInlineAndAtoms.kt:34— android/src/main/java/com/apollohg/editor/RenderBridgeInlineAndAtoms.kt changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in RenderBridgeInlineAndAtomsKt.appendStyledText at line 34. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/RenderBridgeInlineAndAtoms.kt`: 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: rust/editor-core/src/command_planner/text.rs rust/editor-core/src/command_planner/text.rs:842— rust/editor-core/src/command_planner/text.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in editor_core::command_planner::text::plan_delete_scalar_range_impl at line 842. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- rust/editor-core/src/command_planner/text.rs`: 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: ios/Viewer/CoreTextProseLayoutEngine+AttributedText.swift ios/Viewer/CoreTextProseLayoutEngine+AttributedText.swift:209— ios/Viewer/CoreTextProseLayoutEngine+AttributedText.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in CoreTextProseLayoutEngine.attributes at line 209. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- ios/Viewer/CoreTextProseLayoutEngine+AttributedText.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: android/src/main/java/com/apollohg/editor/EditorInputConnection.kt android/src/main/java/com/apollohg/editor/EditorInputConnection.kt:315— android/src/main/java/com/apollohg/editor/EditorInputConnection.kt changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in EditorInputConnection.commitCorrection at line 315. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/EditorInputConnection.kt`: 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: rust/editor-core/src/yrs_engine/engine/commit.rs rust/editor-core/src/yrs_engine/engine/commit.rs:68— rust/editor-core/src/yrs_engine/engine/commit.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in YrsDocumentEngine::apply_compiled_transaction_with_history_and_context at line 68. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- rust/editor-core/src/yrs_engine/engine/commit.rs`: 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: src/NativeEditorRenderNormalization.ts src/NativeEditorRenderNormalization.ts:59— src/NativeEditorRenderNormalization.ts changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in NativeEditorRenderNormalization.validLeafRenderElement at line 59. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- src/NativeEditorRenderNormalization.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: src/useEditorToolbarItems.tsx src/useEditorToolbarItems.tsx:12— src/useEditorToolbarItems.tsx changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in useEditorToolbarItems.useEditorToolbarItems at line 12. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- src/useEditorToolbarItems.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: android/src/main/java/com/apollohg/editor/viewer/ViewerDocument.kt android/src/main/java/com/apollohg/editor/viewer/ViewerDocument.kt:392— android/src/main/java/com/apollohg/editor/viewer/ViewerDocument.kt changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in ViewerDocumentKt.lowerElements at line 392. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/viewer/ViewerDocument.kt`: 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: rust/editor-core/src/render/incremental.rs rust/editor-core/src/render/incremental.rs:628— rust/editor-core/src/render/incremental.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in editor_core::render::incremental::generate_block_inner at line 628. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- rust/editor-core/src/render/incremental.rs`: 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: viewer/AndroidProseLayoutEngine.kt android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt— FileTooLong — 2393 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: StaticLayoutAndroidProseLayoutEngine (277-3041). The bar is 500 significant lines; this is 1893 over it, 4.79× 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: tables/EditorTableSurface.kt android/src/main/java/com/apollohg/editor/tables/EditorTableSurface.kt— FileTooLong — 2158 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: EditorTableSurface (156-2728). The bar is 500 significant lines; this is 1658 over it, 4.32× 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: viewer/PreparedProseDrawingView.kt android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt— FileTooLong — 1652 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: PreparedProseDrawingView (77-2114). The bar is 500 significant lines; this is 1152 over it, 3.30× 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: Tables/EditorTableSurface.swift ios/Tables/EditorTableSurface.swift— FileTooLong — 1546 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: EditorTableSurface (79-1858). The bar is 500 significant lines; this is 1046 over it, 3.09× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Viewer/PreparedProseDrawingView.swift ios/Viewer/PreparedProseDrawingView.swift— FileTooLong — 1525 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: PreparedProseDrawingView (80-1931). The bar is 500 significant lines; this is 1025 over it, 3.05× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Viewer/CoreTextProseLayoutEngine.swift ios/Viewer/CoreTextProseLayoutEngine.swift— FileTooLong — 1424 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: CoreTextProseLayoutEngine (9-1709). The bar is 500 significant lines; this is 924 over it, 2.85× 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: tables/ViewerTableSurface.kt android/src/main/java/com/apollohg/editor/tables/ViewerTableSurface.kt— FileTooLong — 1271 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 771 over it, 2.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.
FileTooLong: ios/RichTextEditorView.swift ios/RichTextEditorView.swift— FileTooLong — 1248 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: RichTextEditorView (96-1664). The bar is 500 significant lines; this is 748 over it, 2.50× 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: Tables/ViewerTableSurface.swift ios/Tables/ViewerTableSurface.swift— FileTooLong — 1056 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 556 over it, 2.11× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: commands/text.rs rust/editor-core/src/yrs_engine/commands/text.rs— FileTooLong — 996 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 496 over it, 1.99× 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/RichTextEditorView.kt android/src/main/java/com/apollohg/editor/RichTextEditorView.kt— FileTooLong — 977 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: RichTextEditorView (34-1334). The bar is 500 significant lines; this is 477 over it, 1.95× 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: engine/commit.rs rust/editor-core/src/yrs_engine/engine/commit.rs— FileTooLong — 977 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: YrsDocumentEngine (66-1299). The bar is 500 significant lines; this is 477 over it, 1.95× 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: derived_state/localized_index.rs rust/editor-core/src/yrs_engine/derived_state/localized_index.rs— FileTooLong — 953 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 67% of them inside a single declaration: LocalizedTextLeafIndex (3 blocks, 124-970). The bar is 500 significant lines; this is 453 over it, 1.91× 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: yrs_engine/position.rs rust/editor-core/src/yrs_engine/position.rs— FileTooLong — 923 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 40 free functions. The bar is 500 significant lines; this is 423 over it, 1.85× 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: lowering/text.rs rust/editor-core/src/yrs_engine/mutation/lowering/text.rs— FileTooLong — 917 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 86% of them inside a single declaration: MutationCompiler (1-929). The bar is 500 significant lines; this is 417 over it, 1.83× 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: serialize/html_in.rs rust/editor-core/src/serialize/html_in.rs— FileTooLong — 911 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 41 free functions. The bar is 500 significant lines; this is 411 over it, 1.82× 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: command_planner/text.rs rust/editor-core/src/command_planner/text.rs— FileTooLong — 899 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). 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: viewer/PreparedProseViewerManager.kt android/src/main/java/com/apollohg/editor/viewer/PreparedProseViewerManager.kt— FileTooLong — 885 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: PreparedProseViewerManager (50-1141). The bar is 500 significant lines; this is 385 over it, 1.77× 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: index/lookup_seed.rs rust/editor-core/src/yrs_engine/mutation/lowering/index/lookup_seed.rs— FileTooLong — 861 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: MutationLookupSeed (1-1079). The bar is 500 significant lines; this is 361 over it, 1.72× 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: yrs_engine/engine.rs rust/editor-core/src/yrs_engine/engine.rs— FileTooLong — 854 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 354 over it, 1.71× 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: src/table_interop.rs rust/editor-core/src/table_interop.rs— FileTooLong — 836 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 63% of them inside a single declaration: RustPeer (2 blocks, 284-1020). The bar is 500 significant lines; this is 336 over it, 1.67× 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: schema/content_rule.rs rust/editor-core/src/schema/content_rule.rs— FileTooLong — 826 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 326 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: yrs_engine/derived_state.rs rust/editor-core/src/yrs_engine/derived_state.rs— FileTooLong — 799 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 89% of them inside a single declaration: DerivedStateCache (3 blocks, 113-1015). The bar is 500 significant lines; this is 299 over it, 1.60× 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: ios/EditorLayoutManager.swift ios/EditorLayoutManager.swift— FileTooLong — 789 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: EditorLayoutManager (7-1045). The bar is 500 significant lines; this is 289 over it, 1.58× 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: editor/EditorEditText.kt android/src/main/java/com/apollohg/editor/EditorEditText.kt— FileTooLong — 763 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: EditorEditText (29-1180). The bar is 500 significant lines; this is 263 over it, 1.53× 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.
editor_core::yrs_engine::compiler::yrs_compilation::compile_transaction_with_yrs_impl (cognitive 103) rust/editor-core/src/yrs_engine/compiler/yrs_compilation.rs:221— editor_core::yrs_engine::compiler::yrs_compilation::compile_transaction_with_yrs_impl has cognitive complexity 103 (threshold 15). Drivers by points: if/else 35 (94 pts), boolean chains 5, match/switch 2 (4 pts) (nesting depth added 61). 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.
editor_core::serialize::html_in::clipboard::normalize (cognitive 74) rust/editor-core/src/serialize/html_in/clipboard.rs:67— editor_core::serialize::html_in::clipboard::normalize has cognitive complexity 74 (threshold 15). Drivers by points: if/else 29 (53 pts), loops 5 (10 pts), boolean chains 7, match/switch 2 (4 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
editor_core::yrs_engine::mutation::plan::preflight::preflight_mutation_plan_impl (cognitive 72) rust/editor-core/src/yrs_engine/mutation/plan/preflight.rs:395— editor_core::yrs_engine::mutation::plan::preflight::preflight_mutation_plan_impl has cognitive complexity 72 (threshold 15). Drivers by points: if/else 16 (51 pts), match/switch 3 (8 pts), loops 3 (7 pts), boolean chains 6 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
editor_core::tables::reference_grid::compute_map (cognitive 69) rust/editor-core/src/tables/reference_grid.rs:90— editor_core::tables::reference_grid::compute_map has cognitive complexity 69 (threshold 15). Drivers by points: if/else 12 (35 pts), loops 11 (26 pts), match/switch 1 (5 pts), boolean chains 3 (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.
editor_core::yrs_engine::compiler::semantic::compile_transaction_impl (cognitive 64) rust/editor-core/src/yrs_engine/compiler/semantic.rs:32— editor_core::yrs_engine::compiler::semantic::compile_transaction_impl has cognitive complexity 64 (threshold 15). Drivers by points: if/else 36 (41 pts), boolean chains 13, match/switch 7 (9 pts), loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
editor_core::yrs_engine::mutation::lowering::range::text_targets::drive_lookup_materialization_collector (cognitive 60) rust/editor-core/src/yrs_engine/mutation/lowering/range/text_targets.rs:12— editor_core::yrs_engine::mutation::lowering::range::text_targets::drive_lookup_materialization_collector has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (51 pts), loops 3 (7 pts), match/switch 1 (2 pts) (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.
editor_core::yrs_engine::compiler::insert_position::resolve_insert_node_position (cognitive 58) rust/editor-core/src/yrs_engine/compiler/insert_position.rs:20— editor_core::yrs_engine::compiler::insert_position::resolve_insert_node_position has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (46 pts), loops 2 (6 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
editor_core::alignment::targets_in (cognitive 57) rust/editor-core/src/alignment.rs:114— editor_core::alignment::targets_in has cognitive complexity 57 (threshold 15). Drivers by points: if/else 20 (38 pts), match/switch 3 (8 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
editor_core::transform::apply::range::insert_nodes_in_children (cognitive 56) rust/editor-core/src/transform/apply/range.rs:165— editor_core::transform::apply::range::insert_nodes_in_children has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 7 (23 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
editor_core::serialize::html_out::serialize_nodes (cognitive 50) rust/editor-core/src/serialize/html_out.rs:61— editor_core::serialize::html_out::serialize_nodes has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (41 pts), loops 3 (7 pts), match/switch 1 (2 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.
editor_core::yrs_engine::mutation::lowering::index::localized_format::localized_existing_textblock_targets (cognitive 49) rust/editor-core/src/yrs_engine/mutation/lowering/index/localized_format.rs:320— editor_core::yrs_engine::mutation::lowering::index::localized_format::localized_existing_textblock_targets has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (32 pts), boolean chains 13, loops 2, match/switch 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.
editor_core::boundary::write_json_frames (cognitive 45) rust/editor-core/src/boundary.rs:531— editor_core::boundary::write_json_frames has cognitive complexity 45 (threshold 15). Drivers by points: if/else 4 (20 pts), loops 5 (17 pts), match/switch 3 (8 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
editor_core::ffi_v2::native_frame::build_native_frame (cognitive 43) rust/editor-core/src/ffi_v2/native_frame.rs:246— editor_core::ffi_v2::native_frame::build_native_frame has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (27 pts), loops 4 (11 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
editor_core::yrs_engine::commands::format::plan (cognitive 43) rust/editor-core/src/yrs_engine/commands/format.rs:110— editor_core::yrs_engine::commands::format::plan has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (38 pts), loops 1 (4 pts), match/switch 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.
editor_core::serialize::json_in::parse_node (cognitive 42) rust/editor-core/src/serialize/json_in.rs:147— editor_core::serialize::json_in::parse_node has cognitive complexity 42 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 4 (12 pts), match/switch 2 (6 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
editor_core::yrs_engine::commands::clipboard::plan_at_selection (cognitive 42) rust/editor-core/src/yrs_engine/commands/clipboard.rs:264— editor_core::yrs_engine::commands::clipboard::plan_at_selection has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (33 pts), match/switch 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
editor_core::yrs_engine::compiler::insert_position::resolve_insert_position_budgeted (cognitive 42) rust/editor-core/src/yrs_engine/compiler/insert_position.rs:497— editor_core::yrs_engine::compiler::insert_position::resolve_insert_position_budgeted has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
editor_core::yrs_engine::mutation::lowering::index::localized_locators::localized_root_structural_parent (cognitive 38) rust/editor-core/src/yrs_engine/mutation/lowering/index/localized_locators.rs:102— editor_core::yrs_engine::mutation::lowering::index::localized_locators::localized_root_structural_parent has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
editor_core::serialize::html_in::extract_node_attrs (cognitive 37) rust/editor-core/src/serialize/html_in.rs:358— editor_core::serialize::html_in::extract_node_attrs has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 22). 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.
editor_core::tables::reference_grid::reference_pass (cognitive 37) rust/editor-core/src/tables/reference_grid.rs:264— editor_core::tables::reference_grid::reference_pass has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 6 (10 pts), boolean chains 4, match/switch 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.
editor_core::transform::apply::range::insert_node_in_children (cognitive 34) rust/editor-core/src/transform/apply/range.rs:8— editor_core::transform::apply::range::insert_node_in_children has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
editor_core::tables::paste::clip_matrix (cognitive 33) rust/editor-core/src/tables/paste.rs:263— editor_core::tables::paste::clip_matrix has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 5 (14 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.
editor_core::render::incremental::generate_block_inner (cognitive 32) rust/editor-core/src/render/incremental.rs:628— editor_core::render::incremental::generate_block_inner has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 5 (11 pts), boolean chains 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
editor_core::yrs_engine::commands::text::plan (cognitive 32) rust/editor-core/src/yrs_engine/commands/text.rs:987— editor_core::yrs_engine::commands::text::plan has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (28 pts), match/switch 3 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
editor_core::yrs_engine::mutation::lowering::range::text_targets::collect_text_targets_inner (cognitive 32) rust/editor-core/src/yrs_engine/mutation/lowering/range/text_targets.rs:341— editor_core::yrs_engine::mutation::lowering::range::text_targets::collect_text_targets_inner has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 2 (6 pts), match/switch 1 (2 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.
MethodTooLong: YrsDocumentEngine.apply_compiled_transaction_with_history_and_context rust/editor-core/src/yrs_engine/engine/commit.rs:68— MethodTooLong — apply_compiled_transaction_with_history_and_context runs 935 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 835 over it, 9.35× 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: StaticLayoutAndroidProseLayoutEngine.prepareLayout android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:499— MethodTooLong — prepareLayout runs 724 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 624 over it, 7.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.
MethodTooLong: OperationCompiler.compile_structure rust/editor-core/src/yrs_engine/compiler/operations/structure.rs:28— MethodTooLong — compile_structure runs 569 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 469 over it, 5.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RenderBridgeElementsKt.appendElements android/src/main/java/com/apollohg/editor/RenderBridgeElements.kt:10— MethodTooLong — appendElements runs 542 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 442 over it, 5.42× 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: MutationCompiler.split_block REDACTED:190— MethodTooLong — split_block runs 430 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 330 over it, 4.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MutationCompiler.unwrap_from_list rust/editor-core/src/yrs_engine/mutation/lowering/list/unwrap.rs:3— MethodTooLong — unwrap_from_list runs 393 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 293 over it, 3.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: YrsDocumentEngine.prepare_remote_update_internal rust/editor-core/src/yrs_engine/engine/remote.rs:113— MethodTooLong — prepare_remote_update_internal runs 375 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 275 over it, 3.75× 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: CoreTextProseLayoutEngine.prepareBlock ios/Viewer/CoreTextProseLayoutEngine.swift:1238— MethodTooLong — prepareBlock 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.
MethodTooLong: StaticLayoutAndroidProseLayoutEngine.prepareBlock android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:1758— MethodTooLong — prepareBlock runs 355 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 255 over it, 3.55× 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: CoreTextProseLayoutEngine.makePreparation ios/Viewer/CoreTextProseLayoutEngine.swift:399— MethodTooLong — makePreparation runs 349 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 249 over it, 3.49× 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: RenderBridge.renderElements ios/RenderBridge.swift:260— MethodTooLong — renderElements runs 339 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 239 over it, 3.39× 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: MutationCompiler.outdent_list_item rust/editor-core/src/yrs_engine/mutation/lowering/list/indent.rs:328— MethodTooLong — outdent_list_item runs 334 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 234 over it, 3.34× 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: MutationCompiler.wrap_in_list rust/editor-core/src/yrs_engine/mutation/lowering/list/wrap.rs:3— MethodTooLong — wrap_in_list runs 334 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 234 over it, 3.34× 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: OperationCompiler.compile_marks rust/editor-core/src/yrs_engine/compiler/operations/marks.rs:20— MethodTooLong — compile_marks runs 325 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 225 over it, 3.25× 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: Schema.try_new_with_budget rust/editor-core/src/schema/construction.rs:14— MethodTooLong — try_new_with_budget runs 300 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 200 over it, 3.00× 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: OperationCompiler.compile_text rust/editor-core/src/yrs_engine/compiler/operations/text.rs:21— MethodTooLong — compile_text runs 292 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 192 over it, 2.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MutationCompiler.indent_list_item rust/editor-core/src/yrs_engine/mutation/lowering/list/indent.rs:3— MethodTooLong — indent_list_item runs 282 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 182 over it, 2.82× 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: EditorTextView.applyUpdateJSON ios/EditorTextView+Rendering.swift:331— MethodTooLong — applyUpdateJSON runs 280 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 180 over it, 2.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: YrsDocumentEngine.apply_empty_skip_transaction rust/editor-core/src/yrs_engine/engine/selection_commit.rs:19— MethodTooLong — apply_empty_skip_transaction runs 264 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 164 over it, 2.64× 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: OperationCompiler.compile_edit_structure rust/editor-core/src/yrs_engine/compiler/operations/batch.rs:247— MethodTooLong — compile_edit_structure runs 262 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 162 over it, 2.62× 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: NativeEditorModule.definition ios/NativeEditorModule.swift:517— MethodTooLong — definition runs 251 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 151 over it, 2.51× 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: MutationCompiler.insert_structural_node rust/editor-core/src/yrs_engine/mutation/lowering/node.rs:2— MethodTooLong — insert_structural_node runs 243 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 143 over it, 2.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.
MethodTooLong: MutationCompiler.rebuild_target_layout rust/editor-core/src/yrs_engine/mutation/lowering/list/layout.rs:312— MethodTooLong — rebuild_target_layout runs 237 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 137 over it, 2.37× 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: MutationCompiler.delete_structural_range rust/editor-core/src/yrs_engine/mutation/lowering/index/structural_delete.rs:2— MethodTooLong — delete_structural_range runs 230 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 130 over it, 2.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OperationCompiler.compile rust/editor-core/src/yrs_engine/compiler/operations.rs:71— MethodTooLong — compile runs 217 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× 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: editor_core::yrs_engine::compiler::semantic::compile_transaction_impl rust/editor-core/src/yrs_engine/compiler/semantic.rs:32— FunctionTooLong — editor_core::yrs_engine::compiler::semantic::compile_transaction_impl runs 477 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 377 over it, 4.77× 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: useRichTextEditorCommands.useRichTextEditorCommands src/useRichTextEditorCommands.tsx:32— FunctionTooLong — useRichTextEditorCommands 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: useRichTextEditorUpdates.useRichTextEditorUpdates src/useRichTextEditorUpdates.tsx:25— FunctionTooLong — useRichTextEditorUpdates 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: editor_core::yrs_engine::compiler::yrs_compilation::compile_transaction_with_yrs_impl rust/editor-core/src/yrs_engine/compiler/yrs_compilation.rs:221— FunctionTooLong — editor_core::yrs_engine::compiler::yrs_compilation::compile_transaction_with_yrs_impl runs 390 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 290 over it, 3.90× 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: useNativeEditor.useNativeEditorDocument src/useNativeEditor.ts:108— FunctionTooLong — useNativeEditorDocument runs 387 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 287 over it, 3.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: useEditorToolbarPresentation.useEditorToolbarPresentation src/useEditorToolbarPresentation.tsx:20— FunctionTooLong — useEditorToolbarPresentation runs 364 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 264 over it, 3.64× 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: useViewerAtoms.useViewerAtoms src/useViewerAtoms.tsx:176— FunctionTooLong — useViewerAtoms runs 355 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 255 over it, 3.55× 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: useRichTextEditorEvents.useRichTextEditorEvents src/useRichTextEditorEvents.tsx:37— FunctionTooLong — useRichTextEditorEvents runs 349 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 249 over it, 3.49× 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: useEditorToolbarItems.useEditorToolbarItems src/useEditorToolbarItems.tsx:12— FunctionTooLong — useEditorToolbarItems runs 345 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 245 over it, 3.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: useRichTextEditorMentions.useRichTextEditorMentions src/useRichTextEditorMentions.tsx:27— FunctionTooLong — useRichTextEditorMentions runs 331 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 231 over it, 3.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: editor_core::yrs_engine::mutation::plan::preflight::preflight_mutation_plan_impl rust/editor-core/src/yrs_engine/mutation/plan/preflight.rs:395— FunctionTooLong — editor_core::yrs_engine::mutation::plan::preflight::preflight_mutation_plan_impl runs 321 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 221 over it, 3.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: editor_core::schema::presets::build_schema_parts rust/editor-core/src/schema/presets.rs:198— FunctionTooLong — editor_core::schema::presets::build_schema_parts runs 307 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 207 over it, 3.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: useEditorToolbarInteractions.useEditorToolbarInteractions src/useEditorToolbarInteractions.tsx:14— FunctionTooLong — useEditorToolbarInteractions runs 266 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× 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: editor_core::yrs_engine::commands::text::plan rust/editor-core/src/yrs_engine/commands/text.rs:987— FunctionTooLong — editor_core::yrs_engine::commands::text::plan runs 233 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 133 over it, 2.33× 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: editor_core::render::incremental::generate_block_inner rust/editor-core/src/render/incremental.rs:628— FunctionTooLong — editor_core::render::incremental::generate_block_inner runs 222 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 122 over it, 2.22× 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: editor_core::yrs_engine::commands::text::semantic_transaction_impl rust/editor-core/src/yrs_engine/commands/text.rs:132— FunctionTooLong — editor_core::yrs_engine::commands::text::semantic_transaction_impl runs 197 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 97 over it, 1.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: editor_core::yrs_engine::compiler::input_limits::admit_transaction_envelope rust/editor-core/src/yrs_engine/compiler/input_limits.rs:12— FunctionTooLong — editor_core::yrs_engine::compiler::input_limits::admit_transaction_envelope runs 184 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 84 over it, 1.84× 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: editor_core::render::generate::walk_children rust/editor-core/src/render/generate.rs:52— FunctionTooLong — editor_core::render::generate::walk_children runs 162 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 62 over it, 1.62× 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: editor_core::yrs_engine::mutation::plan::preflight::expected_preflight_work rust/editor-core/src/yrs_engine/mutation/plan/preflight.rs:52— FunctionTooLong — editor_core::yrs_engine::mutation::plan::preflight::expected_preflight_work runs 150 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× 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: editor_core::yrs_engine::commands::clipboard::plan_at_selection rust/editor-core/src/yrs_engine/commands/clipboard.rs:264— FunctionTooLong — editor_core::yrs_engine::commands::clipboard::plan_at_selection runs 149 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× 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: editor_core::serialize::html_in::clipboard::normalize rust/editor-core/src/serialize/html_in/clipboard.rs:67— FunctionTooLong — editor_core::serialize::html_in::clipboard::normalize runs 142 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× 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: editor_core::command_planner::text::plan_delete_scalar_range_impl rust/editor-core/src/command_planner/text.rs:842— FunctionTooLong — editor_core::command_planner::text::plan_delete_scalar_range_impl runs 141 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: editor_core::ffi_v2::native_frame::build_native_frame rust/editor-core/src/ffi_v2/native_frame.rs:246— FunctionTooLong — editor_core::ffi_v2::native_frame::build_native_frame runs 140 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: editor_core::yrs_engine::compiler::selection::selection_plan rust/editor-core/src/yrs_engine/compiler/selection.rs:224— FunctionTooLong — editor_core::yrs_engine::compiler::selection::selection_plan runs 139 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× 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: editor_core::transform::apply::range::apply_cross_parent_delete rust/editor-core/src/transform/apply/range.rs:262— FunctionTooLong — editor_core::transform::apply::range::apply_cross_parent_delete runs 137 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× 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.
editor_core::yrs_engine::compiler::semantic::compile_transaction_impl (cyclomatic 51) rust/editor-core/src/yrs_engine/compiler/semantic.rs:32— editor_core::yrs_engine::compiler::semantic::compile_transaction_impl has cyclomatic complexity 51 (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.
editor_core::serialize::html_in::clipboard::normalize (cyclomatic 46) rust/editor-core/src/serialize/html_in/clipboard.rs:67— editor_core::serialize::html_in::clipboard::normalize 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.
editor_core::yrs_engine::compiler::yrs_compilation::compile_transaction_with_yrs_impl (cyclomatic 44) rust/editor-core/src/yrs_engine/compiler/yrs_compilation.rs:221— editor_core::yrs_engine::compiler::yrs_compilation::compile_transaction_with_yrs_impl has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
editor_core::yrs_engine::mutation::lowering::index::localized_format::localized_existing_textblock_targets (cyclomatic 40) rust/editor-core/src/yrs_engine/mutation/lowering/index/localized_format.rs:320— editor_core::yrs_engine::mutation::lowering::index::localized_format::localized_existing_textblock_targets has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
editor_core::yrs_engine::mutation::plan::preflight::preflight_mutation_plan_impl (cyclomatic 32) rust/editor-core/src/yrs_engine/mutation/plan/preflight.rs:395— editor_core::yrs_engine::mutation::plan::preflight::preflight_mutation_plan_impl has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
editor_core::alignment::targets_in (cyclomatic 31) rust/editor-core/src/alignment.rs:114— editor_core::alignment::targets_in 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.
editor_core::yrs_engine::commands::tables::plan (cyclomatic 29) rust/editor-core/src/yrs_engine/commands/tables.rs:442— editor_core::yrs_engine::commands::tables::plan has cyclomatic complexity 29 (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.
editor_core::tables::reference_grid::compute_map (cyclomatic 28) rust/editor-core/src/tables/reference_grid.rs:90— editor_core::tables::reference_grid::compute_map 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.
editor_core::yrs_engine::commands::clipboard::plan_at_selection (cyclomatic 26) rust/editor-core/src/yrs_engine/commands/clipboard.rs:264— editor_core::yrs_engine::commands::clipboard::plan_at_selection 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.
editor_core::yrs_engine::commands::text::plan (cyclomatic 25) rust/editor-core/src/yrs_engine/commands/text.rs:987— editor_core::yrs_engine::commands::text::plan 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.
editor_core::render::incremental::generate_block_inner (cyclomatic 24) rust/editor-core/src/render/incremental.rs:628— editor_core::render::incremental::generate_block_inner 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.
editor_core::serialize::markdown_out::block_kind (cyclomatic 24) rust/editor-core/src/serialize/markdown_out.rs:113— editor_core::serialize::markdown_out::block_kind 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.
editor_core::yrs_engine::commands::format::plan (cyclomatic 24) rust/editor-core/src/yrs_engine/commands/format.rs:110— editor_core::yrs_engine::commands::format::plan 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.
editor_core::yrs_engine::compiler::insert_position::resolve_insert_node_position (cyclomatic 24) rust/editor-core/src/yrs_engine/compiler/insert_position.rs:20— editor_core::yrs_engine::compiler::insert_position::resolve_insert_node_position 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.
editor_core::boundary::write_json_frames (cyclomatic 23) rust/editor-core/src/boundary.rs:531— editor_core::boundary::write_json_frames has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
editor_core::command_planner::text::plan_delete_scalar_range_impl (cyclomatic 23) rust/editor-core/src/command_planner/text.rs:842— editor_core::command_planner::text::plan_delete_scalar_range_impl 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.
editor_core::tables::reference_grid::reference_pass (cyclomatic 22) rust/editor-core/src/tables/reference_grid.rs:264— editor_core::tables::reference_grid::reference_pass 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.
editor_core::yrs_engine::compiler::input_limits::admit_transaction_envelope (cyclomatic 21) rust/editor-core/src/yrs_engine/compiler/input_limits.rs:12— editor_core::yrs_engine::compiler::input_limits::admit_transaction_envelope has cyclomatic complexity 21 (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.
editor_core::yrs_engine::compiler::selection::selection_plan (cyclomatic 21) rust/editor-core/src/yrs_engine/compiler/selection.rs:224— editor_core::yrs_engine::compiler::selection::selection_plan has cyclomatic complexity 21 (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.
editor_core::yrs_engine::mutation::lowering::range::text_targets::drive_lookup_materialization_collector (cyclomatic 21) rust/editor-core/src/yrs_engine/mutation/lowering/range/text_targets.rs:12— editor_core::yrs_engine::mutation::lowering::range::text_targets::drive_lookup_materialization_collector 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.
editor_core::clipboard::replacement (cyclomatic 20) rust/editor-core/src/clipboard.rs:379— editor_core::clipboard::replacement 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.
editor_core::ffi_v2::native_frame::build_native_frame (cyclomatic 20) rust/editor-core/src/ffi_v2/native_frame.rs:246— editor_core::ffi_v2::native_frame::build_native_frame 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.
editor_core::transform::apply::range::insert_nodes_in_children (cyclomatic 20) rust/editor-core/src/transform/apply/range.rs:165— editor_core::transform::apply::range::insert_nodes_in_children 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.
editor_core::transform::apply::validation::validate_opaque (cyclomatic 20) rust/editor-core/src/transform/apply/validation.rs:598— editor_core::transform::apply::validation::validate_opaque 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.
editor_core::ffi_v2::render::serialize_render_element (cyclomatic 19) rust/editor-core/src/ffi_v2/render.rs:691— editor_core::ffi_v2::render::serialize_render_element 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.
+ 16 more in this group — see findings.md.
X5 · Nullable reference types· Symbol treated as nullable, then dereferenced unguarded · ×40
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/build.rs:6— `std::env::var("DEP_MIMALLOC_INCLUDE_DIR")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `main` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/boundary.rs:36— `current.checked_add(1)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `enter` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/boundary.rs:265— `built.len().checked_sub(len)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `clone_json_value_stack_safe` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/boundary.rs:273— `built.len().checked_sub(keys.len())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `clone_json_value_stack_safe` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/boundary.rs:281— `built.pop()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `clone_json_value_stack_safe` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/boundary.rs:626— `write_json_value_stack_safe(&mut output,value)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `serialize_json_value_stack_safe` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/boundary.rs:951— `chunk.try_into()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `string_requires_json_escape` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/clipboard.rs:327— `left.pop()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `join_edges` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/clipboard.rs:330— `a.content()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `join_edges` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/clipboard.rs:331— `b.content()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `join_edges` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/command_planner.rs:262— `schema.mark(mark_type)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `validate_mark_request` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/editor_state.rs:297— `table_surface.as_ref()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `command_applicability_with_known_node_count_impl` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/native_transaction_bridge.rs:405— `map.block(block_index)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `submit_selection` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/position_epoch.rs:317— `self.get(index)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `iter` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/position_epoch.rs:859— `installation.replacing` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `install_update` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/table_interop.rs:1047— `serde_json::from_str(&serialized)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `parse_outcome` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/yrs_engine/block_branch_index.rs:81— `position_map.block(index)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `for_blocks` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/yrs_engine/block_branch_index.rs:225— `builder.blocks[index].as_mut()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `text` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/yrs_engine/canonical.rs:73— `crate::serialize::json_out::write_node_json(&mut counter,node,schema)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `measure_node_json_len` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/yrs_engine/canonical.rs:539— `self.write_canonical_json(&mut serialized)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `canonical_json_bytes` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/yrs_engine/canonical.rs:559— `projection_hash::projection_sha256(&serialized)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `sha256` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/yrs_engine/canonical.rs:573— `self.0.projection_sha256.get()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `projection_sha256` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/yrs_engine/canonical.rs:646— `crate::serialize::json_out::write_node_json(&mut serialized,document.root(),&self.0.schema_context.0.schema,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `matches_document` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/yrs_engine/canonical.rs:759— `projection_hash::projection_sha256(&serialized)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `sha256` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded rust/editor-core/src/yrs_engine/canonical.rs:794— `self.projection_sha256.get()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `projection_sha256` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
TooManyMethods: EditorTextView ios/EditorTextView.swift:15— TooManyMethods — 346 methods, declared across 20 files: ios/EditorTextView+Selection.swift (39), ios/EditorTextView+KeyboardInput.swift (33), ios/EditorTextView+Images.swift (28), ios/EditorTextView.swift (28), +16 more file(s). The bar is 30 methods; this is 316 over it, 11.53× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorV2Adapter ios/EditorV2Adapter.swift:22— TooManyMethods — 165 methods, declared across 8 files: ios/EditorV2Adapter+Selection.swift (29), ios/EditorV2Adapter+RenderState.swift (26), ios/EditorV2Adapter+Commands.swift (24), ios/EditorV2Adapter+Envelope.swift (23), +4 more file(s). The bar is 30 methods; this is 135 over it, 5.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: YrsDocumentEngine rust/editor-core/src/yrs_engine/engine.rs:171— TooManyMethods — 152 methods, declared across 15 files: yrs_engine/engine.rs (57), engine/undo_redo.rs (18), engine/imports.rs (16), engine/commands.rs (14), +11 more file(s). The bar is 30 methods; this is 122 over it, 5.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NativeEditorExpoView ios/NativeEditorExpoView.swift:49— TooManyMethods — 149 methods, declared across 11 files: ios/NativeEditorExpoView+Properties.swift (27), ios/NativeEditorExpoView+Focus.swift (18), ios/NativeEditorExpoView+AccessoryRetry.swift (17), ios/NativeEditorExpoView+Updates.swift (15), +7 more file(s). The bar is 30 methods; this is 119 over it, 4.97× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorEditText android/src/main/java/com/apollohg/editor/EditorEditText.kt:29— TooManyMethods — 141 methods. The bar is 30 methods; this is 111 over it, 4.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NativeEditorExpoView android/src/main/java/com/apollohg/editor/NativeEditorExpoView.kt:25— TooManyMethods — 122 methods. The bar is 30 methods; this is 92 over it, 4.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorTableSurface ios/Tables/EditorTableSurface.swift:79— TooManyMethods — 113 methods, declared across 2 files: Tables/EditorTableSurface.swift (105), Tables/EditorTableSurface+CellDragDrop.swift (8). The bar is 30 methods; this is 83 over it, 3.77× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PreparedProseDrawingView android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:77— TooManyMethods — 107 methods. The bar is 30 methods; this is 77 over it, 3.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorTableSurface android/src/main/java/com/apollohg/editor/tables/EditorTableSurface.kt:156— TooManyMethods — 103 methods. The bar is 30 methods; this is 73 over it, 3.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PreparedProseDrawingView ios/Viewer/PreparedProseDrawingView.swift:79— TooManyMethods — 101 methods, declared across 2 files: Viewer/PreparedProseDrawingView.swift (98), ios/EditorCodeHighlighting.swift (3). The bar is 30 methods; this is 71 over it, 3.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RichTextEditorView ios/RichTextEditorView.swift:96— TooManyMethods — 92 methods. The bar is 30 methods; this is 62 over it, 3.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorV2Adapter android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:10— TooManyMethods — 83 methods. The bar is 30 methods; this is 53 over it, 2.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RichTextEditorView android/src/main/java/com/apollohg/editor/RichTextEditorView.kt:34— TooManyMethods — 77 methods. The bar is 30 methods; this is 47 over it, 2.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorTextSurface android/src/main/java/com/apollohg/editor/EditorTextSurface.kt:46— TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: YrsHistory rust/editor-core/src/yrs_engine/history.rs:562— TooManyMethods — 62 methods, declared across 5 files: history/replay.rs (29), history/capture.rs (15), history/recording.rs (12), history/deletion_filter.rs (5), +1 more file(s). The bar is 30 methods; this is 32 over it, 2.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PreparedProseLayoutRegistry ios/Viewer/PreparedProseLayoutRegistry.swift:6— TooManyMethods — 61 methods, declared across 4 files: Viewer/PreparedProseLayoutRegistry+Artifacts.swift (22), Viewer/PreparedProseLayoutRegistry+Fabric.swift (21), Viewer/PreparedProseLayoutRegistry+FabricOwnership.swift (10), Viewer/PreparedProseLayoutRegistry.swift (8). The bar is 30 methods; this is 31 over it, 2.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MutationCompiler rust/editor-core/src/yrs_engine/mutation/lowering/model.rs:238— TooManyMethods — 60 methods, declared across 12 files: index/construction.rs (21), lowering/range.rs (8), lowering/text.rs (7), index/structural_delete.rs (6), +8 more file(s). The bar is 30 methods; this is 30 over it, 2.00× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorAccessoryToolbarView ios/NativeToolbar.swift:3— TooManyMethods — 56 methods, declared across 5 files: ios/NativeToolbar+Diagnostics.swift (17), ios/NativeToolbar.swift (17), ios/NativeToolbar+ButtonStyle.swift (11), ios/NativeToolbar+Buttons.swift (10), +1 more file(s). The bar is 30 methods; this is 26 over it, 1.87× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorSession rust/editor-core/src/session.rs:62— TooManyMethods — 56 methods, declared across 3 files: session/collaboration.rs (32), session/native.rs (13), session/content.rs (11). The bar is 30 methods; this is 26 over it, 1.87× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ProseViewerView android/src/main/java/com/apollohg/editor/ProseViewerView.kt:114— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RenderBridge ios/RenderBridge.swift:156— TooManyMethods — 49 methods, declared across 5 files: ios/RenderBridge+Style.swift (18), ios/RenderBridge+BlockBoundaries.swift (17), ios/RenderBridge+Atoms.swift (6), ios/RenderBridge.swift (6), +1 more file(s). The bar is 30 methods; this is 19 over it, 1.63× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RenderImageLoader android/src/main/java/com/apollohg/editor/RenderImageLoader.kt:21— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AndroidCollaborationTransport android/src/main/java/com/apollohg/editor/AndroidCollaborationTransport.kt:130— TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorInputConnection android/src/main/java/com/apollohg/editor/EditorInputConnection.kt:44— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorKeyboardToolbarView android/src/main/java/com/apollohg/editor/EditorKeyboardToolbarView.kt:29— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StaticLayoutAndroidProseLayoutEngine android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:277— ClassTooLong — 2175 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 1775 over it, 5.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: EditorTableSurface android/src/main/java/com/apollohg/editor/tables/EditorTableSurface.kt:156— ClassTooLong — 2021 significant lines (blank, comment-only and punctuation-only lines excluded), 103 methods. The bar is 400 significant lines; this is 1621 over it, 5.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PreparedProseDrawingView android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:77— ClassTooLong — 1560 significant lines (blank, comment-only and punctuation-only lines excluded), 107 methods. The bar is 400 significant lines; this is 1160 over it, 3.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PreparedProseDrawingView ios/Viewer/PreparedProseDrawingView.swift:79— ClassTooLong — 1433 significant lines (blank, comment-only and punctuation-only lines excluded), 101 methods. The bar is 400 significant lines; this is 1033 over it, 3.58× 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: CoreTextProseLayoutEngine ios/Viewer/CoreTextProseLayoutEngine.swift:9— ClassTooLong — 1420 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 1020 over it, 3.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: EditorTableSurface ios/Tables/EditorTableSurface.swift:79— ClassTooLong — 1408 significant lines (blank, comment-only and punctuation-only lines excluded), 113 methods. The bar is 400 significant lines; this is 1008 over it, 3.52× 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: RichTextEditorView ios/RichTextEditorView.swift:96— ClassTooLong — 1185 significant lines (blank, comment-only and punctuation-only lines excluded), 92 methods. The bar is 400 significant lines; this is 785 over it, 2.96× 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: RichTextEditorView android/src/main/java/com/apollohg/editor/RichTextEditorView.kt:34— ClassTooLong — 949 significant lines (blank, comment-only and punctuation-only lines excluded), 77 methods. The bar is 400 significant lines; this is 549 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PreparedProseViewerManager android/src/main/java/com/apollohg/editor/viewer/PreparedProseViewerManager.kt:50— ClassTooLong — 791 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 391 over it, 1.98× 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: EditorLayoutManager ios/EditorLayoutManager.swift:7— ClassTooLong — 787 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 387 over it, 1.97× 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: EditorV2Adapter android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:10— ClassTooLong — 757 significant lines (blank, comment-only and punctuation-only lines excluded), 83 methods. The bar is 400 significant lines; this is 357 over it, 1.89× 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: EditorEditText android/src/main/java/com/apollohg/editor/EditorEditText.kt:29— ClassTooLong — 742 significant lines (blank, comment-only and punctuation-only lines excluded), 141 methods. The bar is 400 significant lines; this is 342 over it, 1.86× 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: EditorTextView ios/EditorTextView.swift:15— ClassTooLong — 736 significant lines (blank, comment-only and punctuation-only lines excluded), 346 methods. The bar is 400 significant lines; this is 336 over it, 1.84× 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: EditorKeyboardToolbarView android/src/main/java/com/apollohg/editor/EditorKeyboardToolbarView.kt:29— ClassTooLong — 727 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 327 over it, 1.82× 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: DerivedStateCache rust/editor-core/src/yrs_engine/derived_state.rs:113— ClassTooLong — 712 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods, 3 blocks, lines 113-1015. The bar is 400 significant lines; this is 312 over it, 1.78× 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: LocalizedTextLeafIndex rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:124— ClassTooLong — 643 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods, 3 blocks, lines 124-970. The bar is 400 significant lines; this is 243 over it, 1.61× 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: EditorTextSurface android/src/main/java/com/apollohg/editor/EditorTextSurface.kt:46— ClassTooLong — 641 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods. The bar is 400 significant lines; this is 241 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ProseViewerView android/src/main/java/com/apollohg/editor/ProseViewerView.kt:114— ClassTooLong — 630 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods. The bar is 400 significant lines; this is 230 over it, 1.58× 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: NativeEditorExpoView android/src/main/java/com/apollohg/editor/NativeEditorExpoView.kt:25— ClassTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded), 122 methods. The bar is 400 significant lines; this is 225 over it, 1.56× 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: ViewerTableSurface android/src/main/java/com/apollohg/editor/tables/ViewerTableSurface.kt:227— ClassTooLong — 606 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 206 over it, 1.52× 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: PreparedProseLayoutCache ios/Viewer/PreparedProseLayoutCache.swift:6— ClassTooLong — 549 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 149 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: EditorTextSurfaceInteraction android/src/main/java/com/apollohg/editor/EditorTextSurfaceInteraction.kt:30— ClassTooLong — 540 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 140 over it, 1.35× 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: useRichTextEditorPresentation src/useRichTextEditorPresentation.tsx:1— ClassTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 138 over it, 1.35× 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: AndroidCollaborationTransport android/src/main/java/com/apollohg/editor/AndroidCollaborationTransport.kt:130— ClassTooLong — 529 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 129 over it, 1.32× 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: RustPeer rust/editor-core/src/table_interop.rs:284— ClassTooLong — 523 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 2 blocks, lines 284-1020. The bar is 400 significant lines; this is 123 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.
Duplicated block (9 lines × 2) rust/editor-core/src/command_planner/structure.rs:141— rust/editor-core/src/command_planner/structure.rs:141-149 | rust/editor-core/src/editor_state/selection.rs:272-280 — 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 `rust/editor-core/src/command_planner/structure.rs:141` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) rust/editor-core/src/ffi_v2/collaboration.rs:77— rust/editor-core/src/ffi_v2/collaboration.rs:77-85 | rust/editor-core/src/ffi_v2/collaboration.rs:103-111 — both copies are in the same file, so extract the 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 `rust/editor-core/src/ffi_v2/collaboration.rs:77` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) rust/editor-core/src/ffi_v2/editor.rs:497— rust/editor-core/src/ffi_v2/editor.rs:497-505 | rust/editor-core/src/ffi_v2/editor.rs:531-539 — both copies are in the same file, so extract the 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 `rust/editor-core/src/ffi_v2/editor.rs:497` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) rust/editor-core/src/serialize/html_in.rs:571— rust/editor-core/src/serialize/html_in.rs:571-579 | rust/editor-core/src/serialize/html_in.rs:1089-1097 — both copies are in the same file, so extract the 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 `rust/editor-core/src/serialize/html_in.rs:571` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) rust/editor-core/src/transform/apply.rs:139— rust/editor-core/src/transform/apply.rs:139-147 | rust/editor-core/src/transform/apply/validation.rs:295-303 — 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 `rust/editor-core/src/transform/apply.rs:139` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) rust/editor-core/src/transform/apply/list_wrap.rs:233— rust/editor-core/src/transform/apply/list_wrap.rs:233-241 | rust/editor-core/src/transform/apply/list_wrap.rs:243-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) rust/editor-core/src/yrs_engine/engine/candidate.rs:281— rust/editor-core/src/yrs_engine/engine/candidate.rs:281-289 | rust/editor-core/src/yrs_engine/engine/snapshots.rs:132-140 — 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 `rust/editor-core/src/yrs_engine/engine/candidate.rs:281` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) rust/editor-core/src/yrs_engine/engine/candidate.rs:298— rust/editor-core/src/yrs_engine/engine/candidate.rs:298-306 | rust/editor-core/src/yrs_engine/engine/snapshots.rs:149-157 — 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 `rust/editor-core/src/yrs_engine/engine/candidate.rs:298` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) rust/editor-core/src/yrs_engine/engine/candidate.rs:348— rust/editor-core/src/yrs_engine/engine/candidate.rs:348-356 | rust/editor-core/src/yrs_engine/engine/candidate.rs:433-441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, 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) rust/editor-core/src/yrs_engine/mutation/lowering/attrs.rs:245— rust/editor-core/src/yrs_engine/mutation/lowering/attrs.rs:245-253 | rust/editor-core/src/yrs_engine/mutation/lowering/attrs.rs:264-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) rust/editor-core/src/yrs_engine/mutation/lowering/index/construction.rs:906— rust/editor-core/src/yrs_engine/mutation/lowering/index/construction.rs:906-914 | rust/editor-core/src/yrs_engine/mutation/lowering/index/construction.rs:916-924 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/mutation/lowering/index/construction.rs:906` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) rust/editor-core/src/yrs_engine/mutation/plan/model.rs:335— rust/editor-core/src/yrs_engine/mutation/plan/model.rs:335-343 | rust/editor-core/src/yrs_engine/mutation/plan/model.rs:354-362 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/mutation/plan/model.rs:335` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) rust/editor-core/src/yrs_engine/derived_state/candidate_evidence.rs:313— rust/editor-core/src/yrs_engine/derived_state/candidate_evidence.rs:313-321 | rust/editor-core/src/yrs_engine/derived_state/candidate_evidence.rs:371-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/editor-core/src/yrs_engine/derived_state/candidate_evidence.rs:310` calls `matches_exact_source_document`, `schema_fingerprint`, `schema_context` and `rust/editor-core/src/yrs_engine/derived_state/candidate_evidence.rs:370` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) rust/editor-core/src/boundary/limits.rs:175— rust/editor-core/src/boundary/limits.rs:175-183 | rust/editor-core/src/yrs_engine/error.rs:29-37 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) rust/editor-core/src/render/generate.rs:18— rust/editor-core/src/render/generate.rs:18-26 | rust/editor-core/src/render/incremental.rs:305-313 — before extracting anything, compare `rust/editor-core/src/render/generate.rs` and `rust/editor-core/src/render/incremental.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `&Node` in one and `&crate::model::Node` 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) rust/editor-core/src/transform/apply/range.rs:670— rust/editor-core/src/transform/apply/range.rs:670-678 | rust/editor-core/src/transform/apply/range.rs:713-722 — both copies are in the same file, so extract the 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 `rust/editor-core/src/transform/apply/range.rs:670` 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 (9 lines × 2) rust/editor-core/src/yrs_engine/mutation/lowering/range.rs:476— rust/editor-core/src/yrs_engine/mutation/lowering/range.rs:476-484 | rust/editor-core/src/yrs_engine/mutation/lowering/range.rs:501-509 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/mutation/lowering/range.rs:476` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) android/src/main/java/com/apollohg/editor/EditorEditTextDeferredUpdates.kt:176— android/src/main/java/com/apollohg/editor/EditorEditTextDeferredUpdates.kt:176-184 | android/src/main/java/com/apollohg/editor/EditorEditTextRustCommands.kt:277-285 — 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 `android/src/main/java/com/apollohg/editor/EditorEditTextDeferredUpdates.kt:176` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) android/src/main/java/com/apollohg/editor/ProseViewerView.kt:949— android/src/main/java/com/apollohg/editor/ProseViewerView.kt:949-957 | android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:2078-2086 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) ios/EditorV2Adapter+TextCommands.swift:282— ios/EditorV2Adapter+TextCommands.swift:282-292 | ios/EditorV2Adapter+TextCommands.swift:302-310 — both copies are in the same file, so extract the 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 `ios/EditorV2Adapter+TextCommands.swift:282` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (9 lines × 2) rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/localized_marks.rs:374— rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/localized_marks.rs:374-382 | rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/paste_root_window.rs:176-184 — 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 `rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/localized_marks.rs:374` 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.
MutationCompiler::apply_virtual_structural_splices (cognitive 90) rust/editor-core/src/yrs_engine/mutation/lowering/list/layout.rs:2— MutationCompiler::apply_virtual_structural_splices has cognitive complexity 90 (threshold 15). Drivers by points: if/else 16 (44 pts), match/switch 10 (24 pts), loops 10 (19 pts), boolean chains 3 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MutationCompiler::wrap_in_list (cognitive 62) rust/editor-core/src/yrs_engine/mutation/lowering/list/wrap.rs:3— MutationCompiler::wrap_in_list has cognitive complexity 62 (threshold 15). Drivers by points: if/else 16 (30 pts), match/switch 6 (16 pts), loops 11 (13 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.
MutationCompiler::split_block (cognitive 58) REDACTED:190— MutationCompiler::split_block has cognitive complexity 58 (threshold 15). Drivers by points: if/else 20 (36 pts), loops 4 (15 pts), match/switch 3 (4 pts), boolean chains 3 (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.
MutationCompiler::unwrap_from_list (cognitive 48) rust/editor-core/src/yrs_engine/mutation/lowering/list/unwrap.rs:3— MutationCompiler::unwrap_from_list has cognitive complexity 48 (threshold 15). Drivers by points: if/else 25 (41 pts), loops 3 (4 pts), boolean chains 2, match/switch 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.
MutationCompiler::delete_structural_range (cognitive 44) rust/editor-core/src/yrs_engine/mutation/lowering/index/structural_delete.rs:2— MutationCompiler::delete_structural_range has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 8 (12 pts), match/switch 5 (9 pts), boolean chains 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.
MutationCompiler::rebuild_target_layout (cognitive 44) rust/editor-core/src/yrs_engine/mutation/lowering/list/layout.rs:312— MutationCompiler::rebuild_target_layout has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 7 (9 pts), match/switch 6 (9 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.
MutationCompiler::current_storage_insertion (cognitive 38) rust/editor-core/src/yrs_engine/mutation/lowering/index/structural_delete.rs:441— MutationCompiler::current_storage_insertion has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 5 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MutationCompiler::shift_child_actions_after_insert (cognitive 36) rust/editor-core/src/yrs_engine/mutation/lowering/index/construction.rs:369— MutationCompiler::shift_child_actions_after_insert has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (28 pts), match/switch 2 (5 pts), loops 2, 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.
MutationCompiler::remove_prepared_children (cognitive 34) rust/editor-core/src/yrs_engine/mutation/lowering/index/construction.rs:557— MutationCompiler::remove_prepared_children has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 6 (12 pts), match/switch 2 (4 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.
MutationCompiler::release_prepared_storage_suffix (cognitive 25) rust/editor-core/src/yrs_engine/mutation/lowering/index/construction.rs:282— MutationCompiler::release_prepared_storage_suffix has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 5 (11 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MutationCompiler::try_wrap_prepared_root_batch (cognitive 21) rust/editor-core/src/yrs_engine/mutation/lowering/list/wrap.rs:399— MutationCompiler::try_wrap_prepared_root_batch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 5, boolean chains 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MutationCompiler::outdent_list_item (cognitive 20) rust/editor-core/src/yrs_engine/mutation/lowering/list/indent.rs:328— MutationCompiler::outdent_list_item has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 2, loops 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.
MutationCompiler::replace_structural_range (cognitive 18) rust/editor-core/src/yrs_engine/mutation/lowering/text.rs:677— MutationCompiler::replace_structural_range has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 3, boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
MutationCompiler::update_node_attrs (cognitive 16) rust/editor-core/src/yrs_engine/mutation/lowering/attrs.rs:2— MutationCompiler::update_node_attrs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MutationCompiler::insert_structural_node (cognitive 16) rust/editor-core/src/yrs_engine/mutation/lowering/node.rs:2— MutationCompiler::insert_structural_node has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (4 pts), boolean chains 2, match/switch 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.
MutationCompiler::register_inserted_structural_children (cognitive 16) rust/editor-core/src/yrs_engine/mutation/lowering/node.rs:384— MutationCompiler::register_inserted_structural_children has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3, 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.
MutationCompiler::delete (cognitive 16) rust/editor-core/src/yrs_engine/mutation/lowering/text.rs:191— MutationCompiler::delete has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (4 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.
Duplicated block (10 lines × 2) rust/editor-core/src/command_planner.rs:232— rust/editor-core/src/command_planner.rs:232-241 | rust/editor-core/src/yrs_engine/derived_state/selection.rs:262-271 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) rust/editor-core/src/command_planner.rs:366— rust/editor-core/src/command_planner.rs:366-375 | rust/editor-core/src/command_planner.rs:496-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 (10 lines × 2) rust/editor-core/src/command_planner/structure.rs:473— rust/editor-core/src/command_planner/structure.rs:473-482 | rust/editor-core/src/command_planner/structure.rs:489-498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) rust/editor-core/src/ffi_v2/collaboration.rs:191— rust/editor-core/src/ffi_v2/collaboration.rs:191-200 | rust/editor-core/src/ffi_v2/collaboration.rs:216-225 — both copies are in the same file, so extract the 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 `rust/editor-core/src/ffi_v2/collaboration.rs:191` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) rust/editor-core/src/render/generate.rs:209— rust/editor-core/src/render/generate.rs:209-218 | rust/editor-core/src/render/incremental.rs:852-861 — before extracting anything, compare `rust/editor-core/src/render/generate.rs` and `rust/editor-core/src/render/incremental.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/render/generate.rs:209` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) rust/editor-core/src/serialize/html_in.rs:1301— rust/editor-core/src/serialize/html_in.rs:1301-1310 | rust/editor-core/src/serialize/html_out.rs:557-566 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) rust/editor-core/src/yrs_engine/codec.rs:147— rust/editor-core/src/yrs_engine/codec.rs:147-156 | rust/editor-core/src/yrs_engine/codec/mutation.rs:136-145 — 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) rust/editor-core/src/yrs_engine/compiler/positions.rs:112— rust/editor-core/src/yrs_engine/compiler/positions.rs:112-123 | rust/editor-core/src/yrs_engine/compiler/positions.rs:193-202 — both copies are in the same file, so extract the 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) rust/editor-core/src/yrs_engine/derived_state/history_snapshot.rs:551— rust/editor-core/src/yrs_engine/derived_state/history_snapshot.rs:551-560 | rust/editor-core/src/yrs_engine/derived_state/history_snapshot.rs:751-760 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:948— rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:948-957 | rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:1204-1213 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:948` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) rust/editor-core/src/yrs_engine/mutation/lowering/index/lookup_seed.rs:140— rust/editor-core/src/yrs_engine/mutation/lowering/index/lookup_seed.rs:140-149 | rust/editor-core/src/yrs_engine/mutation/lowering/index/lookup_seed.rs:369-378 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/mutation/lowering/index/lookup_seed.rs:140` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:471— rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:471-480 | rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:495-504 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:471` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) rust/editor-core/src/tables/commands/columns.rs:11— rust/editor-core/src/tables/commands/columns.rs:11-20 | rust/editor-core/src/tables/commands/rows.rs:12-21 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) rust/editor-core/src/table_interop.rs:1055— rust/editor-core/src/table_interop.rs:1055-1065 | rust/editor-core/src/table_interop.rs:1091-1100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) rust/editor-core/src/yrs_engine/mutation/plan/model.rs:810— rust/editor-core/src/yrs_engine/mutation/plan/model.rs:810-819 | rust/editor-core/src/yrs_engine/mutation/plan/model.rs:825-834 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/mutation/plan/model.rs:810` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) ios/EditorLayoutManager.swift:626— ios/EditorLayoutManager.swift:626-635 | ios/EditorLayoutManager.swift:812-821 — both copies are in the same file, so extract the 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 `ios/EditorLayoutManager.swift:626` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) rust/editor-core/src/test_support/yrs_engine_transaction_property_test/oracle_properties.rs:388— rust/editor-core/src/test_support/yrs_engine_transaction_property_test/oracle_properties.rs:388-397 | rust/editor-core/src/test_support/yrs_engine_transaction_property_test/oracle_properties.rs:548-557 — both copies are in the same file, so extract the 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 `rust/editor-core/src/test_support/yrs_engine_transaction_property_test/oracle_properties.rs:388` 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.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×17
Recursive walk over a caller-supplied document has no depth cap src/NativeEditorResultNormalization.ts:472— `validJsonValue` is exported and takes `value: unknown` from its caller, and it calls itself at line 472 (`validJsonValue`) with a piece of `value` (and at line 475) — and nowhere in `validJsonValue` 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 `validJsonValue` 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 src/attributeValidation.ts:32— `validateAttribute` is exported, takes a document from its caller (line 67) and hands it to `validateJson`, which calls itself at line 32 (`validateJson`) with a piece of `value` — and nowhere in `validateJson` 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 `validateJson` 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 src/attributeValidation.ts:59— `validateAttribute` is exported, takes a document from its caller (line 67) and hands it to `equal`, which calls itself at line 59 (`equal`) with a piece of `left` — and nowhere in `equal` 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 `equal` 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 rust/editor-core/src/clipboard.rs:223— `node_text` is public and takes `node: &Node` from its caller, and it calls itself at line 223 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `node_text` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap rust/editor-core/src/editor_state.rs:562— `document_node_count` is public and takes `node: &Node` from its caller, and it calls itself at line 562 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `document_node_count` 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 rust/editor-core/src/yrs_engine/compiler.rs:445— `node_text_bytes` is public and takes `node: &Node` from its caller, and it calls itself at line 445 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `node_text_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 rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:506— `prepared_nodes_metrics` is public, takes a document from its caller (line 451) and hands it to `node_metrics`, which calls itself at line 506 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `node_metrics` 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 rust/editor-core/src/yrs_engine/compiler/input_limits.rs:386— `validate_fragment_marks` is public, takes a document from its caller (line 371) and hands it to `visit`, which calls itself at line 386 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `visit` 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 rust/editor-core/src/tables/mutation_guard.rs:161— `tables_flattened_into_blocks` is public, takes a document from its caller (line 143) and hands it to `flatten_tables`, which calls itself at line 161 with a piece of the document (and at line 167) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `flatten_tables` 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 rust/editor-core/src/tables/render.rs:171— `clone` is public and takes a `TableRenderRecord` as its receiver from its caller, and it calls itself at line 171 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `clone` 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 rust/editor-core/src/render/mod.rs:123— `clone` is public and takes a `RenderElement` as its receiver from its caller, and it calls itself at line 123 with a piece of the document (and at line 127, line 128, line 135, line 144, line 155, line 156, line 169, line 170, line 182, line 183, line 185) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `clone` 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 rust/editor-core/src/render/output_bytes.rs:24— `render_element_bytes` is public and takes `element: &RenderElement` from its caller, and it calls itself at line 24 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `render_element_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 rust/editor-core/src/model/fragment.rs:46— `iter` is public and takes a `Fragment` as its receiver from its caller, and it calls itself at line 46 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `iter` 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 rust/editor-core/src/model/node.rs:56— `clone` is public and takes a `NodeData` as its receiver from its caller, and it calls itself at line 56 with a piece of the document (and at line 57, line 60, line 61, line 68, line 69, line 70) — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `clone` 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 rust/editor-core/src/model/node.rs:269— `child_count` is public and takes a `Node` as its receiver from its caller, and it calls itself at line 269 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `child_count` 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 rust/editor-core/src/model/node.rs:277— `child` is public and takes a `Node` as its receiver from its caller, and it calls itself at line 277 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `child` 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 rust/editor-core/src/model/node.rs:325— `replace_node_at_path` is public and takes a `Node` as its receiver from its caller, and it calls itself at line 325 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. 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. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `replace_node_at_path` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Duplicated block (7 lines × 2) rust/editor-core/src/command_planner/text.rs:771— rust/editor-core/src/command_planner/text.rs:771-777 | rust/editor-core/src/command_planner/text.rs:1034-1040 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) rust/editor-core/src/editor_state.rs:584— rust/editor-core/src/editor_state.rs:584-590 | rust/editor-core/src/editor_state/selection.rs:371-377 — 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 `rust/editor-core/src/editor_state.rs:584` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) rust/editor-core/src/transform/apply/range.rs:736— rust/editor-core/src/transform/apply/range.rs:736-742 | rust/editor-core/src/transform/apply/range.rs:761-767 — both copies are in the same file, so extract the 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 `rust/editor-core/src/transform/apply/range.rs:736` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) rust/editor-core/src/transform/apply/text.rs:249— rust/editor-core/src/transform/apply/text.rs:249-256 | rust/editor-core/src/transform/apply/text.rs:348-354 — both copies are in the same file, so extract the 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 `rust/editor-core/src/transform/apply/text.rs:249` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) rust/editor-core/src/ffi_v2/render.rs:247— rust/editor-core/src/ffi_v2/render.rs:247-253 | rust/editor-core/src/yrs_engine/derived_state/selection.rs:667-673 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) rust/editor-core/src/yrs_engine/codec/projection_match.rs:441— rust/editor-core/src/yrs_engine/codec/projection_match.rs:441-447 | rust/editor-core/src/yrs_engine/codec/projection_write.rs:9-15 — before extracting anything, compare `rust/editor-core/src/yrs_engine/codec/projection_match.rs` and `rust/editor-core/src/yrs_engine/codec/projection_write.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/yrs_engine/codec/projection_match.rs:441` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) rust/editor-core/src/ffi_v2/editor/create_scanner.rs:377— rust/editor-core/src/ffi_v2/editor/create_scanner.rs:377-383 | rust/editor-core/src/ffi_v2/editor/create_scanner.rs:426-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 `rust/editor-core/src/ffi_v2/editor/create_scanner.rs:377` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) android/src/main/java/com/apollohg/editor/EditorEditTextDeletion.kt:89— android/src/main/java/com/apollohg/editor/EditorEditTextDeletion.kt:89-95 | android/src/main/java/com/apollohg/editor/EditorEditTextDeletion.kt:149-155 — both copies are in the same file, so extract the 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 `android/src/main/java/com/apollohg/editor/EditorEditTextDeletion.kt:89` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `android/src/main/java/com/apollohg/editor/EditorEditTextDeletion.kt:88` calls `canDispatchTableCellMutation` and `android/src/main/java/com/apollohg/editor/EditorEditTextDeletion.kt:148` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) android/src/main/java/com/apollohg/editor/EditorInputCoordinates.kt:110— android/src/main/java/com/apollohg/editor/EditorInputCoordinates.kt:110-116 | android/src/main/java/com/apollohg/editor/EditorInputCoordinates.kt:143-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) ios/EditorV2Adapter+Mutation.swift:172— ios/EditorV2Adapter+Mutation.swift:172-178 | ios/EditorV2Adapter+Mutation.swift:433-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) ios/EditorV2Adapter+Mutation.swift:428— ios/EditorV2Adapter+Mutation.swift:428-434 | ios/EditorV2Adapter+RenderState.swift:269-275 — 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 `ios/EditorV2Adapter+Mutation.swift:428` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) ios/EditorLayoutManager.swift:1006— ios/EditorLayoutManager.swift:1006-1012 | ios/Viewer/PreparedProseDrawingView.swift:1924-1930 — 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 `ios/EditorLayoutManager.swift:1006` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) ios/Tables/ViewerTableSurface.swift:376— ios/Tables/ViewerTableSurface.swift:376-382 | ios/Tables/ViewerTableSurface.swift:503-509 — both copies are in the same file, so extract the 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) ios/EditorTextView+DragDrop.swift:119— ios/EditorTextView+DragDrop.swift:119-125 | ios/EditorTextView+DragDrop.swift:146-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. Read the line range as the matched WINDOW rather than a finished unit: at `ios/EditorTextView+DragDrop.swift:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) ios/Viewer/ViewerDocument.swift:494— ios/Viewer/ViewerDocument.swift:494-500 | ios/Viewer/ViewerDocument.swift:590-596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/Viewer/ViewerDocument.swift:494` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) rust/editor-core/src/test_support/serialize_test/json_roundtrip.rs:172— rust/editor-core/src/test_support/serialize_test/json_roundtrip.rs:172-178 | rust/editor-core/src/test_support/serialize_test/schema_projection.rs:742-748 — 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.
MutationCompiler::apply_virtual_structural_splices (cyclomatic 43) rust/editor-core/src/yrs_engine/mutation/lowering/list/layout.rs:2— MutationCompiler::apply_virtual_structural_splices has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MutationCompiler::wrap_in_list (cyclomatic 41) rust/editor-core/src/yrs_engine/mutation/lowering/list/wrap.rs:3— MutationCompiler::wrap_in_list has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MutationCompiler::split_block (cyclomatic 30) REDACTED:190— MutationCompiler::split_block 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.
MutationCompiler::unwrap_from_list (cyclomatic 28) rust/editor-core/src/yrs_engine/mutation/lowering/list/unwrap.rs:3— MutationCompiler::unwrap_from_list 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.
MutationCompiler::delete_structural_range (cyclomatic 27) rust/editor-core/src/yrs_engine/mutation/lowering/index/structural_delete.rs:2— MutationCompiler::delete_structural_range 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.
MutationCompiler::rebuild_target_layout (cyclomatic 25) rust/editor-core/src/yrs_engine/mutation/lowering/list/layout.rs:312— MutationCompiler::rebuild_target_layout 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.
MutationCompiler::current_storage_insertion (cyclomatic 20) rust/editor-core/src/yrs_engine/mutation/lowering/index/structural_delete.rs:441— MutationCompiler::current_storage_insertion 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.
MutationCompiler::try_wrap_prepared_root_batch (cyclomatic 19) rust/editor-core/src/yrs_engine/mutation/lowering/list/wrap.rs:399— MutationCompiler::try_wrap_prepared_root_batch 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.
MutationCompiler::replace_structural_range (cyclomatic 19) rust/editor-core/src/yrs_engine/mutation/lowering/text.rs:677— MutationCompiler::replace_structural_range 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.
MutationCompiler::normalize_existing_target_for_split (cyclomatic 18) REDACTED:4— MutationCompiler::normalize_existing_target_for_split has cyclomatic complexity 18 (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.
MutationCompiler::outdent_list_item (cyclomatic 17) rust/editor-core/src/yrs_engine/mutation/lowering/list/indent.rs:328— MutationCompiler::outdent_list_item 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.
MutationCompiler::shift_child_actions_after_insert (cyclomatic 16) rust/editor-core/src/yrs_engine/mutation/lowering/index/construction.rs:369— MutationCompiler::shift_child_actions_after_insert has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MutationCompiler::remove_prepared_children (cyclomatic 16) rust/editor-core/src/yrs_engine/mutation/lowering/index/construction.rs:557— MutationCompiler::remove_prepared_children 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.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×13
Edited copy of a member (9 corresponding lines) rust/editor-core/src/tables/render/content_key.rs:61— rust/editor-core/src/tables/render/content_key.rs:61-69 | rust/editor-core/src/tables/render/row_key.rs:30-38 — 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) ios/EditorTheme.swift:34— ios/EditorTheme.swift:34-42 | ios/EditorTheme.swift:151-159 — 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) ios/EditorV2Adapter+Commands.swift:195— ios/EditorV2Adapter+Commands.swift:195-205 | ios/EditorV2Adapter+Commands.swift:227-235 — 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) android/src/main/java/com/apollohg/editor/UniffiEditorV2Backend.kt:73— android/src/main/java/com/apollohg/editor/UniffiEditorV2Backend.kt:73-81 | android/src/main/java/com/apollohg/editor/UniffiEditorV2Backend.kt:205-216 — 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) ios/NativeCollaborationSocket.swift:78— ios/NativeCollaborationSocket.swift:78-86 | ios/NativeCollaborationSocket.swift:88-96 — 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) android/src/main/java/com/apollohg/editor/viewer/ViewerImagePipeline.kt:224— android/src/main/java/com/apollohg/editor/viewer/ViewerImagePipeline.kt:224-232 | android/src/main/java/com/apollohg/editor/viewer/ViewerImagePipeline.kt:243-253 — 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) rust/editor-core/src/ffi_v2/editor.rs:181— rust/editor-core/src/ffi_v2/editor.rs:181-189 | rust/editor-core/src/native_transaction_bridge.rs:724-735 — 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) android/src/main/java/com/apollohg/editor/IntArrayPartition.kt:6— android/src/main/java/com/apollohg/editor/IntArrayPartition.kt:6-14 | android/src/main/java/com/apollohg/editor/tables/ViewerTableSurface.kt:1029-1037 — 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) rust/editor-core/src/yrs_engine/compiler/input_limits.rs:222— rust/editor-core/src/yrs_engine/compiler/input_limits.rs:222-230 | rust/editor-core/src/yrs_engine/compiler/insert_position.rs:463-471 — 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) rust/editor-core/src/ffi_v2/snapshot.rs:45— rust/editor-core/src/ffi_v2/snapshot.rs:45-54 | rust/editor-core/src/test_support/ffi_v2_test/session_fixtures.rs:62-70 — 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) rust/editor-core/src/ffi_v2/collaboration.rs:20— rust/editor-core/src/ffi_v2/collaboration.rs:20-28 | rust/editor-core/src/ffi_v2/native_frame.rs:420-428 — 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) rust/editor-core/src/yrs_engine/engine/imports.rs:615— rust/editor-core/src/yrs_engine/engine/imports.rs:615-623 | rust/editor-core/src/yrs_engine/error.rs:54-62 — 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) rust/editor-core/src/tables/interchange.rs:136— rust/editor-core/src/tables/interchange.rs:136-144 | rust/editor-core/src/yrs_engine/commands/tables.rs:358-369 — 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.
Repeated repair: android/src/main/java/com/apollohg/editor/NativeEditorExpoView.kt android/src/main/java/com/apollohg/editor/NativeEditorExpoView.kt:631— android/src/main/java/com/apollohg/editor/NativeEditorExpoView.kt changed 27 times in last 90 days and 15 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is NativeEditorExpoView.onEditorUpdate at line 631), 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(clipboard): complete rich copy and paste with configurable modes”; “fix(editor): make resets authoritative over pending native input”; “fix(android): stretch custom atoms with editor content”; “fix(atoms): harden editing and render synchronization”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/NativeEditorExpoView.kt`: 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: android/src/main/java/com/apollohg/editor/RenderBridge.kt android/src/main/java/com/apollohg/editor/RenderBridge.kt:123— android/src/main/java/com/apollohg/editor/RenderBridge.kt changed 21 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is RenderBridge.buildSpannableFromBlocks at line 123), 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(android): render collaboration cursors inside table cells”; “fix(atoms): align component mounting and update behavior”; “fix(native): stabilize caret and image interactions”; “fix(atoms): preserve spacing and caret behavior”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/RenderBridge.kt`: 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: android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:344— android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt changed 19 times in last 90 days and 11 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 EditorV2Adapter.adoptExternalReset at line 344), 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(lists): convert list types and align iOS bullets”; “fix(clipboard): complete rich copy and paste with configurable modes”; “fix(android): correct editor input and gesture regressions”; “fix(editor): make resets authoritative over pending native input”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt`: 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: rust/editor-core/src/command_planner.rs rust/editor-core/src/command_planner.rs:130— rust/editor-core/src/command_planner.rs changed 13 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is SemanticOperation::as_step at line 130), 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(atoms): preserve spacing and caret behavior”; “fix(atoms): harden editing and render synchronization”; “fix(editor): support terminal atom editing and drag moves”; “fix(atoms): stabilize Android layout and deletion”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- rust/editor-core/src/command_planner.rs`: 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: ios/EditorV2Shadow.swift ios/EditorV2Shadow.swift:22— ios/EditorV2Shadow.swift changed 10 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 8 (its worst body is EditorV2Shadow.currentScalarSelection at line 22), 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(tables): preserve task checkbox interaction and layout”; “fix(lists): convert list types and align iOS bullets”; “fix(clipboard): complete rich copy and paste with configurable modes”; “fix(ios): preserve image scrolling and node selection”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- ios/EditorV2Shadow.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: android/src/main/java/com/apollohg/editor/EditorDocumentLayout.kt android/src/main/java/com/apollohg/editor/EditorDocumentLayout.kt:595— android/src/main/java/com/apollohg/editor/EditorDocumentLayout.kt 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 10 (its worst body is EditorDocumentLayout.getSelectionPath at line 595), 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(ci): repair benchmark contracts and Android validation”; “fix(android): match native caret and selection handle behavior”; “fix(editor): correct mobile caret, list editing, and task checkboxes”; “fix(layout): collapse sibling margins and trim quote spacing”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/EditorDocumentLayout.kt`: 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: ios/EditorTextView+Images.swift ios/EditorTextView+Images.swift:260— ios/EditorTextView+Images.swift changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is EditorTextView.selectedImageSelectionState at line 260), 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(tables): preserve task checkbox interaction and layout”; “fix(editor): reflow content during image resizing”; “fix(ios): stabilize caret, checkbox, and keyboard interactions”; “fix(ios): preserve image scrolling and node selection”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- ios/EditorTextView+Images.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/editor-core/src/command_planner/backspace.rs rust/editor-core/src/command_planner/backspace.rs:367— rust/editor-core/src/command_planner/backspace.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is editor_core::command_planner::backspace::lift_trailing_empty_list_block at line 367), 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(editor): continue backspacing paragraphs after lists”; “fix(editor): unwrap list items after nested lists on backspace”; “fix(editor): correct mobile caret, list editing, and task checkboxes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- rust/editor-core/src/command_planner/backspace.rs`: 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: android/src/main/java/com/apollohg/editor/ImageResizeOverlayView.kt android/src/main/java/com/apollohg/editor/ImageResizeOverlayView.kt:293— android/src/main/java/com/apollohg/editor/ImageResizeOverlayView.kt 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 9 (its worst body is ImageResizeOverlayView.resizedRect at line 293), 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(editor): reflow content during image resizing”; “fix(native): stabilize caret and image interactions”; “fix(android): stabilize caret and resize geometry”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/ImageResizeOverlayView.kt`: 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: android/src/main/java/com/apollohg/editor/SharedNativeImagePipeline.kt android/src/main/java/com/apollohg/editor/SharedNativeImagePipeline.kt:29— android/src/main/java/com/apollohg/editor/SharedNativeImagePipeline.kt 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 3 (its worst body is ImageLoadingPolicy.fromJson at line 29), 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(images): support native SVG rendering and imported image content”; “fix(android): constrain approximate image decodes”; “fix(android): bound decoded image ownership”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/SharedNativeImagePipeline.kt`: 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: android/src/main/java/com/apollohg/editor/AndroidCollaborationTransport.kt android/src/main/java/com/apollohg/editor/AndroidCollaborationTransport.kt:500— android/src/main/java/com/apollohg/editor/AndroidCollaborationTransport.kt 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 AndroidCollaborationTransport.driveOutboundIfPossible at line 500), 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(android): finalize collaboration protocol boundaries”; “fix(android): preserve collaboration across host lifecycle”; “fix(android): close the collaboration socket with a going-away handshake”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- android/src/main/java/com/apollohg/editor/AndroidCollaborationTransport.kt`: 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: rust/editor-core/src/test_support/yrs_engine_typing_regression_test/structural_typing.rs rust/editor-core/src/test_support/yrs_engine_typing_regression_test/structural_typing.rs:1— rust/editor-core/src/test_support/yrs_engine_typing_regression_test/structural_typing.rs 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 1 (its worst body is editor_core::test_support::yrs_engine_typing_regression_test::structural_typing::apply_bullet_list at line 1), 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(editor): continue backspacing paragraphs after lists”; “fix(editor): unwrap list items after nested lists on backspace”; “fix(editor): correct mobile caret, list editing, and task checkboxes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 11:43:05 +11:00' --until='2026-11-01 11:43:05 +11:00' --full-history --no-merges -- rust/editor-core/src/test_support/yrs_engine_typing_regression_test/structural_typing.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×12
Edited copy of a member (12 corresponding lines) ios/EditorTheme.swift:180— ios/EditorTheme.swift:180-191 | ios/EditorTheme.swift:215-230 — 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) rust/editor-core/src/session/errors.rs:125— rust/editor-core/src/session/errors.rs:125-136 | rust/editor-core/src/session/errors.rs:151-163 — 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) ios/EditorTextView+KeyboardInput.swift:586— ios/EditorTextView+KeyboardInput.swift:586-600 | ios/EditorTextView+KeyboardInput.swift:602-613 — 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) android/src/main/java/com/apollohg/editor/EditorTheme.kt:227— android/src/main/java/com/apollohg/editor/EditorTheme.kt:227-238 | android/src/main/java/com/apollohg/editor/EditorTheme.kt:270-284 — 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) android/src/main/java/com/apollohg/editor/EditorTheme.kt:213— android/src/main/java/com/apollohg/editor/EditorTheme.kt:213-224 | android/src/main/java/com/apollohg/editor/EditorTheme.kt:253-267 — 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) rust/editor-core/src/yrs_engine/history/deletion_filter.rs:103— rust/editor-core/src/yrs_engine/history/deletion_filter.rs:103-114 | rust/editor-core/src/yrs_engine/history/deletion_filter.rs:116-127 — 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) rust/editor-core/src/boundary/limits.rs:94— rust/editor-core/src/boundary/limits.rs:94-140 | rust/editor-core/src/yrs_engine/editing_limits.rs:91-102 — 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) android/src/main/java/com/apollohg/editor/ProseViewerView.kt:847— android/src/main/java/com/apollohg/editor/ProseViewerView.kt:847-867 | android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:2006-2017 — 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) android/src/main/java/com/apollohg/editor/ProseViewerView.kt:960— android/src/main/java/com/apollohg/editor/ProseViewerView.kt:960-971 | android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:2090-2101 — 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) ios/NativeCollaborationTransport+Validation.swift:77— ios/NativeCollaborationTransport+Validation.swift:77-88 | ios/NativeCollaborationTransportRegistry.swift:509-520 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) rust/editor-core/src/ffi_v2/types.rs:95— rust/editor-core/src/ffi_v2/types.rs:95-106 | rust/editor-core/src/session/errors.rs:71-82 — 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) rust/editor-core/fuzz/fuzz_targets/position_map.rs:148— rust/editor-core/fuzz/fuzz_targets/position_map.rs:148-159 | rust/editor-core/fuzz/fuzz_targets/position_map.rs:170-181 — 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.
Duplicated block (6 lines × 2) rust/editor-core/src/command_planner/text.rs:127— rust/editor-core/src/command_planner/text.rs:127-132 | rust/editor-core/src/command_planner/text.rs:511-516 — both copies are in the same file, so extract the 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 `rust/editor-core/src/command_planner/text.rs:127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) rust/editor-core/src/command_planner/text.rs:713— rust/editor-core/src/command_planner/text.rs:713-718 | rust/editor-core/src/editor_state/structure.rs:55-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) rust/editor-core/src/viewer/compile.rs:507— rust/editor-core/src/viewer/compile.rs:507-512 | rust/editor-core/src/viewer/compile.rs:527-532 — both copies are in the same file, so extract the 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) rust/editor-core/src/yrs_engine/codec/projection_match.rs:619— rust/editor-core/src/yrs_engine/codec/projection_match.rs:619-624 | rust/editor-core/src/yrs_engine/codec/projection_write.rs:166-171 — before extracting anything, compare `rust/editor-core/src/yrs_engine/codec/projection_match.rs` and `rust/editor-core/src/yrs_engine/codec/projection_write.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/yrs_engine/codec/projection_match.rs:619` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) rust/editor-core/src/collaboration_runtime/awareness.rs:282— rust/editor-core/src/collaboration_runtime/awareness.rs:282-287 | rust/editor-core/src/session.rs:191-196 — 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 `rust/editor-core/src/collaboration_runtime/awareness.rs:282` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) rust/editor-core/src/transform/apply/range.rs:290— rust/editor-core/src/transform/apply/range.rs:290-295 | rust/editor-core/src/transform/apply/range.rs:324-329 — both copies are in the same file, so extract the 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) android/src/main/java/com/apollohg/editor/EditorTheme.kt:595— android/src/main/java/com/apollohg/editor/EditorTheme.kt:595-600 | android/src/main/java/com/apollohg/editor/EditorTheme.kt:606-611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `android/src/main/java/com/apollohg/editor/EditorTheme.kt:595` 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 (6 lines × 2) ios/Tables/ViewerTableSurface.swift:1235— ios/Tables/ViewerTableSurface.swift:1235-1240 | ios/Tables/ViewerTableSurface.swift:1287-1292 — both copies are in the same file, so extract the 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 `ios/Tables/ViewerTableSurface.swift:1235` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) ios/EditorTheme.swift:34— ios/EditorTheme.swift:34-39 | ios/EditorTheme.swift:151-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/EditorTheme.swift:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) ios/RenderBridge+Atoms.swift:105— ios/RenderBridge+Atoms.swift:105-110 | ios/RenderBridge+Atoms.swift:224-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/RenderBridge+Atoms.swift:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) rust/editor-core/src/test_support/yrs_engine_transaction_property_test/stateful_traces.rs:269— rust/editor-core/src/test_support/yrs_engine_transaction_property_test/stateful_traces.rs:269-274 | rust/editor-core/src/test_support/yrs_engine_transaction_property_test/stateful_traces.rs:366-371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/editor-core/src/test_support/yrs_engine_transaction_property_test/stateful_traces.rs:372` calls `validate`, `default`, `unwrap` and `rust/editor-core/src/test_support/yrs_engine_transaction_property_test/stateful_traces.rs:275` 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 (6 lines × 2) rust/editor-core/src/test_support/collaboration_awareness_test/cursor_projection.rs:6— rust/editor-core/src/test_support/collaboration_awareness_test/cursor_projection.rs:6-11 | rust/editor-core/src/test_support/ffi_v2_test/session_fixtures.rs:124-129 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×11
Edited copy of a member (14 corresponding lines) android/src/main/java/com/apollohg/editor/RenderedTextFragments.kt:75— android/src/main/java/com/apollohg/editor/RenderedTextFragments.kt:75-88 | android/src/main/java/com/apollohg/editor/RenderedTextFragments.kt:96-109 — 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) rust/editor-core/src/yrs_engine/codec.rs:491— rust/editor-core/src/yrs_engine/codec.rs:491-504 | rust/editor-core/src/yrs_engine/codec/mutation.rs:412-430 — 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) android/src/main/java/com/apollohg/editor/EditorEditTextRendering.kt:203— android/src/main/java/com/apollohg/editor/EditorEditTextRendering.kt:203-216 | android/src/main/java/com/apollohg/editor/EditorEditTextRendering.kt:219-239 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) ios/NativeCollaborationTransportRegistry.swift:295— ios/NativeCollaborationTransportRegistry.swift:295-308 | ios/NativeCollaborationTransportRegistry.swift:310-327 — 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) android/src/main/java/com/apollohg/editor/EditorEditTextRustCommands.kt:257— android/src/main/java/com/apollohg/editor/EditorEditTextRustCommands.kt:257-270 | android/src/main/java/com/apollohg/editor/EditorEditTextRustCommands.kt:275-289 — 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) rust/editor-core/src/command_planner/backspace.rs:352— rust/editor-core/src/command_planner/backspace.rs:352-365 | rust/editor-core/src/editor_state.rs:987-1001 — 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) rust/editor-core/src/yrs_engine/engine/imports.rs:233— rust/editor-core/src/yrs_engine/engine/imports.rs:233-246 | rust/editor-core/src/yrs_engine/engine/imports.rs:253-267 — 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) rust/editor-core/src/yrs_engine/engine/candidate.rs:448— rust/editor-core/src/yrs_engine/engine/candidate.rs:448-461 | rust/editor-core/src/yrs_engine/update_preflight.rs:329-349 — 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) android/src/main/java/com/apollohg/editor/viewer/PreparedProseViewerManager.kt:584— android/src/main/java/com/apollohg/editor/viewer/PreparedProseViewerManager.kt:584-597 | android/src/main/java/com/apollohg/editor/viewer/PreparedProseViewerManager.kt:602-616 — 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) rust/editor-core/src/serialize/html_out.rs:387— rust/editor-core/src/serialize/html_out.rs:387-400 | rust/editor-core/src/viewer/compile.rs:342-356 — 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) rust/editor-core/src/test_support/serialize_test/schema_projection.rs:127— rust/editor-core/src/test_support/serialize_test/schema_projection.rs:127-147 | rust/editor-core/src/yrs_engine/mutation_tests/list_structure/unwrap_multiple.rs:818-831 — 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 (5 lines × 2) rust/editor-core/src/boundary.rs:583— rust/editor-core/src/boundary.rs:583-587 | rust/editor-core/src/serialize/json_out.rs:206-210 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/boundary.rs:583` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) android/src/main/java/com/apollohg/editor/EditorEditTextImages.kt:188— android/src/main/java/com/apollohg/editor/EditorEditTextImages.kt:188-192 | android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:1812-1816 — 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 `android/src/main/java/com/apollohg/editor/EditorEditTextImages.kt: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) android/src/main/java/com/apollohg/editor/NativeToolbarItem.kt:165— android/src/main/java/com/apollohg/editor/NativeToolbarItem.kt:165-169 | android/src/main/java/com/apollohg/editor/NativeToolbarItem.kt:230-241 — both copies are in the same file, so extract the 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 `android/src/main/java/com/apollohg/editor/NativeToolbarItem.kt:165` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) android/src/main/java/com/apollohg/editor/EditorTheme.kt:231— android/src/main/java/com/apollohg/editor/EditorTheme.kt:231-235 | android/src/main/java/com/apollohg/editor/EditorTheme.kt:275-279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) android/src/main/java/com/apollohg/editor/UniffiEditorV2Backend.kt:223— android/src/main/java/com/apollohg/editor/UniffiEditorV2Backend.kt:223-227 | android/src/main/java/com/apollohg/editor/UniffiEditorV2Backend.kt:237-241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) ios/EditorLayoutManager.swift:997— ios/EditorLayoutManager.swift:997-1003 | ios/Viewer/PreparedProseDrawingView.swift:1917-1921 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) ios/EditorTheme.swift:196— ios/EditorTheme.swift:196-200 | ios/EditorTheme.swift:235-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `ios/EditorTheme.swift:240` calls `color` and `ios/EditorTheme.swift:201` 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 (5 lines × 2) rust/editor-core/src/test_support/yrs_engine_transaction_property_test/stateful_traces.rs:129— rust/editor-core/src/test_support/yrs_engine_transaction_property_test/stateful_traces.rs:129-133 | rust/editor-core/src/test_support/yrs_engine_transaction_property_test/stateful_traces.rs:285-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/test_support/yrs_engine_transaction_property_test/stateful_traces.rs:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) rust/editor-core/src/yrs_engine/engine_tests/history_and_commit/snapshot_charges.rs:9— rust/editor-core/src/yrs_engine/engine_tests/history_and_commit/snapshot_charges.rs:9-13 | rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/localized_marks.rs:379-383 — 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 `rust/editor-core/src/yrs_engine/engine_tests/history_and_commit/snapshot_charges.rs:9` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/localized_marks.rs:7— rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/localized_marks.rs:7-11 | rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/paste_root_window.rs:19-23 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/localized_marks.rs:7` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×9
Edited copy of a member (8 corresponding lines) ios/EditorTextView+KeyboardInput.swift:305— ios/EditorTextView+KeyboardInput.swift:305-313 | ios/EditorTextView+KeyboardInput.swift:315-322 — 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) ios/Viewer/PreparedProseLayoutCache.swift:601— ios/Viewer/PreparedProseLayoutCache.swift:601-608 | ios/Viewer/PreparedProseLayoutCache.swift:610-617 — 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) rust/editor-core/src/ffi_v2/render.rs:246— rust/editor-core/src/ffi_v2/render.rs:246-253 | rust/editor-core/src/yrs_engine/derived_state/selection.rs:666-673 — 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) android/src/main/java/com/apollohg/editor/NativeEditorModule.kt:289— android/src/main/java/com/apollohg/editor/NativeEditorModule.kt:289-298 | android/src/main/java/com/apollohg/editor/UniffiEditorV2Backend.kt:222-229 — 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) rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:623— rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:623-630 | rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:632-642 — 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) android/src/main/java/com/apollohg/editor/ProseViewerView.kt:883— android/src/main/java/com/apollohg/editor/ProseViewerView.kt:883-892 | android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:2030-2037 — 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) android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:515— android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:515-525 | android/src/main/java/com/apollohg/editor/EditorV2AdapterRendering.kt:183-190 — 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) rust/editor-core/src/yrs_engine/engine_tests/localized_split.rs:25— rust/editor-core/src/yrs_engine/engine_tests/localized_split.rs:25-32 | rust/editor-core/src/yrs_engine/engine_tests/localized_split.rs:285-292 — 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) rust/editor-core/src/yrs_engine/codec_tests/json_matching.rs:23— rust/editor-core/src/yrs_engine/codec_tests/json_matching.rs:23-30 | rust/editor-core/src/yrs_engine/codec_tests/roundtrip_limits.rs:1-8 — 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 (15 corresponding lines) · ×8
Edited copy of a member (15 corresponding lines) rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:181— rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:181-199 | rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:201-215 — 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) rust/editor-core/src/command_planner/structure.rs:472— rust/editor-core/src/command_planner/structure.rs:472-486 | rust/editor-core/src/command_planner/structure.rs:488-507 — 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) ios/EditorTextView+Caret.swift:108— ios/EditorTextView+Caret.swift:108-122 | ios/EditorTextView+Caret.swift:124-142 — 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) rust/editor-core/src/yrs_engine/engine/remote.rs:883— rust/editor-core/src/yrs_engine/engine/remote.rs:883-897 | rust/editor-core/src/yrs_engine/engine/undo_redo.rs:836-855 — 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) rust/editor-core/src/command_planner/format.rs:310— rust/editor-core/src/command_planner/format.rs:310-324 | rust/editor-core/src/command_planner/format.rs:330-344 — 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) ios/EditorTextView+AttributedPatch.swift:110— ios/EditorTextView+AttributedPatch.swift:110-124 | ios/EditorTextView+AttributedPatch.swift:142-162 — 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) ios/ProseViewerView.swift:422— ios/ProseViewerView.swift:422-436 | ios/ProseViewerView.swift:442-456 — 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) ios/Viewer/PreparedProseLayoutRegistry+FabricOwnership.swift:108— ios/Viewer/PreparedProseLayoutRegistry+FabricOwnership.swift:108-124 | ios/Viewer/PreparedProseLayoutRegistry+FabricOwnership.swift:126-140 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×8
Edited copy of a member (7 corresponding lines) ios/Tables/EditorTableIndex.swift:395— ios/Tables/EditorTableIndex.swift:395-401 | ios/Tables/EditorTableIndex.swift:403-410 — 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) ios/Viewer/PreparedProseLayoutCache.swift:486— ios/Viewer/PreparedProseLayoutCache.swift:486-492 | ios/Viewer/PreparedProseLayoutCache.swift:619-625 — 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) rust/editor-core/src/transform/apply/validation.rs:59— rust/editor-core/src/transform/apply/validation.rs:59-65 | rust/editor-core/src/transform/apply/validation.rs:72-78 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) ios/RichTextEditorView.swift:1344— ios/RichTextEditorView.swift:1344-1350 | ios/RichTextEditorView.swift:1355-1361 — 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) android/src/main/java/com/apollohg/editor/EditorInputConnection.kt:277— android/src/main/java/com/apollohg/editor/EditorInputConnection.kt:277-283 | android/src/main/java/com/apollohg/editor/EditorInputConnection.kt:285-296 — 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) ios/EditorTextView+Commands.swift:187— ios/EditorTextView+Commands.swift:187-197 | ios/EditorTextView+KeyboardInput.swift:748-754 — 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) ios/Viewer/ViewerImagePipeline.swift:239— ios/Viewer/ViewerImagePipeline.swift:239-245 | ios/Viewer/ViewerImagePipeline.swift:259-266 — 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) android/src/main/java/com/apollohg/editor/ProseViewerView.kt:920— android/src/main/java/com/apollohg/editor/ProseViewerView.kt:920-926 | android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:2061-2067 — 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 (14 lines × 2) rust/editor-core/src/ffi_v2/editor/create_scanner.rs:189— rust/editor-core/src/ffi_v2/editor/create_scanner.rs:189-202 | rust/editor-core/src/ffi_v2/editor/create_scanner.rs:229-242 — both copies are in the same file, so extract the 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 `rust/editor-core/src/ffi_v2/editor/create_scanner.rs:189` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) rust/editor-core/src/schema/content_rule.rs:500— rust/editor-core/src/schema/content_rule.rs:500-513 | rust/editor-core/src/schema/content_rule.rs:572-585 — both copies are in the same file, so extract the 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 `rust/editor-core/src/schema/content_rule.rs:500` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) rust/editor-core/src/transform/apply/list_indent.rs:222— rust/editor-core/src/transform/apply/list_indent.rs:222-235 | rust/editor-core/src/transform/apply/list_wrap.rs:161-174 — 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 `rust/editor-core/src/transform/apply/list_indent.rs:222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) rust/editor-core/src/transform/apply/text.rs:309— rust/editor-core/src/transform/apply/text.rs:309-322 | rust/editor-core/src/transform/apply/text.rs:397-410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/transform/apply/text.rs:309` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) rust/editor-core/src/yrs_engine/codec/projection_match.rs:542— rust/editor-core/src/yrs_engine/codec/projection_match.rs:542-555 | rust/editor-core/src/yrs_engine/codec/projection_write.rs:77-90 — before extracting anything, compare `rust/editor-core/src/yrs_engine/codec/projection_match.rs` and `rust/editor-core/src/yrs_engine/codec/projection_write.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/yrs_engine/codec/projection_match.rs:542` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) rust/editor-core/src/yrs_engine/commands/format.rs:129— rust/editor-core/src/yrs_engine/commands/format.rs:129-142 | rust/editor-core/src/yrs_engine/commands/format.rs:186-199 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/commands/format.rs:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:655— rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:655-668 | rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:887-900 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) rust/editor-core/src/yrs_engine/update_preflight.rs:356— rust/editor-core/src/yrs_engine/update_preflight.rs:356-369 | rust/editor-core/src/yrs_engine/update_preflight.rs:663-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/yrs_engine/update_preflight.rs:356` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) rust/editor-core/src/command_planner/format.rs:312— rust/editor-core/src/command_planner/format.rs:312-324 | rust/editor-core/src/command_planner/format.rs:332-344 — both copies are in the same file, so extract the 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 `rust/editor-core/src/command_planner/format.rs:312` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) rust/editor-core/src/render/incremental/cache_helpers.rs:46— rust/editor-core/src/render/incremental/cache_helpers.rs:46-58 | rust/editor-core/src/render/incremental/cache_helpers.rs:97-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) rust/editor-core/src/session/config.rs:102— rust/editor-core/src/session/config.rs:102-114 | rust/editor-core/src/session/config.rs: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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) rust/editor-core/src/transform/apply/range.rs:18— rust/editor-core/src/transform/apply/range.rs:18-30 | rust/editor-core/src/transform/apply/range.rs:179-191 — both copies are in the same file, so extract the 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 `rust/editor-core/src/transform/apply/range.rs:18` 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) rust/editor-core/src/yrs_engine/mutation/lowering/text.rs:701— rust/editor-core/src/yrs_engine/mutation/lowering/text.rs:701-713 | rust/editor-core/src/yrs_engine/mutation/lowering/text.rs:743-755 — both copies are in the same file, so extract the 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) rust/editor-core/src/tables/admission.rs:190— rust/editor-core/src/tables/admission.rs:190-202 | rust/editor-core/src/tables/normalize.rs:145-157 — 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 `rust/editor-core/src/tables/admission.rs:190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) rust/editor-core/src/yrs_engine/update_preflight.rs:162— rust/editor-core/src/yrs_engine/update_preflight.rs:162-174 | rust/editor-core/src/yrs_engine/update_preflight.rs:456-468 — both copies are in the same file, so extract the 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) rust/editor-core/src/test_support/yrs_engine_transaction_property_test/scenarios.rs:62— rust/editor-core/src/test_support/yrs_engine_transaction_property_test/scenarios.rs:62-74 | rust/editor-core/src/test_support/yrs_engine_transaction_property_test/stateful_traces.rs:28-40 — 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 `rust/editor-core/src/test_support/yrs_engine_transaction_property_test/scenarios.rs:62` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) rust/editor-core/src/table_interop.rs:545— rust/editor-core/src/table_interop.rs:545-555 | rust/editor-core/src/table_interop.rs:595-605 — both copies are in the same file, so extract the 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) rust/editor-core/src/yrs_engine/codec/projection_match.rs:569— rust/editor-core/src/yrs_engine/codec/projection_match.rs:569-579 | rust/editor-core/src/yrs_engine/codec/projection_write.rs:97-107 — before extracting anything, compare `rust/editor-core/src/yrs_engine/codec/projection_match.rs` and `rust/editor-core/src/yrs_engine/codec/projection_write.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) rust/editor-core/src/yrs_engine/mutation/lowering/list/layout.rs:406— rust/editor-core/src/yrs_engine/mutation/lowering/list/layout.rs:406-416 | rust/editor-core/src/yrs_engine/mutation/lowering/list/layout.rs:484-494 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/mutation/lowering/list/layout.rs:406` 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) rust/editor-core/src/yrs_engine/update_preflight.rs:488— rust/editor-core/src/yrs_engine/update_preflight.rs:488-498 | rust/editor-core/src/yrs_engine/update_preflight.rs:516-526 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/update_preflight.rs:488` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) rust/editor-core/src/session/errors.rs:126— rust/editor-core/src/session/errors.rs:126-136 | rust/editor-core/src/session/errors.rs: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 `rust/editor-core/src/session/errors.rs:153` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `error` to `YrsEngineError` in one and `BoundaryError` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) rust/editor-core/src/transform/apply/list_indent.rs:242— rust/editor-core/src/transform/apply/list_indent.rs:242-252 | rust/editor-core/src/transform/apply/list_wrap.rs:189-199 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/transform/apply/list_indent.rs:242` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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) rust/editor-core/src/test_support/yrs_engine_transaction_property_test/oracle_properties.rs:371— rust/editor-core/src/test_support/yrs_engine_transaction_property_test/oracle_properties.rs:371-381 | rust/editor-core/src/yrs_engine/mutation_tests/direct_operations.rs:5-15 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) rust/editor-core/src/test_support/native_intent_test/command_availability.rs:69— rust/editor-core/src/test_support/native_intent_test/command_availability.rs:69-79 | rust/editor-core/src/test_support/native_intent_test/command_planning.rs:25-35 — 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 `rust/editor-core/src/test_support/native_intent_test/command_availability.rs:69` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) rust/editor-core/src/command_planner/format.rs:136— rust/editor-core/src/command_planner/format.rs:136-144 | rust/editor-core/src/command_planner/format.rs:210-217 — both copies are in the same file, so extract the 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 `rust/editor-core/src/command_planner/format.rs:136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/editor-core/src/command_planner/format.rs:145` calls `push`, `clone`, `canonical_marks` and `rust/editor-core/src/command_planner/format.rs:218` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) rust/editor-core/src/boundary.rs:594— rust/editor-core/src/boundary.rs:594-601 | rust/editor-core/src/serialize/json_out.rs:246-253 — 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) android/src/main/java/com/apollohg/editor/EditorMentionStyle.kt:11— android/src/main/java/com/apollohg/editor/EditorMentionStyle.kt:11-18 | android/src/main/java/com/apollohg/editor/EditorStyleSheet.kt:356-363 — 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) android/src/main/java/com/apollohg/editor/ProseViewerView.kt:906— android/src/main/java/com/apollohg/editor/ProseViewerView.kt:906-913 | android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:2049-2056 — 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 `android/src/main/java/com/apollohg/editor/ProseViewerView.kt:906` 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 (8 lines × 2) android/src/main/java/com/apollohg/editor/ProseViewerView.kt:871— android/src/main/java/com/apollohg/editor/ProseViewerView.kt:871-881 | android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:2021-2028 — 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 `android/src/main/java/com/apollohg/editor/ProseViewerView.kt:871` 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) ios/EditorTextView+Images.swift:164— ios/EditorTextView+Images.swift:164-172 | ios/EditorTextView+Images.swift:192-199 — both copies are in the same file, so extract the 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, `ios/EditorTextView+Images.swift:161` calls `attributes`, `guard` and `ios/EditorTextView+Images.swift:191` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) ios/EditorTextView+Selection.swift:626— ios/EditorTextView+Selection.swift:626-633 | ios/EditorTextView+Selection.swift:635-642 — both copies are in the same file, so extract the 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 `ios/EditorTextView+Selection.swift:626` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) ios/EditorV2Adapter+Commands.swift:198— ios/EditorV2Adapter+Commands.swift:198-205 | ios/EditorV2Adapter+Commands.swift:216-223 — both copies are in the same file, so extract the 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 `ios/EditorV2Adapter+Commands.swift:198` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
No assertions: TBL-21-P independently declared ${name} semantics scripts/table-interop/cases/presentation-semantics.test.ts:641— 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: TBL-21-P permits empty display-only gap grouping and declared defaults scripts/table-interop/cases/presentation-semantics.test.ts:655— 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: TBL-21-P compares independently represented meaningful synthetic semantics scripts/table-interop/cases/presentation-semantics.test.ts:678— 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: TBL-21-P retains opaque plain data and rich content, merging only equivalent text runs scripts/table-interop/cases/presentation-semantics.test.ts:799— 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: TBL-21-P an unspecified display gap width inherits its resolved column scripts/table-interop/cases/presentation-semantics.test.ts:843— 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: remote lifetime permits fresh authored redo identities with the declared effect scripts/table-interop/cases/supplementary-continuity.test.ts:546— 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: remote lifetime accepts declared cell defaults across peer observations scripts/table-interop/cases/supplementary-continuity.test.ts:621— 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 (19 corresponding lines) · ×7
Edited copy of a member (19 corresponding lines) android/src/main/java/com/apollohg/editor/ImageResizeOverlayView.kt:256— android/src/main/java/com/apollohg/editor/ImageResizeOverlayView.kt:256-277 | android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:733-751 — 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) ios/EditorV2Adapter+TextCommands.swift:107— ios/EditorV2Adapter+TextCommands.swift:107-125 | ios/EditorV2Adapter+TextCommands.swift:127-153 — 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) rust/editor-core/src/yrs_engine/update_preflight.rs:45— rust/editor-core/src/yrs_engine/update_preflight.rs:45-63 | rust/editor-core/src/yrs_engine/update_preflight.rs:212-230 — 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) rust/editor-core/src/yrs_engine/update_preflight.rs:351— rust/editor-core/src/yrs_engine/update_preflight.rs:351-369 | rust/editor-core/src/yrs_engine/update_preflight.rs:658-676 — 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) rust/editor-core/src/yrs_engine/update_preflight.rs:252— rust/editor-core/src/yrs_engine/update_preflight.rs:252-270 | rust/editor-core/src/yrs_engine/update_preflight.rs:678-696 — 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) rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/localized_marks.rs:68— rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/localized_marks.rs:68-86 | rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/paste_root_window.rs:57-79 — 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) rust/editor-core/src/yrs_engine/engine_tests/candidate_cache/root_replacement.rs:6— rust/editor-core/src/yrs_engine/engine_tests/candidate_cache/root_replacement.rs:6-24 | rust/editor-core/src/yrs_engine/engine_tests/history_and_commit/snapshot_charges.rs:6-26 — 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.
Duplicated block (19 lines × 2) rust/editor-core/src/command_planner/backspace.rs:522— rust/editor-core/src/command_planner/backspace.rs:522-540 | rust/editor-core/src/command_planner/empty_blocks.rs:252-270 — before extracting anything, compare `rust/editor-core/src/command_planner/backspace.rs` and `rust/editor-core/src/command_planner/empty_blocks.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/command_planner/backspace.rs:522` 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) rust/editor-core/src/render/generate.rs:164— rust/editor-core/src/render/generate.rs:164-182 | rust/editor-core/src/render/incremental.rs:789-807 — before extracting anything, compare `rust/editor-core/src/render/generate.rs` and `rust/editor-core/src/render/incremental.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/render/generate.rs:164` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (19 lines × 2) rust/editor-core/src/render/incremental.rs:736— rust/editor-core/src/render/incremental.rs:736-754 | rust/editor-core/src/render/incremental.rs:811-829 — both copies are in the same file, so extract the 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 `rust/editor-core/src/render/incremental.rs:736` 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) rust/editor-core/src/yrs_engine/commands/text.rs:475— rust/editor-core/src/yrs_engine/commands/text.rs:475-493 | rust/editor-core/src/yrs_engine/commands/text.rs:704-722 — both copies are in the same file, so extract the 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 (19 lines × 2) rust/editor-core/src/yrs_engine/compiler/yrs_compilation.rs:530— rust/editor-core/src/yrs_engine/compiler/yrs_compilation.rs:530-548 | rust/editor-core/src/yrs_engine/compiler/yrs_compilation.rs:680-698 — both copies are in the same file, so extract the 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 (19 lines × 2) rust/editor-core/src/yrs_engine/derived_state/selection.rs:219— rust/editor-core/src/yrs_engine/derived_state/selection.rs:219-237 | rust/editor-core/src/yrs_engine/derived_state/selection.rs:398-416 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/derived_state/selection.rs:219` 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 (19 lines × 2) ios/RenderBridge.swift:399— ios/RenderBridge.swift:399-417 | ios/RenderBridge.swift:490-508 — both copies are in the same file, so extract the 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 `ios/RenderBridge.swift:399` 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 lines × 2) rust/editor-core/src/schema/content_rule.rs:332— rust/editor-core/src/schema/content_rule.rs:332-347 | rust/editor-core/src/schema/content_rule.rs:680-695 — both copies are in the same file, so extract the 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 `rust/editor-core/src/schema/content_rule.rs:332` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) rust/editor-core/src/transform/apply/text.rs:231— rust/editor-core/src/transform/apply/text.rs:231-246 | rust/editor-core/src/transform/apply/text.rs:330-345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) rust/editor-core/src/yrs_engine/mutation/lowering/attrs.rs:126— rust/editor-core/src/yrs_engine/mutation/lowering/attrs.rs:126-141 | rust/editor-core/src/yrs_engine/mutation/lowering/attrs.rs:142-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) rust/editor-core/src/yrs_engine/mutation/lowering/text.rs:287— rust/editor-core/src/yrs_engine/mutation/lowering/text.rs:287-302 | rust/editor-core/src/yrs_engine/mutation/lowering/text.rs:401-416 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/mutation/lowering/text.rs:287` 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 lines × 2) android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:767— android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:767-782 | android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:795-810 — both copies are in the same file, so extract the 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 `android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:767` 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 lines × 2) android/src/main/java/com/apollohg/editor/EditorInputConnection.kt:524— android/src/main/java/com/apollohg/editor/EditorInputConnection.kt:524-539 | android/src/main/java/com/apollohg/editor/EditorInputConnection.kt:561-576 — both copies are in the same file, so extract the 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 `android/src/main/java/com/apollohg/editor/EditorInputConnection.kt:524` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) ios/EditorLayoutManager.swift:153— ios/EditorLayoutManager.swift:153-168 | ios/EditorLayoutManager.swift:231-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. Read the line range as the matched WINDOW rather than a finished unit: at `ios/EditorLayoutManager.swift:153` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) rust/editor-core/src/ffi_v2/collaboration.rs:286— rust/editor-core/src/ffi_v2/collaboration.rs:286-297 | rust/editor-core/src/table_interop.rs:889-900 — 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 `rust/editor-core/src/ffi_v2/collaboration.rs:286` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) rust/editor-core/src/yrs_engine/mutation/lowering/attrs.rs:49— rust/editor-core/src/yrs_engine/mutation/lowering/attrs.rs:49-60 | rust/editor-core/src/yrs_engine/mutation/lowering/attrs.rs:106-117 — both copies are in the same file, so extract the 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) rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:71— rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:71-82 | rust/editor-core/src/yrs_engine/mutation/plan/estimate.rs:88-99 — both copies are in the same file, so extract the 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) rust/editor-core/src/command_planner.rs:349— rust/editor-core/src/command_planner.rs:349-360 | rust/editor-core/src/command_planner.rs: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.
Duplicated block (12 lines × 2) ios/EditorV2Adapter+Selection.swift:518— ios/EditorV2Adapter+Selection.swift:518-529 | ios/EditorV2Adapter+Selection.swift:537-548 — both copies are in the same file, so extract the 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 `ios/EditorV2Adapter+Selection.swift:518` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) ios/NativeCollaborationTransportRegistry.swift:496— ios/NativeCollaborationTransportRegistry.swift:496-507 | ios/NativeEditorModule.swift:28-39 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/localized_marks.rs:385— rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/localized_marks.rs:385-396 | rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/paste_root_window.rs:186-197 — 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 `rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/localized_marks.rs:385` 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 locations) scripts/table-interop/availability-evidence.ts:222— scripts/table-interop/availability-evidence.ts:222 · scripts/table-interop/text-history-evidence.ts:28 — 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 (11 lines × 2 locations) scripts/table-interop/corpus.ts:337— scripts/table-interop/corpus.ts:337 · scripts/table-interop/corpus.ts:975 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (11 lines × 2 locations) scripts/table-interop/corpus.ts:602— scripts/table-interop/corpus.ts:602 · scripts/table-interop/corpus.ts:619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2 locations) src/NativeEditorCreateJson.ts:433— src/NativeEditorCreateJson.ts:433 · src/NativeEditorCreateJson.ts:671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2 locations) src/NativeEditorResultNormalization.ts:240— src/NativeEditorResultNormalization.ts:240 · src/NativeEditorResultNormalization.ts:314 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (11 lines × 2 locations) src/schemaDocument.ts:31— src/schemaDocument.ts:31 · src/schemaResolution.ts:154 — 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 (11 lines × 2 locations) src/useEditorToolbarPresentation.tsx:173— src/useEditorToolbarPresentation.tsx:173 · src/useEditorToolbarPresentation.tsx:438 — 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.
YrsDocumentEngine::apply_compiled_transaction_with_history_and_context (cognitive 118) rust/editor-core/src/yrs_engine/engine/commit.rs:68— YrsDocumentEngine::apply_compiled_transaction_with_history_and_context has cognitive complexity 118 (threshold 15). Drivers by points: if/else 63 (91 pts), boolean chains 17, match/switch 8 (10 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YrsDocumentEngine::prepare_typed_result (cognitive 34) rust/editor-core/src/yrs_engine/engine/transaction_result.rs:89— YrsDocumentEngine::prepare_typed_result has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (26 pts), match/switch 3 (7 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.
YrsDocumentEngine::apply_empty_skip_transaction (cognitive 28) rust/editor-core/src/yrs_engine/engine/selection_commit.rs:19— YrsDocumentEngine::apply_empty_skip_transaction has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 4, match/switch 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YrsDocumentEngine::prepare_position_epoch_splice (cognitive 24) rust/editor-core/src/yrs_engine/engine.rs:691— YrsDocumentEngine::prepare_position_epoch_splice has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (4 pts), boolean chains 2, 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.
YrsDocumentEngine::prepare_remote_update_internal (cognitive 23) rust/editor-core/src/yrs_engine/engine/remote.rs:113— YrsDocumentEngine::prepare_remote_update_internal has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
YrsDocumentEngine::prepare_position_epoch_update (cognitive 21) rust/editor-core/src/yrs_engine/engine.rs:831— YrsDocumentEngine::prepare_position_epoch_update has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (8 pts), match/switch 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.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×6
Edited copy of a member (18 corresponding lines) ios/EditorLayoutManager.swift:991— ios/EditorLayoutManager.swift:991-1012 | ios/Viewer/PreparedProseDrawingView.swift:1913-1930 — 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) android/src/main/java/com/apollohg/editor/viewer/PreparedProseLayoutRegistry.kt:684— android/src/main/java/com/apollohg/editor/viewer/PreparedProseLayoutRegistry.kt:684-701 | android/src/main/java/com/apollohg/editor/viewer/PreparedProseLayoutRegistry.kt:709-728 — 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) android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:617— android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:617-634 | android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:636-663 — 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) android/src/main/java/com/apollohg/editor/EditorKeyboardToolbarView.kt:826— android/src/main/java/com/apollohg/editor/EditorKeyboardToolbarView.kt:826-844 | android/src/main/java/com/apollohg/editor/MentionSuggestionChipView.kt:211-228 — 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) rust/editor-core/src/test_support/yrs_engine_transaction_property_test/oracle_properties.rs:387— rust/editor-core/src/test_support/yrs_engine_transaction_property_test/oracle_properties.rs:387-404 | rust/editor-core/src/test_support/yrs_engine_transaction_property_test/oracle_properties.rs:547-565 — 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) rust/editor-core/src/yrs_engine/engine_tests/history_and_commit/canonical_cache.rs:44— rust/editor-core/src/yrs_engine/engine_tests/history_and_commit/canonical_cache.rs:44-61 | rust/editor-core/src/yrs_engine/engine_tests/localized_split.rs:57-78 — 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.
R4 · Test Coverage· No test reaches this file · ×6
No test reaches this file example/App.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 example/theme.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 example/components/LinkEditorModal.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 example/components/CounterCard.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 app.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 src/listMarkers.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.
OperationCompiler::compile_structure (cyclomatic 51) rust/editor-core/src/yrs_engine/compiler/operations/structure.rs:28— OperationCompiler::compile_structure has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OperationCompiler::compile (cyclomatic 31) rust/editor-core/src/yrs_engine/compiler/operations.rs:71— OperationCompiler::compile 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.
OperationCompiler::compile_marks (cyclomatic 29) rust/editor-core/src/yrs_engine/compiler/operations/marks.rs:20— OperationCompiler::compile_marks 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.
OperationCompiler::compile_text (cyclomatic 27) rust/editor-core/src/yrs_engine/compiler/operations/text.rs:21— OperationCompiler::compile_text 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.
OperationCompiler::compile_edit_structure (cyclomatic 24) rust/editor-core/src/yrs_engine/compiler/operations/batch.rs:247— OperationCompiler::compile_edit_structure 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.
OperationCompiler::compile_structure (cognitive 78) rust/editor-core/src/yrs_engine/compiler/operations/structure.rs:28— OperationCompiler::compile_structure has cognitive complexity 78 (threshold 15). Drivers by points: if/else 34 (70 pts), boolean chains 7, match/switch 1 (nesting depth added 36). 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.
OperationCompiler::compile_text (cognitive 51) rust/editor-core/src/yrs_engine/compiler/operations/text.rs:21— OperationCompiler::compile_text has cognitive complexity 51 (threshold 15). Drivers by points: if/else 24 (45 pts), match/switch 2 (4 pts), boolean chains 2 (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.
OperationCompiler::compile_edit_structure (cognitive 48) rust/editor-core/src/yrs_engine/compiler/operations/batch.rs:247— OperationCompiler::compile_edit_structure has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (43 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (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.
OperationCompiler::compile_marks (cognitive 48) rust/editor-core/src/yrs_engine/compiler/operations/marks.rs:20— OperationCompiler::compile_marks has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 5, loops 1 (3 pts), match/switch 1 (nesting depth added 22). 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.
OperationCompiler::compile (cognitive 46) rust/editor-core/src/yrs_engine/compiler/operations.rs:71— OperationCompiler::compile has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 7, match/switch 3 (7 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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×5
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×5
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×5
Edited copy of a member (16 corresponding lines) rust/editor-core/src/tables/commands.rs:416— rust/editor-core/src/tables/commands.rs:416-431 | rust/editor-core/src/tables/commands.rs:472-489 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) rust/editor-core/src/schema/content_rule.rs:498— rust/editor-core/src/schema/content_rule.rs:498-513 | rust/editor-core/src/schema/content_rule.rs:570-585 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) ios/Tables/TableCellPositionMap.swift:24— ios/Tables/TableCellPositionMap.swift:24-39 | ios/Tables/TableCellPositionMap.swift:41-58 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) rust/editor-core/src/yrs_engine/derived_state/history_snapshot.rs:218— rust/editor-core/src/yrs_engine/derived_state/history_snapshot.rs:218-234 | rust/editor-core/src/yrs_engine/engine_tests/candidate_publication.rs:126-141 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) rust/editor-core/src/test_support/native_intent_test/command_availability.rs:64— rust/editor-core/src/test_support/native_intent_test/command_availability.rs:64-79 | rust/editor-core/src/test_support/native_intent_test/command_planning.rs:20-35 — 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 copy of a member (10 corresponding lines) · ×5
Edited copy of a member (10 corresponding lines) ios/EditorV2Adapter+RenderState.swift:441— ios/EditorV2Adapter+RenderState.swift:441-450 | ios/EditorV2Adapter+RenderState.swift:503-512 — 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) rust/editor-core/src/table_interop.rs:939— rust/editor-core/src/table_interop.rs:939-948 | rust/editor-core/src/table_interop.rs:953-963 — 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) rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:1095— rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:1095-1104 | rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:1106-1118 — 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) android/src/main/java/com/apollohg/editor/viewer/ViewerFontEnvironment.kt:50— android/src/main/java/com/apollohg/editor/viewer/ViewerFontEnvironment.kt:50-59 | android/src/main/java/com/apollohg/editor/viewer/ViewerFontEnvironment.kt:62-71 — 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) rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/format_commands.rs:663— rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/format_commands.rs:663-672 | rust/editor-core/src/yrs_engine/mutation_tests/list_structure/unwrap_multiple.rs:833-844 — 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 (4 corresponding lines) · ×5
Edited copy of a member (4 corresponding lines) ios/Tables/EditorTableIndex.swift:385— ios/Tables/EditorTableIndex.swift:385-388 | ios/Tables/EditorTableIndex.swift:390-393 — 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) ios/Tables/ViewerTableSurface.swift:928— ios/Tables/ViewerTableSurface.swift:928-931 | ios/Viewer/PreparedProseDrawingView.swift:61-64 — 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) ios/ProseViewerView.swift:300— ios/ProseViewerView.swift:300-303 | ios/Tables/EditorTableSurface.swift:1699-1702 — 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) ios/Viewer/CoreTextProseLayoutEngine+AttributedText.swift:5— ios/Viewer/CoreTextProseLayoutEngine+AttributedText.swift:5-8 | ios/Viewer/PreparedProseLayout.swift:438-441 — 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) android/src/main/java/com/apollohg/editor/EditorTheme.kt:659— android/src/main/java/com/apollohg/editor/EditorTheme.kt:659-662 | android/src/main/java/com/apollohg/editor/NativeToolbarIcons.kt:217-220 — 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 (15 lines × 2) rust/editor-core/src/clipboard.rs:233— rust/editor-core/src/clipboard.rs:233-247 | rust/editor-core/src/clipboard.rs:286-300 — both copies are in the same file, so extract the 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) rust/editor-core/src/transform/apply/range.rs:176— rust/editor-core/src/transform/apply/range.rs:176-190 | rust/editor-core/src/transform/apply/text.rs:59-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/transform/apply/range.rs:176` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) rust/editor-core/src/yrs_engine/mutation/lowering/text.rs:237— rust/editor-core/src/yrs_engine/mutation/lowering/text.rs:237-251 | rust/editor-core/src/yrs_engine/mutation/lowering/text.rs: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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/yrs_engine/mutation/lowering/text.rs:237` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) rust/editor-core/src/yrs_engine/position.rs:345— rust/editor-core/src/yrs_engine/position.rs:345-359 | rust/editor-core/src/yrs_engine/position.rs:374-388 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/position.rs:345` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) ios/EditorV2Adapter+Mutation.swift:289— ios/EditorV2Adapter+Mutation.swift:289-304 | ios/EditorV2Adapter+Mutation.swift:412-426 — both copies are in the same file, so extract the 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 `ios/EditorV2Adapter+Mutation.swift:289` 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.
YrsDocumentEngine::apply_compiled_transaction_with_history_and_context (cyclomatic 86) rust/editor-core/src/yrs_engine/engine/commit.rs:68— YrsDocumentEngine::apply_compiled_transaction_with_history_and_context has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
YrsDocumentEngine::apply_empty_skip_transaction (cyclomatic 22) rust/editor-core/src/yrs_engine/engine/selection_commit.rs:19— YrsDocumentEngine::apply_empty_skip_transaction 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.
YrsDocumentEngine::prepare_remote_update_internal (cyclomatic 16) rust/editor-core/src/yrs_engine/engine/remote.rs:113— YrsDocumentEngine::prepare_remote_update_internal 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.
YrsDocumentEngine::prepare_position_epoch_splice (cyclomatic 16) rust/editor-core/src/yrs_engine/engine.rs:691— YrsDocumentEngine::prepare_position_epoch_splice 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.
ContentRule::choose_matches (cognitive 32) rust/editor-core/src/schema/content_rule.rs:515— ContentRule::choose_matches has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 5 (11 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.
ContentRule::matches_with_states (cognitive 19) rust/editor-core/src/schema/content_rule.rs:321— ContentRule::matches_with_states has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 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. This shape REPEATS in the file: one other method here (ContentRule::states_after_with_states) 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.
ContentRule::compact_insertion_symbols (cognitive 19) rust/editor-core/src/schema/content_rule.rs:378— ContentRule::compact_insertion_symbols has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (5 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.
ContentRule::states_after_with_states (cognitive 19) rust/editor-core/src/schema/content_rule.rs:670— ContentRule::states_after_with_states has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 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. This shape REPEATS in the file: one other method here (ContentRule::matches_with_states) 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.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×4
Edited copy of a member (21 corresponding lines) rust/editor-core/src/serialize/html_in.rs:936— rust/editor-core/src/serialize/html_in.rs:936-964 | rust/editor-core/src/serialize/html_in.rs:970-990 — 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) android/src/main/java/com/apollohg/editor/EditorEditTextAnnotations.kt:36— android/src/main/java/com/apollohg/editor/EditorEditTextAnnotations.kt:36-59 | android/src/main/java/com/apollohg/editor/EditorEditTextAnnotations.kt:61-81 — 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) ios/EditorV2Adapter+TextCommands.swift:155— ios/EditorV2Adapter+TextCommands.swift:155-184 | ios/EditorV2Adapter+TextCommands.swift:186-206 — 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) rust/editor-core/src/editor_state/structure.rs:116— rust/editor-core/src/editor_state/structure.rs:116-139 | rust/editor-core/src/editor_state/structure.rs:145-165 — 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 (11 corresponding lines) · ×4
Edited copy of a member (11 corresponding lines) rust/editor-core/src/command_planner/structure.rs:628— rust/editor-core/src/command_planner/structure.rs:628-638 | rust/editor-core/src/editor_state/structure.rs:80-92 — 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) rust/editor-core/src/transform/apply/range.rs:518— rust/editor-core/src/transform/apply/range.rs:518-528 | rust/editor-core/src/transform/apply/range.rs:530-540 — 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) android/src/main/java/com/apollohg/editor/EditorEditTextConfiguration.kt:313— android/src/main/java/com/apollohg/editor/EditorEditTextConfiguration.kt:313-325 | android/src/main/java/com/apollohg/editor/EditorEditTextImages.kt:95-105 — 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) ios/EditorV2Adapter+Commands.swift:4— ios/EditorV2Adapter+Commands.swift:4-14 | ios/EditorV2Adapter+RenderState.swift:480-491 — 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 copies of one member (3 members, 12+ corresponding lines) · ×4
Edited copies of one member (3 members, 12+ corresponding lines) ios/NativeEditorModule.swift:8— ios/NativeEditorModule.swift:8-20 | ios/NativeEditorModule.swift:242-254 | ios/NativeEditorModule.swift:259-270 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) rust/editor-core/src/render/incremental/cache_helpers.rs:513— rust/editor-core/src/render/incremental/cache_helpers.rs:513-527 | rust/editor-core/src/yrs_engine/commands/clipboard.rs:77-88 | rust/editor-core/src/yrs_engine/engine/imports.rs:117-136 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) android/src/main/java/com/apollohg/editor/ProseViewerView.kt:905— android/src/main/java/com/apollohg/editor/ProseViewerView.kt:905-916 | android/src/main/java/com/apollohg/editor/tables/TableAccessibility.kt:518-529 | android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:2048-2059 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) rust/editor-core/src/ffi_v2/native_frame_mapping.rs:123— rust/editor-core/src/ffi_v2/native_frame_mapping.rs:123-135 | rust/editor-core/src/position/storage.rs:179-191 | rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:436-447 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×4
Edited copy of a member (5 corresponding lines) ios/EditorCodeHighlighting.swift:8— ios/EditorCodeHighlighting.swift:8-12 | ios/EditorInteractionOverlays.swift:7-15 — 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) rust/optimize-kotlin-bindings.py:34— rust/optimize-kotlin-bindings.py:34-40 | rust/optimize-swift-bindings.py:41-45 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) rust/editor-core/src/ffi_v2/editor/create_scanner.rs:70— rust/editor-core/src/ffi_v2/editor/create_scanner.rs:70-75 | rust/editor-core/src/yrs_engine/update_preflight.rs:698-702 — 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) rust/editor-core/src/test_support/serialize_test/json_roundtrip.rs:196— rust/editor-core/src/test_support/serialize_test/json_roundtrip.rs:196-200 | rust/editor-core/src/test_support/serialize_test/schema_projection.rs:669-673 — 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 (9 lines × 3) rust/editor-core/src/command_planner/backspace.rs:19— rust/editor-core/src/command_planner/backspace.rs:19-27 | rust/editor-core/src/command_planner/backspace.rs:383-391 | rust/editor-core/src/command_planner/backspace.rs:476-484 — 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 (9 lines × 3) rust/editor-core/src/tables/admission.rs:193— rust/editor-core/src/tables/admission.rs:193-201 | rust/editor-core/src/tables/mutation_guard.rs:271-279 | rust/editor-core/src/tables/normalize.rs:148-156 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/tables/admission.rs:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) rust/editor-core/src/yrs_engine/mutation/lowering/attrs.rs:11— rust/editor-core/src/yrs_engine/mutation/lowering/attrs.rs:11-19 | rust/editor-core/src/yrs_engine/mutation/lowering/block/join.rs:9-17 | rust/editor-core/src/yrs_engine/mutation/lowering/node.rs:15-23 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/yrs_engine/mutation/lowering/attrs.rs: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.
Duplicated block (9 lines × 3) android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:568— android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:568-576 | android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:754-762 | android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:774-782 — 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 (7–8 lines × 2) rust/editor-core/src/command_planner/structure.rs:87— rust/editor-core/src/command_planner/structure.rs:87-94 | rust/editor-core/src/command_planner/structure.rs:110-116 — both copies are in the same file, so extract the 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 `rust/editor-core/src/command_planner/structure.rs:87` 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 (7–8 lines × 2) rust/editor-core/src/yrs_engine/commands/structural_batch.rs:243— rust/editor-core/src/yrs_engine/commands/structural_batch.rs:243-249 | rust/editor-core/src/yrs_engine/commands/structural_batch.rs:376-383 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/yrs_engine/commands/structural_batch.rs:376` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) rust/editor-core/src/yrs_engine/mutation/lowering/range.rs:531— rust/editor-core/src/yrs_engine/mutation/lowering/range.rs:531-537 | rust/editor-core/src/yrs_engine/mutation/plan/preflight/signatures.rs:186-193 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) android/src/main/java/com/apollohg/editor/EditorEditTextAnnotations.kt:38— android/src/main/java/com/apollohg/editor/EditorEditTextAnnotations.kt:38-44 | android/src/main/java/com/apollohg/editor/EditorEditTextAnnotations.kt:134-141 — both copies are in the same file, so extract the 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 `android/src/main/java/com/apollohg/editor/EditorEditTextAnnotations.kt:38` 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 (7 lines × 3) rust/editor-core/src/command_planner/backspace.rs:130— rust/editor-core/src/command_planner/backspace.rs:130-136 | rust/editor-core/src/command_planner/backspace.rs:188-194 | rust/editor-core/src/command_planner/backspace.rs:285-291 — 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 `rust/editor-core/src/command_planner/backspace.rs:130` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) android/src/main/java/com/apollohg/editor/EditorEditTextAnnotations.kt:37— android/src/main/java/com/apollohg/editor/EditorEditTextAnnotations.kt:37-43 | android/src/main/java/com/apollohg/editor/EditorEditTextAnnotations.kt:62-68 | android/src/main/java/com/apollohg/editor/EditorEditTextAnnotations.kt:133-139 — 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 `android/src/main/java/com/apollohg/editor/EditorEditTextAnnotations.kt:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) ios/EditorLayoutManager.swift:155— ios/EditorLayoutManager.swift:155-161 | ios/EditorLayoutManager.swift:233-239 | ios/EditorLayoutManager.swift:487-493 — 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 `ios/EditorLayoutManager.swift:155` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) ios/EditorV2Adapter+RenderState.swift:457— ios/EditorV2Adapter+RenderState.swift:457-463 | ios/EditorV2Adapter+Selection.swift:518-524 | ios/EditorV2Adapter+Selection.swift:537-543 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `ios/EditorV2Adapter+RenderState.swift:457` 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, `ios/EditorV2Adapter+RenderState.swift:464` calls `emit`, `contractError` and `ios/EditorV2Adapter+Selection.swift:525` 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.
Low cohesion: ItemPtr (LCOM4 5) rust/vendor/yrs/src/block.rs:439— ItemPtr'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: CheckedWork (LCOM4 4) rust/editor-core/src/yrs_engine/editing_limits.rs:106— CheckedWork's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Branch (LCOM4 4) rust/vendor/yrs/src/branch.rs:152— Branch's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: IdMapInner (LCOM4 4) rust/vendor/yrs/src/ids.rs:595— IdMapInner's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Duplicated block (10 lines × 2 locations) scripts/table-interop/corpus.ts:2009— scripts/table-interop/corpus.ts:2009 · scripts/table-interop/supplementary-lifetime.ts:118 — 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 (10 lines × 2 locations) src/ExternalTextComposition.ts:238— src/ExternalTextComposition.ts:238 · src/ExternalTextComposition.ts:255 — 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 (10 lines × 2 locations) src/ExternalTextComposition.ts:397— src/ExternalTextComposition.ts:397 · src/ExternalTextComposition.ts:627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2 locations) src/useNativeEditor.ts:619— src/useNativeEditor.ts:619 · src/useNativeEditor.ts:631 — 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.
Configuration option is read nowhere rust/editor-core/src/ffi_v2/editor.rs:297— `LocalEmptyInitialization._kind` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere rust/editor-core/src/ffi_v2/editor.rs:304— `LocalJsonInitialization._kind` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere rust/editor-core/src/ffi_v2/editor.rs:315— `LocalHtmlInitialization._kind` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere rust/editor-core/src/ffi_v2/editor.rs:328— `RoomInitialization._kind` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Schema::try_new_with_budget (cyclomatic 59) rust/editor-core/src/schema/construction.rs:14— Schema::try_new_with_budget has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Schema::from_json_with_limits (cyclomatic 22) rust/editor-core/src/schema/json.rs:17— Schema::from_json_with_limits has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Schema::validate_constructibility (cyclomatic 19) rust/editor-core/src/schema/construction.rs:417— Schema::validate_constructibility 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.
Schema::try_new_with_budget (cognitive 106) rust/editor-core/src/schema/construction.rs:14— Schema::try_new_with_budget has cognitive complexity 106 (threshold 15). Drivers by points: if/else 38 (79 pts), loops 13 (19 pts), boolean chains 6, match/switch 1 (2 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.
Schema::validate_constructibility (cognitive 48) rust/editor-core/src/schema/construction.rs:417— Schema::validate_constructibility has cognitive complexity 48 (threshold 15). Drivers by points: if/else 9 (32 pts), loops 6 (13 pts), boolean chains 3 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Schema::from_json_with_limits (cognitive 33) rust/editor-core/src/schema/json.rs:17— Schema::from_json_with_limits has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 5 (12 pts), match/switch 3 (7 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.
LocalizedTextLeafIndex::carry_after_textblock_edit (cognitive 52) rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:622— LocalizedTextLeafIndex::carry_after_textblock_edit has cognitive complexity 52 (threshold 15). Drivers by points: if/else 26 (43 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalizedTextLeafIndex::splice_root_window (cognitive 16) rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:235— LocalizedTextLeafIndex::splice_root_window has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 2 (3 pts), boolean chains 2, match/switch 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.
LocalizedTextLeafIndex::carry_after_textblock_marks (cognitive 16) rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:856— LocalizedTextLeafIndex::carry_after_textblock_marks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateJsonScanner::scan_value (cognitive 31) rust/editor-core/src/ffi_v2/editor/create_scanner.rs:159— CreateJsonScanner::scan_value has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (19 pts), match/switch 4 (11 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.
CreateJsonScanner::scan_string (cognitive 20) rust/editor-core/src/ffi_v2/editor/create_scanner.rs:84— CreateJsonScanner::scan_string has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 3 (10 pts), loops 2 (5 pts), if/else 2 (4 pts), boolean chains 1 (nesting depth added 12). 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.
CreateJsonScanner::scan_number (cognitive 18) rust/editor-core/src/ffi_v2/editor/create_scanner.rs:288— CreateJsonScanner::scan_number has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 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.
Change coupling: editor.rs ↔ NativeEditorBridge.ts rust/editor-core/src/ffi_v2/editor.rs:1— `rust/editor-core/src/ffi_v2/editor.rs` and `src/NativeEditorBridge.ts` change together 56% of the time (9 of the 16 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 `ae762158` feat(core): place initial caret from document handle initialization (…; `15c1fa63` feat(snapshot): enable scoped local HTML snapshots; `0316cf38` fix(collab): apply native updates incrementally — run `git show` on any of them.
Change coupling: tests.rs ↔ NativeEditorBridge.ts rust/editor-core/src/ffi_v2/tests.rs:1— `rust/editor-core/src/ffi_v2/tests.rs` and `src/NativeEditorBridge.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) 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 `9dca5ad7` fix: harden Task 4 deep document lifecycle; `83723f67` fix: make deep create parsing and handles authentic; `cfdb9475` fix: close remaining create boundary gaps — run `git show` on any of them.
Change coupling: CoreTextProseLayoutEngine.swift ↔ PreparedProseDrawingView.swift ios/Viewer/CoreTextProseLayoutEngine.swift:1— `ios/Viewer/CoreTextProseLayoutEngine.swift` and `ios/Viewer/PreparedProseDrawingView.swift` change together 52% of the time (12 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `61b42731` fix(layout): collapse sibling margins and trim quote spacing; `62435277` feat(viewer): render custom React atom components; `109b85e6` fix(ios): localize viewer accessibility geometry — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×3
Edited copy of a member (22 corresponding lines) ios/EditorV2Adapter+TextCommands.swift:384— ios/EditorV2Adapter+TextCommands.swift:384-405 | ios/EditorV2Adapter+TextCommands.swift:407-433 — 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) ios/NativeEditorExpoView+MentionRetry.swift:119— ios/NativeEditorExpoView+MentionRetry.swift:119-140 | ios/NativeEditorExpoView+Properties.swift:119-142 — 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) rust/editor-core/src/test_support/large_table_fixture.rs:154— rust/editor-core/src/test_support/large_table_fixture.rs:154-180 | rust/editor-core/src/yrs_engine/engine_tests/structural_representation.rs:63-84 — 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 (17 corresponding lines) · ×3
Edited copy of a member (17 corresponding lines) rust/editor-core/src/yrs_engine/canonical.rs:549— rust/editor-core/src/yrs_engine/canonical.rs:549-565 | rust/editor-core/src/yrs_engine/canonical.rs:746-767 — 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) android/src/main/java/com/apollohg/editor/EditorEditTextRustCommands.kt:330— android/src/main/java/com/apollohg/editor/EditorEditTextRustCommands.kt:330-346 | android/src/main/java/com/apollohg/editor/EditorEditTextRustCommands.kt:348-364 — 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) ios/Viewer/PreparedProseLayoutRegistry+Artifacts.swift:6— ios/Viewer/PreparedProseLayoutRegistry+Artifacts.swift:6-23 | ios/Viewer/PreparedProseLayoutRegistry+Artifacts.swift:58-74 — 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 copies of one member (3 members, 16+ corresponding lines) · ×3
Edited copies of one member (3 members, 16+ corresponding lines) ios/EditorV2Adapter+RenderState.swift:452— ios/EditorV2Adapter+RenderState.swift:452-469 | ios/EditorV2Adapter+Selection.swift:514-529 | ios/EditorV2Adapter+Selection.swift:533-548 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) ios/Tables/EditorTableSurface.swift:1138— ios/Tables/EditorTableSurface.swift:1138-1153 | ios/Tables/EditorTableSurface.swift:1155-1170 | ios/Tables/EditorTableSurface.swift:1221-1237 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) rust/editor-core/src/test_support/ffi_v2_test/session_fixtures.rs:42— rust/editor-core/src/test_support/ffi_v2_test/session_fixtures.rs:42-60 | rust/editor-core/src/test_support/yrs_engine_transaction_property_test/oracle_properties.rs:370-385 | rust/editor-core/src/yrs_engine/mutation_tests/direct_operations.rs:4-19 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×3
Edited copy of a member (13 corresponding lines) android/src/main/java/com/apollohg/editor/tables/EditorTableIndex.kt:377— android/src/main/java/com/apollohg/editor/tables/EditorTableIndex.kt:377-389 | android/src/main/java/com/apollohg/editor/tables/EditorTableIndex.kt:391-406 — 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) android/src/main/java/com/apollohg/editor/EditorEditTextToolbar.kt:25— android/src/main/java/com/apollohg/editor/EditorEditTextToolbar.kt:25-37 | android/src/main/java/com/apollohg/editor/EditorEditTextToolbar.kt:48-61 — 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) rust/editor-core/src/command_planner.rs:322— rust/editor-core/src/command_planner.rs:322-337 | rust/editor-core/src/editor_state.rs:769-781 — 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.
Duplicated block (20 lines × 2) rust/editor-core/src/yrs_engine/codec/projection_match.rs:630— rust/editor-core/src/yrs_engine/codec/projection_match.rs:630-649 | rust/editor-core/src/yrs_engine/codec/projection_write.rs:174-193 — before extracting anything, compare `rust/editor-core/src/yrs_engine/codec/projection_match.rs` and `rust/editor-core/src/yrs_engine/codec/projection_write.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/yrs_engine/codec/projection_match.rs:630` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20 lines × 2) rust/editor-core/src/yrs_engine/mutation/plan/preflight.rs:471— rust/editor-core/src/yrs_engine/mutation/plan/preflight.rs:471-490 | rust/editor-core/src/yrs_engine/mutation/plan/preflight.rs:511-530 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/mutation/plan/preflight.rs:471` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20 lines × 2) android/src/main/java/com/apollohg/editor/RenderBridgeElements.kt:110— android/src/main/java/com/apollohg/editor/RenderBridgeElements.kt:110-129 | android/src/main/java/com/apollohg/editor/RenderBridgeElements.kt:203-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `android/src/main/java/com/apollohg/editor/RenderBridgeElements.kt:130` calls `effectiveTextStyle` and `android/src/main/java/com/apollohg/editor/RenderBridgeElements.kt:223` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) rust/editor-core/src/yrs_engine/compiler/preview.rs:431— rust/editor-core/src/yrs_engine/compiler/preview.rs:431-447 | rust/editor-core/src/yrs_engine/compiler/preview.rs:513-529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) rust/editor-core/src/yrs_engine/mutation_tests/direct_operations/attributes.rs:268— rust/editor-core/src/yrs_engine/mutation_tests/direct_operations/attributes.rs:268-284 | rust/editor-core/src/yrs_engine/mutation_tests/direct_operations/attributes.rs:366-382 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/mutation_tests/direct_operations/attributes.rs:268` 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 (17 lines × 2) rust/editor-core/src/yrs_engine/mutation_tests/preflight_and_properties/deletion_bounds.rs:62— rust/editor-core/src/yrs_engine/mutation_tests/preflight_and_properties/deletion_bounds.rs:62-78 | rust/editor-core/src/yrs_engine/mutation_tests/preflight_and_properties/deletion_bounds.rs:285-301 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/mutation_tests/preflight_and_properties/deletion_bounds.rs:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) rust/editor-core/src/command_planner/format.rs:90— rust/editor-core/src/command_planner/format.rs:90-103 | rust/editor-core/src/command_planner/format.rs:171-184 | rust/editor-core/src/command_planner/format.rs:237-250 — 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 `rust/editor-core/src/command_planner/format.rs:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) rust/editor-core/src/ffi_v2/render.rs:723— rust/editor-core/src/ffi_v2/render.rs:723-736 | rust/editor-core/src/ffi_v2/render.rs:792-805 | rust/editor-core/src/ffi_v2/render.rs:819-832 — 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 `rust/editor-core/src/ffi_v2/render.rs:723` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) rust/editor-core/src/yrs_engine/mutation_tests/block_structure/boundary_splits.rs:17— rust/editor-core/src/yrs_engine/mutation_tests/block_structure/boundary_splits.rs:17-30 | rust/editor-core/src/yrs_engine/mutation_tests/direct_operations/attributes.rs:268-281 | rust/editor-core/src/yrs_engine/mutation_tests/direct_operations/attributes.rs:366-379 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/yrs_engine/mutation_tests/block_structure/boundary_splits.rs: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.
AC3 · Page structure· Page without a main landmark · ×2
Page without a main landmark REDACTED:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark REDACTED:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
CreateJsonScanner::scan_value (cyclomatic 20) rust/editor-core/src/ffi_v2/editor/create_scanner.rs:159— CreateJsonScanner::scan_value 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.
CreateJsonScanner::scan_string (cyclomatic 19) rust/editor-core/src/ffi_v2/editor/create_scanner.rs:84— CreateJsonScanner::scan_string 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.
CachedRenderBlocks::transition_localized_textblock (cyclomatic 20) rust/editor-core/src/render/incremental/cache.rs:432— CachedRenderBlocks::transition_localized_textblock 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.
CachedRenderBlocks::transition (cyclomatic 18) rust/editor-core/src/render/incremental/cache.rs:634— CachedRenderBlocks::transition 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.
YrsHistory::availability_audit (cyclomatic 17) rust/editor-core/src/yrs_engine/history/availability_audit.rs:135— YrsHistory::availability_audit 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.
YrsHistory::unmirrored_stack_metadata_bytes (cyclomatic 17) rust/editor-core/src/yrs_engine/history/capture.rs:399— YrsHistory::unmirrored_stack_metadata_bytes has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TableRenderContext::retain_cells (cognitive 48) rust/editor-core/src/tables/render.rs:580— TableRenderContext::retain_cells has cognitive complexity 48 (threshold 15). Drivers by points: if/else 8 (28 pts), loops 7 (20 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableRenderContext::intern_attributes (cognitive 16) rust/editor-core/src/tables/render.rs:506— TableRenderContext::intern_attributes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YrsHistory::unmirrored_stack_metadata_bytes (cognitive 33) rust/editor-core/src/yrs_engine/history/capture.rs:399— YrsHistory::unmirrored_stack_metadata_bytes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 6 (12 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.
YrsHistory::availability_audit (cognitive 16) rust/editor-core/src/yrs_engine/history/availability_audit.rs:135— YrsHistory::availability_audit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 5, boolean chains 2, match/switch 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CachedRenderBlocks::transition_localized_textblock (cognitive 24) rust/editor-core/src/render/incremental/cache.rs:432— CachedRenderBlocks::transition_localized_textblock has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 3 (4 pts), match/switch 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.
CachedRenderBlocks::transition (cognitive 22) rust/editor-core/src/render/incremental/cache.rs:634— CachedRenderBlocks::transition has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 5, boolean chains 2, match/switch 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.
PositionMap::doc_to_scalar (cognitive 19) rust/editor-core/src/position/mod.rs:297— PositionMap::doc_to_scalar has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 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.
PositionMap::scalar_to_doc_metered (cognitive 16) rust/editor-core/src/position/mod.rs:224— PositionMap::scalar_to_doc_metered has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×2
Edited copy of a member (33 corresponding lines) rust/editor-core/src/yrs_engine/derived_state/candidate_evidence.rs:302— rust/editor-core/src/yrs_engine/derived_state/candidate_evidence.rs:302-349 | rust/editor-core/src/yrs_engine/derived_state/candidate_evidence.rs:363-395 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) rust/editor-core/src/tables/selection.rs:234— rust/editor-core/src/tables/selection.rs:234-266 | rust/editor-core/src/tables/selection.rs:272-305 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×2
Edited copy of a member (39 corresponding lines) rust/editor-core/src/transform/apply/range.rs:669— rust/editor-core/src/transform/apply/range.rs:669-707 | rust/editor-core/src/transform/apply/range.rs:712-750 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) ios/EditorV2Adapter+Selection.swift:289— ios/EditorV2Adapter+Selection.swift:289-345 | ios/EditorV2Adapter+Selection.swift:391-429 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×2
Edited copy of a member (32 corresponding lines) rust/editor-core/src/tables/commands/paste.rs:285— rust/editor-core/src/tables/commands/paste.rs:285-319 | rust/editor-core/src/tables/commands/paste.rs:326-357 — 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) ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:56— ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:56-87 | ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:92-123 — 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 (28 corresponding lines) · ×2
Edited copy of a member (28 corresponding lines) rust/editor-core/src/tables/admission.rs:184— rust/editor-core/src/tables/admission.rs:184-222 | rust/editor-core/src/tables/normalize.rs:140-167 — 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) android/src/main/java/com/apollohg/editor/NativeEditorExpoView.kt:548— android/src/main/java/com/apollohg/editor/NativeEditorExpoView.kt:548-576 | android/src/main/java/com/apollohg/editor/RichTextEditorView.kt:1170-1197 — 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 (34 corresponding lines) · ×2
Edited copy of a member (34 corresponding lines) rust/editor-core/src/yrs_engine/codec/projection_match.rs:457— rust/editor-core/src/yrs_engine/codec/projection_match.rs:457-490 | rust/editor-core/src/yrs_engine/codec/projection_write.rs:25-59 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) ios/EditorTextView+MarkedText.swift:136— ios/EditorTextView+MarkedText.swift:136-169 | ios/EditorTextView+MarkedText.swift:171-204 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 26+ corresponding lines) · ×2
Edited copies of one member (3 members, 26+ corresponding lines) rust/editor-core/src/transform/apply/text.rs:127— rust/editor-core/src/transform/apply/text.rs:127-162 | rust/editor-core/src/transform/apply/text.rs:230-256 | rust/editor-core/src/transform/apply/text.rs:329-354 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 26+ corresponding lines) rust/editor-core/src/yrs_engine/mutation_tests/block_structure/boundary_splits.rs:15— rust/editor-core/src/yrs_engine/mutation_tests/block_structure/boundary_splits.rs:15-42 | rust/editor-core/src/yrs_engine/mutation_tests/preflight_and_properties/deletion_bounds.rs:61-86 | rust/editor-core/src/yrs_engine/mutation_tests/preflight_and_properties/deletion_bounds.rs:284-310 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×2
Edited copy of a member (27 corresponding lines) rust/editor-core/src/ffi_v2/collaboration.rs:272— rust/editor-core/src/ffi_v2/collaboration.rs:272-301 | rust/editor-core/src/table_interop.rs:877-903 — 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) rust/editor-core/src/collaboration_runtime/outbox.rs:433— rust/editor-core/src/collaboration_runtime/outbox.rs:433-459 | rust/editor-core/src/collaboration_runtime/outbox.rs:470-496 — 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 (20 corresponding lines) · ×2
Edited copy of a member (20 corresponding lines) ios/NativeEditorExpoView+AccessoryRetry.swift:54— ios/NativeEditorExpoView+AccessoryRetry.swift:54-73 | ios/NativeEditorExpoView+AccessoryRetry.swift:75-95 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) rust/editor-core/src/yrs_engine/engine_tests/history_and_commit/history_depth.rs:321— rust/editor-core/src/yrs_engine/engine_tests/history_and_commit/history_depth.rs:321-343 | rust/editor-core/src/yrs_engine/engine_tests/localized_split.rs:299-318 — 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 (4 members, 15+ corresponding lines) · ×2
Edited copies of one member (4 members, 15+ corresponding lines) rust/editor-core/src/command_planner/structure.rs:86— rust/editor-core/src/command_planner/structure.rs:86-102 | rust/editor-core/src/editor_state.rs:583-597 | rust/editor-core/src/editor_state/selection.rs:293-311 | rust/editor-core/src/editor_state/selection.rs:370-386 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 15+ corresponding lines) ios/EditorTextView+AttributedPatch.swift:94— ios/EditorTextView+AttributedPatch.swift:94-108 | ios/EditorTextView+AttributedPatch.swift:126-140 | ios/EditorTextView+AttributedPatch.swift:164-184 | ios/EditorTextView+AttributedPatch.swift:186-206 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×2
Edited copies of one member (3 members, 14+ corresponding lines) rust/editor-core/src/collaboration_runtime/outbox.rs:340— rust/editor-core/src/collaboration_runtime/outbox.rs:340-353 | rust/editor-core/src/collaboration_runtime/outbox.rs:360-373 | rust/editor-core/src/collaboration_runtime/outbox.rs:382-399 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) rust/editor-core/src/yrs_engine/mutation/plan/model.rs:806— rust/editor-core/src/yrs_engine/mutation/plan/model.rs:806-819 | rust/editor-core/src/yrs_engine/mutation/plan/model.rs:821-834 | rust/editor-core/src/yrs_engine/mutation/plan/model.rs:836-863 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×2
Edited copy of a member (6 corresponding lines) ios/Viewer/PreparedProseDrawingView.swift:443— ios/Viewer/PreparedProseDrawingView.swift:443-449 | ios/Viewer/PreparedProseDrawingView.swift:451-456 — 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) ios/NativeEditorExpoView+Events.swift:17— ios/NativeEditorExpoView+Events.swift:17-22 | ios/Tables/EditorTableSurface.swift:1406-1411 — 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 copies of one member (3 members, 9+ corresponding lines) · ×2
Edited copies of one member (3 members, 9+ corresponding lines) ios/SharedNativeImagePipeline.swift:166— ios/SharedNativeImagePipeline.swift:166-178 | ios/SharedNativeImagePipeline.swift:180-192 | ios/Viewer/ViewerImagePipeline.swift:324-332 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) android/src/main/java/com/apollohg/editor/EditorInputCoordinates.kt:168— android/src/main/java/com/apollohg/editor/EditorInputCoordinates.kt:168-176 | android/src/main/java/com/apollohg/editor/EditorInputCoordinates.kt:178-187 | android/src/main/java/com/apollohg/editor/EditorInputCoordinates.kt:189-197 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×2
Edited copies of one member (3 members, 15+ corresponding lines) ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:503— ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:503-517 | ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:519-534 | ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:536-554 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) rust/editor-core/src/test_support/yrs_engine_remote_update_test/staging.rs:11— rust/editor-core/src/test_support/yrs_engine_remote_update_test/staging.rs:11-25 | rust/editor-core/src/test_support/yrs_engine_remote_update_test/tables.rs:356-370 | rust/editor-core/src/test_support/yrs_engine_transaction_property_test/oracle_properties.rs:567-583 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×2
Edited copy of a member (3 corresponding lines) ios/Tables/EditorTableSurface.swift:21— ios/Tables/EditorTableSurface.swift:21-23 | ios/Tables/TableInteractionController.swift:332-334 — 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) ios/NativeCodeHighlighting.swift:60— ios/NativeCodeHighlighting.swift:60-62 | ios/NativeEditorModule.swift:940-942 — 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 (22 lines × 2) rust/editor-core/src/render/generate.rs:140— rust/editor-core/src/render/generate.rs:140-161 | rust/editor-core/src/render/incremental.rs:752-773 — before extracting anything, compare `rust/editor-core/src/render/generate.rs` and `rust/editor-core/src/render/incremental.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/render/generate.rs:140` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22 lines × 2) rust/editor-core/src/yrs_engine/mutation/lowering/range/text_targets.rs:481— rust/editor-core/src/yrs_engine/mutation/lowering/range/text_targets.rs:481-502 | rust/editor-core/src/yrs_engine/mutation/lowering/range/text_targets.rs:518-539 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/mutation/lowering/range/text_targets.rs:481` 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) rust/editor-core/src/render/generate.rs:224— rust/editor-core/src/render/generate.rs:224-244 | rust/editor-core/src/render/incremental.rs:864-884 — before extracting anything, compare `rust/editor-core/src/render/generate.rs` and `rust/editor-core/src/render/incremental.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/render/generate.rs:224` 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) rust/editor-core/src/yrs_engine/engine/transaction_result.rs:46— rust/editor-core/src/yrs_engine/engine/transaction_result.rs:46-66 | rust/editor-core/src/yrs_engine/engine/undo_redo.rs:505-525 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/yrs_engine/engine/transaction_result.rs:46` 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 (18 lines × 2) rust/editor-core/src/render/generate.rs:121— rust/editor-core/src/render/generate.rs:121-138 | rust/editor-core/src/render/incremental.rs:720-737 — before extracting anything, compare `rust/editor-core/src/render/generate.rs` and `rust/editor-core/src/render/incremental.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/render/generate.rs:121` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 2) rust/editor-core/src/render/generate.rs:189— rust/editor-core/src/render/generate.rs:189-206 | rust/editor-core/src/render/incremental.rs:827-844 — before extracting anything, compare `rust/editor-core/src/render/generate.rs` and `rust/editor-core/src/render/incremental.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/render/generate.rs:189` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12–14 lines × 2) rust/editor-core/src/command_planner/backspace.rs:188— rust/editor-core/src/command_planner/backspace.rs:188-199 | rust/editor-core/src/command_planner/backspace.rs:285-298 — both copies are in the same file, so extract the 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 `rust/editor-core/src/command_planner/backspace.rs:188` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, 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–14 lines × 2) rust/editor-core/src/transform/apply/range.rs:32— rust/editor-core/src/transform/apply/range.rs:32-45 | rust/editor-core/src/transform/apply/range.rs:195-206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/transform/apply/range.rs:32` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13–14 lines × 2) rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:787— rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:787-799 | rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:830-843 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:787` 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–14 lines × 2) android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:1139— android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:1139-1151 | android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:1210-1223 — both copies are in the same file, so extract the 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 × 3) rust/editor-core/src/command_planner/backspace.rs:338— rust/editor-core/src/command_planner/backspace.rs:338-350 | rust/editor-core/src/command_planner/text.rs:750-762 | rust/editor-core/src/editor_state/selection.rs:389-401 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 3) rust/editor-core/src/yrs_engine/compiler/operations/batch.rs:342— rust/editor-core/src/yrs_engine/compiler/operations/batch.rs:342-354 | rust/editor-core/src/yrs_engine/compiler/operations/batch.rs:406-418 | rust/editor-core/src/yrs_engine/compiler/operations/batch.rs:479-491 — 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 `rust/editor-core/src/yrs_engine/compiler/operations/batch.rs:342` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/editor-core/src/yrs_engine/compiler/operations/batch.rs:478` calls `clone` and `rust/editor-core/src/yrs_engine/compiler/operations/batch.rs:405` 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 (6 lines × 3) rust/editor-core/src/tables/admission.rs:192— rust/editor-core/src/tables/admission.rs:192-197 | rust/editor-core/src/tables/mutation_guard.rs:185-190 | rust/editor-core/src/tables/normalize.rs:147-152 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/tables/admission.rs:192` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) ios/EditorV2Adapter+Mutation.swift:429— ios/EditorV2Adapter+Mutation.swift:429-434 | ios/EditorV2Adapter+RenderState.swift:249-254 | ios/EditorV2Adapter+RenderState.swift:270-275 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `ios/EditorV2Adapter+Mutation.swift:429` 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 (5 lines × 3) rust/editor-core/src/render/generate.rs:196— rust/editor-core/src/render/generate.rs:196-200 | rust/editor-core/src/render/incremental.rs:834-838 | rust/editor-core/src/render/incremental.rs:861-865 — before extracting anything, compare `rust/editor-core/src/render/generate.rs` and `rust/editor-core/src/render/incremental.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/render/generate.rs:196` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) rust/editor-core/src/transform/apply/text.rs:134— rust/editor-core/src/transform/apply/text.rs:134-138 | rust/editor-core/src/transform/apply/text.rs:232-236 | rust/editor-core/src/transform/apply/text.rs:331-335 — 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 `rust/editor-core/src/transform/apply/text.rs:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) android/src/main/java/com/apollohg/editor/EditorKeyboardToolbarView.kt:829— android/src/main/java/com/apollohg/editor/EditorKeyboardToolbarView.kt:829-842 | android/src/main/java/com/apollohg/editor/RemoteSelectionOverlayView.kt:107-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `android/src/main/java/com/apollohg/editor/RemoteSelectionOverlayView.kt:107` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) ios/Tables/ViewerTableSurface.swift:305— ios/Tables/ViewerTableSurface.swift:305-318 | ios/Tables/ViewerTableSurface.swift:348-362 — both copies are in the same file, so extract the 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 `ios/Tables/ViewerTableSurface.swift:348` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) android/src/main/java/com/apollohg/editor/EditorKeyboardToolbarView.kt:581— android/src/main/java/com/apollohg/editor/EditorKeyboardToolbarView.kt:581-593 | android/src/main/java/com/apollohg/editor/EditorKeyboardToolbarView.kt:604-615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `android/src/main/java/com/apollohg/editor/EditorKeyboardToolbarView.kt:604` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12–13 lines × 2) ios/RenderBridge.swift:383— ios/RenderBridge.swift:383-394 | ios/RenderBridge.swift:407-419 — both copies are in the same file, so extract the 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 `ios/RenderBridge.swift:407` 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, `ios/RenderBridge.swift:382` calls `NSAttributedString` and `ios/RenderBridge.swift:407` 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 (17 lines × 2 locations) src/ExternalTextComposition.ts:415— src/ExternalTextComposition.ts:415 · src/ExternalTextComposition.ts:433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2 locations) src/useRichTextEditorState.tsx:241— src/useRichTextEditorState.tsx:241 · src/useRichTextEditorState.tsx:271 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (14 lines × 2 locations) scripts/table-interop/assertions.ts:154— scripts/table-interop/assertions.ts:154 · scripts/table-interop/controller.ts:91 — 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 (14 lines × 2 locations) scripts/table-interop/continuity-evidence.ts:303— scripts/table-interop/continuity-evidence.ts:303 · scripts/table-interop/continuity-evidence.ts:427 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (14 matched lines × 2 locations) · ×2
Duplicated block with local edits (14 matched lines × 2 locations) scripts/table-interop/rust-peer.ts:131— scripts/table-interop/rust-peer.ts:131 · scripts/table-interop/web-peer.ts:177 — the two spans are one implementation copied and then locally edited — 68 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (14 matched lines × 2 locations) src/useRichTextEditorCommands.tsx:111— src/useRichTextEditorCommands.tsx:111 · src/useRichTextEditorCommands.tsx:233 — the two spans are one implementation copied and then locally edited — 60 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 (13 lines × 2 locations) scripts/table-interop/corpus.ts:156— scripts/table-interop/corpus.ts:156 · scripts/table-interop/corpus.ts:184 — 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 (13 lines × 2 locations) src/useNativeEditor.ts:323— src/useNativeEditor.ts:323 · src/useNativeEditor.ts:343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2 locations) src/NativeEditorCreateJson.ts:298— src/NativeEditorCreateJson.ts:298 · src/NativeEditorCreateJson.ts:340 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (12 lines × 2 locations) src/schemaNormalization.ts:200— src/schemaNormalization.ts:200 · src/schemaNormalization.ts:257 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (11 matched lines × 2 locations) · ×2
Duplicated block with local edits (11 matched lines × 2 locations) scripts/table-interop/checkpoint-evidence.ts:149— scripts/table-interop/checkpoint-evidence.ts:149 · scripts/table-interop/corpus.ts:1393 — the two spans are one implementation copied and then locally edited — 63 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (11 matched lines × 2 locations) src/RichTextEditorTypes.tsx:295— src/RichTextEditorTypes.tsx:295 · src/useNativeEditor.ts:61 — the 2 copies are spread across 2 files, and the CITED SPAN is inside a TYPE DECLARATION, not executable code. There is no function to extract and no call site to call one from, so do not read this as an extract-a-helper row: the collapse a type offers is a generic — name the shape once, parameterised over the part that varies, and have each copy instantiate it. First check what actually differs between the copies: where they are a MATRIX of cases (one entry per input, differing precisely in the case each one pins), the repetition IS the enumeration and collapsing it would delete cases rather than de-duplicate anything — leave those alone. Reported because the copies that are not a matrix drift apart the first time only one of them is edited.
Duplicated block (9 lines × 3 locations) src/EditorStyleSheetNormalization.ts:105— src/EditorStyleSheetNormalization.ts:105 · src/NativeEditorCreateValidation.ts:136 · src/NativeEditorLocalAwareness.ts:85 — the 3 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. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Duplicated block (9 lines × 3 locations) src/ExternalTextComposition.ts:771— src/ExternalTextComposition.ts:771 · src/ExternalTextComposition.ts:784 · src/ExternalTextComposition.ts:800 — 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 (9 lines × 2 locations) src/NativeEditorCreateValidation.ts:136— src/NativeEditorCreateValidation.ts:136 · src/NativeEditorLocalAwareness.ts:85 — 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 (9 lines × 2 locations) src/useNativeEditor.ts:423— src/useNativeEditor.ts:423 · src/useNativeEditor.ts:436 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2 locations) scripts/table-interop/availability-evidence.ts:173— scripts/table-interop/availability-evidence.ts:173 · scripts/table-interop/corpus.ts:1444 — 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 (8 lines × 2 locations) scripts/table-interop/corpus.ts:140— scripts/table-interop/corpus.ts:140 · scripts/table-interop/corpus.ts:199 — 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.
X12 · Unreachable branch· Statement is unreachable · ×2
Statement is unreachable — control never gets past the statement before it rust/editor-core/src/yrs_engine/canonical.rs:831— `let _ = self.serialized_len.set(exact_len);` follows `{ return None; }` (line 828) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
Statement is unreachable — control never gets past the statement before it rust/editor-core/src/yrs_engine/engine/undo_redo.rs:207— `let next_document_revision = checked_operation_increment(request_id, self.rev…` follows `{ return Ok(HistoryPopPreparation::Unavailable); }` (line 203) in the same block, and control never passes that statement — it returns, breaks, continues, panics, exits or calls a function that never returns. This code cannot run for any input; rustc warns `unreachable_code` on it. Delete it, or move it before the statement that leaves if it was meant to run.
X18 · Disposal-pattern correctness· Explicit release owed and not made on every path · ×2
Explicit release owed and not made on every path rust/editor-core/src/yrs_engine/engine/commands.rs:419— `transaction` (line 419) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends.
Explicit release owed and not made on every path rust/editor-core/src/yrs_engine/engine/commands.rs:598— `transaction` (line 598) is a transaction this function owns and never releases: no `commit()` (or a deliberate `rollback()`) on any path, and it is not handed on. Rust drops it at the end of the scope, and a transaction that is dropped rolls back, so every write made through it is silently undone. Release it where the work ends.
AC4 · Keyboard semantics· Anchor without href · ×1
Anchor without href src/schemaPresets.ts:244— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
useEditorToolbarItems.useEditorToolbarItems (cyclomatic 84) src/useEditorToolbarItems.tsx:12— useEditorToolbarItems.useEditorToolbarItems has cyclomatic complexity 84 (threshold 15). Most of this is not in the body itself: 1 of the 84 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 89, 221, 352, …). 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.
CoreTextProseLayoutEngine.prepareBlock (cyclomatic 77) ios/Viewer/CoreTextProseLayoutEngine.swift:1238— CoreTextProseLayoutEngine.prepareBlock has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useRichTextEditorPresentation.useRichTextEditorPresentation (cyclomatic 77) src/useRichTextEditorPresentation.tsx:50— useRichTextEditorPresentation.useRichTextEditorPresentation has cyclomatic complexity 77 (threshold 15). Of this number, 45 points are the body's own statements and 32 belong to 14 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.
RenderBridgeElementsKt.appendElements (cyclomatic 76) android/src/main/java/com/apollohg/editor/RenderBridgeElements.kt:10— RenderBridgeElementsKt.appendElements has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RichTextEditorView.moveFromActiveTableCell (cyclomatic 75) ios/RichTextEditorView.swift:468— RichTextEditorView.moveFromActiveTableCell has cyclomatic complexity 75 (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.
RenderBridge.renderElements (cyclomatic 69) ios/RenderBridge.swift:260— RenderBridge.renderElements has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EditorTableIndex.stage (cyclomatic 67) ios/Tables/EditorTableIndex.swift:58— EditorTableIndex.stage has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StaticLayoutAndroidProseLayoutEngine.prepareLayout (cyclomatic 66) android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:499— StaticLayoutAndroidProseLayoutEngine.prepareLayout 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.
CoreTextProseLayoutEngine.makePreparation (cyclomatic 65) ios/Viewer/CoreTextProseLayoutEngine.swift:399— CoreTextProseLayoutEngine.makePreparation has cyclomatic complexity 65 (threshold 15). Of this number, 62 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.
EditorTextView.applyUpdateJSON (cyclomatic 59) ios/EditorTextView+Rendering.swift:331— EditorTextView.applyUpdateJSON has cyclomatic complexity 59 (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.
schemaNormalization.normalizeSchemaDefinition (cyclomatic 57) src/schemaNormalization.ts:352— schemaNormalization.normalizeSchemaDefinition has cyclomatic complexity 57 (threshold 15). Of this number, 46 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
schemaResolution.resolveDocumentSchema (cyclomatic 51) src/schemaResolution.ts:127— schemaResolution.resolveDocumentSchema has cyclomatic complexity 51 (threshold 15). Of this number, 46 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ViewerDocument.validTables (cyclomatic 50) ios/Viewer/ViewerDocument.swift:792— ViewerDocument.validTables has cyclomatic complexity 50 (threshold 15). Of this number, 43 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ViewerDocument.lowerElements (cyclomatic 48) ios/Viewer/ViewerDocument.swift:435— ViewerDocument.lowerElements has cyclomatic complexity 48 (threshold 15). Of this number, 40 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useRichTextEditorState.useRichTextEditorState (cyclomatic 48) src/useRichTextEditorState.tsx:43— useRichTextEditorState.useRichTextEditorState has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 15 of the 48 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 224, 241, 271, …). 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.
NativeToolbarItem.parse (cyclomatic 47) ios/NativeToolbar+Models.swift:348— NativeToolbarItem.parse has cyclomatic complexity 47 (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.
PreparedProseDrawingView.updateTableLayers (cyclomatic 44) ios/Viewer/PreparedProseDrawingView.swift:1524— PreparedProseDrawingView.updateTableLayers has cyclomatic complexity 44 (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.
NativeEditorCreateJson.normalizeV2JsonValue (cyclomatic 43) src/NativeEditorCreateJson.ts:226— NativeEditorCreateJson.normalizeV2JsonValue has cyclomatic complexity 43 (threshold 15). Of this number, 41 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeEditorRenderNormalization.validLeafRenderElement (cyclomatic 43) src/NativeEditorRenderNormalization.ts:59— NativeEditorRenderNormalization.validLeafRenderElement has cyclomatic complexity 43 (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.
useNativeEditor.useNativeEditorDocument.refresh (cyclomatic 43) src/useNativeEditor.ts:217— useNativeEditor.useNativeEditorDocument.refresh has cyclomatic complexity 43 (threshold 15). Of this number, 40 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EditorAccessoryToolbarView.apply (cyclomatic 42) ios/NativeToolbar.swift:195— EditorAccessoryToolbarView.apply has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EditorTableIndex.stage (cyclomatic 39) android/src/main/java/com/apollohg/editor/tables/EditorTableIndex.kt:75— EditorTableIndex.stage has cyclomatic complexity 39 (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.
schemaDocumentConstruction.constructDefaultEmptyDocument (cyclomatic 39) src/schemaDocumentConstruction.ts:11— schemaDocumentConstruction.constructDefaultEmptyDocument has cyclomatic complexity 39 (threshold 15). Of this number, 16 points are the body's own statements and 23 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeEditorExpoViewToolbarKt.handleToolbarItemPress (cyclomatic 38) android/src/main/java/com/apollohg/editor/NativeEditorExpoViewToolbar.kt:210— NativeEditorExpoViewToolbarKt.handleToolbarItemPress has cyclomatic complexity 38 (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.
RenderBridgeInlineAndAtomsKt.appendStyledText (cyclomatic 38) android/src/main/java/com/apollohg/editor/RenderBridgeInlineAndAtoms.kt:34— RenderBridgeInlineAndAtomsKt.appendStyledText has cyclomatic complexity 38 (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.
EditorV2Adapter.isValidRenderElement (cyclomatic 38) ios/EditorV2Adapter+RenderValidation.swift:187— EditorV2Adapter.isValidRenderElement has cyclomatic complexity 38 (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.
CoreTextProseLayoutEngine.attributes (cyclomatic 38) ios/Viewer/CoreTextProseLayoutEngine+AttributedText.swift:209— CoreTextProseLayoutEngine.attributes 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.
StaticLayoutAndroidProseLayoutEngine.markSpans (cyclomatic 37) android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:2594— StaticLayoutAndroidProseLayoutEngine.markSpans has cyclomatic complexity 37 (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.
RenderImageDecoder.isSelfContainedSvg (cyclomatic 36) android/src/main/java/com/apollohg/editor/RenderImageDecoder.kt:476— RenderImageDecoder.isSelfContainedSvg has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RichTextEditorView.moveFromActiveTableCell (cyclomatic 36) ios/RichTextEditorView.swift:407— RichTextEditorView.moveFromActiveTableCell has cyclomatic complexity 36 (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.
useEditorToolbarPresentation.useEditorToolbarPresentation (cyclomatic 36) src/useEditorToolbarPresentation.tsx:20— useEditorToolbarPresentation.useEditorToolbarPresentation has cyclomatic complexity 36 (threshold 15). Of this number, 19 points are the body's own statements and 17 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.
useRichTextEditorMentions.useRichTextEditorMentions.handleAddonEvent (cyclomatic 35) src/useRichTextEditorMentions.tsx:272— useRichTextEditorMentions.useRichTextEditorMentions.handleAddonEvent has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EditorTableSurface.moveFromActiveCellByArrow (cyclomatic 33) android/src/main/java/com/apollohg/editor/tables/EditorTableSurface.kt:2111— EditorTableSurface.moveFromActiveCellByArrow has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useNativeEditor.useNativeEditorDocument (cyclomatic 33) src/useNativeEditor.ts:108— useNativeEditor.useNativeEditorDocument has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 7 of the 33 points are its own statements and the rest belongs to one function literal inside it that branches (line 380). 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.
EditorEditTextUpdatesKt.applyUpdateJSONImpl (cyclomatic 32) android/src/main/java/com/apollohg/editor/EditorEditTextUpdates.kt:76— EditorEditTextUpdatesKt.applyUpdateJSONImpl 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.
RenderImageLoadOwner.decodedDataURLByteCount (cyclomatic 32) ios/SharedNativeImagePipeline.swift:448— RenderImageLoadOwner.decodedDataURLByteCount has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeEditorCollaborationTransport.normalizeNativeCollaborationTransportEvent (cyclomatic 32) src/NativeEditorCollaborationTransport.ts:457— NativeEditorCollaborationTransport.normalizeNativeCollaborationTransportEvent has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useRichTextEditorEvents.useRichTextEditorEvents.handleAtomLayout (cyclomatic 32) src/useRichTextEditorEvents.tsx:386— useRichTextEditorEvents.useRichTextEditorEvents.handleAtomLayout has cyclomatic complexity 32 (threshold 15). Of this number, 21 points are the body's own statements and 11 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.
EditorTextView.textViewDidChangeSelection (cyclomatic 31) ios/EditorTextView+Selection.swift:184— EditorTextView.textViewDidChangeSelection 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.
EditorV2Adapter.adopt (cyclomatic 31) ios/EditorV2Adapter+RenderState.swift:69— EditorV2Adapter.adopt has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
TableGridLayout.relayout (cyclomatic 31) ios/Tables/TableGridLayout.swift:165— TableGridLayout.relayout has cyclomatic complexity 31 (threshold 15). Of this number, 28 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StaticLayoutAndroidProseLayoutEngine.prepareBlock (cyclomatic 30) android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:1758— StaticLayoutAndroidProseLayoutEngine.prepareBlock 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.
ViewerDocumentKt.validViewerTables (cyclomatic 30) android/src/main/java/com/apollohg/editor/viewer/ViewerDocument.kt:168— ViewerDocumentKt.validViewerTables 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.
EditorTextView.deleteBackward (cyclomatic 30) ios/EditorTextView.swift:733— EditorTextView.deleteBackward 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.
PreparedProseDrawingView.selectionHandles (cyclomatic 30) ios/Viewer/PreparedProseDrawingView.swift:483— PreparedProseDrawingView.selectionHandles has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
schemaDefinition.defineSchema (cyclomatic 30) src/schemaDefinition.ts:343— schemaDefinition.defineSchema has cyclomatic complexity 30 (threshold 15). Of this number, 23 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EditorTextView.applyAttributedRender (cyclomatic 29) ios/EditorTextView+Rendering.swift:155— EditorTextView.applyAttributedRender 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.
EditorTableSurface.stepDragFrame (cyclomatic 29) ios/Tables/EditorTableSurface.swift:1413— EditorTableSurface.stepDragFrame 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.
CoreTextProseLayoutEngine.makeBinding (cyclomatic 29) ios/Viewer/CoreTextProseLayoutEngine.swift:808— CoreTextProseLayoutEngine.makeBinding has cyclomatic complexity 29 (threshold 15). Of this number, 20 points are the body's own statements and 9 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.
NativeEditorCreateJson.serializeV2CreateEnvelope (cyclomatic 29) src/NativeEditorCreateJson.ts:590— NativeEditorCreateJson.serializeV2CreateEnvelope 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.
useRichTextEditorUpdates.useRichTextEditorUpdates (cyclomatic 29) src/useRichTextEditorUpdates.tsx:25— useRichTextEditorUpdates.useRichTextEditorUpdates 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 5 function literals inside it that branch (lines 577, 509, 309, …). 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.
EditorTextSurfaceInteraction.performAccessibilityAction (cyclomatic 28) android/src/main/java/com/apollohg/editor/EditorTextSurfaceInteraction.kt:610— EditorTextSurfaceInteraction.performAccessibilityAction 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.
EditorTextView.refreshRetainedPositionalMetadata (cyclomatic 28) ios/EditorTextView+RenderPatch.swift:162— EditorTextView.refreshRetainedPositionalMetadata 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.
CoreTextProseLayoutEngine.makeAttributedString (cyclomatic 28) ios/Viewer/CoreTextProseLayoutEngine+AttributedText.swift:48— CoreTextProseLayoutEngine.makeAttributedString has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PreparedProseDrawingView.hitResizeEdge (cyclomatic 28) ios/Viewer/PreparedProseDrawingView.swift:604— PreparedProseDrawingView.hitResizeEdge 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.
PreparedProseLayoutRegistry.measure (cyclomatic 28) ios/Viewer/PreparedProseLayoutRegistry.swift:222— PreparedProseLayoutRegistry.measure 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.
ExternalTextComposition.parseNativeCompositionResult (cyclomatic 28) src/ExternalTextComposition.ts:149— ExternalTextComposition.parseNativeCompositionResult has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
useViewerAtoms.parsePositions.positions (cyclomatic 28) src/useViewerAtoms.tsx:95— useViewerAtoms.parsePositions.positions has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LocalizedTextLeafIndex::carry_after_textblock_edit (cyclomatic 27) rust/editor-core/src/yrs_engine/derived_state/localized_index.rs:622— LocalizedTextLeafIndex::carry_after_textblock_edit 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.
EditorTableCellProjection.project (cyclomatic 27) android/src/main/java/com/apollohg/editor/tables/EditorTableCellProjection.kt:29— EditorTableCellProjection.project 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.
EditorTableSurface.refreshPresentation (cyclomatic 27) android/src/main/java/com/apollohg/editor/tables/EditorTableSurface.kt:1396— EditorTableSurface.refreshPresentation has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TableInteractionController.onTouch (cyclomatic 27) android/src/main/java/com/apollohg/editor/tables/TableInteractionController.kt:80— TableInteractionController.onTouch 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.
PreparedProseDrawingView.drawTableNodes (cyclomatic 27) android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:1137— PreparedProseDrawingView.drawTableNodes 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.
EditorTextView.reusingStyledParagraphBox (cyclomatic 27) ios/EditorTextView+RenderPatch.swift:508— EditorTextView.reusingStyledParagraphBox has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorV2Adapter.isValidMentionStyle (cyclomatic 27) ios/EditorV2Adapter+RenderValidation.swift:158— EditorV2Adapter.isValidMentionStyle 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.
attributeValidation.validateAttributeSpec (cyclomatic 27) src/attributeValidation.ts:96— attributeValidation.validateAttributeSpec has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
NativeEditorCreateConfig.buildV2CreateRequestUnchecked (cyclomatic 27) src/NativeEditorCreateConfig.ts:137— NativeEditorCreateConfig.buildV2CreateRequestUnchecked 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.
EditorTextSurfaceInteraction.onKeyDown (cyclomatic 26) android/src/main/java/com/apollohg/editor/EditorTextSurfaceInteraction.kt:485— EditorTextSurfaceInteraction.onKeyDown 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.
EditorTextView.nativeTextMutationWithCurrentSelection (cyclomatic 26) ios/EditorTextView+NativeMutation.swift:261— EditorTextView.nativeTextMutationWithCurrentSelection has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorTableSurface.arrowDestination (cyclomatic 26) ios/Tables/EditorTableSurface.swift:858— EditorTableSurface.arrowDestination has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorTableSurface.prepareEntries (cyclomatic 26) ios/Tables/EditorTableSurface.swift:1533— EditorTableSurface.prepareEntries has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CoreTextProseLayoutEngine.listPlacement (cyclomatic 26) ios/Viewer/CoreTextProseLayoutEngine.swift:1170— CoreTextProseLayoutEngine.listPlacement 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.
EditorEditTextRustCommandsKt.insertPlainTextRangeInRust (cyclomatic 25) android/src/main/java/com/apollohg/editor/EditorEditTextRustCommands.kt:84— EditorEditTextRustCommandsKt.insertPlainTextRangeInRust 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.
EditorKeyboardToolbarView.buttonState (cyclomatic 25) android/src/main/java/com/apollohg/editor/EditorKeyboardToolbarView.kt:733— EditorKeyboardToolbarView.buttonState has cyclomatic complexity 25 (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.
EditorTextView.applySelectionFromJSON (cyclomatic 25) ios/EditorTextView+Selection.swift:602— EditorTextView.applySelectionFromJSON 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.
EditorTableInputCoordinator.projection (cyclomatic 25) ios/Tables/EditorTableInputCoordinator.swift:39— EditorTableInputCoordinator.projection has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PreparedProseDrawingView.paint (cyclomatic 25) ios/Viewer/PreparedProseDrawingView.swift:1341— PreparedProseDrawingView.paint has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ViewerImagePipeline.updateVisibleRect (cyclomatic 25) ios/Viewer/ViewerImagePipeline.swift:426— ViewerImagePipeline.updateVisibleRect 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.
schemaDefinition.validateAttributeDOMRules (cyclomatic 25) src/schemaDefinition.ts:237— schemaDefinition.validateAttributeDOMRules has cyclomatic complexity 25 (threshold 15). Of this number, 16 points are the body's own statements and 9 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorEditText.dispatchKeyEvent (cyclomatic 24) android/src/main/java/com/apollohg/editor/EditorEditText.kt:419— EditorEditText.dispatchKeyEvent has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorStyleSheetKt.overlaidWith (cyclomatic 24) android/src/main/java/com/apollohg/editor/EditorStyleSheet.kt:352— EditorStyleSheetKt.overlaidWith has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ViewerDocumentKt.lowerElements (cyclomatic 24) android/src/main/java/com/apollohg/editor/viewer/ViewerDocument.kt:392— ViewerDocumentKt.lowerElements 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.
EditorStyleSheetNormalization.normalizeEditorTheme (cyclomatic 24) src/EditorStyleSheetNormalization.ts:372— EditorStyleSheetNormalization.normalizeEditorTheme has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeEditorResultNormalization.normalizeNativeEditorV2PeersValue (cyclomatic 24) src/NativeEditorResultNormalization.ts:487— NativeEditorResultNormalization.normalizeNativeEditorV2PeersValue 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.
AtomHost.AtomHost (cyclomatic 24) src/AtomHost.tsx:75— AtomHost.AtomHost has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 126, 186, 196, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EditorV2RenderValidationKt.validRenderElement (cyclomatic 23) android/src/main/java/com/apollohg/editor/EditorV2RenderValidation.kt:190— EditorV2RenderValidationKt.validRenderElement has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
NativeEditorExpoViewBindingKt.setEditorIdImpl (cyclomatic 23) android/src/main/java/com/apollohg/editor/NativeEditorExpoViewBinding.kt:20— NativeEditorExpoViewBindingKt.setEditorIdImpl 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.
StaticLayoutAndroidProseLayoutEngine.bindCellShape (cyclomatic 23) android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:1446— StaticLayoutAndroidProseLayoutEngine.bindCellShape 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.
PreparedProseDrawingView.onTouchEvent (cyclomatic 23) android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:1627— PreparedProseDrawingView.onTouchEvent 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.
NativeCollaborationTransportRegistry.parseProtocolAdapterConfig (cyclomatic 23) ios/NativeCollaborationTransportRegistry.swift:365— NativeCollaborationTransportRegistry.parseProtocolAdapterConfig 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.
EditorAccessoryToolbarView.buttonState (cyclomatic 23) ios/NativeToolbar+ButtonStyle.swift:4— EditorAccessoryToolbarView.buttonState has cyclomatic complexity 23 (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.
PreparedProseLayoutCache.value (cyclomatic 23) ios/Viewer/PreparedProseLayoutCache.swift:92— PreparedProseLayoutCache.value 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.
schemaNormalization.normalizeNodeHtmlRules (cyclomatic 23) src/schemaNormalization.ts:261— schemaNormalization.normalizeNodeHtmlRules has cyclomatic complexity 23 (threshold 15). Of this number, 15 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
NativeEditorCollaborationTransport.collaborationProtocolAdapterDescriptor (cyclomatic 23) src/NativeEditorCollaborationTransport.ts:189— NativeEditorCollaborationTransport.collaborationProtocolAdapterDescriptor has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
NativeTransactionBridge::submit_native_intent (cyclomatic 22) rust/editor-core/src/native_transaction_bridge.rs:83— NativeTransactionBridge::submit_native_intent 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.
AwarenessCodec::admit_update (cyclomatic 22) rust/editor-core/src/yrs_engine/awareness.rs:415— AwarenessCodec::admit_update 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.
TableCommandSurface::is_available (cyclomatic 22) rust/editor-core/src/yrs_engine/commands/tables.rs:806— TableCommandSurface::is_available has cyclomatic complexity 22 (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.
EditorV2AdapterMutationsKt.performNativeIntent (cyclomatic 22) android/src/main/java/com/apollohg/editor/EditorV2AdapterMutations.kt:57— EditorV2AdapterMutationsKt.performNativeIntent 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.
NativeEditorExpoViewPendingUpdatesKt.applyPendingEditorUpdateIfNeededImpl (cyclomatic 22) android/src/main/java/com/apollohg/editor/NativeEditorExpoViewPendingUpdates.kt:199— NativeEditorExpoViewPendingUpdatesKt.applyPendingEditorUpdateIfNeededImpl 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.
EditorV2Adapter.submitNativeIntentRecoveringStaleEpoch (cyclomatic 22) ios/EditorV2Adapter+Mutation.swift:106— EditorV2Adapter.submitNativeIntentRecoveringStaleEpoch 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.
EditorV2Adapter.performMutation (cyclomatic 22) ios/EditorV2Adapter+Mutation.swift:281— EditorV2Adapter.performMutation 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.
EditorV2Adapter.commitNativeTextMutation (cyclomatic 22) ios/EditorV2Adapter+TextCommands.swift:4— EditorV2Adapter.commitNativeTextMutation 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.
NativeEditorExpoView.handleToolbarItemPress (cyclomatic 22) ios/NativeEditorExpoView+Toolbar.swift:51— NativeEditorExpoView.handleToolbarItemPress has cyclomatic complexity 22 (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.
RenderImageLoadOwner.startLocked (cyclomatic 22) ios/SharedNativeImagePipeline.swift:199— RenderImageLoadOwner.startLocked 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.
EditorTableIndex.entry (cyclomatic 22) ios/Tables/EditorTableIndex.swift:234— EditorTableIndex.entry has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
NativeEditorExpoViewPendingUpdatesKt.applyPendingEditorResetUpdateIfNeededImpl (cyclomatic 21) android/src/main/java/com/apollohg/editor/NativeEditorExpoViewPendingUpdates.kt:136— NativeEditorExpoViewPendingUpdatesKt.applyPendingEditorResetUpdateIfNeededImpl 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.
NativeToolbarItem.parseItem (cyclomatic 21) android/src/main/java/com/apollohg/editor/NativeToolbarItem.kt:127— NativeToolbarItem.parseItem 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.
ViewerTableSurface.replacingCells (cyclomatic 21) android/src/main/java/com/apollohg/editor/tables/ViewerTableSurface.kt:365— ViewerTableSurface.replacingCells 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.
PreparedProseDrawingView.hitResizeEdge (cyclomatic 21) android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:567— PreparedProseDrawingView.hitResizeEdge 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.
ViewerImagePipeline.updateVisibleRect (cyclomatic 21) android/src/main/java/com/apollohg/editor/viewer/ViewerImagePipeline.kt:363— ViewerImagePipeline.updateVisibleRect 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.
EditorV2Adapter.adoptExternalReset (cyclomatic 21) ios/EditorV2Adapter+RenderState.swift:232— EditorV2Adapter.adoptExternalReset 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.
RenderBridge.paragraphStyleForBlock (cyclomatic 21) ios/RenderBridge+Style.swift:22— RenderBridge.paragraphStyleForBlock 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.
EditorCellSelection.resolve (cyclomatic 21) ios/Tables/EditorCellSelection.swift:40— EditorCellSelection.resolve 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.
CoreTextProseLayoutEngine.measurePlainCell (cyclomatic 21) ios/Viewer/CoreTextProseLayoutEngine.swift:1104— CoreTextProseLayoutEngine.measurePlainCell 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.
EditorStyleSheetNormalization.property (cyclomatic 21) src/EditorStyleSheetNormalization.ts:175— EditorStyleSheetNormalization.property 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.
schemaResolution.admitSchemaCollections (cyclomatic 21) src/schemaResolution.ts:34— schemaResolution.admitSchemaCollections has cyclomatic complexity 21 (threshold 15). Of this number, 20 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.
NativeEditorRenderNormalization.normalizeRenderSelection (cyclomatic 21) src/NativeEditorRenderNormalization.ts:239— NativeEditorRenderNormalization.normalizeRenderSelection 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.
useViewerAtoms.useViewerAtoms.onAtomLayout (cyclomatic 21) src/useViewerAtoms.tsx:313— useViewerAtoms.useViewerAtoms.onAtomLayout has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useRichTextEditorCommands.useRichTextEditorCommands.runAtomAction (cyclomatic 21) src/useRichTextEditorCommands.tsx:176— useRichTextEditorCommands.useRichTextEditorCommands.runAtomAction has cyclomatic complexity 21 (threshold 15). Of this number, 20 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.
LocalizedSplitCompiler::try_new (cyclomatic 20) rust/editor-core/src/yrs_engine/mutation/lowering/index/localized_split.rs:3— LocalizedSplitCompiler::try_new 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.
EditorInputConnection.commitCorrection (cyclomatic 20) android/src/main/java/com/apollohg/editor/EditorInputConnection.kt:315— EditorInputConnection.commitCorrection 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.
EditorV2AdapterMutationsKt.performMutation (cyclomatic 20) android/src/main/java/com/apollohg/editor/EditorV2AdapterMutations.kt:173— EditorV2AdapterMutationsKt.performMutation 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.
EditorClipboardPaste.semanticHTML (cyclomatic 20) ios/EditorTextView+KeyboardInput.swift:185— EditorClipboardPaste.semanticHTML 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.
EditorTextView.insertText (cyclomatic 20) ios/EditorTextView.swift:636— EditorTextView.insertText 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.
EditorTextView.applyNativeTextReplacementIfPossible (cyclomatic 20) ios/EditorTextView+AttributedPatch.swift:39— EditorTextView.applyNativeTextReplacementIfPossible has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorTextView.beginExternalTextComposition (cyclomatic 20) ios/EditorTextView+ExternalComposition.swift:19— EditorTextView.beginExternalTextComposition 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.
NativeCollaborationTransportRegistry.parseProtocolAdapterResponse (cyclomatic 20) ios/NativeCollaborationTransportRegistry.swift:435— NativeCollaborationTransportRegistry.parseProtocolAdapterResponse 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.
RichTextEditorView.settleTableSelectionAfterTextSync (cyclomatic 20) ios/RichTextEditorView.swift:355— RichTextEditorView.settleTableSelectionAfterTextSync has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RichTextEditorView.toggleTaskListMarker (cyclomatic 20) ios/RichTextEditorView.swift:1253— RichTextEditorView.toggleTaskListMarker 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.
atoms.defineAtomNode (cyclomatic 20) src/atoms.ts:260— atoms.defineAtomNode 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.
NativeEditorCreateJson.appendV2JsonString (cyclomatic 20) src/NativeEditorCreateJson.ts:513— NativeEditorCreateJson.appendV2JsonString 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.
CollaborationRuntime::process_admitted_message (cyclomatic 19) rust/editor-core/src/collaboration_runtime/protocol.rs:173— CollaborationRuntime::process_admitted_message has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EditorEditTextClipboardKt.handlePaste (cyclomatic 19) android/src/main/java/com/apollohg/editor/EditorEditTextClipboard.kt:179— EditorEditTextClipboardKt.handlePaste 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.
EditorEditTextRenderPatchKt.retainedBlockMetadata (cyclomatic 19) android/src/main/java/com/apollohg/editor/EditorEditTextRenderPatch.kt:90— EditorEditTextRenderPatchKt.retainedBlockMetadata 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.
EditorEditTextRenderingKt.applyRenderedSpannable (cyclomatic 19) android/src/main/java/com/apollohg/editor/EditorEditTextRendering.kt:47— EditorEditTextRenderingKt.applyRenderedSpannable 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.
EditorTextSurfaceInteraction.onTouchEvent (cyclomatic 19) android/src/main/java/com/apollohg/editor/EditorTextSurfaceInteraction.kt:107— EditorTextSurfaceInteraction.onTouchEvent 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.
EditorScrollView.onInterceptTouchEvent (cyclomatic 19) android/src/main/java/com/apollohg/editor/RichTextEditorView.kt:87— EditorScrollView.onInterceptTouchEvent 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.
EditorStyleSheet.applyText (cyclomatic 19) ios/EditorStyleSheet.swift:169— EditorStyleSheet.applyText 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.
EditorTextView.commitNativeTextMutationIfPossible (cyclomatic 19) ios/EditorTextView+NativeInputLifecycle.swift:291— EditorTextView.commitNativeTextMutationIfPossible 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.
EditorTextView.shouldPreserveAcceptedAutocorrectSpace (cyclomatic 19) ios/EditorTextView+NativeMutation.swift:220— EditorTextView.shouldPreserveAcceptedAutocorrectSpace 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.
RenderBridge.attributesForMarks (cyclomatic 19) ios/RenderBridge+Atoms.swift:16— RenderBridge.attributesForMarks 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.
ViewerTablePresentation.project (cyclomatic 19) ios/Tables/ViewerTableSurface.swift:1165— ViewerTablePresentation.project 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 3 function items inside it that branch (appendLayout::appendBlocks, appendLayout::appendInteraction, appendLayout::appendAccessibility). 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.
ViewerDocument.cellSupportsBackgroundPreparation (cyclomatic 19) ios/Viewer/ViewerDocument.swift:673— ViewerDocument.cellSupportsBackgroundPreparation 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.
EditorAddons.swift.resolveMentionQueryState (cyclomatic 19) ios/EditorAddons.swift:85— EditorAddons.swift.resolveMentionQueryState 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.
NativeEditorModule.swift.v2MutationResultDictionary (cyclomatic 19) ios/NativeEditorModule.swift:99— NativeEditorModule.swift.v2MutationResultDictionary 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.
EditorStyleSheetNormalization.normalizeStyle (cyclomatic 19) src/EditorStyleSheetNormalization.ts:225— EditorStyleSheetNormalization.normalizeStyle has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 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.
atoms.normalizedHtmlRules (cyclomatic 19) src/atoms.ts:184— atoms.normalizedHtmlRules 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.
schemaNormalization.normalizeNodeJSONProjection (cyclomatic 19) src/schemaNormalization.ts:204— schemaNormalization.normalizeNodeJSONProjection 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.
NativeEditorCreateJson.chargeV2JsonStringBytes (cyclomatic 19) src/NativeEditorCreateJson.ts:186— NativeEditorCreateJson.chargeV2JsonStringBytes 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.
EditorEditTextDeletionKt.handleBackspaceImpl (cyclomatic 18) android/src/main/java/com/apollohg/editor/EditorEditTextDeletion.kt:85— EditorEditTextDeletionKt.handleBackspaceImpl 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.
EditorInputSurroundingDeletionKt.performPlainSurroundingDelete (cyclomatic 18) android/src/main/java/com/apollohg/editor/EditorInputSurroundingDeletion.kt:84— EditorInputSurroundingDeletionKt.performPlainSurroundingDelete 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.
NativeEditorExpoViewUpdatesKt.applyEditorResetUpdateOutcome (cyclomatic 18) android/src/main/java/com/apollohg/editor/NativeEditorExpoViewUpdates.kt:16— NativeEditorExpoViewUpdatesKt.applyEditorResetUpdateOutcome 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.
EditorTableSurface.onDragTouch (cyclomatic 18) android/src/main/java/com/apollohg/editor/tables/EditorTableSurface.kt:1007— EditorTableSurface.onDragTouch 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.
PreparedProseViewerManager.createViewInstance (cyclomatic 18) android/src/main/java/com/apollohg/editor/viewer/PreparedProseViewerManager.kt:63— PreparedProseViewerManager.createViewInstance 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.
EditorTextView.trimmedAttributedPatch (cyclomatic 18) ios/EditorTextView+AttributedPatch.swift:238— EditorTextView.trimmedAttributedPatch 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.
EditorTextView.isAtTableCellArrowBoundary (cyclomatic 18) ios/EditorTextView+KeyboardInput.swift:338— EditorTextView.isAtTableCellArrowBoundary has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorTextView.applyTopLevelChildMetadataPatch (cyclomatic 18) ios/EditorTextView+RenderPatch.swift:379— EditorTextView.applyTopLevelChildMetadataPatch 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.
NativeCollaborationTransportRegistry.enqueue (cyclomatic 18) ios/NativeCollaborationTransportRegistry.swift:192— NativeCollaborationTransportRegistry.enqueue 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.
NativeEditorExpoView.applyEditorUpdateOutcome (cyclomatic 18) ios/NativeEditorExpoView+Updates.swift:151— NativeEditorExpoView.applyEditorUpdateOutcome 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.
RenderBridge.collapseStyledSiblingMargins (cyclomatic 18) ios/EditorStyleSheet.swift:477— RenderBridge.collapseStyledSiblingMargins 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.
EditorTableSurface.resolveTableCellDrop (cyclomatic 18) ios/Tables/EditorTableSurface+CellDragDrop.swift:144— EditorTableSurface.resolveTableCellDrop 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.
ViewerTableSurface.init (cyclomatic 18) ios/Tables/ViewerTableSurface.swift:348— ViewerTableSurface.init 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PreparedProseDrawingView.drawTableChromeBorders (cyclomatic 18) ios/Viewer/PreparedProseDrawingView.swift:1741— PreparedProseDrawingView.drawTableChromeBorders 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.
NativeEditorCollaborationTransport.serializeCollaborationProtocolAdapterResult (cyclomatic 18) src/NativeEditorCollaborationTransport.ts:296— NativeEditorCollaborationTransport.serializeCollaborationProtocolAdapterResult has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 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.
EditorAddonNormalization.normalizeEditorAddons (cyclomatic 18) src/EditorAddonNormalization.ts:16— EditorAddonNormalization.normalizeEditorAddons 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.
useRichTextEditorCommands.useRichTextEditorCommands.updateAtomAttrs (cyclomatic 18) src/useRichTextEditorCommands.tsx:84— useRichTextEditorCommands.useRichTextEditorCommands.updateAtomAttrs has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useRichTextEditorMentions.useRichTextEditorMentions.insertMentionSuggestion (cyclomatic 18) src/useRichTextEditorMentions.tsx:140— useRichTextEditorMentions.useRichTextEditorMentions.insertMentionSuggestion 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.
JsonValueMeter::admit_object (cyclomatic 17) rust/editor-core/src/boundary.rs:847— JsonValueMeter::admit_object 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.
ImportTextCaptureWork::observe (cyclomatic 17) rust/editor-core/src/yrs_engine/mutation/lowering/import_lookup.rs:114— ImportTextCaptureWork::observe 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.
EditorCaretOverlayView.canDrawSeparately (cyclomatic 17) android/src/main/java/com/apollohg/editor/EditorCaretOverlayView.kt:103— EditorCaretOverlayView.canDrawSeparately 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.
EditorEditTextRenderPatchKt.jsonValuesEqual (cyclomatic 17) android/src/main/java/com/apollohg/editor/EditorEditTextRenderPatch.kt:396— EditorEditTextRenderPatchKt.jsonValuesEqual 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.
RenderImageDecoder.decodeSvgLease (cyclomatic 17) android/src/main/java/com/apollohg/editor/RenderImageDecoder.kt:404— RenderImageDecoder.decodeSvgLease 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.
TableGridLayout.relayoutCells (cyclomatic 17) android/src/main/java/com/apollohg/editor/tables/TableGridLayout.kt:404— TableGridLayout.relayoutCells 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.
FallbackSelectionGeometryKt.fallbackSelectionRectsForGeometry (cyclomatic 17) android/src/main/java/com/apollohg/editor/viewer/FallbackSelectionGeometry.kt:304— FallbackSelectionGeometryKt.fallbackSelectionRectsForGeometry 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.
PreparedProseLayoutRegistry.measure (cyclomatic 17) android/src/main/java/com/apollohg/editor/viewer/PreparedProseLayoutRegistry.kt:162— PreparedProseLayoutRegistry.measure 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.
RemoteSelectionDecoration.from (cyclomatic 17) ios/EditorInteractionOverlays.swift:46— RemoteSelectionDecoration.from 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.
EditorTextView.applyRenderPatchIfPossible (cyclomatic 17) ios/EditorTextView+RenderPatch.swift:534— EditorTextView.applyRenderPatchIfPossible 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.
EditorTextView.currentLogicalScalarSelection (cyclomatic 17) ios/EditorTextView+Selection.swift:430— EditorTextView.currentLogicalScalarSelection 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.
NativeCollaborationTransport.normalizeDirective (cyclomatic 17) ios/NativeCollaborationTransport+Validation.swift:4— NativeCollaborationTransport.normalizeDirective 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.
NativeEditorExpoView.setEditorId (cyclomatic 17) ios/NativeEditorExpoView+Binding.swift:34— NativeEditorExpoView.setEditorId 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.
NativeToolbarIcon.from (cyclomatic 17) ios/NativeToolbar+Models.swift:240— NativeToolbarIcon.from 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.
RenderBridge.inputElements (cyclomatic 17) ios/RenderBridge.swift:184— RenderBridge.inputElements has cyclomatic complexity 17 (threshold 15). Of this number, 16 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.
RenderBridge.closeStyledBlock (cyclomatic 17) ios/EditorStyleSheet.swift:436— RenderBridge.closeStyledBlock 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.
RenderBridge.applyBlockStyle (cyclomatic 17) ios/RenderBridge+Style.swift:204— RenderBridge.applyBlockStyle 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.
CoreTextProseLayoutEngine.makeCellPreparation (cyclomatic 17) ios/Viewer/CoreTextProseLayoutEngine.swift:228— CoreTextProseLayoutEngine.makeCellPreparation 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.
PreparedProseLayoutRegistry.preparedDocument (cyclomatic 17) ios/Viewer/PreparedProseLayoutRegistry+Artifacts.swift:89— PreparedProseLayoutRegistry.preparedDocument 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.
NativeEditorCollaborationTransport.decodeNativeCollaborationProtocolBytes (cyclomatic 17) src/NativeEditorCollaborationTransport.ts:412— NativeEditorCollaborationTransport.decodeNativeCollaborationProtocolBytes 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.
useViewerAtoms.useViewerAtoms.updateAttrs (cyclomatic 17) src/useViewerAtoms.tsx:412— useViewerAtoms.useViewerAtoms.updateAttrs has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (execute, clean). 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. This is NOT this file's highest cyclomatic complexity: useViewerAtoms.useViewerAtoms.measure (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
TableNormalization.normalizeNativeTableSelectionGeometry (cyclomatic 17) src/TableNormalization.ts:298— TableNormalization.normalizeNativeTableSelectionGeometry 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.
YjsCollaboration.peersToRemoteSelections (cyclomatic 17) src/YjsCollaboration.ts:193— YjsCollaboration.peersToRemoteSelections 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 196). 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.
AttrSpec::validate_definition (cyclomatic 16) rust/editor-core/src/schema/mod.rs:305— AttrSpec::validate_definition 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.
TableRenderContext::retain_cells (cyclomatic 16) rust/editor-core/src/tables/render.rs:580— TableRenderContext::retain_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.
DerivedStateCache::after_document_change (cyclomatic 16) rust/editor-core/src/yrs_engine/derived_state.rs:762— DerivedStateCache::after_document_change 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.
PreflightReader::read_content (cyclomatic 16) rust/editor-core/src/yrs_engine/update_preflight.rs:91— PreflightReader::read_content has cyclomatic complexity 16 (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.
EditorEditTextDeletionKt.handleDeleteImpl (cyclomatic 16) android/src/main/java/com/apollohg/editor/EditorEditTextDeletion.kt:17— EditorEditTextDeletionKt.handleDeleteImpl 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.
EditorEditTextExternalCompositionKt.finishExternalTextComposition (cyclomatic 16) android/src/main/java/com/apollohg/editor/EditorEditTextExternalComposition.kt:178— EditorEditTextExternalCompositionKt.finishExternalTextComposition 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.
EditorEditTextSelectionKt.applySelectionFromJSON (cyclomatic 16) android/src/main/java/com/apollohg/editor/EditorEditTextSelection.kt:298— EditorEditTextSelectionKt.applySelectionFromJSON 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.
EditorV2AdapterRenderingKt.adopt (cyclomatic 16) android/src/main/java/com/apollohg/editor/EditorV2AdapterRendering.kt:67— EditorV2AdapterRenderingKt.adopt 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.
NativeCollaborationTransportRegistry.parseProtocolAdapterResponse (cyclomatic 16) android/src/main/java/com/apollohg/editor/NativeCollaborationTransportRegistry.kt:427— NativeCollaborationTransportRegistry.parseProtocolAdapterResponse 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.
RenderImageDecoder.preflightDataUrl (cyclomatic 16) android/src/main/java/com/apollohg/editor/RenderImageDecoder.kt:162— RenderImageDecoder.preflightDataUrl 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.
EditorTableSurface.reconcileActiveCell (cyclomatic 16) android/src/main/java/com/apollohg/editor/tables/EditorTableSurface.kt:2402— EditorTableSurface.reconcileActiveCell 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.
PreparedProseDrawingView.install (cyclomatic 16) android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:400— PreparedProseDrawingView.install 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.
RemoteSelectionOverlayView.refresh (cyclomatic 16) ios/EditorInteractionOverlays.swift:181— RemoteSelectionOverlayView.refresh 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.
EditorLayoutManager.layoutManager (cyclomatic 16) ios/EditorLayoutManager.swift:72— EditorLayoutManager.layoutManager 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.
EditorClipboardPaste.command (cyclomatic 16) ios/EditorTextView+KeyboardInput.swift:137— EditorClipboardPaste.command 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.
EditorTextView.scheduleCodeHighlighting (cyclomatic 16) ios/EditorCodeHighlighting.swift:140— EditorTextView.scheduleCodeHighlighting has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
EditorTheme.init (cyclomatic 16) ios/EditorTheme.swift:452— EditorTheme.init has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorV2Adapter.parseTableAttributes (cyclomatic 16) ios/EditorV2Adapter+RenderValidation.swift:258— EditorV2Adapter.parseTableAttributes 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.
EditorV2Adapter.scalarSelection (cyclomatic 16) ios/EditorV2Adapter+RenderValidation.swift:355— EditorV2Adapter.scalarSelection has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
NativeCollaborationTransport.receiveNext (cyclomatic 16) ios/NativeCollaborationTransport+Socket.swift:142— NativeCollaborationTransport.receiveNext 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.
NativeEditorExpoView.insertMentionSuggestion (cyclomatic 16) ios/NativeEditorExpoView+MentionRetry.swift:20— NativeEditorExpoView.insertMentionSuggestion 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.
BlockImageAttachment.attachmentBounds (cyclomatic 16) ios/RenderBridge+Attachments.swift:134— BlockImageAttachment.attachmentBounds 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.
RichTextEditorView.bindTableCell (cyclomatic 16) ios/RichTextEditorView.swift:291— RichTextEditorView.bindTableCell 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.
RichTextEditorView.surroundingProseScalar (cyclomatic 16) ios/RichTextEditorView.swift:601— RichTextEditorView.surroundingProseScalar 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.
EditorTableIndex.validate (cyclomatic 16) ios/Tables/EditorTableIndex.swift:300— EditorTableIndex.validate 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.
EditorTableSurface.remoteTextInput (cyclomatic 16) ios/Tables/EditorTableSurface.swift:459— EditorTableSurface.remoteTextInput 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.
EditorTableSurface.cellEditMenuActions (cyclomatic 16) ios/Tables/EditorTableSurface.swift:743— EditorTableSurface.cellEditMenuActions 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.
EditorTableSurface.retargetHandleDrag (cyclomatic 16) ios/Tables/EditorTableSurface.swift:1356— EditorTableSurface.retargetHandleDrag 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.
CoreTextProseLayoutEngine.strikeFragments (cyclomatic 16) ios/Viewer/CoreTextProseLayoutEngine+AttributedText.swift:324— CoreTextProseLayoutEngine.strikeFragments 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.
PreparedProseDrawingView.boundCellChrome (cyclomatic 16) ios/Viewer/PreparedProseDrawingView.swift:1497— PreparedProseDrawingView.boundCellChrome 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.
PreparedProseDrawingView.drawForeground (cyclomatic 16) ios/Viewer/PreparedProseDrawingView.swift:1858— PreparedProseDrawingView.drawForeground 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.
PreparedProseLayoutCache.acquireForFabricMount (cyclomatic 16) ios/Viewer/PreparedProseLayoutCache.swift:190— PreparedProseLayoutCache.acquireForFabricMount 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.
PreparedProseLayoutCache.contribution (cyclomatic 16) ios/Viewer/PreparedProseLayoutCache.swift:798— PreparedProseLayoutCache.contribution 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.
attributeValidation.validateAttribute (cyclomatic 16) src/attributeValidation.ts:67— attributeValidation.validateAttribute 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.
schemaNormalization.isSafeHtmlAttr (cyclomatic 16) src/schemaNormalization.ts:149— schemaNormalization.isSafeHtmlAttr has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ManagedExternalTextCompositionSession.commit (cyclomatic 16) src/ExternalTextComposition.ts:338— ManagedExternalTextCompositionSession.commit 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.
useViewerAtoms.useViewerAtoms.children (cyclomatic 16) src/useViewerAtoms.tsx:580— useViewerAtoms.useViewerAtoms.children has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: useViewerAtoms.useViewerAtoms.measure (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
NativeProseViewer.RichTextViewer (cyclomatic 16) src/NativeProseViewer.tsx:191— NativeProseViewer.RichTextViewer has cyclomatic complexity 16 (threshold 15). Of this number, 9 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.
RichTextEditorSerialization.parseSelectionFromUpdate (cyclomatic 16) src/RichTextEditorSerialization.tsx:130— RichTextEditorSerialization.parseSelectionFromUpdate 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.
RenderBridgeElementsKt.appendElements (cognitive 207) android/src/main/java/com/apollohg/editor/RenderBridgeElements.kt:10— RenderBridgeElementsKt.appendElements has cognitive complexity 207 (threshold 15). Drivers by points: if/else 60 (182 pts), boolean chains 19, match/switch 2 (5 pts), loops 1 (nesting depth added 125). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenderBridge.renderElements (cognitive 157) ios/RenderBridge.swift:260— RenderBridge.renderElements has cognitive complexity 157 (threshold 15). Drivers by points: if/else 41 (117 pts), boolean chains 20, ternaries 4 (17 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 90). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextProseLayoutEngine.makePreparation (cognitive 133) ios/Viewer/CoreTextProseLayoutEngine.swift:399— CoreTextProseLayoutEngine.makePreparation has cognitive complexity 133 (threshold 15). Drivers by points: if/else 28 (61 pts), ternaries 17 (44 pts), boolean chains 15, loops 5 (13 pts) (nesting depth added 68). Of this number, 124 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StaticLayoutAndroidProseLayoutEngine.prepareLayout (cognitive 128) android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:499— StaticLayoutAndroidProseLayoutEngine.prepareLayout has cognitive complexity 128 (threshold 15). Drivers by points: if/else 77 (110 pts), boolean chains 16, loops 1 (2 pts) (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.
EditorTableIndex.stage (cognitive 123) ios/Tables/EditorTableIndex.swift:58— EditorTableIndex.stage has cognitive complexity 123 (threshold 15). Drivers by points: if/else 31 (76 pts), loops 19 (30 pts), boolean chains 13, ternaries 4 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextProseLayoutEngine.prepareBlock (cognitive 121) ios/Viewer/CoreTextProseLayoutEngine.swift:1238— CoreTextProseLayoutEngine.prepareBlock has cognitive complexity 121 (threshold 15). Drivers by points: if/else 34 (59 pts), ternaries 20 (35 pts), boolean chains 16, loops 4 (8 pts), match/switch 2 (3 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useEditorToolbarItems.useEditorToolbarItems (cognitive 109) src/useEditorToolbarItems.tsx:12— useEditorToolbarItems.useEditorToolbarItems has cognitive complexity 109 (threshold 15). Drivers by points: ternaries 16 (59 pts), if/else 12 (23 pts), boolean chains 12, match/switch 6 (10 pts), loops 2 (5 pts) (nesting depth added 61). None of this is in the body itself: all 109 points belong to 6 function literals inside it that branch (lines 192, 352, 89, …). 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.
ViewerDocument.lowerElements (cognitive 84) ios/Viewer/ViewerDocument.swift:435— ViewerDocument.lowerElements has cognitive complexity 84 (threshold 15). Drivers by points: if/else 20 (45 pts), ternaries 8 (22 pts), boolean chains 11, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 41). Of this number, 74 points are the body's own statements and 10 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.
RichTextEditorView.moveFromActiveTableCell (cognitive 81) ios/RichTextEditorView.swift:468— RichTextEditorView.moveFromActiveTableCell has cognitive complexity 81 (threshold 15). Drivers by points: boolean chains 48, if/else 13 (24 pts), match/switch 3 (5 pts), ternaries 2 (4 pts) (nesting depth added 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.
NativeEditorCreateJson.normalizeV2JsonValue (cognitive 80) src/NativeEditorCreateJson.ts:226— NativeEditorCreateJson.normalizeV2JsonValue has cognitive complexity 80 (threshold 15). Drivers by points: if/else 29 (70 pts), boolean chains 6, ternaries 1 (3 pts), loops 1 (nesting depth added 43). Of this number, 78 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.
EditorTextView.applyUpdateJSON (cognitive 77) ios/EditorTextView+Rendering.swift:331— EditorTextView.applyUpdateJSON has cognitive complexity 77 (threshold 15). Drivers by points: if/else 42 (50 pts), boolean chains 25, ternaries 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ViewerDocument.validTables (cognitive 77) ios/Viewer/ViewerDocument.swift:792— ViewerDocument.validTables has cognitive complexity 77 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 28, loops 8 (18 pts) (nesting depth added 28). Of this number, 66 points are the body's own statements and 11 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.
useRichTextEditorPresentation.useRichTextEditorPresentation (cognitive 76) src/useRichTextEditorPresentation.tsx:50— useRichTextEditorPresentation.useRichTextEditorPresentation has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 24 (35 pts), boolean chains 20, if/else 15 (17 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 14). Of this number, 44 points are the body's own statements and 32 belong to 14 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.
schemaNormalization.normalizeSchemaDefinition (cognitive 67) src/schemaNormalization.ts:352— schemaNormalization.normalizeSchemaDefinition has cognitive complexity 67 (threshold 15). Drivers by points: ternaries 17 (34 pts), if/else 7 (16 pts), boolean chains 10, loops 4 (5 pts), match/switch 2 (nesting depth added 27). Of this number, 65 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenderImageDecoder.isSelfContainedSvg (cognitive 57) android/src/main/java/com/apollohg/editor/RenderImageDecoder.kt:476— RenderImageDecoder.isSelfContainedSvg has cognitive complexity 57 (threshold 15). Drivers by points: if/else 15 (40 pts), boolean chains 10, loops 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
schemaDefinition.defineSchema (cognitive 56) src/schemaDefinition.ts:343— schemaDefinition.defineSchema has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 15 (26 pts), if/else 7 (18 pts), loops 3 (8 pts), boolean chains 4 (nesting depth added 27). Of this number, 49 points are the body's own statements and 7 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.
EditorEditTextRustCommandsKt.insertPlainTextRangeInRust (cognitive 55) android/src/main/java/com/apollohg/editor/EditorEditTextRustCommands.kt:84— EditorEditTextRustCommandsKt.insertPlainTextRangeInRust has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (37 pts), boolean chains 6, error handling 1 (5 pts), match/switch 1 (4 pts), loops 1 (3 pts) (nesting depth added 31). 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.
EditorTableIndex.stage (cognitive 54) android/src/main/java/com/apollohg/editor/tables/EditorTableIndex.kt:75— EditorTableIndex.stage has cognitive complexity 54 (threshold 15). Drivers by points: if/else 37 (45 pts), boolean chains 7, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TableInteractionController.onTouch (cognitive 54) android/src/main/java/com/apollohg/editor/tables/TableInteractionController.kt:80— TableInteractionController.onTouch has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (51 pts), boolean chains 2, match/switch 1 (nesting depth added 33). 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.
schemaResolution.resolveDocumentSchema (cognitive 54) src/schemaResolution.ts:127— schemaResolution.resolveDocumentSchema has cognitive complexity 54 (threshold 15). Drivers by points: if/else 24 (36 pts), loops 8 (10 pts), boolean chains 7, error handling 1 (nesting depth added 14). Of this number, 51 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ViewerDocumentKt.validViewerTables (cognitive 53) android/src/main/java/com/apollohg/editor/viewer/ViewerDocument.kt:168— ViewerDocumentKt.validViewerTables has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 7 (13 pts), boolean chains 9 (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.
EditorTextSurfaceInteraction.performAccessibilityAction (cognitive 52) android/src/main/java/com/apollohg/editor/EditorTextSurfaceInteraction.kt:610— EditorTextSurfaceInteraction.performAccessibilityAction has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (42 pts), loops 1 (4 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 26). 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.
EditorTextView.applySelectionFromJSON (cognitive 52) ios/EditorTextView+Selection.swift:602— EditorTextView.applySelectionFromJSON has cognitive complexity 52 (threshold 15). Drivers by points: if/else 22 (46 pts), boolean chains 5, match/switch 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
schemaDocumentConstruction.constructDefaultEmptyDocument (cognitive 52) src/schemaDocumentConstruction.ts:11— schemaDocumentConstruction.constructDefaultEmptyDocument has cognitive complexity 52 (threshold 15). Drivers by points: if/else 24 (35 pts), boolean chains 8, loops 6 (8 pts), ternaries 1 (nesting depth added 13). Of this number, 25 points are the body's own statements and 27 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeEditorCreateJson.serializeV2CreateEnvelope (cognitive 51) src/NativeEditorCreateJson.ts:590— NativeEditorCreateJson.serializeV2CreateEnvelope has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (43 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useNativeEditor.useNativeEditorDocument.refresh (cognitive 51) src/useNativeEditor.ts:217— useNativeEditor.useNativeEditorDocument.refresh has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (41 pts), boolean chains 10 (nesting depth added 21). Of this number, 50 points are the body's own statements and 1 belongs to one function item 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.
EditorTextSurfaceInteraction.onKeyDown (cognitive 50) android/src/main/java/com/apollohg/editor/EditorTextSurfaceInteraction.kt:485— EditorTextSurfaceInteraction.onKeyDown has cognitive complexity 50 (threshold 15). Drivers by points: if/else 28 (44 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorTableSurface.moveFromActiveCellByArrow (cognitive 50) android/src/main/java/com/apollohg/editor/tables/EditorTableSurface.kt:2111— EditorTableSurface.moveFromActiveCellByArrow has cognitive complexity 50 (threshold 15). Drivers by points: if/else 29 (38 pts), boolean chains 12 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
EditorAccessoryToolbarView.apply (cognitive 50) ios/NativeToolbar.swift:195— EditorAccessoryToolbarView.apply has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 14 (16 pts), boolean chains 15, loops 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.
CoreTextProseLayoutEngine.makeAttributedString (cognitive 50) ios/Viewer/CoreTextProseLayoutEngine+AttributedText.swift:48— CoreTextProseLayoutEngine.makeAttributedString has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 12, ternaries 3 (9 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 18). Of this number, 45 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextProseLayoutEngine.attributes (cognitive 49) ios/Viewer/CoreTextProseLayoutEngine+AttributedText.swift:209— CoreTextProseLayoutEngine.attributes has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 5, match/switch 2 (5 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorStyleSheetKt.overlaidWith (cognitive 48) android/src/main/java/com/apollohg/editor/EditorStyleSheet.kt:352— EditorStyleSheetKt.overlaidWith has cognitive complexity 48 (threshold 15). Drivers by points: if/else 46 (48 pts) (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.
NativeToolbarItem.parse (cognitive 48) ios/NativeToolbar+Models.swift:348— NativeToolbarItem.parse has cognitive complexity 48 (threshold 15). Drivers by points: boolean chains 24, if/else 12 (23 pts), match/switch 1 (nesting depth added 11). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PreparedProseDrawingView.updateTableLayers (cognitive 47) ios/Viewer/PreparedProseDrawingView.swift:1524— PreparedProseDrawingView.updateTableLayers has cognitive complexity 47 (threshold 15). Drivers by points: boolean chains 30, if/else 10 (13 pts), loops 3 (4 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PreparedProseDrawingView.drawTableChromeBorders (cognitive 47) ios/Viewer/PreparedProseDrawingView.swift:1741— PreparedProseDrawingView.drawTableChromeBorders has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 6 (24 pts), if/else 4 (13 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeTransactionBridge::submit_native_intent (cognitive 46) rust/editor-core/src/native_transaction_bridge.rs:83— NativeTransactionBridge::submit_native_intent has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 7 (16 pts), boolean chains 3 (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.
EditorTextView.applyAttributedRender (cognitive 46) ios/EditorTextView+Rendering.swift:155— EditorTextView.applyAttributedRender has cognitive complexity 46 (threshold 15). Drivers by points: if/else 22 (35 pts), boolean chains 8, ternaries 1 (2 pts), match/switch 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.
EditorTableSurface.stepDragFrame (cognitive 46) ios/Tables/EditorTableSurface.swift:1413— EditorTableSurface.stepDragFrame has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 11, ternaries 4 (10 pts), match/switch 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.
CoreTextProseLayoutEngine.makeBinding (cognitive 46) ios/Viewer/CoreTextProseLayoutEngine.swift:808— CoreTextProseLayoutEngine.makeBinding has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 10, loops 3 (5 pts) (nesting depth added 17). Of this number, 29 points are the body's own statements and 17 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.
EditorTextView.deleteBackward (cognitive 45) ios/EditorTextView.swift:733— EditorTextView.deleteBackward has cognitive complexity 45 (threshold 15). Drivers by points: if/else 25 (39 pts), boolean chains 6 (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.
PreparedProseDrawingView.drawTableChromeBorders (cognitive 44) android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:1357— PreparedProseDrawingView.drawTableChromeBorders has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 3 (6 pts), boolean chains 1 (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.
StaticLayoutAndroidProseLayoutEngine.prepareBlock (cognitive 43) android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:1758— StaticLayoutAndroidProseLayoutEngine.prepareBlock has cognitive complexity 43 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 9, match/switch 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.
RenderImageLoadOwner.decodedDataURLByteCount (cognitive 43) ios/SharedNativeImagePipeline.swift:448— RenderImageLoadOwner.decodedDataURLByteCount has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 13, ternaries 4 (5 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreparedProseDrawingView.hitResizeEdge (cognitive 43) ios/Viewer/PreparedProseDrawingView.swift:604— PreparedProseDrawingView.hitResizeEdge has cognitive complexity 43 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 16, ternaries 2 (6 pts), 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.
EditorEditTextUpdatesKt.applyUpdateJSONImpl (cognitive 42) android/src/main/java/com/apollohg/editor/EditorEditTextUpdates.kt:76— EditorEditTextUpdatesKt.applyUpdateJSONImpl has cognitive complexity 42 (threshold 15). Drivers by points: if/else 29 (31 pts), boolean chains 10, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TableGridLayout.relayout (cognitive 42) ios/Tables/TableGridLayout.swift:165— TableGridLayout.relayout has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 10, ternaries 3 (5 pts), loops 4 (nesting depth added 11). Of this number, 38 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useEditorToolbarPresentation.useEditorToolbarPresentation (cognitive 41) src/useEditorToolbarPresentation.tsx:20— useEditorToolbarPresentation.useEditorToolbarPresentation has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 23 (29 pts), boolean chains 7, if/else 4 (5 pts) (nesting depth added 7). Of this number, 20 points are the body's own statements and 21 belong to 7 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.
PreparedProseDrawingView.drawTableNodes (cognitive 40) android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:1137— PreparedProseDrawingView.drawTableNodes has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 12, loops 3 (6 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.
EditorV2Adapter.isValidMentionStyle (cognitive 40) ios/EditorV2Adapter+RenderValidation.swift:158— EditorV2Adapter.isValidMentionStyle has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 4, loops 3, match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorV2Adapter.isValidRenderElement (cognitive 40) ios/EditorV2Adapter+RenderValidation.swift:187— EditorV2Adapter.isValidRenderElement has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 21, if/else 10 (18 pts), match/switch 1 (nesting depth added 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.
EditorV2Adapter.commitNativeTextMutation (cognitive 40) ios/EditorV2Adapter+TextCommands.swift:4— EditorV2Adapter.commitNativeTextMutation has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 3, 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.
PreparedProseLayoutRegistry.measure (cognitive 40) ios/Viewer/PreparedProseLayoutRegistry.swift:222— PreparedProseLayoutRegistry.measure has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 7, error handling 5 (7 pts), 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.
EditorTextView.refreshRetainedPositionalMetadata (cognitive 39) ios/EditorTextView+RenderPatch.swift:162— EditorTextView.refreshRetainedPositionalMetadata has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 12, loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextProseLayoutEngine.listPlacement (cognitive 38) ios/Viewer/CoreTextProseLayoutEngine.swift:1170— CoreTextProseLayoutEngine.listPlacement has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 14 (23 pts), if/else 8 (9 pts), boolean chains 3, loops 1 (2 pts), match/switch 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.
NativeEditorResultNormalization.normalizeNativeEditorV2PeersValue (cognitive 38) src/NativeEditorResultNormalization.ts:487— NativeEditorResultNormalization.normalizeNativeEditorV2PeersValue has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 7, ternaries 3 (5 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.
RenderBridgeInlineAndAtomsKt.appendStyledText (cognitive 37) android/src/main/java/com/apollohg/editor/RenderBridgeInlineAndAtoms.kt:34— RenderBridgeInlineAndAtomsKt.appendStyledText has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 10, match/switch 3 (6 pts), loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
EditorTableSurface.refreshPresentation (cognitive 37) android/src/main/java/com/apollohg/editor/tables/EditorTableSurface.kt:1396— EditorTableSurface.refreshPresentation has cognitive complexity 37 (threshold 15). Drivers by points: if/else 22 (27 pts), boolean chains 9, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
EditorTextView.textViewDidChangeSelection (cognitive 36) ios/EditorTextView+Selection.swift:184— EditorTextView.textViewDidChangeSelection has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 16 (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.
EditorStyleSheetNormalization.normalizeEditorTheme (cognitive 36) src/EditorStyleSheetNormalization.ts:372— EditorStyleSheetNormalization.normalizeEditorTheme has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (32 pts), boolean chains 3, 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.
RichTextEditorView.moveFromActiveTableCell (cognitive 35) ios/RichTextEditorView.swift:407— RichTextEditorView.moveFromActiveTableCell has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 27, if/else 7, 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.
contentExpression.minimalContentMatch (cognitive 35) src/contentExpression.ts:414— contentExpression.minimalContentMatch has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 6 (14 pts), boolean chains 1, error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorV2AdapterMutationsKt.performNativeIntent (cognitive 34) android/src/main/java/com/apollohg/editor/EditorV2AdapterMutations.kt:57— EditorV2AdapterMutationsKt.performNativeIntent has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (25 pts), match/switch 3 (5 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeEditorExpoViewBindingKt.setEditorIdImpl (cognitive 34) android/src/main/java/com/apollohg/editor/NativeEditorExpoViewBinding.kt:20— NativeEditorExpoViewBindingKt.setEditorIdImpl has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 6 (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.
RenderBridge.inputElements (cognitive 34) ios/RenderBridge.swift:184— RenderBridge.inputElements has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 2 (8 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 21). Of this number, 33 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.
ViewerImagePipeline.updateVisibleRect (cognitive 34) ios/Viewer/ViewerImagePipeline.swift:426— ViewerImagePipeline.updateVisibleRect has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 13, 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.
useNativeEditor.useNativeEditorDocument (cognitive 34) src/useNativeEditor.ts:108— useNativeEditor.useNativeEditorDocument has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 7, ternaries 3, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 6 of the 34 points are its own statements and the rest belongs to one function literal inside it that branches (line 380). 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.
ImportTextCaptureWork::observe (cognitive 33) rust/editor-core/src/yrs_engine/mutation/lowering/import_lookup.rs:114— ImportTextCaptureWork::observe has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 3 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorV2Adapter.adopt (cognitive 33) ios/EditorV2Adapter+RenderState.swift:69— EditorV2Adapter.adopt has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 17, if/else 14 (15 pts), ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RenderBridge.paragraphStyleForBlock (cognitive 33) ios/RenderBridge+Style.swift:22— RenderBridge.paragraphStyleForBlock has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 8 (19 pts), if/else 8 (9 pts), match/switch 2 (3 pts), 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.
NativeEditorCollaborationTransport.normalizeNativeCollaborationTransportEvent (cognitive 33) src/NativeEditorCollaborationTransport.ts:457— NativeEditorCollaborationTransport.normalizeNativeCollaborationTransportEvent has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 7, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorTableCellProjection.project (cognitive 32) android/src/main/java/com/apollohg/editor/tables/EditorTableCellProjection.kt:29— EditorTableCellProjection.project has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 8, 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.
NativeEditorCreateConfig.buildV2CreateRequestUnchecked (cognitive 32) src/NativeEditorCreateConfig.ts:137— NativeEditorCreateConfig.buildV2CreateRequestUnchecked has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 2, loops 1 (2 pts), ternaries 2, 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.
useRichTextEditorState.useRichTextEditorState (cognitive 32) src/useRichTextEditorState.tsx:43— useRichTextEditorState.useRichTextEditorState has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 10, ternaries 2 (3 pts) (nesting depth added 2). Most of this is not in the body itself: 14 of the 32 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 224, 241, 271, …). 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.
ViewerDocumentKt.lowerElements (cognitive 31) android/src/main/java/com/apollohg/editor/viewer/ViewerDocument.kt:392— ViewerDocumentKt.lowerElements has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 6, match/switch 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.
EditorV2Adapter.submitNativeIntentRecoveringStaleEpoch (cognitive 31) ios/EditorV2Adapter+Mutation.swift:106— EditorV2Adapter.submitNativeIntentRecoveringStaleEpoch has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 3 (8 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeCollaborationTransportRegistry.parseProtocolAdapterConfig (cognitive 31) ios/NativeCollaborationTransportRegistry.swift:365— NativeCollaborationTransportRegistry.parseProtocolAdapterConfig has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 14, 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.
EditorCellSelection.resolve (cognitive 31) ios/Tables/EditorCellSelection.swift:40— EditorCellSelection.resolve has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 8, 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.
PreparedProseDrawingView.drawHierarchicalBackgrounds (cognitive 31) ios/Viewer/PreparedProseDrawingView.swift:1685— PreparedProseDrawingView.drawHierarchicalBackgrounds has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (8 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
schemaResolution.admitSchemaCollections (cognitive 31) src/schemaResolution.ts:34— schemaResolution.admitSchemaCollections has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 6, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorEditTextRenderPatchKt.retainedBlockMetadata (cognitive 30) android/src/main/java/com/apollohg/editor/EditorEditTextRenderPatch.kt:90— EditorEditTextRenderPatchKt.retainedBlockMetadata has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 6, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorTextSurfaceInteraction.onTouchEvent (cognitive 30) android/src/main/java/com/apollohg/editor/EditorTextSurfaceInteraction.kt:107— EditorTextSurfaceInteraction.onTouchEvent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 5, match/switch 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.
PreparedProseLayoutCache.value (cognitive 30) ios/Viewer/PreparedProseLayoutCache.swift:92— PreparedProseLayoutCache.value has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 10, 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.
EditorAddonNormalization.normalizeEditorAddons (cognitive 30) src/EditorAddonNormalization.ts:16— EditorAddonNormalization.normalizeEditorAddons has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 2 (4 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.
JsonValueMeter::admit_object (cognitive 29) rust/editor-core/src/boundary.rs:847— JsonValueMeter::admit_object has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AwarenessCodec::admit_update (cognitive 29) rust/editor-core/src/yrs_engine/awareness.rs:415— AwarenessCodec::admit_update has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, loops 4, match/switch 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.
EditorEditTextRenderPatchKt.renderBlockVisuallyEquals (cognitive 29) android/src/main/java/com/apollohg/editor/EditorEditTextRenderPatch.kt:21— EditorEditTextRenderPatchKt.renderBlockVisuallyEquals has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (24 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.
EditorTextView.nativeTextMutationWithCurrentSelection (cognitive 29) ios/EditorTextView+NativeMutation.swift:261— EditorTextView.nativeTextMutationWithCurrentSelection has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 15, if/else 9, ternaries 5. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PreparedProseDrawingView.selectionHandles (cognitive 29) ios/Viewer/PreparedProseDrawingView.swift:483— PreparedProseDrawingView.selectionHandles has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 13, ternaries 12, if/else 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PreparedProseDrawingView.paint (cognitive 29) ios/Viewer/PreparedProseDrawingView.swift:1341— PreparedProseDrawingView.paint has cognitive complexity 29 (threshold 15). Drivers by points: loops 9 (12 pts), boolean chains 9, if/else 5 (7 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorStyleSheetNormalization.normalizeStyle (cognitive 29) src/EditorStyleSheetNormalization.ts:225— EditorStyleSheetNormalization.normalizeStyle has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 6 (8 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 11). Of this number, 19 points are the body's own statements and 10 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.
EditorEditTextRenderingKt.applyRenderedSpannable (cognitive 28) android/src/main/java/com/apollohg/editor/EditorEditTextRendering.kt:47— EditorEditTextRenderingKt.applyRenderedSpannable has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 7 (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.
ViewerTableSurface.replacingCells (cognitive 28) android/src/main/java/com/apollohg/editor/tables/ViewerTableSurface.kt:365— ViewerTableSurface.replacingCells has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 10 (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.
NativeEditorRenderNormalization.normalizeRenderSelection (cognitive 28) src/NativeEditorRenderNormalization.ts:239— NativeEditorRenderNormalization.normalizeRenderSelection has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useRichTextEditorUpdates.useRichTextEditorUpdates (cognitive 28) src/useRichTextEditorUpdates.tsx:25— useRichTextEditorUpdates.useRichTextEditorUpdates has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 10, error handling 2, ternaries 1 (nesting depth added 3). None of this is in the body itself: all 28 points belong to 5 function literals inside it that branch (lines 577, 509, 309, …). 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.
CollaborationRuntime::process_admitted_message (cognitive 27) rust/editor-core/src/collaboration_runtime/protocol.rs:173— CollaborationRuntime::process_admitted_message has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 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.
NativeEditorExpoViewToolbarKt.handleToolbarItemPress (cognitive 27) android/src/main/java/com/apollohg/editor/NativeEditorExpoViewToolbar.kt:210— NativeEditorExpoViewToolbarKt.handleToolbarItemPress has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 3 (4 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.
TableGridLayout.relayoutCells (cognitive 27) android/src/main/java/com/apollohg/editor/tables/TableGridLayout.kt:404— TableGridLayout.relayoutCells has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 3, 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.
StaticLayoutAndroidProseLayoutEngine.bindCellShape (cognitive 27) android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:1446— StaticLayoutAndroidProseLayoutEngine.bindCellShape has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ViewerImagePipeline.updateVisibleRect (cognitive 27) android/src/main/java/com/apollohg/editor/viewer/ViewerImagePipeline.kt:363— ViewerImagePipeline.updateVisibleRect has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19 (20 pts), boolean chains 7 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorClipboardPaste.semanticHTML (cognitive 27) ios/EditorTextView+KeyboardInput.swift:185— EditorClipboardPaste.semanticHTML has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 5 (8 pts), boolean chains 7, 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.
NativeEditorExpoView.setEditorId (cognitive 27) ios/NativeEditorExpoView+Binding.swift:34— NativeEditorExpoView.setEditorId has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (25 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.
RenderBridge.collapseStyledSiblingMargins (cognitive 27) ios/EditorStyleSheet.swift:477— RenderBridge.collapseStyledSiblingMargins has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 5 (6 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.
RenderImageLoadOwner.startLocked (cognitive 27) ios/SharedNativeImagePipeline.swift:199— RenderImageLoadOwner.startLocked has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 7, ternaries 1 (2 pts), match/switch 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.
EditorTableIndex.entry (cognitive 27) ios/Tables/EditorTableIndex.swift:234— EditorTableIndex.entry has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 12, if/else 5 (9 pts), loops 4 (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.
EditorTableSurface.prepareEntries (cognitive 27) ios/Tables/EditorTableSurface.swift:1533— EditorTableSurface.prepareEntries has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 14, if/else 11 (13 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ViewerTableSurface.init (cognitive 27) ios/Tables/ViewerTableSurface.swift:348— ViewerTableSurface.init has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 7). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
attributeValidation.validateAttributeSpec (cognitive 27) src/attributeValidation.ts:96— attributeValidation.validateAttributeSpec has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 11, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatchBuilder::into_edits (cognitive 26) rust/editor-core/src/yrs_engine/commands/structural_batch.rs:400— BatchBuilder::into_edits has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (5 pts), match/switch 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DerivedStateCache::after_document_change (cognitive 26) rust/editor-core/src/yrs_engine/derived_state.rs:762— DerivedStateCache::after_document_change has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
EditorEditText.dispatchKeyEvent (cognitive 26) android/src/main/java/com/apollohg/editor/EditorEditText.kt:419— EditorEditText.dispatchKeyEvent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 10 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorEditTextRenderPatchKt.jsonValuesEqual (cognitive 26) android/src/main/java/com/apollohg/editor/EditorEditTextRenderPatch.kt:396— EditorEditTextRenderPatchKt.jsonValuesEqual has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorInputConnection.commitCorrection (cognitive 26) android/src/main/java/com/apollohg/editor/EditorInputConnection.kt:315— EditorInputConnection.commitCorrection has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 4 (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.
PreparedProseDrawingView.onTouchEvent (cognitive 26) android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:1627— PreparedProseDrawingView.onTouchEvent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 7, 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.
EditorTextView.reusingStyledParagraphBox (cognitive 26) ios/EditorTextView+RenderPatch.swift:508— EditorTextView.reusingStyledParagraphBox has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 24, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorV2Adapter.performMutation (cognitive 26) ios/EditorV2Adapter+Mutation.swift:281— EditorV2Adapter.performMutation has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 3 (5 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeCollaborationTransport.receiveNext (cognitive 26) ios/NativeCollaborationTransport+Socket.swift:142— NativeCollaborationTransport.receiveNext has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 4, match/switch 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.
EditorTableInputCoordinator.projection (cognitive 26) ios/Tables/EditorTableInputCoordinator.swift:39— EditorTableInputCoordinator.projection has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 14, if/else 9 (11 pts), loops 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
useRichTextEditorMentions.useRichTextEditorMentions.handleAddonEvent (cognitive 26) src/useRichTextEditorMentions.tsx:272— useRichTextEditorMentions.useRichTextEditorMentions.handleAddonEvent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 4 (7 pts), boolean chains 5, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeCollaborationTransportRegistry.parseProtocolAdapterResponse (cognitive 25) android/src/main/java/com/apollohg/editor/NativeCollaborationTransportRegistry.kt:427— NativeCollaborationTransportRegistry.parseProtocolAdapterResponse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StaticLayoutAndroidProseLayoutEngine.attributed (cognitive 25) android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:2404— StaticLayoutAndroidProseLayoutEngine.attributed has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 3, 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.
ViewerDocumentKt.parseTableAttributes (cognitive 25) android/src/main/java/com/apollohg/editor/viewer/ViewerDocument.kt:924— ViewerDocumentKt.parseTableAttributes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (7 pts), match/switch 1 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorStyleSheet.applyText (cognitive 25) ios/EditorStyleSheet.swift:169— EditorStyleSheet.applyText has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (24 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.
RichTextEditorView.toggleTaskListMarker (cognitive 25) ios/RichTextEditorView.swift:1253— RichTextEditorView.toggleTaskListMarker has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 11, 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.
PreparedProseLayoutRegistry.preparedDocument (cognitive 25) ios/Viewer/PreparedProseLayoutRegistry+Artifacts.swift:89— PreparedProseLayoutRegistry.preparedDocument has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeEditorCreateJson.appendV2JsonString (cognitive 25) src/NativeEditorCreateJson.ts:513— NativeEditorCreateJson.appendV2JsonString has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 1 (4 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExternalTextComposition.parseNativeCompositionResult (cognitive 25) src/ExternalTextComposition.ts:149— ExternalTextComposition.parseNativeCompositionResult has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 8, ternaries 3 (6 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useRichTextEditorCommands.useRichTextEditorCommands.runAtomAction (cognitive 25) src/useRichTextEditorCommands.tsx:176— useRichTextEditorCommands.useRichTextEditorCommands.runAtomAction has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, ternaries 2 (3 pts), error handling 1 (nesting depth added 5). Of this number, 24 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.
EditorCaretOverlayView.canDrawSeparately (cognitive 24) android/src/main/java/com/apollohg/editor/EditorCaretOverlayView.kt:103— EditorCaretOverlayView.canDrawSeparately has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 6 (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.
EditorTextDecorationDrawing.draw (cognitive 24) android/src/main/java/com/apollohg/editor/EditorTextDecorationDrawing.kt:58— EditorTextDecorationDrawing.draw has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (3 pts), boolean chains 1, match/switch 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.
EditorV2AdapterMutationsKt.performMutation (cognitive 24) android/src/main/java/com/apollohg/editor/EditorV2AdapterMutations.kt:173— EditorV2AdapterMutationsKt.performMutation has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorV2AdapterRenderingKt.adopt (cognitive 24) android/src/main/java/com/apollohg/editor/EditorV2AdapterRendering.kt:67— EditorV2AdapterRenderingKt.adopt has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 4 (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.
RenderImageDecoder.preflightDataUrl (cognitive 24) android/src/main/java/com/apollohg/editor/RenderImageDecoder.kt:162— RenderImageDecoder.preflightDataUrl has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 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.
FallbackSelectionGeometryKt.fallbackSelectionRectsForGeometry (cognitive 24) android/src/main/java/com/apollohg/editor/viewer/FallbackSelectionGeometry.kt:304— FallbackSelectionGeometryKt.fallbackSelectionRectsForGeometry has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 6, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
EditorTextView.trimmedAttributedPatch (cognitive 24) ios/EditorTextView+AttributedPatch.swift:238— EditorTextView.trimmedAttributedPatch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 5 (7 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeCollaborationTransportRegistry.parseProtocolAdapterResponse (cognitive 24) ios/NativeCollaborationTransportRegistry.swift:435— NativeCollaborationTransportRegistry.parseProtocolAdapterResponse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 8, match/switch 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.
RenderBridge.closeStyledBlock (cognitive 24) ios/EditorStyleSheet.swift:436— RenderBridge.closeStyledBlock has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, ternaries 2 (6 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorTableSurface.arrowDestination (cognitive 24) ios/Tables/EditorTableSurface.swift:858— EditorTableSurface.arrowDestination has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 14, if/else 4 (5 pts), ternaries 3 (4 pts), match/switch 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ViewerDocument.cellSupportsBackgroundPreparation (cognitive 24) ios/Viewer/ViewerDocument.swift:673— ViewerDocument.cellSupportsBackgroundPreparation has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useRichTextEditorEvents.useRichTextEditorEvents.handleAtomLayout (cognitive 24) src/useRichTextEditorEvents.tsx:386— useRichTextEditorEvents.useRichTextEditorEvents.handleAtomLayout has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (9 pts), ternaries 2 (3 pts), loops 2 (nesting depth added 3). Of this number, 15 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorEditTextClipboardKt.handlePaste (cognitive 23) android/src/main/java/com/apollohg/editor/EditorEditTextClipboard.kt:179— EditorEditTextClipboardKt.handlePaste has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PreparedProseViewerManager.createViewInstance (cognitive 23) android/src/main/java/com/apollohg/editor/viewer/PreparedProseViewerManager.kt:63— PreparedProseViewerManager.createViewInstance has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 6 (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.
EditorV2Adapter.adoptExternalReset (cognitive 23) ios/EditorV2Adapter+RenderState.swift:232— EditorV2Adapter.adoptExternalReset has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 5, match/switch 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.
EditorV2Adapter.parseTableAttributes (cognitive 23) ios/EditorV2Adapter+RenderValidation.swift:258— EditorV2Adapter.parseTableAttributes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenderBridge.attributesForMarks (cognitive 23) ios/RenderBridge+Atoms.swift:16— RenderBridge.attributesForMarks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 1 (2 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
atoms.normalizedHtmlRules (cognitive 23) src/atoms.ts:184— atoms.normalizedHtmlRules has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4, 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.
schemaDefinition.validateAttributeDOMRules (cognitive 23) src/schemaDefinition.ts:237— schemaDefinition.validateAttributeDOMRules has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 9, ternaries 2 (3 pts) (nesting depth added 4). Of this number, 16 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AtomHost.AtomHost (cognitive 23) src/AtomHost.tsx:75— AtomHost.AtomHost has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 6 (7 pts), boolean chains 6, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 126, 186, 196, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AttrSpec::validate_definition (cognitive 22) rust/editor-core/src/schema/mod.rs:305— AttrSpec::validate_definition has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 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.
EditorEditTextDeletionKt.handleBackspaceImpl (cognitive 22) android/src/main/java/com/apollohg/editor/EditorEditTextDeletion.kt:85— EditorEditTextDeletionKt.handleBackspaceImpl has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
EditorMentionStyleKt.mergedWith (cognitive 22) android/src/main/java/com/apollohg/editor/EditorMentionStyle.kt:9— EditorMentionStyleKt.mergedWith has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22. 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.
NativeEditorExpoViewUpdatesKt.applyEditorResetUpdateOutcome (cognitive 22) android/src/main/java/com/apollohg/editor/NativeEditorExpoViewUpdates.kt:16— NativeEditorExpoViewUpdatesKt.applyEditorResetUpdateOutcome has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 3, 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.
EditorScrollView.onInterceptTouchEvent (cognitive 22) android/src/main/java/com/apollohg/editor/RichTextEditorView.kt:87— EditorScrollView.onInterceptTouchEvent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 8 (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.
PlainTableCellMeasurer.measure (cognitive 22) android/src/main/java/com/apollohg/editor/viewer/PlainTableCellMeasurement.kt:32— PlainTableCellMeasurer.measure has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreparedProseDrawingView.install (cognitive 22) android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:400— PreparedProseDrawingView.install has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorTextView.insertText (cognitive 22) ios/EditorTextView.swift:636— EditorTextView.insertText has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
EditorTextView.beginExternalTextComposition (cognitive 22) ios/EditorTextView+ExternalComposition.swift:19— EditorTextView.beginExternalTextComposition has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, ternaries 3 (4 pts) (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.
EditorTextView.commitNativeTextMutationIfPossible (cognitive 22) ios/EditorTextView+NativeInputLifecycle.swift:291— EditorTextView.commitNativeTextMutationIfPossible has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4 (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.
NativeEditorExpoView.applyEditorUpdateOutcome (cognitive 22) ios/NativeEditorExpoView+Updates.swift:151— NativeEditorExpoView.applyEditorUpdateOutcome has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (19 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
CoreTextProseLayoutEngine.strikeFragments (cognitive 22) ios/Viewer/CoreTextProseLayoutEngine+AttributedText.swift:324— CoreTextProseLayoutEngine.strikeFragments has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 5, if/else 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorStyleSheetNormalization.property (cognitive 22) src/EditorStyleSheetNormalization.ts:175— EditorStyleSheetNormalization.property has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 7, 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.
NativeEditorCreateJson.chargeV2JsonStringBytes (cognitive 22) src/NativeEditorCreateJson.ts:186— NativeEditorCreateJson.chargeV2JsonStringBytes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Engine::highlight (cognitive 21) packages/code-highlighting/rust/src/lib.rs:97— Engine::highlight has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorEditTextDeletionKt.handleForwardDeleteImpl (cognitive 21) android/src/main/java/com/apollohg/editor/EditorEditTextDeletion.kt:145— EditorEditTextDeletionKt.handleForwardDeleteImpl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StaticLayoutAndroidProseLayoutEngine.markSpans (cognitive 21) android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:2594— StaticLayoutAndroidProseLayoutEngine.markSpans has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5, match/switch 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.
PreparedProseDrawingView.hitResizeEdge (cognitive 21) android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:567— PreparedProseDrawingView.hitResizeEdge has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PreparedProseDrawingView.selectionHandles (cognitive 21) android/src/main/java/com/apollohg/editor/viewer/PreparedProseDrawingView.kt:645— PreparedProseDrawingView.selectionHandles has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RemoteSelectionOverlayView.refresh (cognitive 21) ios/EditorInteractionOverlays.swift:181— RemoteSelectionOverlayView.refresh has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorStyleBox.draw (cognitive 21) ios/EditorStyleSheet.swift:272— EditorStyleBox.draw has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 4 (8 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenderBridge.applyBlockStyle (cognitive 21) ios/RenderBridge+Style.swift:204— RenderBridge.applyBlockStyle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeEditorCreateConfig.cloneAndFreezeDescriptorValue (cognitive 21) src/NativeEditorCreateConfig.ts:327— NativeEditorCreateConfig.cloneAndFreezeDescriptorValue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (6 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableGeography::survey (cognitive 20) rust/editor-core/src/tables/mutation_guard.rs:261— TableGeography::survey has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorEditTextRenderPatchKt.refreshRetainedBlockMetadata (cognitive 20) android/src/main/java/com/apollohg/editor/EditorEditTextRenderPatch.kt:167— EditorEditTextRenderPatchKt.refreshRetainedBlockMetadata has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorEditTextSelectionKt.applySelectionFromJSON (cognitive 20) android/src/main/java/com/apollohg/editor/EditorEditTextSelection.kt:298— EditorEditTextSelectionKt.applySelectionFromJSON has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, 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.
EditorInputSurroundingDeletionKt.performPlainSurroundingDelete (cognitive 20) android/src/main/java/com/apollohg/editor/EditorInputSurroundingDeletion.kt:84— EditorInputSurroundingDeletionKt.performPlainSurroundingDelete has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, match/switch 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.
EditorKeyboardToolbarView.applyButtonLayout (cognitive 20) android/src/main/java/com/apollohg/editor/EditorKeyboardToolbarView.kt:893— EditorKeyboardToolbarView.applyButtonLayout has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 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.
NativeEditorExpoViewPendingUpdatesKt.applyPendingEditorUpdateIfNeededImpl (cognitive 20) android/src/main/java/com/apollohg/editor/NativeEditorExpoViewPendingUpdates.kt:199— NativeEditorExpoViewPendingUpdatesKt.applyPendingEditorUpdateIfNeededImpl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 2, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NativeToolbarItem.parseItem (cognitive 20) android/src/main/java/com/apollohg/editor/NativeToolbarItem.kt:127— NativeToolbarItem.parseItem has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 8). 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.
RenderImageLoader.loadInternal (cognitive 20) android/src/main/java/com/apollohg/editor/RenderImageLoader.kt:359— RenderImageLoader.loadInternal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
EditorTableSurface.onDragTouch (cognitive 20) android/src/main/java/com/apollohg/editor/tables/EditorTableSurface.kt:1007— EditorTableSurface.onDragTouch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, match/switch 1 (nesting depth added 7). 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.
EditorTextView.measuredAutoGrowHeight (cognitive 20) ios/EditorTextView+Layout.swift:194— EditorTextView.measuredAutoGrowHeight has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 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.
EditorTextView.applyTopLevelChildMetadataPatch (cognitive 20) ios/EditorTextView+RenderPatch.swift:379— EditorTextView.applyTopLevelChildMetadataPatch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorAccessoryToolbarView.updateButtonAppearance (cognitive 20) ios/NativeToolbar+ButtonStyle.swift:92— EditorAccessoryToolbarView.updateButtonAppearance has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 8, 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.
EditorTableSurface.resolveTableCellDrop (cognitive 20) ios/Tables/EditorTableSurface+CellDragDrop.swift:144— EditorTableSurface.resolveTableCellDrop has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, ternaries 2 (3 pts) (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.
ViewerTablePresentation.project::appendLayout::appendBlocks (cognitive 20) ios/Tables/ViewerTableSurface.swift:1230— ViewerTablePresentation.project::appendLayout::appendBlocks has cognitive complexity 20 (threshold 15). Drivers by points: loops 7 (10 pts), if/else 4 (8 pts), boolean chains 2 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CoreTextProseLayoutEngine.makeCellPreparation (cognitive 20) ios/Viewer/CoreTextProseLayoutEngine.swift:228— CoreTextProseLayoutEngine.makeCellPreparation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 3, match/switch 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.
CoreTextProseLayoutEngine.measurePlainCell (cognitive 20) ios/Viewer/CoreTextProseLayoutEngine.swift:1104— CoreTextProseLayoutEngine.measurePlainCell has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 16, if/else 3, 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.
EditorAddons.swift.resolveMentionQueryState (cognitive 20) ios/EditorAddons.swift:85— EditorAddons.swift.resolveMentionQueryState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
NativeEditorModule.swift.v2MutationResultDictionary (cognitive 20) ios/NativeEditorModule.swift:99— NativeEditorModule.swift.v2MutationResultDictionary has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 14, if/else 4 (6 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorStyleSheetNormalization.tableTheme (cognitive 20) src/EditorStyleSheetNormalization.ts:313— EditorStyleSheetNormalization.tableTheme has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (4 pts), loops 3, 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.
ManagedExternalTextCompositionSession.commit (cognitive 20) src/ExternalTextComposition.ts:338— ManagedExternalTextCompositionSession.commit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useViewerAtoms.useViewerAtoms.onAtomLayout (cognitive 20) src/useViewerAtoms.tsx:313— useViewerAtoms.useViewerAtoms.onAtomLayout has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (4 pts), boolean chains 3, loops 2, error handling 1 (nesting depth added 4). Of this number, 15 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlockBranchIndex::build (cognitive 19) rust/editor-core/src/yrs_engine/block_branch_index.rs:368— BlockBranchIndex::build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (7 pts), loops 2 (nesting depth added 9). Of this number, 15 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanonicalSpliceCache::prepare (cognitive 19) rust/editor-core/src/yrs_engine/canonical/splice_cache.rs:114— CanonicalSpliceCache::prepare has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (18 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, 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.
Cursor.node (cognitive 19) android/src/main/java/com/apollohg/editor/CanonicalPlainJson.kt:21— Cursor.node has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorEditTextHardwareInputKt.handlePrintableHardwareKeyEventImpl (cognitive 19) android/src/main/java/com/apollohg/editor/EditorEditTextHardwareInput.kt:166— EditorEditTextHardwareInputKt.handlePrintableHardwareKeyEventImpl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, 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.
EditorTableIndex.containingTable (cognitive 19) android/src/main/java/com/apollohg/editor/tables/EditorTableIndex.kt:411— EditorTableIndex.containingTable has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 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.
EditorLayoutManager.layoutManager (cognitive 19) ios/EditorLayoutManager.swift:72— EditorLayoutManager.layoutManager has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 8 (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.
EditorTextView.applyNativeTextReplacementIfPossible (cognitive 19) ios/EditorTextView+AttributedPatch.swift:39— EditorTextView.applyNativeTextReplacementIfPossible has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 17, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorTextView.isAtTableCellArrowBoundary (cognitive 19) ios/EditorTextView+KeyboardInput.swift:338— EditorTextView.isAtTableCellArrowBoundary has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 5 (6 pts), ternaries 1 (2 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorTheme.init (cognitive 19) ios/EditorTheme.swift:452— EditorTheme.init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 1 (2 pts), ternaries 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.
NativeToolbarIcon.from (cognitive 19) ios/NativeToolbar+Models.swift:240— NativeToolbarIcon.from has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, match/switch 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.
RichTextEditorView.settleTableSelectionAfterTextSync (cognitive 19) ios/RichTextEditorView.swift:355— RichTextEditorView.settleTableSelectionAfterTextSync has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 16, if/else 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorTableIndex.validate (cognitive 19) ios/Tables/EditorTableIndex.swift:300— EditorTableIndex.validate has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (6 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CoreTextProseLayoutEngine.makeListMarker (cognitive 19) ios/Viewer/CoreTextProseLayoutEngine+AttributedText.swift:391— CoreTextProseLayoutEngine.makeListMarker has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (6 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
EditorStyleSheetNormalization.orderedMarker (cognitive 19) src/EditorStyleSheetNormalization.ts:131— EditorStyleSheetNormalization.orderedMarker has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorMentionThemeValidation.validEditorMentionTheme (cognitive 19) src/EditorMentionThemeValidation.ts:108— EditorMentionThemeValidation.validEditorMentionTheme has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 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.
atoms.defineAtomNode (cognitive 19) src/atoms.ts:260— atoms.defineAtomNode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 3, loops 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useRichTextEditorUpdates.useRichTextEditorUpdates.applyParsedUpdateState (cognitive 19) src/useRichTextEditorUpdates.tsx:331— useRichTextEditorUpdates.useRichTextEditorUpdates.applyParsedUpdateState has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 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.
useRichTextEditorCommands.useRichTextEditorCommands.updateAtomAttrs (cognitive 19) src/useRichTextEditorCommands.tsx:84— useRichTextEditorCommands.useRichTextEditorCommands.updateAtomAttrs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectionNormalizer::write (cognitive 18) rust/editor-core/src/yrs_engine/canonical/projection_hash.rs:212— ProjectionNormalizer::write 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.
LocalizedSplitCompiler::try_new (cognitive 18) rust/editor-core/src/yrs_engine/mutation/lowering/index/localized_split.rs:3— LocalizedSplitCompiler::try_new has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorEditTextRenderPatchKt.firstCharacterOffsetForTopLevelChildIndex (cognitive 18) android/src/main/java/com/apollohg/editor/EditorEditTextRenderPatch.kt:286— EditorEditTextRenderPatchKt.firstCharacterOffsetForTopLevelChildIndex has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorV2Adapter.adoptExternalReset (cognitive 18) android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:344— EditorV2Adapter.adoptExternalReset has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (4 pts), match/switch 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.
NativeCollaborationTransportRegistry.parseProtocolAdapterConfig (cognitive 18) android/src/main/java/com/apollohg/editor/NativeCollaborationTransportRegistry.kt:355— NativeCollaborationTransportRegistry.parseProtocolAdapterConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 1 (2 pts), match/switch 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeEditorExpoViewPendingUpdatesKt.applyPendingEditorResetUpdateIfNeededImpl (cognitive 18) android/src/main/java/com/apollohg/editor/NativeEditorExpoViewPendingUpdates.kt:136— NativeEditorExpoViewPendingUpdatesKt.applyPendingEditorResetUpdateIfNeededImpl has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NativeEditorExpoViewUpdatesKt.applyEditorUpdateOutcome (cognitive 18) android/src/main/java/com/apollohg/editor/NativeEditorExpoViewUpdates.kt:147— NativeEditorExpoViewUpdatesKt.applyEditorUpdateOutcome has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreparedProseLayoutRegistry.measure (cognitive 18) android/src/main/java/com/apollohg/editor/viewer/PreparedProseLayoutRegistry.kt:162— PreparedProseLayoutRegistry.measure has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, boolean chains 6, error handling 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.
ViewerDocumentKt.cellSupportsBackgroundPreparation (cognitive 18) android/src/main/java/com/apollohg/editor/viewer/ViewerDocument.kt:647— ViewerDocumentKt.cellSupportsBackgroundPreparation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ViewerDocumentKt.cellSemanticSourceIndex (cognitive 18) android/src/main/java/com/apollohg/editor/viewer/ViewerDocument.kt:750— ViewerDocumentKt.cellSemanticSourceIndex has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, 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.
EditorTextView.setMarkedText (cognitive 18) ios/EditorTextView.swift:930— EditorTextView.setMarkedText has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorTextView.scheduleCodeHighlighting (cognitive 18) ios/EditorCodeHighlighting.swift:140— EditorTextView.scheduleCodeHighlighting has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, loops 1 (3 pts), error handling 2, match/switch 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.
EditorTextView.shouldPreserveAcceptedAutocorrectSpace (cognitive 18) ios/EditorTextView+NativeMutation.swift:220— EditorTextView.shouldPreserveAcceptedAutocorrectSpace has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 16, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorTextView.currentLogicalScalarSelection (cognitive 18) ios/EditorTextView+Selection.swift:430— EditorTextView.currentLogicalScalarSelection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 8 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
NativeCollaborationTransport.normalizeDirective (cognitive 18) ios/NativeCollaborationTransport+Validation.swift:4— NativeCollaborationTransport.normalizeDirective has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 12, if/else 3 (5 pts), match/switch 1 (nesting depth added 2). 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.
EditorTableIndex.containingTable (cognitive 18) ios/Tables/EditorTableIndex.swift:415— EditorTableIndex.containingTable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, ternaries 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
attributeValidation.validateAttribute (cognitive 18) src/attributeValidation.ts:67— attributeValidation.validateAttribute has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, ternaries 3 (6 pts), if/else 3 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
schemaNormalization.normalizeNodeHtmlRules (cognitive 18) src/schemaNormalization.ts:261— schemaNormalization.normalizeNodeHtmlRules has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, ternaries 2, loops 1 (nesting depth added 1). Of this number, 11 points are the body's own statements and 7 belong to 2 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.
NativeEditorCollaborationTransport.decodeNativeCollaborationProtocolBytes (cognitive 18) src/NativeEditorCollaborationTransport.ts:412— NativeEditorCollaborationTransport.decodeNativeCollaborationProtocolBytes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeEditorRenderNormalization.validLeafRenderElement (cognitive 18) src/NativeEditorRenderNormalization.ts:59— NativeEditorRenderNormalization.validLeafRenderElement has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 16, if/else 1, match/switch 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.
useViewerAtoms.parsePositions.positions (cognitive 18) src/useViewerAtoms.tsx:95— useViewerAtoms.parsePositions.positions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Blocks::shift (cognitive 17) rust/editor-core/src/position/storage.rs:277— Blocks::shift has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 3 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ImportLookupMaterializationCollector::end_container (cognitive 17) rust/editor-core/src/yrs_engine/mutation/lowering/import_lookup.rs:497— ImportLookupMaterializationCollector::end_container has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 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.
YrsMutationPlan::deleted_base_branch_roots (cognitive 17) rust/editor-core/src/yrs_engine/mutation/plan/model.rs:329— YrsMutationPlan::deleted_base_branch_roots has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (4 pts), boolean chains 2, match/switch 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.
EditorDocumentLayout.getSelectionPath (cognitive 17) android/src/main/java/com/apollohg/editor/EditorDocumentLayout.kt:595— EditorDocumentLayout.getSelectionPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorEditTextDeletionKt.handleDeleteImpl (cognitive 17) android/src/main/java/com/apollohg/editor/EditorEditTextDeletion.kt:17— EditorEditTextDeletionKt.handleDeleteImpl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorEditTextUpdatesKt.rootTableRenderForUpdate (cognitive 17) android/src/main/java/com/apollohg/editor/EditorEditTextUpdates.kt:22— EditorEditTextUpdatesKt.rootTableRenderForUpdate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
EditorInputCursorGeometryKt.buildSurfaceCursorAnchorInfo (cognitive 17) android/src/main/java/com/apollohg/editor/EditorInputCursorGeometry.kt:11— EditorInputCursorGeometryKt.buildSurfaceCursorAnchorInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorKeyboardToolbarView.updateButtonAppearance (cognitive 17) android/src/main/java/com/apollohg/editor/EditorKeyboardToolbarView.kt:624— EditorKeyboardToolbarView.updateButtonAppearance has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 2, match/switch 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorV2RenderValidationKt.validRenderElement (cognitive 17) android/src/main/java/com/apollohg/editor/EditorV2RenderValidation.kt:190— EditorV2RenderValidationKt.validRenderElement has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 15, if/else 1, match/switch 1. 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.
EditorTableSurface.activateCell (cognitive 17) android/src/main/java/com/apollohg/editor/tables/EditorTableSurface.kt:1919— EditorTableSurface.activateCell has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ViewerTableSurface.measuringViewport (cognitive 17) android/src/main/java/com/apollohg/editor/tables/ViewerTableSurface.kt:486— ViewerTableSurface.measuringViewport has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorClipboardPaste.command (cognitive 17) ios/EditorTextView+KeyboardInput.swift:137— EditorClipboardPaste.command 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.
EditorTextView.applyRenderPatchIfPossible (cognitive 17) ios/EditorTextView+RenderPatch.swift:534— EditorTextView.applyRenderPatchIfPossible has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorV2Adapter.scalarSelection (cognitive 17) ios/EditorV2Adapter+RenderValidation.swift:355— EditorV2Adapter.scalarSelection has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (6 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorTableSurface.nestedTableHeights (cognitive 17) ios/Tables/EditorTableSurface.swift:922— EditorTableSurface.nestedTableHeights has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextProseLayoutEngine.tablePreparationPlan (cognitive 17) ios/Viewer/CoreTextProseLayoutEngine.swift:37— CoreTextProseLayoutEngine.tablePreparationPlan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreparedProseDrawingView.drawForeground (cognitive 17) ios/Viewer/PreparedProseDrawingView.swift:1858— PreparedProseDrawingView.drawForeground has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 5). 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.
PreparedProseLayoutCache.acquireForFabricMount (cognitive 17) ios/Viewer/PreparedProseLayoutCache.swift:190— PreparedProseLayoutCache.acquireForFabricMount has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (5 pts), loops 2 (3 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ViewerDocument.cellDocument (cognitive 17) ios/Viewer/ViewerDocument.swift:701— ViewerDocument.cellDocument has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (7 pts), boolean chains 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useViewerAtoms.useViewerAtoms.children (cognitive 17) src/useViewerAtoms.tsx:580— useViewerAtoms.useViewerAtoms.children has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 4, if/else 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
useRichTextEditorMentions.useRichTextEditorMentions.insertMentionSuggestion (cognitive 17) src/useRichTextEditorMentions.tsx:140— useRichTextEditorMentions.useRichTextEditorMentions.insertMentionSuggestion has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, error handling 2, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
JsonPreflight::read_number (cognitive 16) rust/editor-core/src/yrs_engine/update_preflight.rs:583— JsonPreflight::read_number has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AndroidCollaborationTransport.driveOutboundIfPossible (cognitive 16) android/src/main/java/com/apollohg/editor/AndroidCollaborationTransport.kt:500— AndroidCollaborationTransport.driveOutboundIfPossible has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (7 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.
EditorBlockSpacingKt.resolvedBlockSpacing (cognitive 16) android/src/main/java/com/apollohg/editor/EditorBlockSpacing.kt:5— EditorBlockSpacingKt.resolvedBlockSpacing has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (6 pts), boolean chains 5, if/else 2 (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.
EditorBoxDrawing.draw (cognitive 16) android/src/main/java/com/apollohg/editor/EditorBoxDrawing.kt:50— EditorBoxDrawing.draw has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 2, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorEditTextClipboardKt.handleCut (cognitive 16) android/src/main/java/com/apollohg/editor/EditorEditTextClipboard.kt:232— EditorEditTextClipboardKt.handleCut has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 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, 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.
EditorEditTextCorrectionKt.handleCompositionCommitImpl (cognitive 16) android/src/main/java/com/apollohg/editor/EditorEditTextCorrection.kt:3— EditorEditTextCorrectionKt.handleCompositionCommitImpl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
EditorEditTextExternalCompositionKt.finishExternalTextComposition (cognitive 16) android/src/main/java/com/apollohg/editor/EditorEditTextExternalComposition.kt:178— EditorEditTextExternalCompositionKt.finishExternalTextComposition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EditorEditTextHardwareInputKt.handleCompositionKeyEventImpl (cognitive 16) android/src/main/java/com/apollohg/editor/EditorEditTextHardwareInput.kt:7— EditorEditTextHardwareInputKt.handleCompositionKeyEventImpl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, match/switch 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.
EditorEditTextHardwareInputKt.handleHardwareKeyEventImpl (cognitive 16) android/src/main/java/com/apollohg/editor/EditorEditTextHardwareInput.kt:127— EditorEditTextHardwareInputKt.handleHardwareKeyEventImpl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorEditTextImagesKt.handleImageTap (cognitive 16) android/src/main/java/com/apollohg/editor/EditorEditTextImages.kt:122— EditorEditTextImagesKt.handleImageTap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, match/switch 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.
EditorInputConnection.commitTextToEditor (cognitive 16) android/src/main/java/com/apollohg/editor/EditorInputConnection.kt:430— EditorInputConnection.commitTextToEditor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 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.
EditorV2AdapterSelectionKt.ensureSelection (cognitive 16) android/src/main/java/com/apollohg/editor/EditorV2AdapterSelection.kt:198— EditorV2AdapterSelectionKt.ensureSelection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorV2AdapterSelectionKt.publishAwarenessSelection (cognitive 16) android/src/main/java/com/apollohg/editor/EditorV2AdapterSelection.kt:350— EditorV2AdapterSelectionKt.publishAwarenessSelection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 1 (2 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.
NativeEditorModuleKt.destroyEditorV2FromModule (cognitive 16) android/src/main/java/com/apollohg/editor/NativeEditorModule.kt:76— NativeEditorModuleKt.destroyEditorV2FromModule has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, match/switch 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.
NativeEditorModuleKt.mutationResult (cognitive 16) android/src/main/java/com/apollohg/editor/NativeEditorModule.kt:300— NativeEditorModuleKt.mutationResult has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 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.
RenderImageDecoder.decodeSvgLease (cognitive 16) android/src/main/java/com/apollohg/editor/RenderImageDecoder.kt:404— RenderImageDecoder.decodeSvgLease has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, error handling 4, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RichTextEditorView.renderedAtomHeightPx (cognitive 16) android/src/main/java/com/apollohg/editor/RichTextEditorView.kt:687— RichTextEditorView.renderedAtomHeightPx has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (7 pts), loops 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EditorTableSurface.reconcileActiveCell (cognitive 16) android/src/main/java/com/apollohg/editor/tables/EditorTableSurface.kt:2402— EditorTableSurface.reconcileActiveCell has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 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.
RemoteSelectionDecoration.from (cognitive 16) ios/EditorInteractionOverlays.swift:46— RemoteSelectionDecoration.from has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 13, if/else 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
BlockImageAttachment.attachmentBounds (cognitive 16) ios/RenderBridge+Attachments.swift:134— BlockImageAttachment.attachmentBounds has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RenderBridge.renderBlocks (cognitive 16) ios/RenderBridge.swift:688— RenderBridge.renderBlocks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 6, loops 2 (3 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.
RichTextEditorView.surroundingProseScalar (cognitive 16) ios/RichTextEditorView.swift:601— RichTextEditorView.surroundingProseScalar has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 4, ternaries 3 (4 pts), loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TableGridLayout.columnGeometry (cognitive 16) ios/Tables/TableGridLayout.swift:234— TableGridLayout.columnGeometry has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextProseLayoutEngine.semanticBindings (cognitive 16) ios/Viewer/CoreTextProseLayoutEngine.swift:1042— CoreTextProseLayoutEngine.semanticBindings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreparedProseLayoutCache.contribution (cognitive 16) ios/Viewer/PreparedProseLayoutCache.swift:798— PreparedProseLayoutCache.contribution has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 5, match/switch 1 (nesting depth added 5). 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.
UIView.editorVisibleRectInWindow (cognitive 16) ios/EditorStyleSheet.swift:569— UIView.editorVisibleRectInWindow has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (6 pts), loops 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
NativeEditorModule.swift.destroyEditorV2FromModule (cognitive 16) ios/NativeEditorModule.swift:327— NativeEditorModule.swift.destroyEditorV2FromModule has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
schemaNormalization.normalizeNodeJSONProjection (cognitive 16) src/schemaNormalization.ts:204— schemaNormalization.normalizeNodeJSONProjection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
useEditorToolbarInteractions.useEditorToolbarInteractions (cognitive 16) src/useEditorToolbarInteractions.tsx:14— useEditorToolbarInteractions.useEditorToolbarInteractions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3 (nesting depth added 2). None of this is in the body itself: all 16 points belong to 7 function literals inside it that branch (lines 230, 205, 255, …). 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.
ManagedExternalTextCompositionSession.cancelWithCause (cognitive 16) src/ExternalTextComposition.ts:582— ManagedExternalTextCompositionSession.cancelWithCause has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 1, error handling 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useViewerAtoms.useViewerAtoms.updateAttrs (cognitive 16) src/useViewerAtoms.tsx:412— useViewerAtoms.useViewerAtoms.updateAttrs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, boolean chains 5, ternaries 3 (4 pts), error handling 1 (nesting depth added 1). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 2 function items inside it that branch (execute, clean). 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.
useFocusPreservingFrames.useFocusPreservingFrames.refresh (cognitive 16) src/useFocusPreservingFrames.ts:99— useFocusPreservingFrames.useFocusPreservingFrames.refresh has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 125, 136, 104). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
TooManyFunctions: editor_core::ffi_v2::editor rust/editor-core/src/ffi_v2/editor.rs:68— TooManyFunctions — 37 free functions. The bar is 30 free functions; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×1
Change-coupling hub: NativeRichTextEditor.tsx → EditorToolbar.tsx, NativeProseViewer.tsx, useNativeEditor.ts src/NativeRichTextEditor.tsx— `src/NativeRichTextEditor.tsx` changes together with 3 other files — `src/EditorToolbar.tsx`, `src/NativeProseViewer.tsx`, `src/useNativeEditor.ts` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Near-duplicate member pair (134 shared lines) rust/editor-core/src/render/generate.rs:59— rust/editor-core/src/render/generate.rs:59-247 | rust/editor-core/src/render/incremental.rs:638-886 — These two members are variants of one another: 134 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 (4 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (4 members, 50+ identical tokens) rust/editor-core/src/command_planner.rs:231— rust/editor-core/src/command_planner.rs:231-241 | rust/editor-core/src/transform/apply.rs:115-196 | rust/editor-core/src/transform/apply/text.rs:265-322 | rust/editor-core/src/yrs_engine/derived_state/selection.rs:261-271 — 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 (49 corresponding lines) · ×1
Edited copy of a member (49 corresponding lines) rust/editor-core/src/transform/apply/text.rs:265— rust/editor-core/src/transform/apply/text.rs:265-322 | rust/editor-core/src/transform/apply/text.rs:362-410 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 69+ corresponding lines) · ×1
Edited copies of one member (3 members, 69+ corresponding lines) rust/editor-core/src/transform/apply/range.rs:8— rust/editor-core/src/transform/apply/range.rs:8-83 | rust/editor-core/src/transform/apply/range.rs:165-251 | rust/editor-core/src/transform/apply/text.rs:52-120 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 69 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 (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) rust/editor-core/src/yrs_engine/codec.rs:569— rust/editor-core/src/yrs_engine/codec.rs:569-619 | rust/editor-core/src/yrs_engine/codec/projection_match.rs:212-248 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (59 corresponding lines) · ×1
Edited copy of a member (59 corresponding lines) rust/editor-core/src/command_planner/format.rs:111— rust/editor-core/src/command_planner/format.rs:111-184 | rust/editor-core/src/command_planner/format.rs:192-250 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (62 corresponding lines) · ×1
Edited copy of a member (62 corresponding lines) android/src/main/java/com/apollohg/editor/NativeEditorExpoViewPendingUpdates.kt:136— android/src/main/java/com/apollohg/editor/NativeEditorExpoViewPendingUpdates.kt:136-197 | android/src/main/java/com/apollohg/editor/NativeEditorExpoViewPendingUpdates.kt:199-284 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×1
Edited copy of a member (25 corresponding lines) ios/EditorStyleSheet.swift:625— ios/EditorStyleSheet.swift:625-649 | ios/Viewer/PreparedProseDrawingView.swift:943-967 — 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 (56 corresponding lines) · ×1
Edited copy of a member (56 corresponding lines) rust/editor-core/src/yrs_engine/engine/transaction_result.rs:32— rust/editor-core/src/yrs_engine/engine/transaction_result.rs:32-87 | rust/editor-core/src/yrs_engine/engine/undo_redo.rs:490-553 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:387— ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:387-426 | ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:433-474 — 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 (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:547— android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:547-579 | android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:581-609 — 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 (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) rust/editor-core/src/schema/content_rule.rs:330— rust/editor-core/src/schema/content_rule.rs:330-353 | rust/editor-core/src/schema/content_rule.rs:678-701 — 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 (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:763— android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:763-788 | android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:791-816 — 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 copies of one member (3 members, 17+ corresponding lines) · ×1
Edited copies of one member (3 members, 17+ corresponding lines) ios/EditorV2Adapter+TextCommands.swift:262— ios/EditorV2Adapter+TextCommands.swift:262-279 | ios/EditorV2Adapter+TextCommands.swift:281-299 | ios/EditorV2Adapter+TextCommands.swift:301-317 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 19+ corresponding lines) · ×1
Edited copies of one member (5 members, 19+ corresponding lines) rust/editor-core/src/ffi_v2/collaboration.rs:75— rust/editor-core/src/ffi_v2/collaboration.rs:75-93 | rust/editor-core/src/ffi_v2/collaboration.rs:101-120 | rust/editor-core/src/ffi_v2/collaboration.rs:132-156 | rust/editor-core/src/ffi_v2/collaboration.rs:190-208 | rust/editor-core/src/ffi_v2/collaboration.rs:215-233 — 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 (4 members, 18+ corresponding lines) · ×1
Edited copies of one member (4 members, 18+ corresponding lines) rust/editor-core/src/yrs_engine/derived_state/history_snapshot.rs:729— rust/editor-core/src/yrs_engine/derived_state/history_snapshot.rs:729-746 | rust/editor-core/src/yrs_engine/engine/history_state.rs:265-282 | rust/editor-core/src/yrs_engine/engine/remote.rs:818-837 | rust/editor-core/src/yrs_engine/engine/remote.rs:839-858 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×1
Edited copies of one member (3 members, 8+ corresponding lines) rust/editor-core/src/ffi_v2/render.rs:561— rust/editor-core/src/ffi_v2/render.rs:561-569 | rust/editor-core/src/ffi_v2/render.rs:572-582 | rust/editor-core/src/ffi_v2/render.rs:585-592 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 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, 7+ corresponding lines) · ×1
Edited copies of one member (3 members, 7+ corresponding lines) ios/EditorTextView+Commands.swift:136— ios/EditorTextView+Commands.swift:136-142 | ios/EditorTextView+Commands.swift:144-155 | ios/EditorTextView+Commands.swift:218-225 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 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 (6 members, 8+ corresponding lines) · ×1
Edited copies of one member (6 members, 8+ corresponding lines) android/src/main/java/com/apollohg/editor/EditorEditTextToolbar.kt:16— android/src/main/java/com/apollohg/editor/EditorEditTextToolbar.kt:16-23 | android/src/main/java/com/apollohg/editor/EditorEditTextToolbar.kt:39-46 | android/src/main/java/com/apollohg/editor/EditorEditTextToolbar.kt:63-71 | android/src/main/java/com/apollohg/editor/EditorEditTextToolbar.kt:73-80 | android/src/main/java/com/apollohg/editor/EditorEditTextToolbar.kt:82-89 | android/src/main/java/com/apollohg/editor/EditorEditTextToolbar.kt:91-98 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 8 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, 14+ corresponding lines) · ×1
Edited copies of one member (5 members, 14+ corresponding lines) ios/EditorV2Adapter+Registry.swift:42— ios/EditorV2Adapter+Registry.swift:42-55 | ios/EditorV2Adapter+Registry.swift:57-70 | ios/EditorV2Adapter+Registry.swift:72-85 | ios/EditorV2Adapter+Registry.swift:87-100 | ios/EditorV2Adapter+Registry.swift:102-119 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 5+ corresponding lines) · ×1
Edited copies of one member (6 members, 5+ corresponding lines) ios/EditorV2Adapter+Commands.swift:40— ios/EditorV2Adapter+Commands.swift:40-44 | ios/EditorV2Adapter+Commands.swift:62-66 | ios/EditorV2Adapter+Commands.swift:68-72 | ios/EditorV2Adapter+Commands.swift:86-94 | ios/EditorV2Adapter+Commands.swift:96-104 | ios/EditorV2Adapter+TextCommands.swift:354-362 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 5+ corresponding lines) · ×1
Edited copies of one member (8 members, 5+ corresponding lines) ios/EditorV2Shadow.swift:128— ios/EditorV2Shadow.swift:128-132 | ios/EditorV2Shadow.swift:203-207 | ios/EditorV2Shadow.swift:253-257 | ios/EditorV2Shadow.swift:259-263 | ios/EditorV2Shadow.swift:265-269 | ios/EditorV2Shadow.swift:283-287 | ios/EditorV2Shadow.swift:289-294 | ios/EditorV2Shadow.swift:314-318 — These 8 members are one piece of code written 8 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 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×1
Edited copies of one member (4 members, 9+ corresponding lines) ios/EditorV2Adapter.swift:210— ios/EditorV2Adapter.swift:210-218 | ios/NativeCollaborationTransport+Validation.swift:67-75 | ios/NativeCollaborationTransportRegistry.swift:485-493 | ios/NativeEditorModule.swift:148-157 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (33–35 lines × 2) rust/editor-core/src/transform/apply/text.rs:266— rust/editor-core/src/transform/apply/text.rs:266-300 | rust/editor-core/src/transform/apply/text.rs:363-395 — both copies are in the same file, so extract the 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 `rust/editor-core/src/transform/apply/text.rs:266` 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 (19–22 lines × 2) rust/editor-core/src/yrs_engine/mutation/plan/preflight.rs:90— rust/editor-core/src/yrs_engine/mutation/plan/preflight.rs:90-111 | rust/editor-core/src/yrs_engine/mutation/plan/preflight.rs:119-137 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/mutation/plan/preflight.rs:90` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19–21 lines × 2) rust/editor-core/src/render/generate.rs:63— rust/editor-core/src/render/generate.rs:63-83 | rust/editor-core/src/render/incremental.rs:656-674 — before extracting anything, compare `rust/editor-core/src/render/generate.rs` and `rust/editor-core/src/render/incremental.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/render/generate.rs:63` 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 (19–20 lines × 2) rust/editor-core/src/editor_state/structure.rs:120— rust/editor-core/src/editor_state/structure.rs:120-139 | rust/editor-core/src/editor_state/structure.rs:147-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/editor_state/structure.rs:120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 3) rust/editor-core/src/yrs_engine/commands/format.rs:211— rust/editor-core/src/yrs_engine/commands/format.rs:211-228 | rust/editor-core/src/yrs_engine/commands/format.rs:240-256 | rust/editor-core/src/yrs_engine/commands/format.rs:268-284 — 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 `rust/editor-core/src/yrs_engine/commands/format.rs:211` 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) rust/editor-core/src/yrs_engine/mutation/lowering/range.rs:214— rust/editor-core/src/yrs_engine/mutation/lowering/range.rs:214-236 | rust/editor-core/src/yrs_engine/mutation/plan/preflight/signatures.rs:130-152 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14–16 lines × 2) rust/editor-core/src/command_planner/backspace.rs:483— rust/editor-core/src/command_planner/backspace.rs:483-496 | rust/editor-core/src/command_planner/empty_blocks.rs:225-240 — before extracting anything, compare `rust/editor-core/src/command_planner/backspace.rs` and `rust/editor-core/src/command_planner/empty_blocks.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/command_planner/backspace.rs:483` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, 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, `rust/editor-core/src/command_planner/empty_blocks.rs:241` calls `try_from`, `get`, `ok` and `rust/editor-core/src/command_planner/backspace.rs:497` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 4) rust/editor-core/src/ffi_v2/render.rs:720— rust/editor-core/src/ffi_v2/render.rs:720-734 | rust/editor-core/src/ffi_v2/render.rs:745-759 | rust/editor-core/src/ffi_v2/render.rs:776-790 | rust/editor-core/src/ffi_v2/render.rs:816-830 — 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 `rust/editor-core/src/ffi_v2/render.rs:720` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `rust/editor-core/src/ffi_v2/render.rs:760` calls `Some`, `atom_id`, `String` and `rust/editor-core/src/ffi_v2/render.rs:735` 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 (11–13 lines × 2) rust/editor-core/src/command_planner/empty_blocks.rs:113— rust/editor-core/src/command_planner/empty_blocks.rs:113-123 | rust/editor-core/src/command_planner/empty_blocks.rs:180-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. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/command_planner/empty_blocks.rs:113` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, 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) rust/editor-core/src/render/generate.rs:144— rust/editor-core/src/render/generate.rs:144-155 | rust/editor-core/src/render/generate.rs:176-187 | rust/editor-core/src/render/incremental.rs:756-767 | rust/editor-core/src/render/incremental.rs:801-812 — before extracting anything, compare `rust/editor-core/src/render/generate.rs` and `rust/editor-core/src/render/incremental.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 3) rust/editor-core/src/command_planner/backspace.rs:451— rust/editor-core/src/command_planner/backspace.rs:451-461 | rust/editor-core/src/command_planner/backspace.rs:524-534 | rust/editor-core/src/command_planner/empty_blocks.rs:252-263 — before extracting anything, compare `rust/editor-core/src/command_planner/backspace.rs` and `rust/editor-core/src/command_planner/empty_blocks.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/command_planner/backspace.rs:451` 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 (26–27 lines × 2) rust/editor-core/src/transform/apply/block.rs:8— rust/editor-core/src/transform/apply/block.rs:8-34 | rust/editor-core/src/transform/apply/text.rs:8-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11–12 lines × 2) rust/editor-core/src/yrs_engine/engine/remote.rs:308— rust/editor-core/src/yrs_engine/engine/remote.rs:308-319 | rust/editor-core/src/yrs_engine/engine/undo_redo.rs:690-700 — 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 `rust/editor-core/src/yrs_engine/engine/remote.rs:308` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 3) rust/editor-core/src/command_planner/backspace.rs:12— rust/editor-core/src/command_planner/backspace.rs:12-22 | rust/editor-core/src/command_planner/backspace.rs:41-51 | rust/editor-core/src/command_planner/backspace.rs:376-386 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–11 lines × 2) rust/editor-core/src/yrs_engine/mutation/lowering/list/layout.rs:45— rust/editor-core/src/yrs_engine/mutation/lowering/list/layout.rs:45-54 | rust/editor-core/src/yrs_engine/mutation/lowering/list/layout.rs:75-85 — both copies are in the same file, so extract the 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 `rust/editor-core/src/yrs_engine/mutation/lowering/list/layout.rs:45` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) rust/editor-core/src/serialize/json_in.rs:623— rust/editor-core/src/serialize/json_in.rs:623-632 | rust/editor-core/src/serialize/json_out.rs:29-38 | rust/editor-core/src/transform/apply.rs:158-167 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/serialize/json_in.rs:623` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) rust/editor-core/src/ffi_v2/collaboration.rs:76— rust/editor-core/src/ffi_v2/collaboration.rs:76-83 | rust/editor-core/src/ffi_v2/collaboration.rs:102-109 | rust/editor-core/src/ffi_v2/collaboration.rs:133-140 — 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 (7–8 lines × 3) rust/editor-core/src/transform/apply/list_wrap.rs:234— rust/editor-core/src/transform/apply/list_wrap.rs:234-240 | rust/editor-core/src/transform/apply/list_wrap.rs:244-250 | rust/editor-core/src/transform/apply/list_wrap.rs:258-265 — 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 `rust/editor-core/src/transform/apply/list_wrap.rs:234` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) rust/editor-core/src/command_planner/backspace.rs:19— rust/editor-core/src/command_planner/backspace.rs:19-25 | rust/editor-core/src/command_planner/backspace.rs:383-389 | rust/editor-core/src/command_planner/backspace.rs:476-482 | rust/editor-core/src/command_planner/empty_blocks.rs:478-484 — before extracting anything, compare `rust/editor-core/src/command_planner/backspace.rs` and `rust/editor-core/src/command_planner/empty_blocks.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/command_planner/backspace.rs:19` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/editor-core/src/command_planner/backspace.rs:474` calls `node_by_html_tag`, `as_str` and `rust/editor-core/src/command_planner/empty_blocks.rs:476` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 5) rust/editor-core/src/command_planner/backspace.rs:18— rust/editor-core/src/command_planner/backspace.rs:18-23 | rust/editor-core/src/command_planner/backspace.rs:47-52 | rust/editor-core/src/command_planner/backspace.rs:382-387 | rust/editor-core/src/command_planner/backspace.rs:475-480 | rust/editor-core/src/command_planner/empty_blocks.rs:477-482 — before extracting anything, compare `rust/editor-core/src/command_planner/backspace.rs` and `rust/editor-core/src/command_planner/empty_blocks.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `rust/editor-core/src/command_planner/backspace.rs:474` calls `node_by_html_tag`, `as_str` and `rust/editor-core/src/command_planner/empty_blocks.rs:476` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5–6 lines × 4) rust/editor-core/src/command_planner.rs:234— rust/editor-core/src/command_planner.rs:234-238 | rust/editor-core/src/transform/apply.rs:117-122 | rust/editor-core/src/transform/apply/text.rs:303-307 | rust/editor-core/src/yrs_engine/derived_state/selection.rs:264-268 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. 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 (35 lines × 2) rust/editor-core/src/tables/commands/columns.rs:83— rust/editor-core/src/tables/commands/columns.rs:83-117 | rust/editor-core/src/tables/commands/rows.rs:100-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `rust/editor-core/src/tables/commands/columns.rs:83` 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 (46–54 lines × 2) android/src/main/java/com/apollohg/editor/EditorMentionStyle.kt:19— android/src/main/java/com/apollohg/editor/EditorMentionStyle.kt:19-72 | android/src/main/java/com/apollohg/editor/EditorStyleSheet.kt:392-437 — 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 `android/src/main/java/com/apollohg/editor/EditorMentionStyle.kt:19` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–23 lines × 2) android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:1297— android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:1297-1319 | android/src/main/java/com/apollohg/editor/viewer/AndroidProseLayoutEngine.kt:1644-1664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–21 lines × 2) android/src/main/java/com/apollohg/editor/EditorTextDecorationDrawing.kt:41— android/src/main/java/com/apollohg/editor/EditorTextDecorationDrawing.kt:41-56 | android/src/main/java/com/apollohg/editor/EditorTextDecorationDrawing.kt:111-131 — both copies are in the same file, so extract the 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 `android/src/main/java/com/apollohg/editor/EditorTextDecorationDrawing.kt:41` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–13 lines × 2) android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:622— android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:622-629 | android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:643-655 — both copies are in the same file, so extract the 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 `android/src/main/java/com/apollohg/editor/EditorV2Adapter.kt:622` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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 (28 lines × 2) ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:58— ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:58-85 | ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:94-121 — both copies are in the same file, so extract the 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 `ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:58` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (24 lines × 2) ios/Tables/TableSurfaceSource.swift:29— ios/Tables/TableSurfaceSource.swift:29-52 | ios/Tables/TableSurfaceSource.swift:54-77 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (21–22 lines × 2) ios/EditorTextView+RenderPatch.swift:601— ios/EditorTextView+RenderPatch.swift:601-622 | ios/EditorTextView+RenderPatch.swift:624-644 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/EditorTextView+RenderPatch.swift:601` 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 (38 lines × 2) ios/EditorInteractionOverlays.swift:85— ios/EditorInteractionOverlays.swift:85-122 | ios/EditorTheme.swift:579-616 — 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 `ios/EditorInteractionOverlays.swift:85` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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) ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:11— ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:11-25 | ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:131-145 | ios/Viewer/PreparedProseLayoutRegistry+Fabric.swift:190-204 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–15 lines × 2) ios/EditorV2Adapter+TextCommands.swift:111— ios/EditorV2Adapter+TextCommands.swift:111-120 | ios/EditorV2Adapter+TextCommands.swift:133-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. Read the line range as the matched WINDOW rather than a finished unit: at `ios/EditorV2Adapter+TextCommands.swift:111` 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 (8–9 lines × 2) ios/EditorV2Adapter+Commands.swift:208— ios/EditorV2Adapter+Commands.swift:208-216 | ios/EditorV2Adapter+Commands.swift:240-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/EditorV2Adapter+Commands.swift:208` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. 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 (8 lines × 4) ios/EditorV2Adapter+Commands.swift:208— ios/EditorV2Adapter+Commands.swift:208-215 | ios/EditorV2Adapter+Commands.swift:240-247 | ios/EditorV2Adapter+TextCommands.swift:385-392 | ios/EditorV2Adapter+TextCommands.swift:408-415 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (9–11 lines × 2) ios/EditorV2Adapter+TextCommands.swift:344— ios/EditorV2Adapter+TextCommands.swift:344-352 | ios/EditorV2Adapter+TextCommands.swift:423-433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ios/EditorV2Adapter+TextCommands.swift:344` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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–8 lines × 2) ios/Viewer/ViewerDocument.swift:477— ios/Viewer/ViewerDocument.swift:477-482 | ios/Viewer/ViewerDocument.swift:570-577 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5–6 lines × 2) ios/EditorV2Adapter+RenderState.swift:249— ios/EditorV2Adapter+RenderState.swift:249-253 | ios/EditorV2Adapter+RenderState.swift:457-462 — both copies are in the same file, so extract the 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 `ios/EditorV2Adapter+RenderState.swift:249` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication· Edited copies of one member (3 members, 30+ corresponding lines) · ×1
Edited copies of one member (3 members, 30+ corresponding lines) rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/boundary_typing.rs:11— rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/boundary_typing.rs:11-45 | rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/localized_marks.rs:5-51 | rust/editor-core/src/yrs_engine/engine_tests/prepared_commands/paste_root_window.rs:17-46 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Sync-over-async blocking scripts/table-interop/controller.ts:462— `existsSync` in `startPeer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
R10 · Code Duplication· Duplicated block with local edits (39 matched lines × 2 locations) · ×1
Duplicated block with local edits (39 matched lines × 2 locations) scripts/table-interop/continuity-evidence.ts:164— scripts/table-interop/continuity-evidence.ts:164 · scripts/table-interop/supplementary-evidence.ts:45 — the two spans are one implementation copied and then locally edited — 283 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 (38 lines × 2 locations) src/NativeEditorDocumentBridge.ts:343— src/NativeEditorDocumentBridge.ts:343 · src/NativeEditorDocumentBridge.ts:392 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (23 matched lines × 2 locations) · ×1
Duplicated block with local edits (23 matched lines × 2 locations) scripts/table-interop/checkpoint-io.ts:193— scripts/table-interop/checkpoint-io.ts:193 · scripts/table-interop/checkpoint-io.ts:226 — the two spans are one implementation copied and then locally edited — 134 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 (19 matched lines × 2 locations) · ×1
Duplicated block with local edits (19 matched lines × 2 locations) scripts/ktlint.mjs:37— scripts/ktlint.mjs:37 · scripts/swiftlint.mjs:23 — the two spans are one implementation copied and then locally edited — 165 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 (19 lines × 2 locations) src/useRichTextEditorMentions.tsx:201— src/useRichTextEditorMentions.tsx:201 · src/useRichTextEditorUpdates.tsx:521 — 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.
R10 · Code Duplication· Duplicated block with local edits (18 matched lines × 2 locations) · ×1
Duplicated block with local edits (18 matched lines × 2 locations) scripts/table-interop/availability-evidence.ts:55— scripts/table-interop/availability-evidence.ts:55 · scripts/table-interop/checkpoint-evidence.ts:123 — the two spans are one implementation copied and then locally edited — 131 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 (17 matched lines × 2 locations) · ×1
Duplicated block with local edits (17 matched lines × 2 locations) scripts/table-interop/checkpoint-io.ts:44— scripts/table-interop/checkpoint-io.ts:44 · scripts/table-interop/run-continuations.ts:82 — the two spans are one implementation copied and then locally edited — 91 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 (16 lines × 2 locations) src/useNativeEditor.ts:559— src/useNativeEditor.ts:559 · src/useNativeEditor.ts:607 — 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 (15 lines × 2 locations) src/NativeEditorCreateJson.ts:105— src/NativeEditorCreateJson.ts:105 · src/NativeEditorCreateJson.ts:132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication· Duplicated block with local edits (10 matched lines × 2 locations) · ×1
Duplicated block with local edits (10 matched lines × 2 locations) src/NativeProseViewer.tsx:134— src/NativeProseViewer.tsx:134 · src/RichTextEditorSerialization.tsx:436 — the two spans are one implementation copied and then locally edited — 58 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 (9 matched lines × 2 locations) · ×1
Duplicated block with local edits (9 matched lines × 2 locations) src/atoms.ts:336— src/atoms.ts:336 · src/attributeValidation.ts:38 — the two spans are one implementation copied and then locally edited — 62 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.
Boundary violation [package:relative-cross-package] scripts/table-interop/peer-build.ts:8— scripts/table-interop/peer-build.ts:8 reaches into another package with a relative path (../../rust/editor-core/Cargo.toml) — import the package by name instead.
Complex function assertEffectivePresentation (cyclomatic 60, cognitive 132) scripts/table-interop/presentation-semantics.ts:217— assertEffectivePresentation has cyclomatic complexity 60 and cognitive complexity 132; 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 observePresentation (cyclomatic 52, cognitive 93) scripts/table-interop/browser/presentation-observer.ts:50— observePresentation has cyclomatic complexity 52 and cognitive complexity 93; 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 normalizeSchemaDefinition (cyclomatic 49, cognitive 73) src/schemaNormalization.ts:352— normalizeSchemaDefinition has cyclomatic complexity 49 and cognitive complexity 73; 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 useRichTextEditorPresentation (cyclomatic 49, cognitive 39) src/useRichTextEditorPresentation.tsx:50— useRichTextEditorPresentation has cyclomatic complexity 49 and cognitive complexity 39; 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 48, cognitive 94) scripts/table-interop/corpus.ts:1642— (anonymous) has cyclomatic complexity 48 and cognitive complexity 94; 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 assertFamilyEvidence (cyclomatic 48, cognitive 80) scripts/table-interop/scenario-evidence.ts:628— assertFamilyEvidence has cyclomatic complexity 48 and cognitive complexity 80; 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 resolveDocumentSchema (cyclomatic 47, cognitive 56) src/schemaResolution.ts:127— resolveDocumentSchema has cyclomatic complexity 47 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 continuationPassed (cyclomatic 45, cognitive 35) scripts/table-interop/corpus.ts:1415— continuationPassed has cyclomatic complexity 45 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 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 validLeafRenderElement (cyclomatic 43, cognitive 35) src/NativeEditorRenderNormalization.ts:59— validLeafRenderElement has cyclomatic complexity 43 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 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 normalizeV2JsonValue (cyclomatic 41, cognitive 81) src/NativeEditorCreateJson.ts:226— normalizeV2JsonValue has cyclomatic complexity 41 and cognitive complexity 81; 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 validateFallback (cyclomatic 41, cognitive 59) scripts/table-interop/presentation-overlap.ts:85— validateFallback has cyclomatic complexity 41 and cognitive complexity 59; 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 41, cognitive 55) src/useNativeEditor.ts:217— (anonymous) has cyclomatic complexity 41 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 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 41, cognitive 33) src/useEditorToolbarItems.tsx:89— (anonymous) has cyclomatic complexity 41 and cognitive complexity 33; 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 35, cognitive 32) src/useRichTextEditorMentions.tsx:272— (anonymous) has cyclomatic complexity 35 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 stockLimitation (cyclomatic 34, cognitive 43) scripts/table-interop/availability-evidence.ts:424— stockLimitation has cyclomatic complexity 34 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 assertActionEvidence (cyclomatic 34, cognitive 39) scripts/table-interop/scenario-evidence.ts:179— assertActionEvidence has cyclomatic complexity 34 and cognitive complexity 39; 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 normalizeNativeCollaborationTransportEvent (cyclomatic 32, cognitive 38) src/NativeEditorCollaborationTransport.ts:457— normalizeNativeCollaborationTransportEvent has cyclomatic complexity 32 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 31, cognitive 22) src/__tests__/helpers/createFakeEditingModule.ts:140— (anonymous) has cyclomatic complexity 31 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 resolveToolbarButtonVisuals (cyclomatic 30, cognitive 19) src/EditorToolbarVisuals.tsx:136— resolveToolbarButtonVisuals has cyclomatic complexity 30 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 serializeV2CreateEnvelope (cyclomatic 29, cognitive 54) src/NativeEditorCreateJson.ts:590— serializeV2CreateEnvelope has cyclomatic complexity 29 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function visit (cyclomatic 29, cognitive 46) scripts/table-interop/presentation-semantics.ts:432— visit has cyclomatic complexity 29 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 28, cognitive 29) src/useNativeEditor.ts:380— (anonymous) has cyclomatic complexity 28 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseNativeCompositionResult (cyclomatic 28, cognitive 28) src/ExternalTextComposition.ts:149— parseNativeCompositionResult has cyclomatic complexity 28 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 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 buildV2CreateRequestUnchecked (cyclomatic 27, cognitive 32) src/NativeEditorCreateConfig.ts:137— buildV2CreateRequestUnchecked has cyclomatic complexity 27 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 validateSample (cyclomatic 27, cognitive 28) scripts/check-table-performance.mjs:120— validateSample has cyclomatic complexity 27 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 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 useEditorToolbarPresentation (cyclomatic 27, cognitive 26) src/useEditorToolbarPresentation.tsx:20— useEditorToolbarPresentation 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 checkpointProof (cyclomatic 27, cognitive 18) scripts/table-interop/checkpoint-evidence.ts:52— checkpointProof 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 defineSchema (cyclomatic 26, cognitive 52) src/schemaDefinition.ts:343— defineSchema has cyclomatic complexity 26 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 handleReceive (cyclomatic 26, cognitive 34) src/__tests__/helpers/createFakeRuntimeState.ts:600— handleReceive has cyclomatic complexity 26 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function validateAttributeSpec (cyclomatic 26, cognitive 29) src/attributeValidation.ts:96— validateAttributeSpec has cyclomatic complexity 26 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 26, cognitive 20) src/useViewerAtoms.tsx:95— (anonymous) has cyclomatic complexity 26 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 normalizeNativeEditorV2PeersValue (cyclomatic 25, cognitive 40) src/NativeEditorResultNormalization.ts:487— normalizeNativeEditorV2PeersValue has cyclomatic complexity 25 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function evidenceCall (cyclomatic 25, cognitive 30) scripts/table-interop/evidence-observer.ts:98— evidenceCall has cyclomatic complexity 25 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 24, cognitive 14) src/useEditorToolbarItems.tsx:227— (anonymous) has cyclomatic complexity 24 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 23, cognitive 29) src/__tests__/helpers/createFakeEditingModule.ts:372— (anonymous) has cyclomatic complexity 23 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function defineAtomNode (cyclomatic 22, cognitive 21) src/atoms.ts:260— defineAtomNode 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 normalizeRenderSelection (cyclomatic 21, cognitive 30) src/NativeEditorRenderNormalization.ts:239— normalizeRenderSelection has cyclomatic complexity 21 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function property (cyclomatic 21, cognitive 22) src/EditorStyleSheetNormalization.ts:175— property has cyclomatic complexity 21 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 21, cognitive 17) src/useRichTextEditorEvents.tsx:386— (anonymous) has cyclomatic complexity 21 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 collaborationProtocolAdapterDescriptor (cyclomatic 21, cognitive 16) src/NativeEditorCollaborationTransport.ts:189— collaborationProtocolAdapterDescriptor has cyclomatic complexity 21 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· scripts/table-interop/corpus.ts · ×1
scripts/table-interop/corpus.ts: 1961 lines of code scripts/table-interop/corpus.ts:1— scripts/table-interop/corpus.ts has 1961 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/table-interop/browser/peer.ts · ×1
scripts/table-interop/browser/peer.ts: 985 lines of code scripts/table-interop/browser/peer.ts:1— scripts/table-interop/browser/peer.ts has 985 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/table-interop/scenario-evidence.ts · ×1
scripts/table-interop/scenario-evidence.ts: 819 lines of code scripts/table-interop/scenario-evidence.ts:1— scripts/table-interop/scenario-evidence.ts has 819 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· src/useRichTextEditorPresentation.tsx · ×1
src/useRichTextEditorPresentation.tsx: 713 lines of code src/useRichTextEditorPresentation.tsx:1— src/useRichTextEditorPresentation.tsx has 713 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/YjsCollaboration.ts: 694 lines of code src/YjsCollaboration.ts:1— src/YjsCollaboration.ts has 694 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· src/ExternalTextComposition.ts · ×1
src/ExternalTextComposition.ts: 682 lines of code src/ExternalTextComposition.ts:1— src/ExternalTextComposition.ts has 682 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/table-interop/availability-evidence.ts · ×1
scripts/table-interop/availability-evidence.ts: 638 lines of code scripts/table-interop/availability-evidence.ts:1— scripts/table-interop/availability-evidence.ts has 638 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· src/NativeEditorCreateJson.ts · ×1
src/NativeEditorCreateJson.ts: 590 lines of code src/NativeEditorCreateJson.ts:1— src/NativeEditorCreateJson.ts has 590 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· src/NativeEditorResultNormalization.ts · ×1
src/NativeEditorResultNormalization.ts: 585 lines of code src/NativeEditorResultNormalization.ts:1— src/NativeEditorResultNormalization.ts has 585 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/useViewerAtoms.tsx: 585 lines of code src/useViewerAtoms.tsx:1— src/useViewerAtoms.tsx has 585 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/useNativeEditor.ts: 578 lines of code src/useNativeEditor.ts:1— src/useNativeEditor.ts has 578 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/table-interop/presentation-semantics.ts · ×1
scripts/table-interop/presentation-semantics.ts: 570 lines of code scripts/table-interop/presentation-semantics.ts:1— scripts/table-interop/presentation-semantics.ts has 570 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· src/useRichTextEditorState.tsx · ×1
src/useRichTextEditorState.tsx: 568 lines of code src/useRichTextEditorState.tsx:1— src/useRichTextEditorState.tsx has 568 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· src/useRichTextEditorCommands.tsx · ×1
src/useRichTextEditorCommands.tsx: 564 lines of code src/useRichTextEditorCommands.tsx:1— src/useRichTextEditorCommands.tsx has 564 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· src/useRichTextEditorUpdates.tsx · ×1
src/useRichTextEditorUpdates.tsx: 556 lines of code src/useRichTextEditorUpdates.tsx:1— src/useRichTextEditorUpdates.tsx has 556 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/table-interop/controller.ts · ×1
scripts/table-interop/controller.ts: 553 lines of code scripts/table-interop/controller.ts:1— scripts/table-interop/controller.ts has 553 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· src/NativeEditorDocumentBridge.ts · ×1
src/NativeEditorDocumentBridge.ts: 534 lines of code src/NativeEditorDocumentBridge.ts:1— src/NativeEditorDocumentBridge.ts has 534 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· src/NativeEditorCollaborationTransport.ts · ×1
src/NativeEditorCollaborationTransport.ts: 494 lines of code src/NativeEditorCollaborationTransport.ts:1— src/NativeEditorCollaborationTransport.ts has 494 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· src/NativeEditorRenderNormalization.ts · ×1
src/NativeEditorRenderNormalization.ts: 492 lines of code src/NativeEditorRenderNormalization.ts:1— src/NativeEditorRenderNormalization.ts has 492 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· src/useRichTextEditorEvents.tsx · ×1
src/useRichTextEditorEvents.tsx: 470 lines of code src/useRichTextEditorEvents.tsx:1— src/useRichTextEditorEvents.tsx has 470 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/table-interop/continuity-evidence.ts · ×1
scripts/table-interop/continuity-evidence.ts: 452 lines of code scripts/table-interop/continuity-evidence.ts:1— scripts/table-interop/continuity-evidence.ts has 452 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· src/useRichTextEditorMentions.tsx · ×1
src/useRichTextEditorMentions.tsx: 445 lines of code src/useRichTextEditorMentions.tsx:1— src/useRichTextEditorMentions.tsx has 445 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· src/useEditorToolbarPresentation.tsx · ×1
src/useEditorToolbarPresentation.tsx: 442 lines of code src/useEditorToolbarPresentation.tsx:1— src/useEditorToolbarPresentation.tsx has 442 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· src/EditorToolbarVisuals.tsx · ×1
src/EditorToolbarVisuals.tsx: 419 lines of code src/EditorToolbarVisuals.tsx:1— src/EditorToolbarVisuals.tsx has 419 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· src/RichTextEditorSerialization.tsx · ×1
src/RichTextEditorSerialization.tsx: 413 lines of code src/RichTextEditorSerialization.tsx:1— src/RichTextEditorSerialization.tsx has 413 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/schemaDefinition.ts: 406 lines of code src/schemaDefinition.ts:1— src/schemaDefinition.ts has 406 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/schemaNormalization.ts: 405 lines of code src/schemaNormalization.ts:1— src/schemaNormalization.ts has 405 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling· This package's lint script runs in no CI job · ×1
This package's lint script runs in no CI job package.json:90— The root package declares the lint script `validate:package` (`npm run prepare:example:native && npm run install:ios-test-pods && npm run lint:ios && npm run lint:kotlin && node scripts/tests/validate-prepared-prose-viewer-cutover.mjs && npm run validate:security -- --release --behavior && node scripts/tests/validate-security-contracts-negative.mjs && node scripts/tests/validate-publish-lifecycle.mjs && bash ./scripts/tests/validate-generated-bindings.sh && bash ./scripts/tests/validate-packed-xcframework.sh && node scripts/tests/validate-packed-package.test.mjs && bash ./scripts/validate-packed-package.sh`), but no step of this repository's CI runs it, by name, through another script, a Makefile target or a workspace runner, and no CI step runs the linter over the package itself. The rules it sets are enforced nowhere a pull request can fail. Run it in CI: a step that runs `npm run validate:package` in `.` (or the workspace's task runner).
Dead file (~285 LoC) example/App.tsx— no import path from any entry point (98 application, 23 tooling, 167 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 (~208 LoC) example/theme.ts— no import path from any entry point (98 application, 23 tooling, 167 test roots considered), but 3 in-repo import(s) from 3 other file(s) do name it (example/App.tsx, example/components/CounterCard.tsx, example/components/LinkEditorModal.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~203 LoC) example/components/LinkEditorModal.tsx— no import path from any entry point (98 application, 23 tooling, 167 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (example/App.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~165 LoC) example/components/CounterCard.tsx— no import path from any entry point (98 application, 23 tooling, 167 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (example/App.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~18 LoC) src/listMarkers.ts— no import path from any entry point (98 application, 23 tooling, 167 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 'prosemirror-commands' scripts/table-interop/package.json:30— Declared in scripts/table-interop/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 'prosemirror-transform' scripts/table-interop/package.json:35— Declared in scripts/table-interop/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-native-community/cli' scripts/tests/android-rn076-consumer/package.json:14— Declared in scripts/tests/android-rn076-consumer/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-native-community/cli-platform-android' scripts/tests/android-rn076-consumer/package.json:15— Declared in scripts/tests/android-rn076-consumer/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-native-vector-icons/material-design-icons' scripts/tests/android-rn076-consumer/package.json:7— Declared in scripts/tests/android-rn076-consumer/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.
SC1 · Supply-chain hygiene· JavaScript dependencies are not locked · ×1
JavaScript dependencies are not locked scripts/tests/android-rn076-consumer/package.json:6— scripts/tests/android-rn076-consumer/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
Duplicated predicate scripts/check-yrs-document-foundation-benchmarks.mjs:162— `!Array.isArray(samples) || samples.length !== 5` appears character-identically in 2 files — scripts/check-yrs-document-foundation-benchmarks.mjs, scripts/check-yrs-editing-semantics-benchmarks.mjs. 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 src/atomUpdates.ts:21— `!Array.isArray(value) && Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null` appears character-identically in 2 files — src/atomUpdates.ts, src/attributeValidation.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 scripts/table-interop/availability-evidence.ts:554— `!Number.isInteger(colspan) || colspan < 1` appears character-identically in 2 files — scripts/table-interop/availability-evidence.ts, scripts/table-interop/browser/row-insertion-observer.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 scripts/check-yrs-document-foundation-benchmarks.mjs:155— `!allowExtraCases && indexed.size !== REQUIRED_CASES.length` appears character-identically in 2 files — scripts/check-yrs-document-foundation-benchmarks.mjs, scripts/check-yrs-editing-semantics-benchmarks.mjs. 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 src/useRichTextEditorMentions.tsx:217— `!collapsed || !isPositionInvalidError(error)` appears character-identically in 2 files — src/useRichTextEditorMentions.tsx, src/useRichTextEditorUpdates.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 scripts/check-yrs-document-foundation-benchmarks.mjs:125— `!result || typeof result !== 'object' || Array.isArray(result)` appears character-identically in 2 files — scripts/check-yrs-document-foundation-benchmarks.mjs, scripts/check-yrs-editing-semantics-benchmarks.mjs. 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 scripts/check-table-performance.mjs:122— `!sample || typeof sample !== 'object' || Array.isArray(sample)` appears character-identically in 3 files — scripts/check-table-performance.mjs, scripts/check-yrs-document-foundation-benchmarks.mjs, scripts/check-yrs-editing-semantics-benchmarks.mjs. 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 scripts/table-interop/availability-evidence.ts:226— `/^\d+$/.test(part) && node.content?.[Number(part)]` appears character-identically in 2 files — scripts/table-interop/availability-evidence.ts, scripts/table-interop/text-history-evidence.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 src/atoms.ts:152— `ATOM_HTML_IDENTIFIER.test(name) && !name.startsWith('on') && !ATOM_HTML_DENIED_ATTRS.has(name)` appears character-identically in 2 files — src/atoms.ts, src/schemaNormalization.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 src/atoms.ts:147— `ATOM_HTML_IDENTIFIER.test(tag) && !ATOM_HTML_DENIED_TAGS.has(tag)` appears character-identically in 2 files — src/atoms.ts, src/schemaNormalization.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 scripts/table-interop/availability-evidence.ts:168— `boundary.kind !== 'rust' || (boundary.passes === 0 && boundary.autonomous === 0)` appears character-identically in 2 files — scripts/table-interop/availability-evidence.ts, scripts/table-interop/checkpoint-evidence.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 src/NativeEditorCreateJson.ts:305— `descriptor === undefined || !('value' in descriptor) || descriptor.enumerable !== true` appears character-identically in 2 files — src/NativeEditorCreateJson.ts, src/NativeEditorLocalAwareness.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 src/useRichTextEditorEvents.tsx:338— `documentHandle.isDestroyed || !isForThisEditor(event.nativeEvent)` appears character-identically in 2 files — src/useRichTextEditorEvents.tsx, src/useRichTextEditorMentions.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 src/RichTextEditorSerialization.tsx:213— `error instanceof NativeEditorOperationError && error.code === 'REVISION_MISMATCH'` appears character-identically in 2 files — src/RichTextEditorSerialization.tsx, src/useNativeEditor.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 scripts/table-interop/assertions.ts:114— `key in CELL_ATTRIBUTE_DEFAULTS && value === CELL_ATTRIBUTE_DEFAULTS[key]` appears character-identically in 2 files — scripts/table-interop/assertions.ts, scripts/table-interop/table-schema.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/atoms.ts:341— `left == null || right == null || typeof left !== 'object' || typeof right !== 'object'` appears character-identically in 2 files — src/atoms.ts, src/attributeValidation.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 src/schemaDocument.ts:31— `node != null && typeof node.content === 'string'` appears character-identically in 2 files — src/schemaDocument.ts, src/schemaResolution.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 scripts/table-interop/checkpoint-evidence.ts:155— `other.source === table.source && other.kind === 'overlap-fallback' && other.evidence === 'live-overlap'` appears character-identically in 2 files — scripts/table-interop/checkpoint-evidence.ts, scripts/table-interop/corpus.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 src/EditorStyleSheetNormalization.ts:112— `prototype === Object.prototype || prototype === null` appears character-identically in 3 files — src/EditorStyleSheetNormalization.ts, src/NativeEditorCreateValidation.ts, src/NativeEditorLocalAwareness.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 scripts/table-interop/checkpoint-report.ts:348— `slot.family === 'overlap' && slot.proof === 'history'` appears character-identically in 3 files — scripts/table-interop/checkpoint-report.ts, scripts/table-interop/run-checkpoint.ts, scripts/table-interop/run-continuations.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 src/EditorToolbarVisuals.tsx:193— `suggestion.label?.trim() || suggestion.title` appears character-identically in 2 files — src/EditorToolbarVisuals.tsx, src/addons.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 scripts/check-yrs-document-foundation-benchmarks.mjs:128— `typeof result.name !== 'string' || result.name.length === 0` appears character-identically in 2 files — scripts/check-yrs-document-foundation-benchmarks.mjs, scripts/check-yrs-editing-semantics-benchmarks.mjs. 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 scripts/check-yrs-document-foundation-benchmarks.mjs:141— `typeof result.p50Ms !== 'number' || !Number.isFinite(result.p50Ms) || result.p50Ms <= 0` appears character-identically in 2 files — scripts/check-yrs-document-foundation-benchmarks.mjs, scripts/check-yrs-editing-semantics-benchmarks.mjs. 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 src/atomUpdates.ts:13— `typeof value !== 'object' || ancestors.has(value) || ancestors.size > 128` appears character-identically in 2 files — src/atomUpdates.ts, src/attributeValidation.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 src/atomUpdates.ts:9— `typeof value === 'number' && Number.isFinite(value)` appears character-identically in 2 files — src/atomUpdates.ts, src/attributeValidation.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.
Silent fallback default in catch android/src/main/java/com/apollohg/editor/EditorEditTextRustCommands.kt:397— `preferredHardBreakNodeType` swallows every exception into `"hardBreak"` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch android/src/main/java/com/apollohg/editor/NativeCollaborationTransportRegistry.kt:332— `peers` swallows every exception into `emptyList<Any>()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch android/src/main/java/com/apollohg/editor/RemoteSelectionOverlayView.kt:62— `fromJson` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
Silent fallback default in catch ios/EditorV2Adapter.swift:390— `cacheStateForTesting` turns every thrown error into `""` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). 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 at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch ios/Viewer/PreparedProseDrawingView.swift:811— `atomLayoutsJSON` turns every thrown error into `"[]"` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). 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 at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
Silent fallback default in catch scripts/table-interop/continuity-evidence.ts:67— `continuationTarget` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/EditorMentionThemeValidation.ts:136— `validEditorMentionTheme` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/contentExpression.ts:409— `acceptingContentSymbols` 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.
Mock-dominated test: coalesces pending provisional values and commits the final value src/__tests__/ExternalTextComposition.test.ts:79— This test sets up 4 test doubles (for example `jest
.fn`) against 1 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: routes native link, mention, and error events through public callbacks src/__tests__/NativeProseViewer.test.tsx:202— This test sets up 3 test doubles (for example `jest.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: forwards native selection changes with the engine selection and fires focus/blur edges src/__tests__/NativeRichTextEditor.native-commits.test.tsx:719— This test sets up 3 test doubles (for example `jest.fn`) against 0 real object(s) of its own, and its only verification is 7 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: forgets the emitted active state when the view rebinds to another document src/__tests__/NativeRichTextEditor.native-events.test.tsx:398— This test sets up 3 test doubles (for example `jest.spyOn`) 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: never creates or changes an engine selection src/__tests__/TableSelectionGeometry.test.tsx:374— This test sets up 3 test doubles (for example `jest.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: exports subscribed content once per document revision and skips unchanged renders src/__tests__/useNativeEditor.test.tsx:67— This test sets up 4 test doubles (for example `jest.fn`) against 0 real object(s) of its own, and its only verification is 11 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.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×3
Projects may be oversized for their cohesion rust/editor-core/Cargo.toml:1— `rust/editor-core` (183804 LoC, 391 module-visible types across 71 directories) overshoots its size bounds. 3 of 7 build unit(s) (Cargo, Gradle, npm) overshoot their size bounds, lowering Project Cohesion to 1.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 package.json:1— `(repository root)` (65990 LoC, 1338 module-visible types across 23 directories) overshoots its size bounds. 3 of 7 build unit(s) (Cargo, Gradle, npm) overshoot their size bounds, lowering Project Cohesion to 1.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 android/build.gradle:1— `android` (54527 LoC, 845 module-visible types across 5 directories) overshoots its size bounds. 3 of 7 build unit(s) (Cargo, Gradle, npm) overshoot their size bounds, lowering Project Cohesion to 1.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.
Silent fallback default on Err packages/code-highlighting/rust/src/lib.rs:125— `highlight` turns every `Err` into `Ok(Vec::new())` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
Silent fallback default on Err rust/editor-core/src/alignment.rs:123— `targets_in` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
Silent fallback default on Err rust/editor-core/src/editor_state.rs:784— `nodes_at_position` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
No ADRs found rust/editor-core/Cargo.toml:42— 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 `rust/editor-core/Cargo.toml` makes this repository a deployable product (line 42).
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.
Logging is not universal — Only 1/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `packages/code-highlighting/rust`, `rust/editor-core`.
No SAST REDACTED:19— No static application security testing detected. For this repository's stack, add cargo-audit / cargo-deny (or clippy) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 2 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 dependency-update automation package.json:116— `package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
R7 · Dead Code· Unused export 'MENTION_NODE_STRING_FIELDS' · ×1
Unused export 'MENTION_NODE_STRING_FIELDS' src/EditorMentionThemeValidation.ts:17— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MENTION_NODE_NUMBER_FIELDS' · ×1
Unused export 'MENTION_NODE_NUMBER_FIELDS' src/EditorMentionThemeValidation.ts:23— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'isEditorToolbarFocusPreservationActive' · ×1
Unused export 'isEditorToolbarFocusPreservationActive' src/EditorToolbarRegistry.tsx:173— Nothing ultimately consumes this binding: its only referrer is the re-export in src/EditorToolbar.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/EditorToolbar.tsx in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export '_setEditorToolbarFrameForTests' · ×1
Unused export '_setEditorToolbarFrameForTests' src/EditorToolbarRegistry.tsx:254— Nothing ultimately consumes this binding: its only referrer is the re-export in src/EditorToolbar.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/EditorToolbar.tsx in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export '_beginEditorToolbarInteractionForTests' · ×1
Unused export '_beginEditorToolbarInteractionForTests' src/EditorToolbarRegistry.tsx:272— Nothing ultimately consumes this binding: its only referrer is the re-export in src/EditorToolbar.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/EditorToolbar.tsx in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export '_endEditorToolbarInteractionForTests' · ×1
Unused export '_endEditorToolbarInteractionForTests' src/EditorToolbarRegistry.tsx:276— Nothing ultimately consumes this binding: its only referrer is the re-export in src/EditorToolbar.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/EditorToolbar.tsx in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'MAX_COLLABORATION_PROTOCOLS' · ×1
Unused export 'MAX_COLLABORATION_PROTOCOLS' src/NativeEditorCollaborationTransport.ts:179— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MAX_COLLABORATION_PROTOCOL_BYTES' · ×1
Unused export 'MAX_COLLABORATION_PROTOCOL_BYTES' src/NativeEditorCollaborationTransport.ts:181— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MAX_COLLABORATION_ADAPTER_FRAME_BYTES' · ×1
Unused export 'MAX_COLLABORATION_ADAPTER_FRAME_BYTES' src/NativeEditorCollaborationTransport.ts:187— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused private field '_nativeEditorLocalAwarenessSelectionBrand' · ×1
Unused private field '_nativeEditorLocalAwarenessSelectionBrand' src/NativeEditorTypes.ts:46— Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
R7 · Dead Code· Unused private field '_nativeEditorLocalAwarenessCellSelectionBrand' · ×1
Unused private field '_nativeEditorLocalAwarenessCellSelectionBrand' src/NativeEditorTypes.ts:55— Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
doc comments repeat the names src/EditorToolbarTypes.tsx:329— 0 of 6 documented parameters and 6 of 649 summaries in `@apollohg/react-native-rich-text-editor` only repeat the member or parameter name (e.g. "Toggle bullet list." for `onToggleBulletList`). 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.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
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 33 file(s) — `android/src/main/java/com/apollohg/editor/AndroidCollaborationTransport.kt`, `android/src/main/java/com/apollohg/editor/EditorEditTextAnnotations.kt`, `android/src/main/java/com/apollohg/editor/EditorEditTextRenderPatch.kt`, `android/src/main/java/com/apollohg/editor/EditorEditTextRendering.kt`, `android/src/main/java/com/apollohg/editor/EditorEditTextSelection.kt`, … (+28 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
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 01a1e9ed-77da-75c4-b3c7-204f6ba347e4 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 128 · Warnings: 1800 · Recommendations: 84 · Info: 1 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 14:33 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.