Public report of edwardkim/rhwp, 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, 06:50 UTC · Survey ID cd_406bcd0e3e544e98add0fe52458084b4
edwardkim/rhwp
Measured 17 November 2026, 06:43 UTC, at code version 7213ed1
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 very large codebase: 1,246,284 lines of product code in 24 projects, tests not counted · Estimated rebuild effort: about 11.0 person-years · Weakest lens: Accessibility, 36.5
Findings by how serious they are
136 critical8795 serious283 minor
13 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, 06:43 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 ▸
65of 65 dimensions measured by tools.
9177of 9214 findings point to an exact file and line, so you can open each one in the code. The other 37 concern the repository as a whole, such as missing documentation.
65dimensions across 8 lenses, read from 1,246,284 lines of product code in 24 projects.
edwardkim/rhwp is rated At risk because critical security findings are open, all of them in the packages it uses. Its score is held back because it has controls that only work with a mouse and images with no text description. It scores 44.4 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.
Accessibility, at 36.5, is the weakest lens and counts most in the score. The best first step for the work it takes is making the tests check their results, worth about 2.8 points. Making the controls keyboard-usable would lift Accessibility itself, worth about 3.9 points. Raising Accessibility to 65 would lift the score to about 50.1.
Thirty-three controls can't be used without a mouse. Twenty-eight images have no description for people who can't see them, and thirty-seven form fields can't be read by a screen reader. Making the controls work with a keyboard, describing the images and labelling the form fields would close these risks. Updating the vulnerable packages would fix the eight packages with a known security hole. The seven sets of files in separate parts that keep changing together need that dependency made explicit.
The product code is 1,246,284 lines, about €1,600,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 Accessibility rose from 36.5 to 65, the lowest score rated Strong, the score would rise from 44.4 to about 50.1.
Code composition: what the lines of code are
Business logic 0%Supporting code 0%Tests 100%
Rebuild cost: about €1,600,000 · Estimate
Cost to rebuild
€530,000 to €2,700,000, for 8,856 to 28,094 hours of work, about 11.0 person-years for 6 to 21 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 44. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Very large: 1,246,284 lines of product code
Comment lines
The estimate prices 1,246,262 lines. Comment lines count towards the size of 1,246,284 lines but aren't priced as work.
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.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with cell-selection-caret-sync.test.ts.
Raises the score by about 2.8 points · Low effort · Test Quality
2
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 3.9 points · Medium effort · Keyboard semantics
3
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 3.2 points · Medium effort · Text alternatives
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 €1,600,000 to build again, about 11.0 person-years of work. Its weakest lens is Accessibility, at 36.5 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Resolve the 1 No assertions (empty test) finding(s) in Test Quality. Of all the actions in this report, it raises the score most for the work it takes: about 2.8 points for low effort, because it clears the 1 Test Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.2 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 7% to 16% on every change. The history of the code shows how much it changes: about 5,208,609 lines over the last 90 days, which is about 21,123,803 lines a year. At that pace, the extra work comes to an estimated 3695 to 22170.1 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.
2782 modules, with 5423 dependencies between them. 23 loops run through 310 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 2742 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.
rhwp-studio.src.core.wasm-bridge uses rhwp-studio.src.core.types, so a change to rhwp-studio.src.core.types can break rhwp-studio.src.core.wasm-bridge, while a change to rhwp-studio.src.core.wasm-bridge can't break rhwp-studio.src.core.types.
Position
Below the diagonal: rhwp-studio.src.core.wasm-bridge uses a module listed above it, which is the healthy direction.
14→29 rhwp.model.style uses rhwp.agent.dsel.nodepart of a loop✕
Connections
1 pair of types, where a type in rhwp.model.style uses a type in rhwp.agent.dsel.node.
The types involved
rhwp.model.style.Font → rhwp.agent.dsel.node.Node
Direction
rhwp.model.style uses rhwp.agent.dsel.node, so a change to rhwp.agent.dsel.node can break rhwp.model.style, while a change to rhwp.model.style can't break rhwp.agent.dsel.node.
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.
rhwp.model.table uses rhwp.doclang.ir.table, so a change to rhwp.doclang.ir.table can break rhwp.model.table, while a change to rhwp.model.table can't break rhwp.doclang.ir.table.
Position
Below the diagonal: rhwp.model.table uses a module listed above it, which is the healthy direction.
15→19 rhwp.model.table uses rhwp.model.shapepart of a loop✕
Connections
2 pairs of types, where a type in rhwp.model.table uses a type in rhwp.model.shape.
rhwp.model.table uses rhwp.model.shape, so a change to rhwp.model.shape can break rhwp.model.table, while a change to rhwp.model.table can't break rhwp.model.shape.
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.
15→26 rhwp.model.table uses rhwp.model.paragraphpart of a loop✕
Connections
2 pairs of types, where a type in rhwp.model.table uses a type in rhwp.model.paragraph.
rhwp.model.table uses rhwp.model.paragraph, so a change to rhwp.model.paragraph can break rhwp.model.table, while a change to rhwp.model.table can't break rhwp.model.paragraph.
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.
rhwp.native_host.presentation uses rhwp.emf, so a change to rhwp.emf can break rhwp.native_host.presentation, while a change to rhwp.native_host.presentation can't break rhwp.emf.
Position
Below the diagonal: rhwp.native_host.presentation uses a module listed above it, which is the healthy direction.
rhwp_pdf_import_backend.layout.text_block uses rhwp_pdf_import_backend.geometry, so a change to rhwp_pdf_import_backend.geometry can break rhwp_pdf_import_backend.layout.text_block, while a change to rhwp_pdf_import_backend.layout.text_block can't break rhwp_pdf_import_backend.geometry.
Position
Below the diagonal: rhwp_pdf_import_backend.layout.text_block uses a module listed above it, which is the healthy direction.
rhwp_pdf_import_backend.layout.text_block uses rhwp_pdf_import_backend.import_limits, so a change to rhwp_pdf_import_backend.import_limits can break rhwp_pdf_import_backend.layout.text_block, while a change to rhwp_pdf_import_backend.layout.text_block can't break rhwp_pdf_import_backend.import_limits.
Position
Below the diagonal: rhwp_pdf_import_backend.layout.text_block uses a module listed above it, which is the healthy direction.
rhwp_pdf_import_backend.object uses rhwp_pdf_import_backend.import_limits, so a change to rhwp_pdf_import_backend.import_limits can break rhwp_pdf_import_backend.object, while a change to rhwp_pdf_import_backend.object can't break rhwp_pdf_import_backend.import_limits.
Position
Below the diagonal: rhwp_pdf_import_backend.object uses a module listed above it, which is the healthy direction.
rhwp.model.shape uses rhwp.agent.dsel.ast, so a change to rhwp.agent.dsel.ast can break rhwp.model.shape, while a change to rhwp.model.shape can't break rhwp.agent.dsel.ast.
Position
Below the diagonal: rhwp.model.shape uses a module listed above it, which is the healthy direction.
rhwp.model.shape uses rhwp.model.style, so a change to rhwp.model.style can break rhwp.model.shape, while a change to rhwp.model.shape can't break rhwp.model.style.
Position
Below the diagonal: rhwp.model.shape uses a module listed above it, which is the healthy direction.
rhwp.model.shape uses rhwp.model.table, so a change to rhwp.model.table can break rhwp.model.shape, while a change to rhwp.model.shape can't break rhwp.model.table.
Position
Below the diagonal: rhwp.model.shape uses a module listed above it, which is the healthy direction.
19→26 rhwp.model.shape uses rhwp.model.paragraphpart of a loop✕
Connections
2 pairs of types, where a type in rhwp.model.shape uses a type in rhwp.model.paragraph.
rhwp.model.shape uses rhwp.model.paragraph, so a change to rhwp.model.paragraph can break rhwp.model.shape, while a change to rhwp.model.shape can't break rhwp.model.paragraph.
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.
rhwp_pdf_import_backend.document uses rhwp_pdf_import_backend.geometry, so a change to rhwp_pdf_import_backend.geometry can break rhwp_pdf_import_backend.document, while a change to rhwp_pdf_import_backend.document can't break rhwp_pdf_import_backend.geometry.
Position
Below the diagonal: rhwp_pdf_import_backend.document uses a module listed above it, which is the healthy direction.
rhwp_pdf_import_backend.document uses rhwp_pdf_import_backend.import_limits, so a change to rhwp_pdf_import_backend.import_limits can break rhwp_pdf_import_backend.document, while a change to rhwp_pdf_import_backend.document can't break rhwp_pdf_import_backend.import_limits.
Position
Below the diagonal: rhwp_pdf_import_backend.document uses a module listed above it, which is the healthy direction.
rhwp_pdf_import_backend.document uses rhwp_pdf_import_backend.layout.text_block, so a change to rhwp_pdf_import_backend.layout.text_block can break rhwp_pdf_import_backend.document, while a change to rhwp_pdf_import_backend.document can't break rhwp_pdf_import_backend.layout.text_block.
Position
Below the diagonal: rhwp_pdf_import_backend.document uses a module listed above it, which is the healthy direction.
rhwp_pdf_import_backend.document uses rhwp_pdf_import_backend.object, so a change to rhwp_pdf_import_backend.object can break rhwp_pdf_import_backend.document, while a change to rhwp_pdf_import_backend.document can't break rhwp_pdf_import_backend.object.
Position
Below the diagonal: rhwp_pdf_import_backend.document uses a module listed above it, which is the healthy direction.
rhwp.model.image uses rhwp.model.style, so a change to rhwp.model.style can break rhwp.model.image, while a change to rhwp.model.image can't break rhwp.model.style.
Position
Below the diagonal: rhwp.model.image uses a module listed above it, which is the healthy direction.
rhwp.model.image uses rhwp.model.shape, so a change to rhwp.model.shape can break rhwp.model.image, while a change to rhwp.model.image can't break rhwp.model.shape.
Position
Below the diagonal: rhwp.model.image uses a module listed above it, which is the healthy direction.
rhwp.renderer.style_resolver.resolved uses rhwp.model.style, so a change to rhwp.model.style can break rhwp.renderer.style_resolver.resolved, while a change to rhwp.renderer.style_resolver.resolved can't break rhwp.model.style.
Position
Below the diagonal: rhwp.renderer.style_resolver.resolved uses a module listed above it, which is the healthy direction.
rhwp.renderer.style_resolver.resolved uses rhwp.model.image, so a change to rhwp.model.image can break rhwp.renderer.style_resolver.resolved, while a change to rhwp.renderer.style_resolver.resolved can't break rhwp.model.image.
Position
Below the diagonal: rhwp.renderer.style_resolver.resolved uses a module listed above it, which is the healthy direction.
22→25 rhwp.renderer.style_resolver.resolved uses rhwp.rendererpart of a loop✕
Connections
3 pairs of types, where a type in rhwp.renderer.style_resolver.resolved uses a type in rhwp.renderer.
rhwp.renderer.style_resolver.resolved uses rhwp.renderer, so a change to rhwp.renderer can break rhwp.renderer.style_resolver.resolved, while a change to rhwp.renderer.style_resolver.resolved can't break rhwp.renderer.
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.
rhwp.renderer.composer uses rhwp.renderer.style_resolver.resolved, so a change to rhwp.renderer.style_resolver.resolved can break rhwp.renderer.composer, while a change to rhwp.renderer.composer can't break rhwp.renderer.style_resolver.resolved.
Position
Below the diagonal: rhwp.renderer.composer uses a module listed above it, which is the healthy direction.
23→25 rhwp.renderer.composer uses rhwp.rendererpart of a loop✕
Connections
1 pair of types, where a type in rhwp.renderer.composer uses a type in rhwp.renderer.
rhwp.renderer.composer uses rhwp.renderer, so a change to rhwp.renderer can break rhwp.renderer.composer, while a change to rhwp.renderer.composer can't break rhwp.renderer.
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.
23→26 rhwp.renderer.composer uses rhwp.model.paragraphpart of a loop✕
Connections
4 pairs of types, where a type in rhwp.renderer.composer uses a type in rhwp.model.paragraph.
rhwp.renderer.composer uses rhwp.model.paragraph, so a change to rhwp.model.paragraph can break rhwp.renderer.composer, while a change to rhwp.renderer.composer can't break rhwp.model.paragraph.
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.
rhwp.renderer.pagination uses rhwp.doclang.ir.table, so a change to rhwp.doclang.ir.table can break rhwp.renderer.pagination, while a change to rhwp.renderer.pagination can't break rhwp.doclang.ir.table.
Position
Below the diagonal: rhwp.renderer.pagination uses a module listed above it, which is the healthy direction.
rhwp.renderer.pagination uses rhwp.model.page, so a change to rhwp.model.page can break rhwp.renderer.pagination, while a change to rhwp.renderer.pagination can't break rhwp.model.page.
Position
Below the diagonal: rhwp.renderer.pagination uses a module listed above it, which is the healthy direction.
rhwp.renderer.pagination uses rhwp.model.provenance, so a change to rhwp.model.provenance can break rhwp.renderer.pagination, while a change to rhwp.renderer.pagination can't break rhwp.model.provenance.
Position
Below the diagonal: rhwp.renderer.pagination uses a module listed above it, which is the healthy direction.
rhwp.renderer.pagination uses rhwp.renderer.style_resolver.resolved, so a change to rhwp.renderer.style_resolver.resolved can break rhwp.renderer.pagination, while a change to rhwp.renderer.pagination can't break rhwp.renderer.style_resolver.resolved.
Position
Below the diagonal: rhwp.renderer.pagination uses a module listed above it, which is the healthy direction.
24→26 rhwp.renderer.pagination uses rhwp.model.paragraphpart of a loop✕
Connections
3 pairs of types, where a type in rhwp.renderer.pagination uses a type in rhwp.model.paragraph.
rhwp.renderer.pagination uses rhwp.model.paragraph, so a change to rhwp.model.paragraph can break rhwp.renderer.pagination, while a change to rhwp.renderer.pagination can't break rhwp.model.paragraph.
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.
24→27 rhwp.renderer.pagination uses rhwp.model.controlpart of a loop✕
Connections
5 pairs of types, where a type in rhwp.renderer.pagination uses a type in rhwp.model.control.
rhwp.renderer.pagination uses rhwp.model.control, so a change to rhwp.model.control can break rhwp.renderer.pagination, while a change to rhwp.renderer.pagination can't break rhwp.model.control.
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.
rhwp.renderer uses rhwp.doclang.ir.table, so a change to rhwp.doclang.ir.table can break rhwp.renderer, while a change to rhwp.renderer can't break rhwp.doclang.ir.table.
Position
Below the diagonal: rhwp.renderer uses a module listed above it, which is the healthy direction.
rhwp.renderer uses rhwp.model.page, so a change to rhwp.model.page can break rhwp.renderer, while a change to rhwp.renderer can't break rhwp.model.page.
Position
Below the diagonal: rhwp.renderer uses a module listed above it, which is the healthy direction.
rhwp.renderer uses rhwp.model.style, so a change to rhwp.model.style can break rhwp.renderer, while a change to rhwp.renderer can't break rhwp.model.style.
Position
Below the diagonal: rhwp.renderer uses a module listed above it, which is the healthy direction.
rhwp.renderer uses rhwp.model.shape, so a change to rhwp.model.shape can break rhwp.renderer, while a change to rhwp.renderer can't break rhwp.model.shape.
Position
Below the diagonal: rhwp.renderer uses a module listed above it, which is the healthy direction.
rhwp.renderer uses rhwp.renderer.style_resolver.resolved, so a change to rhwp.renderer.style_resolver.resolved can break rhwp.renderer, while a change to rhwp.renderer can't break rhwp.renderer.style_resolver.resolved.
Position
Below the diagonal: rhwp.renderer uses a module listed above it, which is the healthy direction.
rhwp.renderer uses rhwp.renderer.composer, so a change to rhwp.renderer.composer can break rhwp.renderer, while a change to rhwp.renderer can't break rhwp.renderer.composer.
Position
Below the diagonal: rhwp.renderer uses a module listed above it, which is the healthy direction.
rhwp.renderer uses rhwp.renderer.pagination, so a change to rhwp.renderer.pagination can break rhwp.renderer, while a change to rhwp.renderer can't break rhwp.renderer.pagination.
Position
Below the diagonal: rhwp.renderer uses a module listed above it, which is the healthy direction.
25→26 rhwp.renderer uses rhwp.model.paragraphpart of a loop✕
Connections
2 pairs of types, where a type in rhwp.renderer uses a type in rhwp.model.paragraph.
rhwp.renderer uses rhwp.model.paragraph, so a change to rhwp.model.paragraph can break rhwp.renderer, while a change to rhwp.renderer can't break rhwp.model.paragraph.
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.
25→27 rhwp.renderer uses rhwp.model.controlpart of a loop✕
Connections
2 pairs of types, where a type in rhwp.renderer uses a type in rhwp.model.control.
rhwp.renderer uses rhwp.model.control, so a change to rhwp.model.control can break rhwp.renderer, while a change to rhwp.renderer can't break rhwp.model.control.
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.
rhwp.model.paragraph uses rhwp.renderer, so a change to rhwp.renderer can break rhwp.model.paragraph, while a change to rhwp.model.paragraph can't break rhwp.renderer.
Position
Below the diagonal: rhwp.model.paragraph uses a module listed above it, which is the healthy direction.
26→27 rhwp.model.paragraph uses rhwp.model.controlpart of a loop✕
Connections
3 pairs of types, where a type in rhwp.model.paragraph uses a type in rhwp.model.control.
rhwp.model.paragraph uses rhwp.model.control, so a change to rhwp.model.control can break rhwp.model.paragraph, while a change to rhwp.model.paragraph can't break rhwp.model.control.
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.
rhwp.model.control uses rhwp.model.shape, so a change to rhwp.model.shape can break rhwp.model.control, while a change to rhwp.model.control can't break rhwp.model.shape.
Position
Below the diagonal: rhwp.model.control uses a module listed above it, which is the healthy direction.
rhwp.model.control uses rhwp.model.paragraph, so a change to rhwp.model.paragraph can break rhwp.model.control, while a change to rhwp.model.control can't break rhwp.model.paragraph.
Position
Below the diagonal: rhwp.model.control uses a module listed above it, which is the healthy direction.
rhwp.model.document uses rhwp.agent.dsel.ast, so a change to rhwp.agent.dsel.ast can break rhwp.model.document, while a change to rhwp.model.document can't break rhwp.agent.dsel.ast.
Position
Below the diagonal: rhwp.model.document uses a module listed above it, which is the healthy direction.
rhwp.model.document uses rhwp.model.page, so a change to rhwp.model.page can break rhwp.model.document, while a change to rhwp.model.document can't break rhwp.model.page.
Position
Below the diagonal: rhwp.model.document uses a module listed above it, which is the healthy direction.
rhwp.model.document uses rhwp.model.provenance, so a change to rhwp.model.provenance can break rhwp.model.document, while a change to rhwp.model.document can't break rhwp.model.provenance.
Position
Below the diagonal: rhwp.model.document uses a module listed above it, which is the healthy direction.
rhwp.model.document uses rhwp.model.style, so a change to rhwp.model.style can break rhwp.model.document, while a change to rhwp.model.document can't break rhwp.model.style.
Position
Below the diagonal: rhwp.model.document uses a module listed above it, which is the healthy direction.
rhwp.model.document uses rhwp.model.paragraph, so a change to rhwp.model.paragraph can break rhwp.model.document, while a change to rhwp.model.document can't break rhwp.model.paragraph.
Position
Below the diagonal: rhwp.model.document uses a module listed above it, which is the healthy direction.
rhwp.agent.dsel.node uses rhwp.agent.dsel.ast, so a change to rhwp.agent.dsel.ast can break rhwp.agent.dsel.node, while a change to rhwp.agent.dsel.node can't break rhwp.agent.dsel.ast.
Position
Below the diagonal: rhwp.agent.dsel.node uses a module listed above it, which is the healthy direction.
rhwp.agent.dsel.node uses rhwp.model.paragraph, so a change to rhwp.model.paragraph can break rhwp.agent.dsel.node, while a change to rhwp.agent.dsel.node can't break rhwp.model.paragraph.
Position
Below the diagonal: rhwp.agent.dsel.node uses a module listed above it, which is the healthy direction.
rhwp.agent.dsel.node uses rhwp.model.control, so a change to rhwp.model.control can break rhwp.agent.dsel.node, while a change to rhwp.agent.dsel.node can't break rhwp.model.control.
Position
Below the diagonal: rhwp.agent.dsel.node uses a module listed above it, which is the healthy direction.
rhwp.parser uses rhwp.model.document, so a change to rhwp.model.document can break rhwp.parser, while a change to rhwp.parser can't break rhwp.model.document.
Position
Below the diagonal: rhwp.parser uses a module listed above it, which is the healthy direction.
rhwp.renderer.float_placement uses rhwp.doclang.ir.table, so a change to rhwp.doclang.ir.table can break rhwp.renderer.float_placement, while a change to rhwp.renderer.float_placement can't break rhwp.doclang.ir.table.
Position
Below the diagonal: rhwp.renderer.float_placement uses a module listed above it, which is the healthy direction.
rhwp.renderer.float_placement uses rhwp.model.provenance, so a change to rhwp.model.provenance can break rhwp.renderer.float_placement, while a change to rhwp.renderer.float_placement can't break rhwp.model.provenance.
Position
Below the diagonal: rhwp.renderer.float_placement uses a module listed above it, which is the healthy direction.
rhwp.renderer.float_placement uses rhwp.model.style, so a change to rhwp.model.style can break rhwp.renderer.float_placement, while a change to rhwp.renderer.float_placement can't break rhwp.model.style.
Position
Below the diagonal: rhwp.renderer.float_placement uses a module listed above it, which is the healthy direction.
rhwp.renderer.float_placement uses rhwp.model.table, so a change to rhwp.model.table can break rhwp.renderer.float_placement, while a change to rhwp.renderer.float_placement can't break rhwp.model.table.
Position
Below the diagonal: rhwp.renderer.float_placement uses a module listed above it, which is the healthy direction.
rhwp.renderer.float_placement uses rhwp.model.shape, so a change to rhwp.model.shape can break rhwp.renderer.float_placement, while a change to rhwp.renderer.float_placement can't break rhwp.model.shape.
Position
Below the diagonal: rhwp.renderer.float_placement uses a module listed above it, which is the healthy direction.
rhwp.renderer.float_placement uses rhwp.model.image, so a change to rhwp.model.image can break rhwp.renderer.float_placement, while a change to rhwp.renderer.float_placement can't break rhwp.model.image.
Position
Below the diagonal: rhwp.renderer.float_placement uses a module listed above it, which is the healthy direction.
rhwp.renderer.float_placement uses rhwp.renderer.style_resolver.resolved, so a change to rhwp.renderer.style_resolver.resolved can break rhwp.renderer.float_placement, while a change to rhwp.renderer.float_placement can't break rhwp.renderer.style_resolver.resolved.
Position
Below the diagonal: rhwp.renderer.float_placement uses a module listed above it, which is the healthy direction.
rhwp.renderer.float_placement uses rhwp.renderer.pagination, so a change to rhwp.renderer.pagination can break rhwp.renderer.float_placement, while a change to rhwp.renderer.float_placement can't break rhwp.renderer.pagination.
Position
Below the diagonal: rhwp.renderer.float_placement uses a module listed above it, which is the healthy direction.
rhwp.renderer.float_placement uses rhwp.model.paragraph, so a change to rhwp.model.paragraph can break rhwp.renderer.float_placement, while a change to rhwp.renderer.float_placement can't break rhwp.model.paragraph.
Position
Below the diagonal: rhwp.renderer.float_placement uses a module listed above it, which is the healthy direction.
rhwp.renderer.float_placement uses rhwp.model.control, so a change to rhwp.model.control can break rhwp.renderer.float_placement, while a change to rhwp.renderer.float_placement can't break rhwp.model.control.
Position
Below the diagonal: rhwp.renderer.float_placement uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.doclang.ir.table, so a change to rhwp.doclang.ir.table can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.doclang.ir.table.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.model.page, so a change to rhwp.model.page can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.model.page.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.model.provenance, so a change to rhwp.model.provenance can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.model.provenance.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.model.style, so a change to rhwp.model.style can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.model.style.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.model.table, so a change to rhwp.model.table can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.model.table.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.model.shape, so a change to rhwp.model.shape can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.model.shape.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.model.image, so a change to rhwp.model.image can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.model.image.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.renderer.style_resolver.resolved, so a change to rhwp.renderer.style_resolver.resolved can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.renderer.style_resolver.resolved.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.renderer.composer, so a change to rhwp.renderer.composer can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.renderer.composer.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.renderer.pagination, so a change to rhwp.renderer.pagination can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.renderer.pagination.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.renderer, so a change to rhwp.renderer can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.renderer.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.model.paragraph, so a change to rhwp.model.paragraph can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.model.paragraph.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.model.control, so a change to rhwp.model.control can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.model.control.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.agent.dsel.node, so a change to rhwp.agent.dsel.node can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.agent.dsel.node.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
rhwp.renderer.layout uses rhwp.renderer.float_placement, so a change to rhwp.renderer.float_placement can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.renderer.float_placement.
Position
Below the diagonal: rhwp.renderer.layout uses a module listed above it, which is the healthy direction.
32→35 rhwp.renderer.layout uses rhwp.renderer.render_treepart of a loop✕
Connections
11 pairs of types, where a type in rhwp.renderer.layout uses a type in rhwp.renderer.render_tree.
rhwp.renderer.layout uses rhwp.renderer.render_tree, so a change to rhwp.renderer.render_tree can break rhwp.renderer.layout, while a change to rhwp.renderer.layout can't break rhwp.renderer.render_tree.
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.
rhwp.renderer.typeset.paragraph.metrics uses rhwp.model.provenance, so a change to rhwp.model.provenance can break rhwp.renderer.typeset.paragraph.metrics, while a change to rhwp.renderer.typeset.paragraph.metrics can't break rhwp.model.provenance.
Position
Below the diagonal: rhwp.renderer.typeset.paragraph.metrics uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset.paragraph.metrics uses rhwp.renderer.composer, so a change to rhwp.renderer.composer can break rhwp.renderer.typeset.paragraph.metrics, while a change to rhwp.renderer.typeset.paragraph.metrics can't break rhwp.renderer.composer.
Position
Below the diagonal: rhwp.renderer.typeset.paragraph.metrics uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset.paragraph.metrics uses rhwp.model.paragraph, so a change to rhwp.model.paragraph can break rhwp.renderer.typeset.paragraph.metrics, while a change to rhwp.renderer.typeset.paragraph.metrics can't break rhwp.model.paragraph.
Position
Below the diagonal: rhwp.renderer.typeset.paragraph.metrics uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset.paragraph.metrics uses rhwp.renderer.float_placement, so a change to rhwp.renderer.float_placement can break rhwp.renderer.typeset.paragraph.metrics, while a change to rhwp.renderer.typeset.paragraph.metrics can't break rhwp.renderer.float_placement.
Position
Below the diagonal: rhwp.renderer.typeset.paragraph.metrics uses a module listed above it, which is the healthy direction.
rhwp.wmf.converter.svg uses rhwp.agent.dsel.node, so a change to rhwp.agent.dsel.node can break rhwp.wmf.converter.svg, while a change to rhwp.wmf.converter.svg can't break rhwp.agent.dsel.node.
Position
Below the diagonal: rhwp.wmf.converter.svg uses a module listed above it, which is the healthy direction.
rhwp.renderer.render_tree uses rhwp.emf, so a change to rhwp.emf can break rhwp.renderer.render_tree, while a change to rhwp.renderer.render_tree can't break rhwp.emf.
Position
Below the diagonal: rhwp.renderer.render_tree uses a module listed above it, which is the healthy direction.
rhwp.renderer.render_tree uses rhwp.model.style, so a change to rhwp.model.style can break rhwp.renderer.render_tree, while a change to rhwp.renderer.render_tree can't break rhwp.model.style.
Position
Below the diagonal: rhwp.renderer.render_tree uses a module listed above it, which is the healthy direction.
rhwp.renderer.render_tree uses rhwp.model.shape, so a change to rhwp.model.shape can break rhwp.renderer.render_tree, while a change to rhwp.renderer.render_tree can't break rhwp.model.shape.
Position
Below the diagonal: rhwp.renderer.render_tree uses a module listed above it, which is the healthy direction.
rhwp.renderer.render_tree uses rhwp.model.image, so a change to rhwp.model.image can break rhwp.renderer.render_tree, while a change to rhwp.renderer.render_tree can't break rhwp.model.image.
Position
Below the diagonal: rhwp.renderer.render_tree uses a module listed above it, which is the healthy direction.
rhwp.renderer.render_tree uses rhwp.renderer.composer, so a change to rhwp.renderer.composer can break rhwp.renderer.render_tree, while a change to rhwp.renderer.render_tree can't break rhwp.renderer.composer.
Position
Below the diagonal: rhwp.renderer.render_tree uses a module listed above it, which is the healthy direction.
rhwp.renderer.render_tree uses rhwp.renderer, so a change to rhwp.renderer can break rhwp.renderer.render_tree, while a change to rhwp.renderer.render_tree can't break rhwp.renderer.
Position
Below the diagonal: rhwp.renderer.render_tree uses a module listed above it, which is the healthy direction.
rhwp.renderer.render_tree uses rhwp.model.control, so a change to rhwp.model.control can break rhwp.renderer.render_tree, while a change to rhwp.renderer.render_tree can't break rhwp.model.control.
Position
Below the diagonal: rhwp.renderer.render_tree uses a module listed above it, which is the healthy direction.
rhwp.renderer.render_tree uses rhwp.agent.dsel.node, so a change to rhwp.agent.dsel.node can break rhwp.renderer.render_tree, while a change to rhwp.renderer.render_tree can't break rhwp.agent.dsel.node.
Position
Below the diagonal: rhwp.renderer.render_tree uses a module listed above it, which is the healthy direction.
rhwp.renderer.render_tree uses rhwp.renderer.layout, so a change to rhwp.renderer.layout can break rhwp.renderer.render_tree, while a change to rhwp.renderer.render_tree can't break rhwp.renderer.layout.
Position
Below the diagonal: rhwp.renderer.render_tree uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset.state uses rhwp.doclang.ir.table, so a change to rhwp.doclang.ir.table can break rhwp.renderer.typeset.state, while a change to rhwp.renderer.typeset.state can't break rhwp.doclang.ir.table.
Position
Below the diagonal: rhwp.renderer.typeset.state uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset.state uses rhwp.model.page, so a change to rhwp.model.page can break rhwp.renderer.typeset.state, while a change to rhwp.renderer.typeset.state can't break rhwp.model.page.
Position
Below the diagonal: rhwp.renderer.typeset.state uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset.state uses rhwp.model.provenance, so a change to rhwp.model.provenance can break rhwp.renderer.typeset.state, while a change to rhwp.renderer.typeset.state can't break rhwp.model.provenance.
Position
Below the diagonal: rhwp.renderer.typeset.state uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset.state uses rhwp.renderer.style_resolver.resolved, so a change to rhwp.renderer.style_resolver.resolved can break rhwp.renderer.typeset.state, while a change to rhwp.renderer.typeset.state can't break rhwp.renderer.style_resolver.resolved.
Position
Below the diagonal: rhwp.renderer.typeset.state uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset.state uses rhwp.renderer.composer, so a change to rhwp.renderer.composer can break rhwp.renderer.typeset.state, while a change to rhwp.renderer.typeset.state can't break rhwp.renderer.composer.
Position
Below the diagonal: rhwp.renderer.typeset.state uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset.state uses rhwp.renderer.pagination, so a change to rhwp.renderer.pagination can break rhwp.renderer.typeset.state, while a change to rhwp.renderer.typeset.state can't break rhwp.renderer.pagination.
Position
Below the diagonal: rhwp.renderer.typeset.state uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset.state uses rhwp.model.paragraph, so a change to rhwp.model.paragraph can break rhwp.renderer.typeset.state, while a change to rhwp.renderer.typeset.state can't break rhwp.model.paragraph.
Position
Below the diagonal: rhwp.renderer.typeset.state uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset.state uses rhwp.model.control, so a change to rhwp.model.control can break rhwp.renderer.typeset.state, while a change to rhwp.renderer.typeset.state can't break rhwp.model.control.
Position
Below the diagonal: rhwp.renderer.typeset.state uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset.state uses rhwp.renderer.float_placement, so a change to rhwp.renderer.float_placement can break rhwp.renderer.typeset.state, while a change to rhwp.renderer.typeset.state can't break rhwp.renderer.float_placement.
Position
Below the diagonal: rhwp.renderer.typeset.state uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset.state uses rhwp.renderer.layout, so a change to rhwp.renderer.layout can break rhwp.renderer.typeset.state, while a change to rhwp.renderer.typeset.state can't break rhwp.renderer.layout.
Position
Below the diagonal: rhwp.renderer.typeset.state uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset.state uses rhwp.renderer.typeset.paragraph.metrics, so a change to rhwp.renderer.typeset.paragraph.metrics can break rhwp.renderer.typeset.state, while a change to rhwp.renderer.typeset.state can't break rhwp.renderer.typeset.paragraph.metrics.
Position
Below the diagonal: rhwp.renderer.typeset.state uses a module listed above it, which is the healthy direction.
36→38 rhwp.renderer.typeset.state uses rhwp.renderer.typesetpart of a loop✕
Connections
3 pairs of types, where a type in rhwp.renderer.typeset.state uses a type in rhwp.renderer.typeset.
rhwp.renderer.typeset.state uses rhwp.renderer.typeset, so a change to rhwp.renderer.typeset can break rhwp.renderer.typeset.state, while a change to rhwp.renderer.typeset.state can't break rhwp.renderer.typeset.
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.
rhwp.paint.paint_op uses rhwp.model.style, so a change to rhwp.model.style can break rhwp.paint.paint_op, while a change to rhwp.paint.paint_op can't break rhwp.model.style.
Position
Below the diagonal: rhwp.paint.paint_op uses a module listed above it, which is the healthy direction.
rhwp.paint.paint_op uses rhwp.renderer, so a change to rhwp.renderer can break rhwp.paint.paint_op, while a change to rhwp.paint.paint_op can't break rhwp.renderer.
Position
Below the diagonal: rhwp.paint.paint_op uses a module listed above it, which is the healthy direction.
rhwp.paint.paint_op uses rhwp.renderer.render_tree, so a change to rhwp.renderer.render_tree can break rhwp.paint.paint_op, while a change to rhwp.paint.paint_op can't break rhwp.renderer.render_tree.
Position
Below the diagonal: rhwp.paint.paint_op uses a module listed above it, which is the healthy direction.
37→39 rhwp.paint.paint_op uses rhwp.paint.layer_treepart of a loop✕
Connections
10 pairs of types, where a type in rhwp.paint.paint_op uses a type in rhwp.paint.layer_tree.
rhwp.paint.paint_op uses rhwp.paint.layer_tree, so a change to rhwp.paint.layer_tree can break rhwp.paint.paint_op, while a change to rhwp.paint.paint_op can't break rhwp.paint.layer_tree.
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.
rhwp.renderer.typeset uses rhwp.doclang.ir.table, so a change to rhwp.doclang.ir.table can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.doclang.ir.table.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset uses rhwp.model.page, so a change to rhwp.model.page can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.model.page.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset uses rhwp.model.provenance, so a change to rhwp.model.provenance can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.model.provenance.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset uses rhwp.model.table, so a change to rhwp.model.table can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.model.table.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset uses rhwp.model.shape, so a change to rhwp.model.shape can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.model.shape.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset uses rhwp.model.image, so a change to rhwp.model.image can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.model.image.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset uses rhwp.renderer.style_resolver.resolved, so a change to rhwp.renderer.style_resolver.resolved can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.renderer.style_resolver.resolved.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset uses rhwp.renderer.composer, so a change to rhwp.renderer.composer can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.renderer.composer.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset uses rhwp.renderer.pagination, so a change to rhwp.renderer.pagination can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.renderer.pagination.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset uses rhwp.model.paragraph, so a change to rhwp.model.paragraph can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.model.paragraph.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset uses rhwp.model.control, so a change to rhwp.model.control can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.model.control.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset uses rhwp.renderer.float_placement, so a change to rhwp.renderer.float_placement can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.renderer.float_placement.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset uses rhwp.renderer.layout, so a change to rhwp.renderer.layout can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.renderer.layout.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset uses rhwp.renderer.typeset.paragraph.metrics, so a change to rhwp.renderer.typeset.paragraph.metrics can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.renderer.typeset.paragraph.metrics.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.renderer.typeset uses rhwp.renderer.typeset.state, so a change to rhwp.renderer.typeset.state can break rhwp.renderer.typeset, while a change to rhwp.renderer.typeset can't break rhwp.renderer.typeset.state.
Position
Below the diagonal: rhwp.renderer.typeset uses a module listed above it, which is the healthy direction.
rhwp.paint.layer_tree uses rhwp.agent.dsel.node, so a change to rhwp.agent.dsel.node can break rhwp.paint.layer_tree, while a change to rhwp.paint.layer_tree can't break rhwp.agent.dsel.node.
Position
Below the diagonal: rhwp.paint.layer_tree uses a module listed above it, which is the healthy direction.
rhwp.paint.layer_tree uses rhwp.renderer.render_tree, so a change to rhwp.renderer.render_tree can break rhwp.paint.layer_tree, while a change to rhwp.paint.layer_tree can't break rhwp.renderer.render_tree.
Position
Below the diagonal: rhwp.paint.layer_tree uses a module listed above it, which is the healthy direction.
rhwp.paint.layer_tree uses rhwp.paint.paint_op, so a change to rhwp.paint.paint_op can break rhwp.paint.layer_tree, while a change to rhwp.paint.layer_tree can't break rhwp.paint.paint_op.
Position
Below the diagonal: rhwp.paint.layer_tree uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.agent.dsel.ast, so a change to rhwp.agent.dsel.ast can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.agent.dsel.ast.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.doclang.ir.table, so a change to rhwp.doclang.ir.table can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.doclang.ir.table.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.model.page, so a change to rhwp.model.page can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.model.page.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.model.provenance, so a change to rhwp.model.provenance can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.model.provenance.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.model.style, so a change to rhwp.model.style can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.model.style.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.model.table, so a change to rhwp.model.table can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.model.table.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.model.shape, so a change to rhwp.model.shape can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.model.shape.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.model.image, so a change to rhwp.model.image can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.model.image.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.renderer.style_resolver.resolved, so a change to rhwp.renderer.style_resolver.resolved can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.renderer.style_resolver.resolved.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.renderer.composer, so a change to rhwp.renderer.composer can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.renderer.composer.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.renderer.pagination, so a change to rhwp.renderer.pagination can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.renderer.pagination.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.model.paragraph, so a change to rhwp.model.paragraph can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.model.paragraph.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.model.control, so a change to rhwp.model.control can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.model.control.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.model.document, so a change to rhwp.model.document can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.model.document.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.parser, so a change to rhwp.parser can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.parser.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.renderer.layout, so a change to rhwp.renderer.layout can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.renderer.layout.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.renderer.render_tree, so a change to rhwp.renderer.render_tree can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.renderer.render_tree.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.renderer.typeset, so a change to rhwp.renderer.typeset can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.renderer.typeset.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
rhwp.document_core uses rhwp.paint.layer_tree, so a change to rhwp.paint.layer_tree can break rhwp.document_core, while a change to rhwp.document_core can't break rhwp.paint.layer_tree.
Position
Below the diagonal: rhwp.document_core uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 44.1 · Weak · gated by D1, D2, X5 ·
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
A03:2025 — Software Supply Chain Failures
48
High / Critical
A02:2025 — Security Misconfiguration
1
Medium
Roadmap
Top priorities: Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href; 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; Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with cell-selection-caret-sync.test.ts.
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.
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Dependency Vulnerabilities: Medium vulnerability: REDACTED
src/parser/hwp3/mod.rs
6.0
Mixed
Explicit Debt: TodoComment
src/renderer/layout/shape_layout.rs
6.0
Mixed
Explicit Debt: TodoComment
src/wmf/converter/svg/mod.rs
6.0
Mixed
Explicit Debt: HackComment
How the grades work
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 136
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 — 8795
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 — 283
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 13
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 65 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 — 65 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, 9177 of 9214 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 .cs, .ts, .rs, and our analyzer cannot run the .rs 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 64.0% — 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 3,239 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 2,515 test source file(s) (.rs, .py, .dart) 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 — evaluation did not complete — Test Reliability not included (check did not complete) — excluded from the score.
D13 Secret Scanning — 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. Secret Scanning couldn't be assessed within its 5-minute budget on a solution this large — not included in this run.
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.
D15 Churn × Complexity Hotspots — 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. A hotspot's complexity is meant to be the worst body its churn actually touched. For src/parser/pdf/policy.rs that could not be established — the complexity reader for the file reports no body extents, or the history carries no per-line attribution — so the row quotes the file's worst body, which the counted changes may never have touched. The churn count is unaffected.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D20 ADR Quality — 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 ADR lexicon (adr-lexicon-1) covers de, en, it, nl. A record identified as another language, or whose language could not be identified (fewer than 25 words of prose, or no clear winner), is never read with English rules: its missing-section, status, consequence-cost and same-question rules abstain, and only the structural rules (title, single option, dangling link, enforcement field) run.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22'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.
D23 Boundary Type-Coupling — 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 kind measured 0/40 valid on a seeded held-out sample of its rows on 98 C# repositories (docs/plans/deterministic-engine/adjudication/P5c-D23-units.md, "Version 1 ON MAIN"): the noise rows were dependencies on layer folders, shared cores and grouping folders read as contexts. By the pre-registered fallback (PREREGISTRATION v37) it publishes no row until version 4 passes its gate. The candidates are counted here, not reported as findings, and the score does not include them.
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. D24 compares a comment's words with the identifiers, literals and constructs of the code it annotates, using English function-word and rationale lexicons. Comments in another script or language were left unread rather than counted as clean.
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) — 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. `gitleaks` TIMED OUT after 285.4s against a 285.4s budget, so we killed its process tree. The budget is ours; the work may simply be larger than it allows. Nothing about this repository is asserted by the absence of a result; the budget is ours to raise, and raising it is our backlog item, not an action for this repository's owner.
D29 Static Analysis (SAST) — evaluation did not complete — Static Analysis (SAST) not included (check did not complete) — excluded from the score.
AC1 Text alternatives — 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. 2 further occurrence(s) are not listed individually; the score already reflects all 42.
AC2 Forms & labels — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 110 further occurrence(s) are not listed individually; the score already reflects all 150.
AC3 Page structure — 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. 30 further occurrence(s) are not listed individually; the score already reflects all 70.
AC6 Visual & motion safety — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 16 further occurrence(s) are not listed individually; the score already reflects all 56.
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.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (docker-compose.yml). compose up failed (exit 14 — a file the compose project references is missing) — env file .env.docker not found: stat .env.docker: no such file or directory; runtime evidence skipped.
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'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.
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.
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. 178 further occurrence(s) are not listed individually; the score already reflects all 218.
P2 Observability — 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. 79 further occurrence(s) are not listed individually; the score already reflects all 119.
PF3 Async & latency hygiene — 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. 44 further occurrence(s) are not listed individually; the score already reflects all 84.
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. 685 further occurrence(s) are not listed individually; the score already reflects all 725.
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. 752 further occurrence(s) are not listed individually; the score already reflects all 792.
R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 28 further occurrence(s) are not listed individually; the score already reflects all 68.
R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 28 further occurrence(s) are not listed individually; the score already reflects all 68.
R7 Dead Code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 53 further occurrence(s) are not listed individually; the score already reflects all 93.
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. 433 further occurrence(s) are not listed individually; the score already reflects all 473.
X12 Unreachable branch — 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.
X24 Document value interpolated into markup unescaped — 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.
X27 Collection changed while being enumerated — 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 repository's C# was parsed (it ships no .sln or .csproj, so it was read as syntax-only projects), but this check proves its findings from resolved symbols and a reference-free parse resolves none. It abstained rather than report a clean bill it could not earn. That is a gap in this analyzer's reach into build-less repositories — not a finding that the repository is free of what this check looks for.
X7 Silent fallback defaults — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 43 further occurrence(s) are not listed individually; the score already reflects all 83.
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.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
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.
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
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.
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
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".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
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.
1538 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was LayoutEngine::layout_partial_table_cells at 555. A further 121 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 TernaryRasterOperation::as_reverse_polish_notation at 256 — they are counted neither in the figure above nor in this dimension's score. 40 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: src/wmf/parser/constants/enums/ternary_raster_operation.rs (TernaryRasterOperation::as_reverse_polish_notation at 256), src/doclang/eqedit/latex.rs (rhwp::doclang::eqedit::latex::command_for_exact at 173), src/cli/commands/edit/mod.rs (rhwp::cli::commands::edit::run at 90), src/parser/hwp3/johab.rs (rhwp::parser::hwp3::johab::decode_hwp3_extra at 86), src/renderer/equation/layout/source_greek_symbol.rs (rhwp::renderer::equation::layout::source_greek_symbol::greek at 56), and 35 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 462 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 114 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with LayoutEngine::layout_partial_table_cells (cyclomatic 555), LayoutEngine::cell_units_uncached (cyclomatic 542), LayoutEngine::build_single_column (cyclomatic 468). — 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 114 together lifts Cyclomatic Complexity from 2.0 to about 4.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 582 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 285 bodies over 60 down to 60 or less in Cognitive Complexity — start with LayoutEngine::cell_units_uncached (cognitive 1398), LayoutEngine::layout_partial_table_cells (cognitive 1379), LayoutEngine::build_single_column (cognitive 972). — 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 285 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.9 / 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.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 358 FunctionTooLong finding(s) in God Classes — start with section.rs (18), mod.rs (14), renderer.rs (7). — One of this dimension's main actionable groups (358 warning-level).
Resolve the 289 FileTooLong finding(s) in God Classes — start with _gen_pack.py (14), mod.rs (5), shape.rs (4). — One of this dimension's main actionable groups (289 warning-level).
Resolve the 288 MethodTooLong finding(s) in God Classes — start with table_layout.rs (28), paragraph_layout.rs (10), canvaskit-renderer.ts (8). — One of this dimension's main actionable groups (288 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.
2389 duplicated block group(s) detected. 7.5 % of the production lines (88,871 of 1,188,155) are in a reported copy. A further 818 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 393 of the 3207 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.
+ 687 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 138 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with layout.rs (7), wasm_api.rs (6), section.rs (5). — One of this dimension's main actionable groups (138 warning-level).
Resolve the 127 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with height_measurer.rs (6), table_layout.rs (6), border_rendering.rs (4). — One of this dimension's main actionable groups (127 warning-level).
Resolve the 111 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with header.rs (6), table_layout.rs (5), recognition.rs (4). — One of this dimension's main actionable groups (111 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling9.3 / 10Stronggated by 2 serious findings✓ 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.
24 production modules (Cargo+npm+SwiftPM+pub+CMake), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 3 module(s) off the main sequence, with abstractness counted on 19 of the 24 (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).
Off the main sequence: rhwp-ooxml-chart · ×2
Off the main sequence: rhwp-contracts
What to do
Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 13 Low cohesion finding(s) in Cohesion (LCOM4) — start with mod.rs (2), math.rs, device_context.rs. — One of this dimension's main actionable groups (13 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
Detailed fixes: d7_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Adequategated by 1 critical finding✓ 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.
6 skipped (6 with a documented reason), 1 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 3239 tests. Measured on the JavaScript/TypeScript suite only — at least 2,515 test source file(s) (.rs, .py, .dart) went unread, so its test quality is unmeasured and is not in these counts.
No assertions (empty test): F5 단일 셀 선택 이동은 평면·중첩 표의 문서 위치를 동기화한다rhwp-studio/tests/cell-selection-caret-sync.test.ts:109
Skipped (documented): IME 종료 후 예약 탐색은 본문·머리말/꼬리말·각주의 키보드 소유자를 따른다 · ×6rhwp-studio/tests/composition-pending-navigation.test.ts:6
What to do
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with cell-selection-caret-sync.test.ts. — One of this dimension's main actionable groups (1 issue-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.
16 outdated, 0 yanked direct Cargo dependencies. 70 of 78 direct crates were graded against crates.io (0 not published there, 8 not resolved by a committed REDACTED). Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.
Outdated: aes · ×16
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
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 380 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. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: src/renderer/layout/table_layout.rs (515×542=279130); src/renderer/layout.rs (478×468=223704); src/renderer/layout/table_partial.rs (274×555=152070) Repeated repair below the complexity floor: src/renderer/equation/mod.rs (39 of 73 changes were fixes); src/renderer/equation/parser.rs (29 of 39 changes were fixes); src/renderer/typeset/state/commands.rs (22 of 37 changes were fixes)
Resolve the 364 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (8), paragraph.rs (3), section.rs (3). — One of this dimension's main actionable groups (364 warning-level).
Resolve the 94 Repeated repair finding(s) in Churn × Complexity Hotspots — start with mod.rs (3), parser.rs, commands.rs. — One of this dimension's main actionable groups (94 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.1 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
389 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is scripts/visual_sweep.py. Counted over 2038 of the 2715 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×8
Further sole-owners (lower concentration)
What to do
Resolve the 8 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (8 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
8 deducted task-comment markers across 1188155 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.
Resolve the 7 TodoComment finding(s) in Explicit Debt — start with state.rs (2), shape_layout.rs (2), device_independent_bitmap.rs. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 1 HackComment finding(s) in Explicit Debt — start with mod.rs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
4 naming inconsistencies among 233 declarations measured against a convention their peers follow.
`ActID` spells `ID` where 207 names in the project spell it `Id`rhwp-studio/src/hwpctl/action.ts:58
`SetID` spells `ID` where 207 names in the project spell it `Id`rhwp-studio/src/hwpctl/action.ts:59
`createObjectURL` spells `URL` where 23 names in the project spell it `Url`rhwp-studio/src/view/canvaskit/browser-image-decoder.ts:6
`revokeObjectURL` spells `URL` where 23 names in the project spell it `Url`rhwp-studio/src/view/canvaskit/browser-image-decoder.ts:7
What to do
Resolve the 1 `ActID` spells `ID` where 207 names in the project spell it `Id` finding(s) in Naming Consistency — start with action.ts. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `SetID` spells `ID` where 207 names in the project spell it `Id` finding(s) in Naming Consistency — start with action.ts. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `createObjectURL` spells `URL` where 23 names in the project spell it… finding(s) in Naming Consistency — start with browser-image-decoder.ts. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.
Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.
Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.
6 domain type(s) cross context boundaries across 2 contexts; they are measured and withheld (not published, not scored). Contexts: document_core, renderer.
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.
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 15 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (15). — One of this dimension's main actionable groups (15 warning-level).
Resolve the 5 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4), REDACTED. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 3 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 1 Medium IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
25 of 2038 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/doclang/adapter/paragraph.rs. Counted over 2038 of the 2715 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 3 Orphaned knowledge finding(s) in Knowledge Freshness — start with paragraph.rs, mod.rs, latex.rs. — One of this dimension's main actionable groups (3 issue-level).
Resolve the 22 Orphaned file finding(s) in Knowledge Freshness — start with mod.rs (2), geometry_pass.rs, otsl.rs. — One of this dimension's main actionable groups (22 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
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 7 Boundary-crossing change coupling finding(s) in Change Coupling — start with rendering.rs (3), json.rs (2), provenance.rs. — One of this dimension's main actionable groups (7 issue-level).
Resolve the 9 Change coupling finding(s) in Change Coupling — start with canvas_render.rs (2), canvas.rs (2), svg_render.rs. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 5 Change-coupling hub finding(s) in Change Coupling — start with state.rs, page_number.rs, layout.rs. — One of this dimension's main actionable groups (5 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.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 2 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.
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives3.1 / 10Weak✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×28) — mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:3, mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:4, mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:5, …
A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×12) — mydocs/pr/assets/semanticist21-20261005/browser-review.mjs:15, mydocs/pr/assets/semanticist21-20261005/combobox-browser.mjs:23, mydocs/pr/assets/semanticist21-20261005/combobox-browser.mjs:60, …
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 & labels4.6 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This <span> carries a click handler, which makes it a control, and its only name is a title attribute. A plain element maps to role="generic", which does not support a name from the author, so the title is announced as nothing at all — it is a mouse-only tooltip, unreachable on touch. Give it role="button" (which it needs anyway to be operable) so the title becomes a real name, or add an aria-label. (×3) — rhwp-chrome/content-script.js:250, rhwp-firefox/content-script.js:252, rhwp-safari/src/content-script.js:121
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×2) — rhwp-desk/ui/index.html:134, rhwp-safari/src/options.html:243
This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×35) — rhwp-desk/ui/js/main.js:645, rhwp-safari/src/options.html:299, rhwp-studio/hwpctl-test.html:50, …
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×6) — data/font-metrics/adobe-core14/MustRead.html:1, mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:1, mydocs/pr/assets/pr7109_hancom_pdf_bbox.html:1, …
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×28) — data/font-metrics/adobe-core14/MustRead.html:1, mydocs/metrics/2026-07-04-r1/dashboard.html:2, mydocs/metrics/2026-07-04/dashboard.html:2, …
A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope). — data/font-metrics/adobe-core14/MustRead.html:11
An empty <title> gives no page name in the tab, history or screen-reader page list. Put descriptive text in the <title>. (×3) — mydocs/pr/assets/pr7109_hancom_pdf_bbox.html:1, mydocs/pr/assets/pr_6154/visual-sweep/issue6122/issue6122/pdf_bbox.html:1, mydocs/pr/assets/pr_6154/visual-sweep/issue6123/issue6123/pdf_bbox.html:1
Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. (×2) — mydocs/pr/assets/pr7152_negative_report.html:58, mydocs/pr/assets/pr7152_responsive_report.html:58
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".
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. (×21) — rhwp-chrome/content-script.js:181, rhwp-chrome/content-script.js:250, rhwp-desk/ui/js/main.js:189, …
The repo's own CSS styles .menu-title with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. (×8) — rhwp-studio/index.html:26, rhwp-studio/index.html:52, rhwp-studio/index.html:76, …
The repo's own CSS styles .md-item with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. — rhwp-studio/src/automation/menu-dom.ts:92
The repo's own CSS styles .sb-hl-swatch with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. — rhwp-studio/src/ui/toolbar.ts:424
This <div> announces itself as a role="separator" and is operated by pointerdown, pointerup and pointermove, but nothing can put focus on it: no tabindex="0", no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabindex="0"="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds). — rhwp-studio/src/view/side-panel-host.ts:154
A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabindex="0". (×2) — rhwp-vscode/src/webview/viewer.ts:879, rhwp-vscode/src/webview/viewer.ts:1315
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
`.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. (×20) — mydocs/metrics/2026-07-04-r1/dashboard.html:31, mydocs/metrics/2026-07-04/dashboard.html:31, mydocs/metrics/2026-07-05/dashboard.html:31, …
`.screenshot img` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×3) — mydocs/pr/assets/pr7152_negative_report.html:38, mydocs/pr/assets/pr7152_responsive_report.html:38, mydocs/pr/assets/task2809/issue-2809-split-alignment-report.html:38
`.badge.pass` sets color: white on background-color: #28a745 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. (×3) — mydocs/pr/assets/pr7152_negative_report.html:30, mydocs/pr/assets/pr7152_responsive_report.html:30, mydocs/pr/assets/task2809/issue-2809-split-alignment-report.html:30
`.header` sets color: white on background-color: #28a745 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. (×2) — mydocs/pr/assets/pr7152_responsive_report.html:10, mydocs/pr/assets/task2809/issue-2809-split-alignment-report.html:10
`.toggle .slider::before` moves (`transition: transform 0.25s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — rhwp-safari/src/options.html:108
`.add-domain button` sets color: #fff on background-color: #007aff — 4.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — rhwp-safari/src/options.html:137
`.log-btn-primary` sets color: #fff on background-color: #007aff — 4.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — rhwp-safari/src/options.html:156
`.log-btn-danger` sets color: #ff3b30 on background-color: #f5f5f7 — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — rhwp-safari/src/options.html:158
`.log-table th` sets color: #86868b on background-color: #f5f5f7 — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — rhwp-safari/src/options.html:167
`.code-area` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — rhwp-studio/hwpctl-test.html:15
`.protected-cell-hover-guard` sets color: #fff on background-color: #d54f33 — 4.2:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — rhwp-studio/src/styles/table-selection.css:29
`.palette-hint` sets color: #6b7484 on background-color: #1b2029 — 3.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — rhwp-desk/ui/css/app.css:130
`.btn.primary` sets color: #fff on background-color: #5b8def — 3.2:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — rhwp-desk/ui/css/app.css:155
`.palette-foot` sets color: #6b7484 on background-color: #1b2029 — 3.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — rhwp-desk/ui/css/app.css:543
`.cp-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — rhwp-studio/src/styles/command-palette.css:48
`.form-edit-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — rhwp-studio/src/styles/form-overlay.css:42
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
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 Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
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.
Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether 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.
CONTRIBUTING.md links to `mydocs/tech/typesetting_architecture.md`, but `mydocs/tech/typesetting_architecture.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — CONTRIBUTING.md:115
CONTRIBUTING.md links to `mydocs/tech/chart_ole_v1_boundary.md`, but `mydocs/tech/chart_ole_v1_boundary.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — CONTRIBUTING.md:340
CONTRIBUTING.md links to `rhwp-studio/e2e/MANIFEST.md`, but `rhwp-studio/e2e/MANIFEST.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — CONTRIBUTING.md:786
README.md links to `mydocs/release/release_notes_v0.9.0.md`, but `mydocs/release/release_notes_v0.9.0.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README.md:49
README.md links to `packaging/crates-io/README_PACKAGE.md`, but `packaging/crates-io/README_PACKAGE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README.md:53
README_EN.md links to `mydocs/release/release_notes_v0.9.0_EN.md`, but `mydocs/release/release_notes_v0.9.0_EN.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README_EN.md:51
README_EN.md links to `packaging/crates-io/README_PACKAGE.md`, but `packaging/crates-io/README_PACKAGE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README_EN.md:54
fuzz/README.md links to `../src/serializer/hwpx/roundtrip.rs`, but `src/serializer/hwpx/roundtrip.rs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — fuzz/README.md:161
mydocs/README.md links to `tech/README.md`, but `mydocs/tech/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:11
mydocs/README.md links to `tech/hwp_spec_errata.md`, but `mydocs/tech/hwp_spec_errata.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:79
mydocs/README.md links to `tech/한글문서파일형식_5.0_revision1.3.md`, but `mydocs/tech/한글문서파일형식_5.0_revision1.3.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:80
mydocs/README.md links to `tech/document_ir_lineseg_standard.md`, but `mydocs/tech/document_ir_lineseg_standard.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:81
mydocs/README.md links to `tech/rendering_engine_design.md`, but `mydocs/tech/rendering_engine_design.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:82
mydocs/README.md links to `tech/text-ir-v2.md`, but `mydocs/tech/text-ir-v2.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:83
mydocs/README.md links to `tech/table_layout_rules.md`, but `mydocs/tech/table_layout_rules.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:85
mydocs/README.md links to `tech/typesetting_architecture.md`, but `mydocs/tech/typesetting_architecture.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:86
mydocs/README.md links to `tech/font_fallback_strategy.md`, but `mydocs/tech/font_fallback_strategy.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:87
mydocs/README.md links to `tech/edit_action_undo_redo_architecture.md`, but `mydocs/tech/edit_action_undo_redo_architecture.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:88
mydocs/README.md links to `tech/parser_architecture.md`, but `mydocs/tech/parser_architecture.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:89
mydocs/README.md links to `tech/thorvg_decision.md`, but `mydocs/tech/thorvg_decision.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:90
mydocs/README.md links to `tech/archive/dev_roadmap_v1_backup.md`, but `mydocs/tech/archive/dev_roadmap_v1_backup.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:91
mydocs/README.md links to `tech/investigations/README.md`, but `mydocs/tech/investigations/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:92
mydocs/README.md links to `troubleshootings/README.md`, but `mydocs/troubleshootings/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/README.md:93
gym/tools/README.md links to `../../scripts/tests/test_gym_authority_ledger.py`, but `scripts/tests/test_gym_authority_ledger.py` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — gym/tools/README.md:23
gym/tools/README.md links to `../../scripts/tests/test_gym_oracle_probe.py`, but `scripts/tests/test_gym_oracle_probe.py` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — gym/tools/README.md:25
gym/tools/README.md links to `../../mydocs/working/archives/gym_oracle_probe.md`, but `mydocs/working/archives/gym_oracle_probe.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — gym/tools/README.md:27
gym/tools/README_leaderboard.md links to `../../mydocs/working/archives/gym_leaderboard.md`, but `mydocs/working/archives/gym_leaderboard.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — gym/tools/README_leaderboard.md:13
gym/tools/README_robustness.md links to `../../mydocs/working/archives/gym_robustness.md`, but `mydocs/working/archives/gym_robustness.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — gym/tools/README_robustness.md:12
gym/tutorial/README.md links to `../../mydocs/working/archives/gym_tutorial.md`, but `mydocs/working/archives/gym_tutorial.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — gym/tutorial/README.md:22
mydocs/manual/README.md links to `../tech/README.md`, but `mydocs/tech/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/manual/README.md:11
mydocs/manual/README.md links to `../../packaging/crates-io/README_PACKAGE.md`, but `packaging/crates-io/README_PACKAGE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/manual/README.md:23
mydocs/manual/README.md links to `../../tools/fidelity_compare/README.md`, but `tools/fidelity_compare/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/manual/README.md:35
mydocs/manual/README.md links to `../tech/hwpx_hancom_reference.md`, but `mydocs/tech/hwpx_hancom_reference.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/manual/README.md:36
mydocs/manual/README.md links to `../tech/render_backend_fixture_catalog.md`, but `mydocs/tech/render_backend_fixture_catalog.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/manual/README.md:39
mydocs/manual/README.md links to `../tech/render_backend.md`, but `mydocs/tech/render_backend.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/manual/README.md:39
mydocs/manual/README.md links to `../working/assets/issue6042/README.md`, but `mydocs/working/assets/issue6042/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/manual/README.md:48
mydocs/manual/README.md links to `../tech/font_fallback_strategy.md`, but `mydocs/tech/font_fallback_strategy.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/manual/README.md:49
mydocs/manual/README.md links to `../../npm/hwpctrl-ocx/README.md`, but `npm/hwpctrl-ocx/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/manual/README.md:53
mydocs/manual/README.md links to `../../tools/hwpctrl_compat/README.md`, but `tools/hwpctrl_compat/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/manual/README.md:53
mydocs/manual/README.md links to `../../src/renderer/equation/README.md`, but `src/renderer/equation/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mydocs/manual/README.md:56
What to do
Reconcile the README with reality: CONTRIBUTING.md links to `mydocs/tech/typesetting_architecture.md`, but `mydocs/tech/typesetting_architecture.md` does not exist; CONTRIBUTING.md links to `mydocs/tech/chart_ole_v1_boundary.md`, but `mydocs/tech/chart_ole_v1_boundary.md` does not exist; CONTRIBUTING.md links to `rhwp-studio/e2e/MANIFEST.md`, but `rhwp-studio/e2e/MANIFEST.md` does not exist; README.md links to `mydocs/release/release_notes_v0.9.0.md`, but `mydocs/release/release_notes_v0.9.0.md` does not exist; README.md links to `packaging/crates-io/README_PACKAGE.md`, but `packaging/crates-io/README_PACKAGE.md` does not exist.
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 · Observability5.5 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 3/6 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `rhwp-desk`.
`rhwp-studio/cdp_screenshot.cjs` reports through `console.*` at line 7 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/cdp_screenshot.cjs:7
`rhwp-studio/cdp_screenshot.cjs` reports through `console.*` at line 8 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/cdp_screenshot.cjs:8
`rhwp-studio/cdp_screenshot.cjs` reports through `console.*` at line 11 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/cdp_screenshot.cjs:11
`rhwp-studio/cdp_screenshot.cjs` reports through `console.*` at line 18 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/cdp_screenshot.cjs:18
`rhwp-studio/cdp_screenshot.cjs` reports through `console.*` at line 20 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/cdp_screenshot.cjs:20
`rhwp-studio/src/view/canvaskit-renderer.ts` reports through `console.*` at line 589 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/view/canvaskit-renderer.ts:589
`rhwp-studio/src/view/canvaskit-renderer.ts` reports through `console.*` at line 605 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/view/canvaskit-renderer.ts:605
`rhwp-studio/src/view/canvaskit-renderer.ts` reports through `console.*` at line 623 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/view/canvaskit-renderer.ts:623
`rhwp-studio/src/view/canvaskit-renderer.ts` reports through `console.*` at line 644 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/view/canvaskit-renderer.ts:644
`rhwp-studio/src/view/canvaskit-renderer.ts` reports through `console.*` at line 679 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/view/canvaskit-renderer.ts:679
`rhwp-studio/src/view/canvaskit-renderer.ts` reports through `console.*` at line 873 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/view/canvaskit-renderer.ts:873
`rhwp-studio/src/view/canvaskit-renderer.ts` reports through `console.*` at line 935 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/view/canvaskit-renderer.ts:935
`rhwp-studio/src/ui/dialog-apply.ts` reports through `console.*` at line 40 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/ui/dialog-apply.ts:40
`rhwp-studio/src/ui/dialog-apply.ts` reports through `console.*` at line 83 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/ui/dialog-apply.ts:83
`rhwp-studio/src/recent/recent-open.ts` reports through `console.*` at line 70 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/recent/recent-open.ts:70
`rhwp-studio/src/plugin/host.ts` reports through `console.*` at line 313 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/plugin/host.ts:313
`rhwp-studio/src/plugin/host.ts` reports through `console.*` at line 399 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/plugin/host.ts:399
`rhwp-studio/src/plugin/host.ts` reports through `console.*` at line 425 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/plugin/host.ts:425
`rhwp-studio/src/hwpctl/action.ts` reports through `console.*` at line 89 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/action.ts:89
`rhwp-studio/src/hwpctl/action.ts` reports through `console.*` at line 103 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/action.ts:103
`rhwp-studio/src/hwpctl/action.ts` reports through `console.*` at line 113 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/action.ts:113
`rhwp-studio/src/hwpctl/actions/clipboard.ts` reports through `console.*` at line 16 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/clipboard.ts:16
`rhwp-studio/src/hwpctl/actions/clipboard.ts` reports through `console.*` at line 29 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/clipboard.ts:29
`rhwp-studio/src/hwpctl/actions/clipboard.ts` reports through `console.*` at line 45 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/clipboard.ts:45
`rhwp-studio/src/hwpctl/actions/clipboard.ts` reports through `console.*` at line 57 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/clipboard.ts:57
`rhwp-studio/src/hwpctl/actions/format.ts` reports through `console.*` at line 102 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/format.ts:102
`rhwp-studio/src/hwpctl/actions/format.ts` reports through `console.*` at line 117 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/format.ts:117
`rhwp-studio/src/hwpctl/actions/format.ts` reports through `console.*` at line 133 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/format.ts:133
`rhwp-studio/src/hwpctl/actions/navigate.ts` reports through `console.*` at line 65 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/navigate.ts:65
`rhwp-studio/src/hwpctl/actions/page.ts` reports through `console.*` at line 43 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/page.ts:43
`rhwp-studio/src/hwpctl/actions/page.ts` reports through `console.*` at line 71 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/page.ts:71
`rhwp-studio/src/hwpctl/actions/page.ts` reports through `console.*` at line 78 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/page.ts:78
`rhwp-studio/src/hwpctl/actions/page.ts` reports through `console.*` at line 83 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/page.ts:83
`rhwp-studio/src/hwpctl/actions/page.ts` reports through `console.*` at line 88 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/page.ts:88
`rhwp-studio/src/hwpctl/actions/table-edit.ts` reports through `console.*` at line 31 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/table-edit.ts:31
`rhwp-studio/src/hwpctl/actions/table-edit.ts` reports through `console.*` at line 50 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/table-edit.ts:50
`rhwp-studio/src/hwpctl/actions/table-edit.ts` reports through `console.*` at line 68 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/table-edit.ts:68
`rhwp-studio/src/hwpctl/actions/table-edit.ts` reports through `console.*` at line 88 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/table-edit.ts:88
`rhwp-studio/src/hwpctl/actions/table-edit.ts` reports through `console.*` at line 98 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — rhwp-studio/src/hwpctl/actions/table-edit.ts:98
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
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.
`.github/dependabot.yml` schedules updates, but no `package-ecosystem` entry covers `pip`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list. — .github/dependabot.yml:2
What to do
Dependabot is configured but does not watch `pip` — add that `package-ecosystem` entry to .github/dependabot.yml so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
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.
Do you agree with this assessment?
P5 · DR & Backup0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
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.
`readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×21) — mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:21, mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:24, mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:25, …
`mkdirSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:74, scripts/export-wasm-for-sweep.mjs:62, scripts/export-wasm-png-for-sweep.mjs:194
`writeFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×7) — mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:89, mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:90, mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:95, …
`readFileSync` in `hash` 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. — mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:97
`fs.writeFileSync` in `callback to provider.sendExportSvg` 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. — rhwp-vscode/src/extension.ts:73
`fs.writeFileSync` in `callback to provider.sendDebugOverlay` 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. — rhwp-vscode/src/extension.ts:118
`fs.readFileSync` in `cmdDumpParagraph` 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. — rhwp-vscode/src/extension.ts:133
`fs.writeFileSync` in `callback to webview.onDidReceiveMessage` 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. — rhwp-vscode/src/hwp-editor-provider.ts:144
`fs.mkdirSync` in `collectPostmergeDurations` 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/collect-postmerge-duration-data.mjs:208
`fs.writeFileSync` in `collectPostmergeDurations` 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/collect-postmerge-duration-data.mjs:209
`readFileSync` in `studioModule` 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/export-wasm-png-for-sweep.mjs:152
`readFileSync` in `callback to map` 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/export-wasm-png-for-sweep.mjs:174
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 Safety5.9 / 10Adequate✓ 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.
748 typed · 529 plain JS — the untyped files are gym/tools/from_e2e.mjs, gym/tools/from_e2e_contract.test.mjs, gym/tools/from_e2e_exceptions.test.mjs, mydocs/pr/assets/chrisryugj_20261031/edit-wasm.mjs, mydocs/pr/assets/hyunmyungjanelee-20261106/wasm-image-roundtrip.mjs, mydocs/pr/assets/issue8174/v2-s04/reproduce/browser-direct-matrix.mjs (+523 more).
Do you agree with this assessment?
R10 · Code Duplication4.1 / 10Weak✓ Tool-verified
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
36 duplicated blocks under rhwp-studio/src/ have copies in at least two of the sibling directories ai, command, compare, core, dev, document-agent (+6 more sibling(s) not listed) — 21 of them are reported below, and 15 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 36 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 36 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 36 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — rhwp-studio/src/recent/recent-store.ts:61
34 duplicated blocks under the repository root have copies in at least two of the sibling directories mydocs, npm, rhwp-chrome, rhwp-desk, rhwp-firefox, rhwp-safari (+4 more sibling(s) not listed) — 25 of them are reported below, and 9 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 34 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 34 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 34 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — rhwp-chrome/content-script.js:4
6 duplicated blocks under mydocs/pr/assets/ have copies in at least two of the sibling directories chrisryugj_20261031, hyunmyungjanelee-20261106, issue8174, pr7518_p22_spacing_20261004, pr7518_p39_wrapper_flow_20261005, pr8309-latestbase-20261102 (+2 more sibling(s) not listed) — 4 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — mydocs/pr/assets/pr7518_p22_spacing_20261004/capture-cdp.mjs:6
rhwp-chrome/content-script.js:4 · rhwp-firefox/content-script.js:4 — these 2 files are line-for-line copies of one another — 325 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — rhwp-chrome/content-script.js:4
rhwp-chrome/sw/thumbnail-extractor.js:6 · rhwp-firefox/sw/thumbnail-extractor.js:6 — these 2 files are line-for-line copies of one another — 204 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — rhwp-chrome/sw/thumbnail-extractor.js:6
rhwp-studio/src/ui/local-fonts-modal.ts:33 · rhwp-studio/src/ui/validation-modal.ts:39 — the two spans are one implementation copied and then locally edited — 977 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. — rhwp-studio/src/ui/local-fonts-modal.ts:33
scripts/font_rank1_runtime_boundary.mjs:85 · scripts/font_rank7_runtime_boundary.mjs:49 — the two spans are one implementation copied and then locally edited — 1050 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/font_rank1_runtime_boundary.mjs:85
rhwp-chrome/sw/download-interceptor.js:31 · rhwp-firefox/sw/download-interceptor.js:26 — the two spans are one implementation copied and then locally edited — 892 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. — rhwp-chrome/sw/download-interceptor.js:31
rhwp-chrome/sw/fetch-security.js:7 · rhwp-firefox/sw/fetch-security.js:7 — these 2 files are line-for-line copies of one another — 106 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — rhwp-chrome/sw/fetch-security.js:7
rhwp-studio/src/ui/field-edit-dialog.ts:79 · rhwp-studio/src/ui/field-insert-dialog.ts:35 — the two spans are one implementation copied and then locally edited — 834 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. — rhwp-studio/src/ui/field-edit-dialog.ts:79
rhwp-studio/src/ui/bookmark-dialog.ts:29 · rhwp-studio/src/ui/symbols-dialog.ts:72 — the two spans are one implementation copied and then locally edited — 616 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. — rhwp-studio/src/ui/bookmark-dialog.ts:29
rhwp-chrome/dev-tools-inject.js:3 · rhwp-firefox/dev-tools-inject.js:3 — these 2 files are line-for-line copies of one another — 81 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — rhwp-chrome/dev-tools-inject.js:3
rhwp-chrome/build.mjs:7 · rhwp-firefox/build.mjs:7 — these 2 files are line-for-line copies of one another — 77 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — rhwp-chrome/build.mjs:7
rhwp-studio/src/recent/recent-store.ts:61 · rhwp-studio/src/recovery/autosave-store.ts:62 — the two spans are one implementation copied and then locally edited — 598 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. — rhwp-studio/src/recent/recent-store.ts:61
rhwp-chrome/sw/download-interceptor-common.js:17 · rhwp-firefox/sw/download-interceptor-common.js:17 · rhwp-shared/sw/download-interceptor-common.js:17 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. 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. — rhwp-chrome/sw/download-interceptor-common.js:17
rhwp-chrome/sw/download-observer-state.js:6 · rhwp-firefox/sw/download-observer-state.js:6 · rhwp-shared/sw/download-observer-state.js:6 — these 3 files are line-for-line copies of one another — 74 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — rhwp-chrome/sw/download-observer-state.js:6
rhwp-studio/src/ai/provider/gemini.ts:200 · rhwp-studio/src/ai/provider/openai.ts:75 — the two spans are one implementation copied and then locally edited — 417 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. — rhwp-studio/src/ai/provider/gemini.ts:200
rhwp-chrome/sw/document-url-resolver.js:6 · rhwp-firefox/sw/document-url-resolver.js:6 · rhwp-shared/sw/document-url-resolver.js:6 — these 3 files are line-for-line copies of one another — 67 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — rhwp-chrome/sw/document-url-resolver.js:6
rhwp-studio/src/ui/context-menu.ts:30 · rhwp-studio/src/ui/local-context-menu.ts:36 — the two spans are one implementation copied and then locally edited — 478 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. — rhwp-studio/src/ui/context-menu.ts:30
rhwp-studio/src/ui/compare-dialog.ts:362 · rhwp-studio/src/ui/history-dialog.ts:333 — 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. — rhwp-studio/src/ui/compare-dialog.ts:362
scripts/cell-lineseg-agreement.mjs:247 · scripts/layout-coverage-sweep.mjs:96 — the two spans are one implementation copied and then locally edited — 503 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/cell-lineseg-agreement.mjs:247
rhwp-studio/src/history/idb-store.ts:118 · rhwp-studio/src/recovery/autosave-store.ts:98 — the two spans are one implementation copied and then locally edited — 527 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. — rhwp-studio/src/history/idb-store.ts:118
rhwp-studio/src/ui/hwp-password-dialog.ts:9 · rhwp-studio/src/ui/hwp-password-dialog.ts:108 — the two spans are one implementation copied and then locally edited — 419 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. — rhwp-studio/src/ui/hwp-password-dialog.ts:9
mydocs/pr/assets/pr7518_p22_spacing_20261004/capture-cdp.mjs:6 · mydocs/pr/assets/pr7518_p39_wrapper_flow_20261005/capture-cdp.mjs:6 — the two spans are one implementation copied and then locally edited — 1086 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. — mydocs/pr/assets/pr7518_p22_spacing_20261004/capture-cdp.mjs:6
rhwp-studio/src/engine/input-handler-keyboard.ts:2323 · rhwp-studio/src/engine/input-handler-keyboard.ts:2430 — 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. — rhwp-studio/src/engine/input-handler-keyboard.ts:2323
scripts/font_metric_coverage_checkpoint_runner.mjs:544 · scripts/font_metric_coverage_full_manifest.mjs:406 — the two spans are one implementation copied and then locally edited — 357 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/font_metric_coverage_checkpoint_runner.mjs:544
scripts/run-adapter-diff.mjs:117 · scripts/run-prop-roundtrip.mjs:62 — the two spans are one implementation copied and then locally edited — 304 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/run-adapter-diff.mjs:117
rhwp-studio/src/ui/char-shape-dialog.ts:221 · rhwp-studio/src/ui/para-shape-dialog.ts:215 — 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. — rhwp-studio/src/ui/char-shape-dialog.ts:221
rhwp-studio/src/ui/compare-dialog.ts:510 · rhwp-studio/src/ui/history-dialog.ts:481 — 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. — rhwp-studio/src/ui/compare-dialog.ts:510
rhwp-chrome/sw/message-router.js:18 · rhwp-firefox/sw/message-router.js:17 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — rhwp-chrome/sw/message-router.js:18
rhwp-studio/src/engine/command.ts:2199 · rhwp-studio/src/engine/command.ts:2252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — rhwp-studio/src/engine/command.ts:2199
tools/hwpctrl_compat/runner_rhwp.mjs:228 · tools/hwpctrl_compat/runner_webhwp.mjs:166 — the two spans are one implementation copied and then locally edited — 342 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. — tools/hwpctrl_compat/runner_rhwp.mjs:228
rhwp-studio/src/ui/page-setup-dialog.ts:323 · rhwp-studio/src/ui/table-cell-props-dialog.ts:1520 — 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. — rhwp-studio/src/ui/page-setup-dialog.ts:323
rhwp-studio/src/ui/compare-dialog.ts:52 · rhwp-studio/src/ui/history-dialog.ts:61 — 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. — rhwp-studio/src/ui/compare-dialog.ts:52
mydocs/pr/assets/pr8309-latestbase-20261102/reproduce.mjs:8 · mydocs/pr/assets/pr8309-maintainer-20261102/reproduce.mjs:8 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — mydocs/pr/assets/pr8309-latestbase-20261102/reproduce.mjs:8
rhwp-chrome/sw/thumbnail-decompression.js:4 · rhwp-firefox/sw/thumbnail-decompression.js:4 · rhwp-shared/sw/thumbnail-decompression.js:4 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. 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. — rhwp-chrome/sw/thumbnail-decompression.js:4
rhwp-studio/src/ui/table-cell-props-dialog.ts:388 · rhwp-studio/src/ui/table-cell-props-dialog.ts:942 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — rhwp-studio/src/ui/table-cell-props-dialog.ts:388
mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:25 · scripts/export-wasm-for-sweep.mjs:27 — the two spans are one implementation copied and then locally edited — 480 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. — mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:25
scripts/font_metric_lineage.mjs:465 · scripts/font_rule_ledger.mjs:628 — the two spans are one implementation copied and then locally edited — 292 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/font_metric_lineage.mjs:465
scripts/font_typesetting_risk_publish.mjs:351 · scripts/font_typesetting_risk_rank.mjs:1037 — the two spans are one implementation copied and then locally edited — 309 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/font_typesetting_risk_publish.mjs:351
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.
mydocs/pr/assets/pr8300-maintainer-20261101/browser-review.mjs:5 reaches into another package with a relative path (../../../../rhwp-studio/e2e/helpers.mjs) — import the package by name instead. — mydocs/pr/assets/pr8300-maintainer-20261101/browser-review.mjs:5
mydocs/pr/assets/pr8300-maintainer-20261101/browser-review.mjs:5 imports rhwp-studio/e2e/helpers.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — mydocs/pr/assets/pr8300-maintainer-20261101/browser-review.mjs:5
mydocs/pr/assets/pr_7487/reproduce-wasm.mjs:6 reaches into another package with a relative path (../../../../pkg/rhwp.js) — import the package by name instead. — mydocs/pr/assets/pr_7487/reproduce-wasm.mjs:6
mydocs/tech/investigations/issue-8403/validation/browser-verify.mjs:5 reaches into another package with a relative path (../../../../../rhwp-studio/e2e/helpers.mjs) — import the package by name instead. — mydocs/tech/investigations/issue-8403/validation/browser-verify.mjs:5
mydocs/tech/investigations/issue-8403/validation/browser-verify.mjs:5 imports rhwp-studio/e2e/helpers.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — mydocs/tech/investigations/issue-8403/validation/browser-verify.mjs:5
rhwp-shared/pdf/import-worker.js:2 reaches into another package with a relative path (../../pkg/rhwp.js) — import the package by name instead. — rhwp-shared/pdf/import-worker.js:2
rhwp-studio/src/ai/provider/claude.ts:18 imports @anthropic-ai/sdk/lib/transform-json-schema, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — rhwp-studio/src/ai/provider/claude.ts:18
rhwp-studio/src/core/pdf-open.ts:3 reaches into another package with a relative path (../../../rhwp-shared/pdf/import-session.js) — import the package by name instead. — rhwp-studio/src/core/pdf-open.ts:3
rhwp-studio/src/core/wasm-bridge.ts:4074 reaches into another package with a relative path (../../../rhwp-shared/forms/action-runtime) — import the package by name instead. — rhwp-studio/src/core/wasm-bridge.ts:4074
rhwp-studio/src/core/wasm-bridge.ts:4078 reaches into another package with a relative path (../../../rhwp-shared/forms/action-runtime) — import the package by name instead. — rhwp-studio/src/core/wasm-bridge.ts:4078
rhwp-studio/src/engine/form-action-worker.ts:1 reaches into another package with a relative path (../../../rhwp-shared/forms/action-runtime.ts) — import the package by name instead. — rhwp-studio/src/engine/form-action-worker.ts:1
rhwp-studio/src/engine/input-handler-form-action.ts:1 reaches into another package with a relative path (../../../rhwp-shared/forms/action-runtime) — import the package by name instead. — rhwp-studio/src/engine/input-handler-form-action.ts:1
rhwp-studio/src/engine/input-handler.ts:3 reaches into another package with a relative path (../../../rhwp-shared/forms/action-runtime) — import the package by name instead. — rhwp-studio/src/engine/input-handler.ts:3
rhwp-studio/src/ui/pdf-import-dialog.ts:4 reaches into another package with a relative path (../../../rhwp-shared/pdf/import-session.js) — import the package by name instead. — rhwp-studio/src/ui/pdf-import-dialog.ts:4
rhwp-vscode/src/webview/canvaskit-wasm-url.ts:1 reaches into another package with a relative path (../../node_modules/canvaskit-wasm/bin/canvaskit.wasm?url) — import the package by name instead. — rhwp-vscode/src/webview/canvaskit-wasm-url.ts:1
scripts/font_rule_runtime_snapshot.mjs:8 reaches into another package with a relative path (../rhwp-studio/src/core/font-loader.ts) — import the package by name instead. — scripts/font_rule_runtime_snapshot.mjs:8
scripts/font_rule_runtime_snapshot.mjs:14 reaches into another package with a relative path (../rhwp-studio/src/core/font-substitution.ts) — import the package by name instead. — scripts/font_rule_runtime_snapshot.mjs:14
scripts/visual-sweep-font-registration.mjs:1 reaches into another package with a relative path (../rhwp-studio/src/core/canvas-intrinsic-font.mjs) — import the package by name instead. — scripts/visual-sweep-font-registration.mjs:1
What to do
Fix the listed violations: import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (16 rows); move the shared test helper into a source directory production code may depend on (2 rows).
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
onKeyDown has cyclomatic complexity 293 and cognitive complexity 481; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — rhwp-studio/src/engine/input-handler-keyboard.ts:709
onClick has cyclomatic complexity 251 and cognitive complexity 529; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — rhwp-studio/src/engine/input-handler-mouse.ts:299
renderTextRun has cyclomatic complexity 145 and cognitive complexity 163; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — rhwp-studio/src/view/canvaskit-renderer.ts:3142
populateFromProps has cyclomatic complexity 143 and cognitive complexity 256; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — rhwp-studio/src/ui/picture-props-dialog.ts:2151
renderEquationBox has cyclomatic complexity 134 and cognitive complexity 122; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — rhwp-studio/src/view/canvaskit-renderer.ts:4891
inspectRun has cyclomatic complexity 111 and cognitive complexity 161; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — rhwp-chrome/e2e/report.mjs:35
comparePngBuffers has cyclomatic complexity 104 and cognitive complexity 172; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — rhwp-studio/e2e/helpers.mjs:420
parseStaticSvgFragmentLayers has cyclomatic complexity 97 and cognitive complexity 139; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — rhwp-studio/src/view/static-svg-path-layers.ts:86
collectMods has cyclomatic complexity 95 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rhwp-studio/src/ui/para-shape-dialog.ts:779
evaluateTrustedPostMergeReuse has cyclomatic complexity 94 and cognitive complexity 96; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/verify-trusted-postmerge-ci-reuse.mjs:515
replayStatus has cyclomatic complexity 93 and cognitive complexity 86; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — rhwp-studio/src/view/canvaskit/glyph-run-fonts.ts:159
validateTypesettingRiskContract has cyclomatic complexity 92 and cognitive complexity 78; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/font_typesetting_risk_rank.mjs:81
collectMods has cyclomatic complexity 85 and cognitive complexity 84; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rhwp-studio/src/ui/char-shape-dialog.ts:946
fillSnapshotFromWasm has cyclomatic complexity 84 and cognitive complexity 117; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — rhwp-studio/src/compare/diff-engine.ts:929
buildGranularControlDiffs has cyclomatic complexity 82 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rhwp-studio/src/compare/diff-engine.ts:709
validateRegistry has cyclomatic complexity 77 and cognitive complexity 100; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/font_rule_registry.mjs:472
Run has cyclomatic complexity 76 and cognitive complexity 118; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — npm/hwpctrl-ocx/src/index.mjs:2344
onMouseMove has cyclomatic complexity 74 and cognitive complexity 140; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — rhwp-studio/src/engine/input-handler-mouse.ts:1572
parseSupportedCssColor has cyclomatic complexity 74 and cognitive complexity 102; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — rhwp-studio/src/view/canvaskit/css-color.ts:173
(anonymous) has cyclomatic complexity 73 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. — rhwp-studio/src/view/glyph-outline-payload-status.ts:195
(anonymous) has cyclomatic complexity 68 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/tests/pdf-import-wasm.test.mjs:109
validateOracleProfile has cyclomatic complexity 66 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/oracle_profile_contract.mjs:473
isCompletePng has cyclomatic complexity 65 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. — rhwp-chrome/e2e/png-integrity.mjs:18
normalizeFontFaceData has cyclomatic complexity 61 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — rhwp-studio/src/core/sfnt-face.ts:15
drawImage has cyclomatic complexity 58 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. — rhwp-studio/src/view/canvaskit-renderer.ts:2857
auditReviewReuse has cyclomatic complexity 58 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 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/ci-impact-policy.cjs:911
selectLayerTextVariantsForLeaf has cyclomatic complexity 56 and cognitive complexity 109; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — rhwp-studio/src/view/canvaskit/text-variant-selection.ts:23
validateCoverageContract has cyclomatic complexity 56 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/font_metric_coverage_contract.mjs:87
routeEmbedRequest has cyclomatic complexity 55 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — rhwp-studio/src/embed/rpc-router.ts:122
validateLineageManifest has cyclomatic complexity 54 and cognitive complexity 84; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/font_metric_lineage.mjs:1071
drawStaticControlText has cyclomatic complexity 54 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rhwp-studio/src/view/canvaskit-renderer.ts:5239
MovePos has cyclomatic complexity 54 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — npm/hwpctrl-ocx/src/index.mjs:2088
run has cyclomatic complexity 53 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. — rhwp-studio/e2e/responsive.test.mjs:73
isStaticSvgAttributeSupported has cyclomatic complexity 53 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — rhwp-studio/src/view/static-svg-path-layers.ts:711
(anonymous) has cyclomatic complexity 52 and cognitive complexity 181; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — rhwp-studio/e2e/layer-export-issue536.test.mjs:46
validateOracleProfileContract has cyclomatic complexity 52 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/oracle_profile_contract.mjs:223
(anonymous) has cyclomatic complexity 52 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. — rhwp-studio/e2e/header-footer-selection-issue4121.test.mjs:53
imageForOp has cyclomatic complexity 51 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. — rhwp-studio/src/view/canvaskit-renderer.ts:5901
(anonymous) has cyclomatic complexity 51 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — rhwp-studio/e2e/renderer-baseline.mjs:303
onInput has cyclomatic complexity 50 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. — rhwp-studio/src/engine/input-handler-text.ts:566
Do you agree with this assessment?
R3 · Large Files5.0 / 10Adequate✓ 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.
rhwp-studio/src/view/canvaskit-renderer.ts has 6146 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/view/canvaskit-renderer.ts:1
rhwp-studio/src/engine/input-handler.ts has 6138 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/engine/input-handler.ts:1
rhwp-studio/src/core/wasm-bridge.ts has 3706 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/core/wasm-bridge.ts:1
npm/hwpctrl-ocx/src/index.mjs has 3516 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — npm/hwpctrl-ocx/src/index.mjs:1
rhwp-studio/src/engine/command.ts has 2950 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/engine/command.ts:1
rhwp-studio/src/compare/diff-engine.ts has 2907 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/compare/diff-engine.ts:1
rhwp-studio/src/engine/cursor.ts has 2460 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/engine/cursor.ts:1
rhwp-studio/src/ui/picture-props-dialog.ts has 2421 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/ui/picture-props-dialog.ts:1
rhwp-studio/src/engine/input-handler-keyboard.ts has 2331 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/engine/input-handler-keyboard.ts:1
rhwp-studio/src/view/canvas-view.ts has 2318 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/view/canvas-view.ts:1
rhwp-studio/src/main.ts has 2229 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/main.ts:1
rhwp-studio/src/ai/tools/write-tools.ts has 2080 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/ai/tools/write-tools.ts:1
rhwp-studio/src/engine/input-handler-mouse.ts has 2043 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/engine/input-handler-mouse.ts:1
rhwp-studio/src/view/page-renderer.ts has 1550 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/view/page-renderer.ts:1
rhwp-studio/src/ui/table-cell-props-dialog.ts has 1421 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/ui/table-cell-props-dialog.ts:1
rhwp-studio/src/core/local-fonts.ts has 1270 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/core/local-fonts.ts:1
rhwp-vscode/src/webview/viewer.ts has 1243 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-vscode/src/webview/viewer.ts:1
rhwp-studio/src/view/static-svg-path-layers.ts has 1229 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/view/static-svg-path-layers.ts:1
rhwp-studio/src/engine/input-handler-picture.ts has 1208 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/engine/input-handler-picture.ts:1
rhwp-studio/src/command/commands/table.ts has 1120 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/command/commands/table.ts:1
rhwp-studio/src/ui/cell-border-bg-dialog.ts has 1040 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/ui/cell-border-bg-dialog.ts:1
rhwp-studio/src/ui/char-shape-dialog.ts has 1022 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/ui/char-shape-dialog.ts:1
rhwp-desk/ui/js/main.js has 964 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-desk/ui/js/main.js:1
gym/tools/from_e2e.mjs has 928 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — gym/tools/from_e2e.mjs:1
rhwp-studio/src/engine/input-handler-text.ts has 872 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/engine/input-handler-text.ts:1
rhwp-studio/src/ui/toolbar.ts has 870 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/ui/toolbar.ts:1
rhwp-studio/src/engine/input-handler-table.ts has 863 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/engine/input-handler-table.ts:1
rhwp-studio/src/command/commands/file.ts has 856 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/command/commands/file.ts:1
rhwp-studio/src/ui/para-shape-dialog.ts has 852 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/ui/para-shape-dialog.ts:1
rhwp-studio/src/document-agent/controller.ts has 837 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/document-agent/controller.ts:1
rhwp-studio/src/command/commands/insert.ts has 825 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/command/commands/insert.ts:1
rhwp-studio/src/view/ruler.ts has 806 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/view/ruler.ts:1
rhwp-studio/src/ui/endnote-shape-dialog.ts has 756 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/ui/endnote-shape-dialog.ts:1
rhwp-studio/src/ui/equation-editor-dialog.ts has 702 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/ui/equation-editor-dialog.ts:1
rhwp-studio/src/view/virtual-scroll.ts has 678 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/view/virtual-scroll.ts:1
rhwp-vscode/src/hwp-editor-provider.ts has 626 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-vscode/src/hwp-editor-provider.ts:1
rhwp-studio/src/command/commands/page.ts has 625 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/command/commands/page.ts:1
rhwp-studio/src/ui/para-shape-tab-builders.ts has 624 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/ui/para-shape-tab-builders.ts:1
rhwp-studio/src/view/canvaskit/css-color.ts has 616 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/view/canvaskit/css-color.ts:1
rhwp-studio/src/view/glyph-outline-payload-status.ts has 602 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — rhwp-studio/src/view/glyph-outline-payload-status.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 Coverage8.6 / 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. (×40) — rhwp-desk/ui/js/main.js:1, rhwp-firefox/content-script.js:1, rhwp-safari/src/content-script.js: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.
Do you agree with this assessment?
R7 · Dead Code7.9 / 10Strong✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 472 application, 113 tooling and 709 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 (472 application, 113 tooling, 709 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 (×9) — mydocs/tech/investigations/issue-8403/validation/browser-verify.mjs, mydocs/tech/investigations/issue-3587/probes/template-contract.mjs, rhwp-shared/security/filename-sanitizer.js, …
Nothing imports this binding — it is safe to review for removal. (×9) — rhwp-shared/sw/download-observer-state.js:7, rhwp-shared/sw/download-observer-state.js:15, rhwp-studio/src/ai/settings/key-store.ts:16, …
This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×14) — gym/tools/from_e2e.mjs:187, mydocs/pr/assets/issue8174/v2-s04/reproduce/browser-recovery-open-races.mjs:22, mydocs/pr/assets/issue8174/v2-s04/reproduce/browser-recovery-open-races.mjs:23, …
This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments. (×5) — npm/hwpctrl-ocx/src/index.mjs:1003, rhwp-studio/src/engine/input-handler.ts:353, rhwp-studio/src/engine/input-handler.ts:375, …
Nothing in its class calls or references this private method — no member access, no string key, no decorator, and no test reaches it by name. A private member cannot be called from outside its class, so this is the whole search: remove it, or call it where it was meant to be used. — npm/hwpctrl-ocx/src/index.mjs:2970
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. — rhwp-studio/src/engine/input-handler.ts:418
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. (×6) — scripts/tests/frontend-dependency-compat.test.mjs:51, scripts/tests/frontend-dependency-compat.test.mjs:17, mydocs/working/assets/issue6042-stage5-expanded/compare-visuals.mjs:10, …
Only test files import it (first: rhwp-studio/e2e/helpers.mjs:14) — move it to devDependencies. — rhwp-studio/package.json:126
Only test files import it (first: rhwp-studio/e2e/helpers.mjs:18) — move it to devDependencies. — rhwp-studio/package.json:127
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Cryptographic hygiene (weak hash/cipher, password key-derivation). This codebase has no web surface, so transport/header/cookie/CSRF controls are N/A and only crypto is scored. Markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself — a page handed to a consumer runs in that consumer's origin.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
`https://cdn.jsdelivr.net/npm/chart.js@4.4.7/dist/chart.umd.min.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. 21 such include(s) across the repository's markup. — mydocs/metrics/2026-07-04-r1/dashboard.html:7
What to do
Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `ArgumentNullException` tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements (or a repository exception type deriving from it) controlled by an `if` — directly or through the `using`, `lock` or `try` that wraps the throw — whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`); in the `else` branch, for a conjunct of the admitting condition that is FALSE of a non-null `p`. Range guards are read for bounds that leave nothing and for a `p > C.Count` bound whose index then reaches `C[p]`, `C.RemoveAt(p)` or a method of the same type that indexes with it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
0/1 C# file(s) are in a nullable-enabled context. This repository commits no project file, so nothing sets <Nullable>enable</Nullable> for it: a file is enabled only by its own `#nullable enable`, by a Unity `csc.rsp` with `-nullable:enable` for its assembly, or as a file-based app (`#:` directives) whose `#:property Nullable` does not turn it off. NRTs catch a whole class of null-deref bugs at compile time.
What to do
Put every file in a nullable-enabled context — `#nullable enable` at its top, or commit a project file with <Nullable>enable</Nullable> — and resolve warnings rather than suppressing with `!`.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 4 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
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 — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 63 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AX1 Captive dependencies — no DI registrations detected
AX2 Stateful singletons — no singleton implementations detected
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — AX6 reached only 26% of this repository's production lines — rust (919,168 lines), cpp (1,977 lines), c (1,231 lines), objectivec (572 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 — compose up failed (exit 14 — a file the compose project references is missing) — env file .env.docker not found: stat .env.docker: no such file or directory; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
D11 Test Reliability — Test Reliability not included (check did not complete)
D13 Secret Scanning — Secret Scanning not included (time budget)
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.
D20 ADR Quality — 15 ADR(s) are written in a language our ADR lexicon does not cover, or are too short to tell (undetermined); their sections and statuses were not judged.
D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed JavaScript, Rust, Swift surface was not measured.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
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.
D28 Secrets (history) — gitleaks killed before it finished — this repository's working tree not scanned
D29 Static Analysis (SAST) — Static Analysis (SAST) not included (check did not complete)
D32 Data Compliance (PII/GDPR) — 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.
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.
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): 2 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 395 value object(s); 4 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, which this analysis does not build from source alone for this language. 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 — no mutating command handlers or message consumers detected — idempotency check not applicable (this repository commits no MSBuild project, so its C# was read as syntax-only projects — a handler marked ONLY by an interface from a package is not visible without a build)
IC1 Incompleteness & stubs — IC1 reached only 0% of this repository's production lines — rust (919,168 lines), python (150,813 lines), typescript (113,314 lines), javascript (54,349 lines), dart (4,201 lines), cpp (1,977 lines), c (1,231 lines), objectivec (572 lines), swift (501 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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 measured — the application kind could not be determined for this repo
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 21 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
PF1 Benchmark discipline — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
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.
X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X12 Unreachable branch — X12 reached only 0% of this repository's production lines — rust (919,168 lines), python (150,813 lines), typescript (113,314 lines), javascript (54,349 lines), dart (4,201 lines), cpp (1,977 lines), c (1,231 lines), objectivec (572 lines), swift (501 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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
X16 Unfloored truncation loop — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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 — no async method does work a token could cancel
X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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 — X24 reached only 13% of this repository's production lines — rust (919,168 lines), python (150,813 lines), dart (4,201 lines), cpp (1,977 lines), c (1,231 lines), objectivec (572 lines), swift (501 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X25 Inert configuration knob — 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 — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X27 Collection changed while being enumerated — This check needs a compiled C# program and this repository commits no project file to compile, so only its syntax could be read. That is a limit of the analyzer, not a finding about your code.
X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X3 Exception handling — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X4 Structured logging — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Critical — 136 finding(s)
AC1 · Text alternatives· <img> without a text alternative · ×28
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:3— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:4— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:5— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:6— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:8— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:9— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:10— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:11— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:13— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:14— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:15— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:16— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:18— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:19— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:20— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:21— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:23— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:24— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:25— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:26— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:28— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:29— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:30— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:31— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:33— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
+ 3 more in this group — see findings.md.
AC2 · Forms & labels· <input> without a programmatic label · ×20
<input> without a programmatic label rhwp-desk/ui/index.html:134— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label rhwp-safari/src/options.html:243— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<input> without a programmatic label rhwp-safari/src/options.html:299— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ai/ui/ai-panel.ts:356— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/engine/input-handler.ts:6583— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/cell-border-bg-dialog.ts:295— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/cell-border-bg-dialog.ts:449— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/cell-border-bg-dialog.ts:459— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/cell-border-bg-dialog.ts:473— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/cell-border-bg-dialog.ts:487— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/cell-border-bg-dialog.ts:585— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:414— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:423— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:488— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:531— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:561— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:676— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:742— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:753— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:1122— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics· Click handler on a non-interactive <div> · ×19
Click handler on a non-interactive <div> rhwp-chrome/content-script.js:181— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-desk/ui/js/main.js:189— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-desk/ui/js/main.js:304— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-desk/ui/js/main.js:326— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-desk/ui/js/main.js:380— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-desk/ui/js/palette.js:92— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-firefox/content-script.js:183— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-safari/src/content-script.js:224— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-studio/src/ui/cell-border-bg-dialog.ts:238— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-studio/src/ui/context-menu.ts:48— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-studio/src/ui/font-set-dialog.ts:98— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-studio/src/ui/goto-dialog.ts:125— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-studio/src/ui/local-context-menu.ts:50— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-studio/src/ui/numbering-dialog.ts:243— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-studio/src/ui/numbering-dialog.ts:255— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-studio/src/ui/style-dialog.ts:150— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-studio/src/ui/table-cell-props-dialog.ts:820— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <div> rhwp-vscode/src/webview/viewer.ts:879— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabindex="0".
Click handler on a non-interactive <div> rhwp-vscode/src/webview/viewer.ts:1315— A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabindex="0".
AC2 · Forms & labels· <select> without a programmatic label · ×16
<select> without a programmatic label rhwp-desk/ui/js/main.js:645— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/hwpctl-test.html:72— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/src/ai/ui/ai-settings-dialog.ts:55— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/src/ui/cell-border-bg-dialog.ts:283— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/src/ui/cell-border-bg-dialog.ts:1142— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:303— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:322— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:499— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:512— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:542— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:572— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:585— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:638— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:656— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:732— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label rhwp-studio/src/ui/char-shape-dialog.ts:762— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics· Clickable element isn't keyboard-operable · ×10
Clickable element isn't keyboard-operable rhwp-studio/index.html:26— The repo's own CSS styles .menu-title with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable rhwp-studio/index.html:52— The repo's own CSS styles .menu-title with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable rhwp-studio/index.html:76— The repo's own CSS styles .menu-title with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable rhwp-studio/index.html:130— The repo's own CSS styles .menu-title with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable rhwp-studio/index.html:183— The repo's own CSS styles .menu-title with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable rhwp-studio/index.html:217— The repo's own CSS styles .menu-title with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable rhwp-studio/index.html:376— The repo's own CSS styles .menu-title with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable rhwp-studio/index.html:410— The repo's own CSS styles .menu-title with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable rhwp-studio/src/automation/menu-dom.ts:92— The repo's own CSS styles .md-item with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Clickable element isn't keyboard-operable rhwp-studio/src/ui/toolbar.ts:424— The repo's own CSS styles .sb-hl-swatch with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
Boundary-crossing change coupling: rendering.rs ↔ state.rs src/document_core/queries/rendering.rs:1— `src/document_core/queries/rendering.rs` (context document_core) and `src/renderer/pagination/state.rs` (context renderer) sit in DIFFERENT parts of the tree yet change together 100% of the time (10 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `851ca270` fix: 표 앞뒤 호스트 줄의 구성과 소유 범위를 공유; `ecaad39a` fix(typeset): 쪽·종이 기준 자리차지 그림·도형의 세로 밴드를 문단 시작에 계상 (#7696); `788349c8` fix(layout): 저장 문단 끝과 앞 간격의 좌표계를 조판과 배치에 공유 — run `git show` on any of them.
Boundary-crossing change coupling: json.rs ↔ canvas_render.rs src/paint/json.rs:1— `src/paint/json.rs` (context paint) and `src/renderer/equation/canvas_render.rs` (context renderer) sit in DIFFERENT parts of the tree yet change together 71% of the time (20 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 20 shared commits counted here, the most recent 3 are `4dbb274b` fix: HancomEQN 글리프와 첨자 메트릭을 실제 출력에 연결; `eae23ccd` fix: 독립 Print에 따라 정렬 행과 조합·긴 나눗셈·색 범위를 보정; `be1aac16` fix: 공개 MATH 화살촉과 장식 프레임을 각 출력에 공유 — run `git show` on any of them.
Boundary-crossing change coupling: rendering.rs ↔ tests.rs src/document_core/queries/rendering.rs:1— `src/document_core/queries/rendering.rs` (context document_core) and `src/renderer/pagination/tests.rs` (context renderer) sit in DIFFERENT parts of the tree yet change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `851ca270` fix: 표 앞뒤 호스트 줄의 구성과 소유 범위를 공유; `ecaad39a` fix(typeset): 쪽·종이 기준 자리차지 그림·도형의 세로 밴드를 문단 시작에 계상 (#7696); `788349c8` fix(layout): 저장 문단 끝과 앞 간격의 좌표계를 조판과 배치에 공유 — run `git show` on any of them.
Boundary-crossing change coupling: provenance.rs ↔ gen_agent_codex.py crates/rhwp-contracts/src/provenance.rs:1— `crates/rhwp-contracts/src/provenance.rs` (context crates) and `tools/gen_agent_codex.py` (context tools) sit in DIFFERENT parts of the tree yet 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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `15d65b00` feat(cli): charts — 차트 목록 (#5051); `ad0a336f` feat: threat-scan — 무기화 문서 구조 위협 탐지(읽기 전용 안전 에어락) (at that commit the file was still `src/provenance.rs`); `b24cea3b` feat(armor): 프롬프트 주입 방패 — nonce 격벽 + 주입 신호 표지 + 출처 표지 (#4850) (at that commit the file was still `src/provenance.rs`) — run `git show` on any of them.
Boundary-crossing change coupling: rendering.rs ↔ page_number.rs src/document_core/queries/rendering.rs:1— `src/document_core/queries/rendering.rs` (context document_core) and `src/renderer/page_number.rs` (context renderer) sit in DIFFERENT parts of the tree yet change together 56% of the time (10 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `851ca270` fix: 표 앞뒤 호스트 줄의 구성과 소유 범위를 공유; `ecaad39a` fix(typeset): 쪽·종이 기준 자리차지 그림·도형의 세로 밴드를 문단 시작에 계상 (#7696); `788349c8` fix(layout): 저장 문단 끝과 앞 간격의 좌표계를 조판과 배치에 공유 — run `git show` on any of them.
Boundary-crossing change coupling: RhwpNative.cs ↔ mod.rs bindings/csharp/RhwpNative.cs:1— `bindings/csharp/RhwpNative.cs` (context bindings) and `src/native_host/mod.rs` (context native_host) sit in DIFFERENT parts of the tree yet change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `a92974dc` feat(native): integrate bounded Windows D3D12 texture bridge; `d9570e04` feat(native): integrate bounded Metal Flutter texture bridge; `b97dad94` feat: expose native multi-page view state to application hosts — run `git show` on any of them.
Boundary-crossing change coupling: json.rs ↔ equation_conv.rs src/paint/json.rs:1— `src/paint/json.rs` (context paint) and `src/renderer/skia/equation_conv.rs` (context renderer) sit in DIFFERENT parts of the tree yet change together 53% of the time (19 of the 36 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 19 shared commits counted here, the most recent 3 are `4dbb274b` fix: HancomEQN 글리프와 첨자 메트릭을 실제 출력에 연결; `be1aac16` fix: 공개 MATH 화살촉과 장식 프레임을 각 출력에 공유; `b6947263` fix: 수식 명시적 간격과 구분자 윤곽·논리 프레임을 공유 — run `git show` on any of them.
<html> without a lang data/font-metrics/adobe-core14/MustRead.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang mydocs/pr/assets/pr7109_hancom_pdf_bbox.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang mydocs/pr/assets/pr_6154/visual-sweep/issue6122/issue6122/pdf_bbox.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang mydocs/pr/assets/pr_6154/visual-sweep/issue6123/issue6123/pdf_bbox.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang mydocs/pr/assets/pr_6154/visual-sweep/issue6124/issue6124/pdf_bbox.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC4 · Keyboard semantics· Click handler on a non-interactive <span> · ×4
Click handler on a non-interactive <span> rhwp-chrome/content-script.js:250— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <span> rhwp-desk/ui/js/main.js:219— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <span> rhwp-firefox/content-script.js:252— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Click handler on a non-interactive <span> rhwp-safari/src/content-script.js:121— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
AC2 · Forms & labels· Custom control named only by title on <span> · ×3
Custom control named only by title on <span> rhwp-chrome/content-script.js:250— This <span> carries a click handler, which makes it a control, and its only name is a title attribute. A plain element maps to role="generic", which does not support a name from the author, so the title is announced as nothing at all — it is a mouse-only tooltip, unreachable on touch. Give it role="button" (which it needs anyway to be operable) so the title becomes a real name, or add an aria-label.
Custom control named only by title on <span> rhwp-firefox/content-script.js:252— This <span> carries a click handler, which makes it a control, and its only name is a title attribute. A plain element maps to role="generic", which does not support a name from the author, so the title is announced as nothing at all — it is a mouse-only tooltip, unreachable on touch. Give it role="button" (which it needs anyway to be operable) so the title becomes a real name, or add an aria-label.
Custom control named only by title on <span> rhwp-safari/src/content-script.js:121— This <span> carries a click handler, which makes it a control, and its only name is a title attribute. A plain element maps to role="generic", which does not support a name from the author, so the title is announced as nothing at all — it is a mouse-only tooltip, unreachable on touch. Give it role="button" (which it needs anyway to be operable) so the title becomes a real name, or add an aria-label.
AC3 · Page structure· Document <title> is empty · ×3
Document <title> is empty mydocs/pr/assets/pr7109_hancom_pdf_bbox.html:1— An empty <title> gives no page name in the tab, history or screen-reader page list. Put descriptive text in the <title>.
Document <title> is empty mydocs/pr/assets/pr_6154/visual-sweep/issue6122/issue6122/pdf_bbox.html:1— An empty <title> gives no page name in the tab, history or screen-reader page list. Put descriptive text in the <title>.
Document <title> is empty mydocs/pr/assets/pr_6154/visual-sweep/issue6123/issue6123/pdf_bbox.html:1— An empty <title> gives no page name in the tab, history or screen-reader page list. Put descriptive text in the <title>.
Orphaned knowledge src/doclang/adapter/paragraph.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge src/doclang/writer/mod.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge src/doclang/eqedit/latex.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
AC2 · Forms & labels· <textarea> without a programmatic label · ×1
<textarea> without a programmatic label rhwp-studio/hwpctl-test.html:50— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics· Clickable role="separator" that no keyboard user can reach · ×1
Clickable role="separator" that no keyboard user can reach rhwp-studio/src/view/side-panel-host.ts:154— This <div> announces itself as a role="separator" and is operated by pointerdown, pointerup and pointermove, but nothing can put focus on it: no tabindex="0", no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabindex="0"="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds).
D10 · Test Quality· No assertions (empty test) · ×1
No assertions (empty test): F5 단일 셀 선택 이동은 평면·중첩 표의 문서 위치를 동기화한다 rhwp-studio/tests/cell-selection-caret-sync.test.ts:109— Test method has an empty body — it asserts nothing and exercises no code.
Unlisted import 'ajv' scripts/tests/frontend-dependency-compat.test.mjs:51— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'brace-expansion' scripts/tests/frontend-dependency-compat.test.mjs:17— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'pixelmatch' mydocs/working/assets/issue6042-stage5-expanded/compare-visuals.mjs:10— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'pngjs' mydocs/working/assets/issue6042-stage5-expanded/compare-visuals.mjs:9— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'puppeteer-core' mydocs/pr/assets/chrisryugj_20261031/edit-wasm.mjs:19— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'puppeteer' rhwp-firefox/e2e/download-save.test.mjs:20— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
rhwp::parser::pdf::table_paint::partition (cognitive 462) src/parser/pdf/table_paint.rs:444— rhwp::parser::pdf::table_paint::partition has cognitive complexity 462 (threshold 15). Drivers by points: if/else 98 (328 pts), loops 34 (94 pts), boolean chains 23, match/switch 5 (17 pts) (nesting depth added 302). 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.
rhwp::parser::hwp3::parse_paragraph_list_inner (cognitive 384) src/parser/hwp3/mod.rs:3137— rhwp::parser::hwp3::parse_paragraph_list_inner has cognitive complexity 384 (threshold 15). Drivers by points: if/else 101 (266 pts), boolean chains 44, match/switch 10 (39 pts), loops 14 (35 pts) (nesting depth added 215). 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.
rhwp::parser::hwp3::parse_hwp3_object_dispatch (cognitive 252) src/parser/hwp3/mod.rs:1273— rhwp::parser::hwp3::parse_hwp3_object_dispatch has cognitive complexity 252 (threshold 15). Drivers by points: if/else 84 (161 pts), loops 15 (52 pts), match/switch 12 (30 pts), boolean chains 9 (nesting depth added 132). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp::parser::pdf::editable::reflow (cognitive 244) src/parser/pdf/editable.rs:696— rhwp::parser::pdf::editable::reflow has cognitive complexity 244 (threshold 15). Drivers by points: if/else 39 (148 pts), loops 22 (69 pts), match/switch 4 (22 pts), boolean chains 5 (nesting depth added 174). 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.
rhwp::renderer::composer::line_breaking::try_tokenize_paragraph_with_regenerated_space_metric (cognitive 205) src/renderer/composer/line_breaking.rs:538— rhwp::renderer::composer::line_breaking::try_tokenize_paragraph_with_regenerated_space_metric has cognitive complexity 205 (threshold 15). Drivers by points: if/else 61 (167 pts), loops 6 (22 pts), boolean chains 16 (nesting depth added 122). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rhwp::parser::hwpx::section::parse_picture (cognitive 202) src/parser/hwpx/section.rs:3111— rhwp::parser::hwpx::section::parse_picture has cognitive complexity 202 (threshold 15). Drivers by points: match/switch 22 (91 pts), if/else 15 (67 pts), loops 12 (42 pts), boolean chains 2 (nesting depth added 151). 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.
rhwp::parser::hwpx::section::parse_note_pr_children (cognitive 193) src/parser/hwpx/section.rs:1375— rhwp::parser::hwpx::section::parse_note_pr_children has cognitive complexity 193 (threshold 15). Drivers by points: if/else 22 (126 pts), match/switch 9 (44 pts), loops 6 (21 pts), boolean chains 2 (nesting depth added 154). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp::parser::hwpx::header::parse_border_fill (cognitive 189) src/parser/hwpx/header.rs:1657— rhwp::parser::hwpx::header::parse_border_fill has cognitive complexity 189 (threshold 15). Drivers by points: match/switch 14 (69 pts), if/else 15 (68 pts), loops 11 (51 pts), boolean chains 1 (nesting depth added 148). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp::renderer::layout::text_measurement::char_width_decision_with_hft_tracking (cognitive 185) src/renderer/layout/text_measurement.rs:1949— rhwp::renderer::layout::text_measurement::char_width_decision_with_hft_tracking has cognitive complexity 185 (threshold 15). Drivers by points: if/else 84 (127 pts), boolean chains 49, match/switch 3 (6 pts), loops 1 (3 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp::renderer::composer::line_breaking::try_layout_paragraph_in_frame_impl (cognitive 184) src/renderer/composer/line_breaking.rs:4487— rhwp::renderer::composer::line_breaking::try_layout_paragraph_in_frame_impl has cognitive complexity 184 (threshold 15). Drivers by points: if/else 57 (136 pts), boolean chains 21, loops 8 (20 pts), match/switch 3 (7 pts) (nesting depth added 95). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp::renderer::composer::line_breaking::fill_one_interval (cognitive 177) src/renderer/composer/line_breaking.rs:2219— rhwp::renderer::composer::line_breaking::fill_one_interval has cognitive complexity 177 (threshold 15). Drivers by points: if/else 56 (148 pts), boolean chains 13, loops 3 (11 pts), match/switch 2 (5 pts) (nesting depth added 103). 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.
rhwp::renderer::static_svg::normalize_static_svg (cognitive 169) src/renderer/static_svg.rs:10— rhwp::renderer::static_svg::normalize_static_svg has cognitive complexity 169 (threshold 15). Drivers by points: if/else 37 (127 pts), loops 8 (26 pts), boolean chains 14, match/switch 1 (2 pts) (nesting depth added 109). Of this number, 157 points are the body's own statements and 12 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.
rhwp::renderer::composer::line_breaking::try_reflow_line_segs_impl (cognitive 168) src/renderer/composer/line_breaking.rs:5899— rhwp::renderer::composer::line_breaking::try_reflow_line_segs_impl has cognitive complexity 168 (threshold 15). Drivers by points: if/else 65 (128 pts), boolean chains 22, loops 7 (14 pts), match/switch 2 (4 pts) (nesting depth added 72). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp::renderer::native_webfonts::prepare (cognitive 165) src/renderer/native_webfonts.rs:312— rhwp::renderer::native_webfonts::prepare has cognitive complexity 165 (threshold 15). Drivers by points: if/else 43 (114 pts), loops 12 (21 pts), match/switch 4 (16 pts), boolean chains 14 (nesting depth added 92). 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.
rhwp::renderer::skia::image_conv::draw_image_bytes (cognitive 157) src/renderer/skia/image_conv.rs:217— rhwp::renderer::skia::image_conv::draw_image_bytes has cognitive complexity 157 (threshold 15). Drivers by points: if/else 77 (121 pts), boolean chains 25, match/switch 6 (9 pts), loops 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.
rhwp::parser::pdf::structured_lowering::native_borders::plan (cognitive 152) src/parser/pdf/structured_lowering/native_borders.rs:118— rhwp::parser::pdf::structured_lowering::native_borders::plan has cognitive complexity 152 (threshold 15). Drivers by points: if/else 44 (105 pts), loops 13 (26 pts), boolean chains 11, match/switch 4 (10 pts) (nesting depth added 80). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp::parser::hwpx::section::parse_paragraph_body (cognitive 150) src/parser/hwpx/section.rs:662— rhwp::parser::hwpx::section::parse_paragraph_body has cognitive complexity 150 (threshold 15). Drivers by points: if/else 42 (112 pts), loops 7 (15 pts), match/switch 6 (14 pts), boolean chains 9 (nesting depth added 86). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp::renderer::layout::paragraph_layout::compute_line_extra_spacing_with_dash_plan (cognitive 148) src/renderer/layout/paragraph_layout.rs:2360— rhwp::renderer::layout::paragraph_layout::compute_line_extra_spacing_with_dash_plan has cognitive complexity 148 (threshold 15). Drivers by points: if/else 58 (112 pts), boolean chains 20, loops 4 (14 pts), match/switch 1 (2 pts) (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp::parser::pdf::recognition::recognize_page (cognitive 144) src/parser/pdf/recognition.rs:841— rhwp::parser::pdf::recognition::recognize_page has cognitive complexity 144 (threshold 15). Drivers by points: if/else 34 (91 pts), loops 20 (45 pts), boolean chains 4, match/switch 3 (4 pts) (nesting depth added 83). 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.
rhwp::renderer::render_normalization::stored_word_tail::normalize_flow_with_storage (cognitive 142) src/renderer/render_normalization/stored_word_tail.rs:207— rhwp::renderer::render_normalization::stored_word_tail::normalize_flow_with_storage has cognitive complexity 142 (threshold 15). Drivers by points: if/else 36 (116 pts), loops 8 (18 pts), boolean chains 8 (nesting depth added 90). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
rhwp::serializer::hwpx::section::render_runs_in_paragraph_scope_with_storage (cognitive 141) src/serializer/hwpx/section.rs:2244— rhwp::serializer::hwpx::section::render_runs_in_paragraph_scope_with_storage has cognitive complexity 141 (threshold 15). Drivers by points: if/else 35 (81 pts), loops 20 (37 pts), boolean chains 23 (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp::renderer::typeset::controls::stored_tac::prepare (cognitive 140) src/renderer/typeset/controls/stored_tac.rs:581— rhwp::renderer::typeset::controls::stored_tac::prepare has cognitive complexity 140 (threshold 15). Drivers by points: if/else 41 (104 pts), boolean chains 31, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 66). 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.
rhwp::parser::hwpx::header::parse_char_shape (cognitive 135) src/parser/hwpx/header.rs:656— rhwp::parser::hwpx::header::parse_char_shape has cognitive complexity 135 (threshold 15). Drivers by points: match/switch 18 (76 pts), loops 11 (48 pts), if/else 3 (11 pts) (nesting depth added 103). 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.
rhwp::serializer::body_text::try_serialize_para_text_with_slots (cognitive 134) src/serializer/body_text.rs:934— rhwp::serializer::body_text::try_serialize_para_text_with_slots has cognitive complexity 134 (threshold 15). Drivers by points: if/else 37 (83 pts), loops 19 (38 pts), boolean chains 9, match/switch 2 (4 pts) (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp::parser::pdf::table_detection::detect_ruled_tables (cognitive 132) src/parser/pdf/table_detection.rs:866— rhwp::parser::pdf::table_detection::detect_ruled_tables has cognitive complexity 132 (threshold 15). Drivers by points: if/else 30 (76 pts), loops 23 (37 pts), boolean chains 10, match/switch 5 (9 pts) (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp::parser::pdf::table_paint::partition (cyclomatic 156) src/parser/pdf/table_paint.rs:444— rhwp::parser::pdf::table_paint::partition has cyclomatic complexity 156 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp::parser::hwp3::parse_paragraph_list_inner (cyclomatic 155) src/parser/hwp3/mod.rs:3137— rhwp::parser::hwp3::parse_paragraph_list_inner has cyclomatic complexity 155 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp::parser::hwpx::section::parse_picture (cyclomatic 139) src/parser/hwpx/section.rs:3111— rhwp::parser::hwpx::section::parse_picture has cyclomatic complexity 139 (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.
rhwp::parser::hwp3::parse_hwp3_object_dispatch (cyclomatic 132) src/parser/hwp3/mod.rs:1273— rhwp::parser::hwp3::parse_hwp3_object_dispatch has cyclomatic complexity 132 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp::parser::hwpx::header::parse_char_shape (cyclomatic 132) src/parser/hwpx/header.rs:656— rhwp::parser::hwpx::header::parse_char_shape has cyclomatic complexity 132 (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.
rhwp::main (cyclomatic 114) src/main.rs:84— rhwp::main has cyclomatic complexity 114 (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.
rhwp::renderer::layout::text_measurement::char_width_decision_with_hft_tracking (cyclomatic 114) src/renderer/layout/text_measurement.rs:1949— rhwp::renderer::layout::text_measurement::char_width_decision_with_hft_tracking has cyclomatic complexity 114 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp::parser::hwpx::section::parse_form_object (cyclomatic 109) src/parser/hwpx/section.rs:7070— rhwp::parser::hwpx::section::parse_form_object has cyclomatic complexity 109 (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.
rhwp::renderer::skia::image_conv::draw_image_bytes (cyclomatic 107) src/renderer/skia/image_conv.rs:217— rhwp::renderer::skia::image_conv::draw_image_bytes has cyclomatic complexity 107 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp::parser::hwpx::section::parse_paragraph_body (cyclomatic 102) src/parser/hwpx/section.rs:662— rhwp::parser::hwpx::section::parse_paragraph_body has cyclomatic complexity 102 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp::parser::hwpx::section::parse_table (cyclomatic 97) src/parser/hwpx/section.rs:2404— rhwp::parser::hwpx::section::parse_table has cyclomatic complexity 97 (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.
rhwp::parser::hwpx::header::parse_border_fill (cyclomatic 90) src/parser/hwpx/header.rs:1657— rhwp::parser::hwpx::header::parse_border_fill has cyclomatic complexity 90 (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.
rhwp::renderer::composer::line_breaking::try_reflow_line_segs_impl (cyclomatic 81) src/renderer/composer/line_breaking.rs:5899— rhwp::renderer::composer::line_breaking::try_reflow_line_segs_impl has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp::parser::hwpx::section::parse_shape_object (cyclomatic 79) src/parser/hwpx/section.rs:4711— rhwp::parser::hwpx::section::parse_shape_object has cyclomatic complexity 79 (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.
rhwp::parser::hwpx::section::parse_table_cell (cyclomatic 78) src/parser/hwpx/section.rs:2881— rhwp::parser::hwpx::section::parse_table_cell has cyclomatic complexity 78 (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.
rhwp::renderer::equation::canvas_render::render_box (cyclomatic 78) src/renderer/equation/canvas_render.rs:34— rhwp::renderer::equation::canvas_render::render_box has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp::renderer::composer::line_breaking::try_layout_paragraph_in_frame_impl (cyclomatic 77) src/renderer/composer/line_breaking.rs:4487— rhwp::renderer::composer::line_breaking::try_layout_paragraph_in_frame_impl 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.
rhwp::serializer::hwpx::section::render_runs_in_paragraph_scope_with_storage (cyclomatic 74) src/serializer/hwpx/section.rs:2244— rhwp::serializer::hwpx::section::render_runs_in_paragraph_scope_with_storage has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp::renderer::skia::equation_conv::render_box (cyclomatic 71) src/renderer/skia/equation_conv.rs:47— rhwp::renderer::skia::equation_conv::render_box has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp::parser::pdf::structured_lowering::native_borders::plan (cyclomatic 70) src/parser/pdf/structured_lowering/native_borders.rs:118— rhwp::parser::pdf::structured_lowering::native_borders::plan has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp::renderer::equation::svg_render::render_box (cyclomatic 70) src/renderer/equation/svg_render.rs:36— rhwp::renderer::equation::svg_render::render_box has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp::renderer::native_webfonts::prepare (cyclomatic 70) src/renderer/native_webfonts.rs:312— rhwp::renderer::native_webfonts::prepare has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp::parser::hwpx::section::parse_object_layout_child (cyclomatic 68) src/parser/hwpx/section.rs:3847— rhwp::parser::hwpx::section::parse_object_layout_child has cyclomatic complexity 68 (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.
rhwp::renderer::typeset::controls::stored_tac::prepare (cyclomatic 67) src/renderer/typeset/controls/stored_tac.rs:581— rhwp::renderer::typeset::controls::stored_tac::prepare 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.
rhwp::parser::hwpx::header::parse_para_shape_switch (cyclomatic 66) src/parser/hwpx/header.rs:1325— rhwp::parser::hwpx::header::parse_para_shape_switch 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.
Hotspot: src/renderer/layout/table_layout.rs src/renderer/layout/table_layout.rs:14973— src/renderer/layout/table_layout.rs changed 515 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 542 in LayoutEngine::cell_units_uncached at line 14973. 176 of those changes were fix/bug commits, and the other 339 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/layout/table_layout.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/renderer/layout.rs src/renderer/layout.rs:7866— src/renderer/layout.rs changed 478 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 468 in LayoutEngine::build_single_column at line 7866. 147 of those changes were fix/bug commits, and the other 331 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/layout.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/renderer/layout/table_partial.rs src/renderer/layout/table_partial.rs:1077— src/renderer/layout/table_partial.rs changed 274 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 555 in LayoutEngine::layout_partial_table_cells at line 1077. 96 of those changes were fix/bug commits, and the other 178 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/layout/table_partial.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/renderer/layout/paragraph_layout.rs src/renderer/layout/paragraph_layout.rs:5656— src/renderer/layout/paragraph_layout.rs changed 309 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 335 in LayoutEngine::layout_composed_paragraph_in_frame at line 5656. 103 of those changes were fix/bug commits, and the other 206 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/layout/paragraph_layout.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/renderer/typeset.rs src/renderer/typeset.rs:5062— src/renderer/typeset.rs changed 364 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 169 in TypesetEngine::place_table_with_text at line 5062. 56 of those changes were fix/bug commits, and the other 308 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/typeset.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/renderer/height_measurer.rs src/renderer/height_measurer.rs:3765— src/renderer/height_measurer.rs changed 166 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 310 in HeightMeasurer::measure_table_impl_with_storage at line 3765. 57 of those changes were fix/bug commits, and the other 109 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/height_measurer.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/renderer/typeset/table/continuation/fragment/emit.rs src/renderer/typeset/table/continuation/fragment/emit.rs:13— src/renderer/typeset/table/continuation/fragment/emit.rs changed 148 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 288 in TypesetEngine::emit_table_fragment at line 13. 73 of those changes were fix/bug commits, and the other 75 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/typeset/table/continuation/fragment/emit.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/renderer/typeset/table/scan/runner/row_step.rs src/renderer/typeset/table/scan/runner/row_step.rs:15— src/renderer/typeset/table/scan/runner/row_step.rs changed 114 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 258 in TypesetEngine::scan_ordinary_row_step at line 15. 57 of those changes were fix/bug commits, and the other 57 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/typeset/table/scan/runner/row_step.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/renderer/height_cursor.rs src/renderer/height_cursor.rs:497— src/renderer/height_cursor.rs changed 65 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 335 in HeightCursor::vpos_adjust at line 497. 18 of those changes were fix/bug commits, and the other 47 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/height_cursor.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/renderer/typeset/table/block/entry.rs src/renderer/typeset/table/block/entry.rs:15— src/renderer/typeset/table/block/entry.rs changed 74 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 284 in TypesetEngine::prepare_block_table_entry at line 15. 31 of those changes were fix/bug commits, and the other 43 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/typeset/table/block/entry.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/renderer/typeset/table/continuation/fragment/budget.rs src/renderer/typeset/table/continuation/fragment/budget.rs:16— src/renderer/typeset/table/continuation/fragment/budget.rs changed 99 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 203 in TypesetEngine::prepare_table_fragment_budget at line 16. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/typeset/table/continuation/fragment/budget.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: rhwp-studio/src/view/canvaskit-renderer.ts rhwp-studio/src/view/canvaskit-renderer.ts:3142— rhwp-studio/src/view/canvaskit-renderer.ts changed 96 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 163 in CanvasKitLayerRenderer.renderTextRun at line 3142. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- rhwp-studio/src/view/canvaskit-renderer.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/document_core/queries/rendering.rs src/document_core/queries/rendering.rs:5469— src/document_core/queries/rendering.rs changed 145 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 103 in DocumentCore::paginate_pass_with_storage at line 5469. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/document_core/queries/rendering.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/main.rs src/main.rs:84— src/main.rs changed 124 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 114 in rhwp::main at line 84. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/main.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/renderer/layout/text_measurement.rs src/renderer/layout/text_measurement.rs:1949— src/renderer/layout/text_measurement.rs changed 122 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 114 in rhwp::renderer::layout::text_measurement::char_width_decision_with_hft_tracking at line 1949. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/layout/text_measurement.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/document_core/commands/document.rs src/document_core/commands/document.rs:741— src/document_core/commands/document.rs changed 107 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 118 in DocumentCore::reflow_zero_height_paragraphs at line 741. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/document_core/commands/document.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/renderer/typeset/table/block/prepare.rs src/renderer/typeset/table/block/prepare.rs:18— src/renderer/typeset/table/block/prepare.rs changed 67 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 186 in TypesetEngine::prepare_block_table_continuation at line 18. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/typeset/table/block/prepare.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/renderer/skia/renderer.rs src/renderer/skia/renderer.rs:1171— src/renderer/skia/renderer.rs changed 76 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 157 in SkiaLayerRenderer::render_node at line 1171. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/skia/renderer.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/renderer/svg.rs src/renderer/svg.rs:764— src/renderer/svg.rs changed 105 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 112 in SvgRenderer::render_node at line 764. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/svg.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/renderer/layout/shape_layout.rs src/renderer/layout/shape_layout.rs:1715— src/renderer/layout/shape_layout.rs changed 95 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 123 in LayoutEngine::layout_shape_object_with_group_origin at line 1715. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/layout/shape_layout.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/renderer/typeset/notes/endnotes/paragraph.rs src/renderer/typeset/notes/endnotes/paragraph.rs:43— src/renderer/typeset/notes/endnotes/paragraph.rs changed 55 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 199 in TypesetEngine::typeset_endnote_paragraphs 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/typeset/notes/endnotes/paragraph.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/parser/hwpx/section.rs src/parser/hwpx/section.rs:3111— src/parser/hwpx/section.rs changed 78 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 139 in rhwp::parser::hwpx::section::parse_picture at line 3111. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/parser/hwpx/section.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/parser/hwp3/mod.rs src/parser/hwp3/mod.rs:3137— src/parser/hwp3/mod.rs changed 67 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 155 in rhwp::parser::hwp3::parse_paragraph_list_inner at line 3137. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/parser/hwp3/mod.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: rhwp-studio/src/engine/input-handler-keyboard.ts rhwp-studio/src/engine/input-handler-keyboard.ts:709— rhwp-studio/src/engine/input-handler-keyboard.ts changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 289 in input-handler-keyboard.onKeyDown at line 709. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- rhwp-studio/src/engine/input-handler-keyboard.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/renderer/float_placement.rs src/renderer/float_placement.rs:3205— src/renderer/float_placement.rs changed 235 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in rhwp::renderer::float_placement::stored_nested_row_frames_with_storage at line 3205. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/float_placement.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.
FunctionTooLong: input-handler-mouse.onClick rhwp-studio/src/engine/input-handler-mouse.ts:299— FunctionTooLong — onClick runs 776 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 676 over it, 7.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rhwp::cli::metadata::mcp::read::extend src/cli/metadata/mcp/read.rs:6— FunctionTooLong — rhwp::cli::metadata::mcp::read::extend runs 685 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 585 over it, 6.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rhwp::parser::hwp3::parse_hwp3_object_dispatch src/parser/hwp3/mod.rs:1273— FunctionTooLong — rhwp::parser::hwp3::parse_hwp3_object_dispatch runs 671 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 571 over it, 6.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rhwp::parser::hwp3::parse_paragraph_list_inner src/parser/hwp3/mod.rs:3137— FunctionTooLong — rhwp::parser::hwp3::parse_paragraph_list_inner runs 665 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 565 over it, 6.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rhwp::cli::metadata::mcp::edit_content::extend src/cli/metadata/mcp/edit_content.rs:3— FunctionTooLong — rhwp::cli::metadata::mcp::edit_content::extend runs 646 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 546 over it, 6.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rhwp::cli::metadata::mcp::edit_structure::extend src/cli/metadata/mcp/edit_structure.rs:3— FunctionTooLong — rhwp::cli::metadata::mcp::edit_structure::extend runs 637 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 537 over it, 6.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.
FunctionTooLong: input-handler-keyboard.onKeyDown rhwp-studio/src/engine/input-handler-keyboard.ts:709— FunctionTooLong — onKeyDown runs 618 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 518 over it, 6.18× 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: rhwp::parser::pdf::table_paint::partition src/parser/pdf/table_paint.rs:444— FunctionTooLong — rhwp::parser::pdf::table_paint::partition runs 588 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 488 over it, 5.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rhwp::cli::metadata::capabilities::extended::extend src/cli/metadata/capabilities/extended.rs:3— FunctionTooLong — rhwp::cli::metadata::capabilities::extended::extend runs 575 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 475 over it, 5.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.
FunctionTooLong: rhwp::renderer::skia::image_conv::draw_image_bytes src/renderer/skia/image_conv.rs:217— FunctionTooLong — rhwp::renderer::skia::image_conv::draw_image_bytes runs 554 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 454 over it, 5.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rhwp::cli::metadata::mcp::advanced::extend src/cli/metadata/mcp/advanced.rs:3— FunctionTooLong — rhwp::cli::metadata::mcp::advanced::extend runs 549 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 449 over it, 5.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: rhwp::renderer::layout::text_measurement::char_width_decision_with_hft_tracking src/renderer/layout/text_measurement.rs:1949— FunctionTooLong — rhwp::renderer::layout::text_measurement::char_width_decision_with_hft_tracking runs 545 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 445 over it, 5.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: rhwp::parser::pdf::structured_lowering::lower src/parser/pdf/structured_lowering.rs:2257— FunctionTooLong — rhwp::parser::pdf::structured_lowering::lower runs 540 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 440 over it, 5.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: rhwp::serializer::hwpx::section::render_runs_in_paragraph_scope_with_storage src/serializer/hwpx/section.rs:2244— FunctionTooLong — rhwp::serializer::hwpx::section::render_runs_in_paragraph_scope_with_storage runs 525 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 425 over it, 5.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.
FunctionTooLong: rhwp::renderer::skia::equation_conv::render_box src/renderer/skia/equation_conv.rs:47— FunctionTooLong — rhwp::renderer::skia::equation_conv::render_box runs 471 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 371 over it, 4.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rhwp::parser::pdf::lowering::lower src/parser/pdf/lowering.rs:198— FunctionTooLong — rhwp::parser::pdf::lowering::lower runs 455 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 355 over it, 4.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: rhwp.__wbg_get_imports rhwp-studio/public/rhwp.js:14105— FunctionTooLong — __wbg_get_imports runs 454 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 354 over it, 4.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: page-scroll-probe.installPageScrollProbe rhwp-studio/src/dev/page-scroll-probe.ts:75— FunctionTooLong — installPageScrollProbe runs 445 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 345 over it, 4.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: rhwp::renderer::typeset::controls::empty_float::prepare src/renderer/typeset/controls/empty_float.rs:43— FunctionTooLong — rhwp::renderer::typeset::controls::empty_float::prepare runs 418 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 318 over it, 4.18× 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: rhwp::renderer::inline_flow::plan_with_storage src/renderer/inline_flow.rs:278— FunctionTooLong — rhwp::renderer::inline_flow::plan_with_storage runs 410 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 310 over it, 4.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rhwp::cli::metadata::capabilities::core::extend src/cli/metadata/capabilities/core.rs:3— FunctionTooLong — rhwp::cli::metadata::capabilities::core::extend runs 406 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 306 over it, 4.06× 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: rhwp::parser::hwp3::parse_hwp3_inner src/parser/hwp3/mod.rs:4252— FunctionTooLong — rhwp::parser::hwp3::parse_hwp3_inner runs 392 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 292 over it, 3.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rhwp::parser::pdf::recognition::recognize_page src/parser/pdf/recognition.rs:841— FunctionTooLong — rhwp::parser::pdf::recognition::recognize_page runs 378 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 278 over it, 3.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rhwp::renderer::equation::svg_render::render_box src/renderer/equation/svg_render.rs:36— FunctionTooLong — rhwp::renderer::equation::svg_render::render_box runs 378 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 278 over it, 3.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: rhwp::parser::hwpx::section::parse_paragraph_body src/parser/hwpx/section.rs:662— FunctionTooLong — rhwp::parser::hwpx::section::parse_paragraph_body 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.
FileTooLong: layout/table_layout.rs src/renderer/layout/table_layout.rs— FileTooLong — 19660 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 92% of them inside a single declaration: LayoutEngine (2588-28765), declaring 52 free functions. The bar is 500 significant lines; this is 19160 over it, 39.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: renderer/layout.rs src/renderer/layout.rs— FileTooLong — 11985 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 102 free functions. The bar is 500 significant lines; this is 11485 over it, 23.97× 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: layout/paragraph_layout.rs src/renderer/layout/paragraph_layout.rs— FileTooLong — 8426 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 74% of them inside a single declaration: LayoutEngine (2989-11934), declaring 76 free functions. The bar is 500 significant lines; this is 7926 over it, 16.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: public/rhwp.js rhwp-studio/public/rhwp.js— FileTooLong — 8370 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: HwpDocument (73-13416). The bar is 500 significant lines; this is 7870 over it, 16.74× 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: src/wasm_api.rs src/wasm_api.rs— FileTooLong — 7108 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 93% of them inside a single declaration: HwpDocument (7 blocks, 433-10370). The bar is 500 significant lines; this is 6608 over it, 14.22× 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: renderer/float_placement.rs src/renderer/float_placement.rs— FileTooLong — 6812 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 185 free functions. The bar is 500 significant lines; this is 6312 over it, 13.62× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: queries/rendering.rs src/document_core/queries/rendering.rs— FileTooLong — 6740 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 38 free functions. The bar is 500 significant lines; this is 6240 over it, 13.48× 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: layout/table_partial.rs src/renderer/layout/table_partial.rs— FileTooLong — 5716 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 92% of them inside a single declaration: LayoutEngine (734-8395). The bar is 500 significant lines; this is 5216 over it, 11.43× 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: view/canvaskit-renderer.ts rhwp-studio/src/view/canvaskit-renderer.ts— FileTooLong — 5255 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: CanvasKitReadinessBlocker (376-6216). The bar is 500 significant lines; this is 4755 over it, 10.51× 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: hwpx/section.rs src/parser/hwpx/section.rs— FileTooLong — 5096 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 129 free functions. The bar is 500 significant lines; this is 4596 over it, 10.19× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: commands/text_editing.rs src/document_core/commands/text_editing.rs— FileTooLong — 4942 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 85% of them inside a single declaration: DocumentCore (3 blocks, 806-6885), declaring 40 free functions. The bar is 500 significant lines; this is 4442 over it, 9.88× 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: queries/cursor_rect.rs src/document_core/queries/cursor_rect.rs— FileTooLong — 4740 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 4240 over it, 9.48× 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: renderer/height_measurer.rs src/renderer/height_measurer.rs— FileTooLong — 4717 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: HeightMeasurer (3 blocks, 1819-7033), declaring 47 free functions. The bar is 500 significant lines; this is 4217 over it, 9.43× 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: renderer/typeset.rs src/renderer/typeset.rs— FileTooLong — 4459 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 124 free functions. The bar is 500 significant lines; this is 3959 over it, 8.92× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: engine/input-handler.ts rhwp-studio/src/engine/input-handler.ts— FileTooLong — 4450 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: InputHandler (333-6643). The bar is 500 significant lines; this is 3950 over it, 8.90× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: layout/shape_layout.rs src/renderer/layout/shape_layout.rs— FileTooLong — 3858 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: LayoutEngine (737-5365). The bar is 500 significant lines; this is 3358 over it, 7.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: renderer/svg.rs src/renderer/svg.rs— FileTooLong — 3746 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 75% of them inside a single declaration: SvgRenderer (3 blocks, 96-4280), declaring 31 free functions. The bar is 500 significant lines; this is 3246 over it, 7.49× 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: hwpx/section.rs src/serializer/hwpx/section.rs— FileTooLong — 3618 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 150 free functions. The bar is 500 significant lines; this is 3118 over it, 7.24× 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: hwp3/mod.rs src/parser/hwp3/mod.rs— FileTooLong — 3579 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 87 free functions. The bar is 500 significant lines; this is 3079 over it, 7.16× 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: renderer/web_canvas.rs src/renderer/web_canvas.rs— FileTooLong — 3291 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 91% of them inside a single declaration: WebCanvasRenderer (6 blocks, 413-4530). The bar is 500 significant lines; this is 2791 over it, 6.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: commands/table_ops.rs src/document_core/commands/table_ops.rs— FileTooLong — 2945 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 99% of them inside a single declaration: DocumentCore (45-4162). The bar is 500 significant lines; this is 2445 over it, 5.89× 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: paint/json.rs src/paint/json.rs— FileTooLong — 2904 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 95 free functions. The bar is 500 significant lines; this is 2404 over it, 5.81× 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: core/wasm-bridge.ts rhwp-studio/src/core/wasm-bridge.ts— FileTooLong — 2692 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: WasmBridge (339-4165). The bar is 500 significant lines; this is 2192 over it, 5.38× 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: renderer/mod.rs src/renderer/mod.rs— FileTooLong — 2685 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 109 free functions. The bar is 500 significant lines; this is 2185 over it, 5.37× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: commands/document.rs src/document_core/commands/document.rs— FileTooLong — 2529 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: DocumentCore (152-3999). The bar is 500 significant lines; this is 2029 over it, 5.06× 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.
MethodTooLong: LayoutEngine.cell_units_uncached src/renderer/layout/table_layout.rs:14973— MethodTooLong — cell_units_uncached runs 2446 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 2346 over it, 24.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LayoutEngine.layout_horizontal_cell_paragraphs src/renderer/layout/table_layout.rs:7341— MethodTooLong — layout_horizontal_cell_paragraphs runs 2080 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 1980 over it, 20.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: LayoutEngine.layout_composed_paragraph_in_frame src/renderer/layout/paragraph_layout.rs:5656— MethodTooLong — layout_composed_paragraph_in_frame runs 2057 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 1957 over it, 20.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TypesetEngine.emit_table_fragment src/renderer/typeset/table/continuation/fragment/emit.rs:13— MethodTooLong — emit_table_fragment runs 1919 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 1819 over it, 19.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TypesetEngine.prepare_block_table_entry src/renderer/typeset/table/block/entry.rs:15— MethodTooLong — prepare_block_table_entry runs 1867 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 1767 over it, 18.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TypesetEngine.typeset_endnote_paragraphs src/renderer/typeset/notes/endnotes/paragraph.rs:43— MethodTooLong — typeset_endnote_paragraphs runs 1760 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 1660 over it, 17.60× 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: HeightCursor.vpos_adjust src/renderer/height_cursor.rs:497— MethodTooLong — vpos_adjust runs 1674 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 1574 over it, 16.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: HeightMeasurer.measure_table_impl_with_storage src/renderer/height_measurer.rs:3765— MethodTooLong — measure_table_impl_with_storage runs 1610 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 1510 over it, 16.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LayoutEngine.layout_partial_table_resolved src/renderer/layout/table_partial.rs:6003— MethodTooLong — layout_partial_table_resolved runs 1605 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 1505 over it, 16.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TypesetEngine.scan_ordinary_row_step src/renderer/typeset/table/scan/runner/row_step.rs:15— MethodTooLong — scan_ordinary_row_step runs 1424 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 1324 over it, 14.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: TypesetEngine.prepare_table_fragment_budget src/renderer/typeset/table/continuation/fragment/budget.rs:16— MethodTooLong — prepare_table_fragment_budget runs 1414 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 1314 over it, 14.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LayoutEngine.emit_line_runs src/renderer/layout/paragraph_layout.rs:8880— MethodTooLong — emit_line_runs runs 1283 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 1183 over it, 12.83× 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: TypesetEngine.prepare_block_table_continuation src/renderer/typeset/table/block/prepare.rs:18— MethodTooLong — prepare_block_table_continuation runs 1214 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 1114 over it, 12.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LayoutEngine.layout_shape_object_with_group_origin src/renderer/layout/shape_layout.rs:1715— MethodTooLong — layout_shape_object_with_group_origin runs 1047 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 947 over it, 10.47× 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: SkiaLayerRenderer.render_node src/renderer/skia/renderer.rs:1171— MethodTooLong — render_node runs 1005 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 905 over it, 10.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LayoutEngine.layout_textbox_content src/renderer/layout/shape_layout.rs:3304— MethodTooLong — layout_textbox_content runs 991 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 891 over it, 9.91× 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: TypesetEngine.query_tail_fit src/renderer/typeset/notes/endnotes/paragraph/tail_fit.rs:110— MethodTooLong — query_tail_fit runs 917 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 817 over it, 9.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.
MethodTooLong: TypesetEngine.place_table_with_text src/renderer/typeset.rs:5062— MethodTooLong — place_table_with_text runs 884 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 784 over it, 8.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.
MethodTooLong: LayoutEngine.layout_table_with_wrapper_margin src/renderer/layout/table_layout.rs:3798— MethodTooLong — layout_table_with_wrapper_margin runs 873 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 773 over it, 8.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SkiaTextReplay.draw_text src/renderer/skia/text_replay.rs:42— MethodTooLong — draw_text runs 856 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 756 over it, 8.56× 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: TypesetEngine.scan_table_fragment src/renderer/typeset/table/continuation/fragment/scan.rs:26— MethodTooLong — scan_table_fragment runs 763 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 663 over it, 7.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LayoutEngine.layout_inline_table_paragraph src/renderer/layout/paragraph_layout.rs:3640— MethodTooLong — layout_inline_table_paragraph runs 725 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 625 over it, 7.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: Paginator.paginate_with_measured_context_with_storage src/renderer/pagination/engine.rs:375— MethodTooLong — paginate_with_measured_context_with_storage runs 684 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 584 over it, 6.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.
MethodTooLong: DocumentCore.get_selection_rects_for_target_native src/document_core/queries/cursor_nav.rs:1830— MethodTooLong — get_selection_rects_for_target_native runs 622 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 522 over it, 6.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.
MethodTooLong: PaintOp.write_json src/paint/json.rs:645— MethodTooLong — write_json runs 603 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 503 over it, 6.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
DocumentCore::grep_with_context (cognitive 316) src/document_core/queries/grep.rs:237— DocumentCore::grep_with_context has cognitive complexity 316 (threshold 15). Drivers by points: loops 21 (155 pts), if/else 16 (120 pts), match/switch 8 (40 pts), boolean chains 1 (nesting depth added 270). 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.
DocumentCore::reflow_zero_height_paragraphs (cognitive 289) src/document_core/commands/document.rs:741— DocumentCore::reflow_zero_height_paragraphs has cognitive complexity 289 (threshold 15). Drivers by points: if/else 55 (192 pts), boolean chains 55, loops 9 (31 pts), match/switch 2 (11 pts) (nesting depth added 168). 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.
DocumentCore::paginate_pass_with_storage (cognitive 267) src/document_core/queries/rendering.rs:5469— DocumentCore::paginate_pass_with_storage has cognitive complexity 267 (threshold 15). Drivers by points: if/else 74 (189 pts), loops 22 (60 pts), match/switch 5 (12 pts), boolean chains 6 (nesting depth added 160). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DocumentCore::writeback_reflowed_table_frames_with_storage (cognitive 239) src/document_core/commands/document.rs:2649— DocumentCore::writeback_reflowed_table_frames_with_storage has cognitive complexity 239 (threshold 15). Drivers by points: if/else 34 (157 pts), loops 13 (51 pts), match/switch 5 (25 pts), boolean chains 6 (nesting depth added 181). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocumentCore::navigate_next_editable (cognitive 219) src/document_core/queries/doc_tree_nav.rs:377— DocumentCore::navigate_next_editable has cognitive complexity 219 (threshold 15). Drivers by points: if/else 53 (196 pts), loops 4 (14 pts), boolean chains 5, match/switch 2 (4 pts) (nesting depth added 155). 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.
DocumentCore::hit_test_native (cognitive 206) src/document_core/queries/cursor_rect.rs:1605— DocumentCore::hit_test_native has cognitive complexity 206 (threshold 15). Drivers by points: if/else 114 (240 pts), boolean chains 38, match/switch 11 (33 pts), loops 11 (nesting depth added 148). 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. This shape REPEATS in the file: 2 other methods here (DocumentCore::hit_test_native::collect_runs, DocumentCore::hit_test_native::collect_body_inline_image_hits) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DocumentCore::parse_table_html (cognitive 175) src/document_core/html_table_import.rs:11— DocumentCore::parse_table_html has cognitive complexity 175 (threshold 15). Drivers by points: if/else 59 (125 pts), loops 17 (37 pts), match/switch 3 (9 pts), boolean chains 4 (nesting depth added 92). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocumentCore::insert_footnote_native (cognitive 137) src/document_core/commands/object_ops/note.rs:284— DocumentCore::insert_footnote_native has cognitive complexity 137 (threshold 15). Drivers by points: loops 18 (65 pts), if/else 15 (61 pts), match/switch 3 (7 pts), boolean chains 4 (nesting depth added 97). 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.
DocumentCore::compute_render_normalized_with_storage (cognitive 124) src/document_core/queries/rendering.rs:6363— DocumentCore::compute_render_normalized_with_storage has cognitive complexity 124 (threshold 15). Drivers by points: if/else 24 (62 pts), loops 13 (36 pts), boolean chains 19, match/switch 3 (7 pts) (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocumentCore::dump_page_items (cognitive 120) src/document_core/queries/rendering.rs:7542— DocumentCore::dump_page_items has cognitive complexity 120 (threshold 15). Drivers by points: if/else 26 (90 pts), match/switch 3 (15 pts), loops 5 (14 pts), boolean chains 1 (nesting depth added 85). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocumentCore::get_selection_rects_for_target_native (cognitive 109) src/document_core/queries/cursor_nav.rs:1830— DocumentCore::get_selection_rects_for_target_native has cognitive complexity 109 (threshold 15). Drivers by points: if/else 84 (174 pts), boolean chains 25, loops 9 (17 pts), match/switch 9 (13 pts) (nesting depth added 102). 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. This shape REPEATS in the file: 3 other methods here (DocumentCore::get_selection_rects_for_target_native::find_body_cursor::visit, DocumentCore::get_selection_rects_for_target_native::find_cell_cursor::visit, DocumentCore::get_selection_rects_for_target_native::collect_rendered_line_starts) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
DocumentCore::get_cursor_rect_native::find_cursor_in_node (cognitive 106) src/document_core/queries/cursor_rect.rs:898— DocumentCore::get_cursor_rect_native::find_cursor_in_node has cognitive complexity 106 (threshold 15). Drivers by points: if/else 30 (95 pts), boolean chains 10, loops 1 (nesting depth added 65). 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. This shape REPEATS in the file: 5 other methods here (DocumentCore::get_cursor_rect_native, DocumentCore::get_cursor_rect_native::collect_inline_control_bboxes, DocumentCore::get_cursor_rect_native::collect_text_caret_stops, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
DocumentCore::apply_picture_props_inner (cognitive 102) src/document_core/commands/object_ops/picture.rs:950— DocumentCore::apply_picture_props_inner has cognitive complexity 102 (threshold 15). Drivers by points: if/else 62 (81 pts), match/switch 8 (20 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
DocumentCore::set_table_properties_native (cognitive 99) src/document_core/commands/table_ops.rs:3067— DocumentCore::set_table_properties_native has cognitive complexity 99 (threshold 15). Drivers by points: if/else 49 (66 pts), match/switch 13 (24 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocumentCore::parse_html_to_paragraphs_at_depth (cognitive 88) src/document_core/commands/html_import.rs:743— DocumentCore::parse_html_to_paragraphs_at_depth has cognitive complexity 88 (threshold 15). Drivers by points: if/else 40 (77 pts), loops 2 (6 pts), boolean chains 5 (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.
DocumentCore::exit_control (cognitive 84) src/document_core/queries/doc_tree_nav.rs:1028— DocumentCore::exit_control has cognitive complexity 84 (threshold 15). Drivers by points: if/else 24 (72 pts), loops 3 (8 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 54). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DocumentCore::set_shape_properties_native (cognitive 83) src/document_core/commands/object_ops/shape.rs:375— DocumentCore::set_shape_properties_native has cognitive complexity 83 (threshold 15). Drivers by points: if/else 46 (76 pts), match/switch 2 (7 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocumentCore::apply_shape_props_inner (cognitive 81) src/document_core/commands/object_ops/shape.rs:770— DocumentCore::apply_shape_props_inner has cognitive complexity 81 (threshold 15). Drivers by points: if/else 44 (74 pts), match/switch 2 (7 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocumentCore::build_canvas_page_layer_tree_shared_with_profile (cognitive 77) src/document_core/queries/rendering.rs:1560— DocumentCore::build_canvas_page_layer_tree_shared_with_profile has cognitive complexity 77 (threshold 15). Drivers by points: if/else 32 (64 pts), boolean chains 8, loops 4 (5 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocumentCore::find_pages_for_paragraph (cognitive 76) src/document_core/commands/text_editing.rs:6013— DocumentCore::find_pages_for_paragraph has cognitive complexity 76 (threshold 15). Drivers by points: if/else 11 (47 pts), loops 6 (22 pts), match/switch 1 (6 pts), boolean chains 1 (nesting depth added 57). 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.
DocumentCore::reflow_linesegs_on_demand (cognitive 71) src/document_core/commands/document.rs:2352— DocumentCore::reflow_linesegs_on_demand has cognitive complexity 71 (threshold 15). Drivers by points: if/else 13 (44 pts), loops 6 (22 pts), match/switch 1 (5 pts) (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.
DocumentCore::get_page_control_layout_native::collect_controls (cognitive 70) src/document_core/queries/rendering.rs:4175— DocumentCore::get_page_control_layout_native::collect_controls has cognitive complexity 70 (threshold 15). Drivers by points: match/switch 16 (34 pts), if/else 18 (31 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 32). 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.
DocumentCore::get_cursor_rect_native (cognitive 68) src/document_core/queries/cursor_rect.rs:436— DocumentCore::get_cursor_rect_native has cognitive complexity 68 (threshold 15). Drivers by points: if/else 116 (282 pts), boolean chains 45, loops 13 (20 pts), match/switch 3 (5 pts) (nesting depth added 175). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 5 other methods here (DocumentCore::get_cursor_rect_native::collect_inline_control_bboxes, DocumentCore::get_cursor_rect_native::collect_text_caret_stops, DocumentCore::get_cursor_rect_native::find_inline_flow_cursor_hit, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
DocumentCore::set_cell_properties_native (cognitive 66) src/document_core/commands/table_ops.rs:1282— DocumentCore::set_cell_properties_native has cognitive complexity 66 (threshold 15). Drivers by points: if/else 39 (52 pts), boolean chains 8, loops 2 (4 pts), match/switch 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.
DocumentCore::delete_range_internal (cognitive 64) src/document_core/commands/text_editing.rs:3861— DocumentCore::delete_range_internal has cognitive complexity 64 (threshold 15). Drivers by points: if/else 30 (53 pts), boolean chains 8, loops 1 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutEngine::cell_units_uncached (cognitive 1398) src/renderer/layout/table_layout.rs:14973— LayoutEngine::cell_units_uncached has cognitive complexity 1398 (threshold 15). Drivers by points: if/else 318 (977 pts), boolean chains 232, loops 33 (118 pts), match/switch 20 (71 pts) (nesting depth added 795). 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.
LayoutEngine::layout_partial_table_cells (cognitive 1379) src/renderer/layout/table_partial.rs:1077— LayoutEngine::layout_partial_table_cells has cognitive complexity 1379 (threshold 15). Drivers by points: if/else 313 (995 pts), boolean chains 252, loops 19 (75 pts), match/switch 21 (57 pts) (nesting depth added 774). Of this number, 1365 points are the body's own statements and 14 belong 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.
LayoutEngine::build_single_column (cognitive 972) src/renderer/layout.rs:7866— LayoutEngine::build_single_column has cognitive complexity 972 (threshold 15). Drivers by points: if/else 258 (684 pts), boolean chains 153, match/switch 45 (111 pts), loops 10 (24 pts) (nesting depth added 506). 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.
LayoutEngine::layout_horizontal_cell_paragraphs (cognitive 895) src/renderer/layout/table_layout.rs:7341— LayoutEngine::layout_horizontal_cell_paragraphs has cognitive complexity 895 (threshold 15). Drivers by points: if/else 201 (667 pts), boolean chains 106, loops 12 (61 pts), match/switch 16 (61 pts) (nesting depth added 560). 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.
LayoutEngine::layout_composed_paragraph_in_frame (cognitive 621) src/renderer/layout/paragraph_layout.rs:5656— LayoutEngine::layout_composed_paragraph_in_frame has cognitive complexity 621 (threshold 15). Drivers by points: if/else 235 (436 pts), boolean chains 146, loops 12 (30 pts), match/switch 5 (9 pts) (nesting depth added 223). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutEngine::layout_table_control_block (cognitive 598) src/renderer/layout.rs:12856— LayoutEngine::layout_table_control_block has cognitive complexity 598 (threshold 15). Drivers by points: if/else 186 (464 pts), boolean chains 87, loops 6 (28 pts), match/switch 6 (19 pts) (nesting depth added 313). 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.
LayoutEngine::emit_line_runs (cognitive 555) src/renderer/layout/paragraph_layout.rs:8880— LayoutEngine::emit_line_runs has cognitive complexity 555 (threshold 15). Drivers by points: if/else 151 (462 pts), boolean chains 50, loops 10 (38 pts), match/switch 2 (5 pts) (nesting depth added 342). 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.
LayoutEngine::layout_partial_table_resolved (cognitive 552) src/renderer/layout/table_partial.rs:6003— LayoutEngine::layout_partial_table_resolved has cognitive complexity 552 (threshold 15). Drivers by points: if/else 183 (359 pts), boolean chains 135, loops 21 (51 pts), match/switch 3 (7 pts) (nesting depth added 210). Of this number, 532 points are the body's own statements and 20 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.
LayoutEngine::layout_shape_object_with_group_origin (cognitive 453) src/renderer/layout/shape_layout.rs:1715— LayoutEngine::layout_shape_object_with_group_origin has cognitive complexity 453 (threshold 15). Drivers by points: if/else 113 (376 pts), match/switch 8 (42 pts), loops 5 (19 pts), boolean chains 16 (nesting depth added 311). 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.
LayoutEngine::layout_table_item (cognitive 402) src/renderer/layout.rs:14945— LayoutEngine::layout_table_item has cognitive complexity 402 (threshold 15). Drivers by points: if/else 113 (303 pts), boolean chains 60, match/switch 13 (36 pts), loops 1 (3 pts) (nesting depth added 215). 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.
LayoutEngine::layout_column_item (cognitive 310) src/renderer/layout.rs:11586— LayoutEngine::layout_column_item has cognitive complexity 310 (threshold 15). Drivers by points: if/else 78 (256 pts), boolean chains 35, match/switch 6 (19 pts) (nesting depth added 191). 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.
LayoutEngine::layout_textbox_content (cognitive 281) src/renderer/layout/shape_layout.rs:3304— LayoutEngine::layout_textbox_content has cognitive complexity 281 (threshold 15). Drivers by points: if/else 85 (198 pts), loops 19 (44 pts), match/switch 11 (26 pts), boolean chains 13 (nesting depth added 153). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutEngine::layout_table_cells (cognitive 268) src/renderer/layout/table_layout.rs:10492— LayoutEngine::layout_table_cells has cognitive complexity 268 (threshold 15). Drivers by points: if/else 75 (185 pts), boolean chains 51, loops 9 (22 pts), match/switch 3 (10 pts) (nesting depth added 130). 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.
LayoutEngine::layout_table_with_wrapper_margin (cognitive 265) src/renderer/layout/table_layout.rs:3798— LayoutEngine::layout_table_with_wrapper_margin has cognitive complexity 265 (threshold 15). Drivers by points: if/else 95 (196 pts), boolean chains 40, loops 10 (21 pts), match/switch 3 (8 pts) (nesting depth added 117). 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.
LayoutEngine::layout_shape_item (cognitive 251) src/renderer/layout/shape_item.inc.rs:5— LayoutEngine::layout_shape_item has cognitive complexity 251 (threshold 15). Drivers by points: if/else 50 (195 pts), match/switch 7 (30 pts), boolean chains 26 (nesting depth added 168). 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.
LayoutEngine::layout_inline_table_paragraph (cognitive 197) src/renderer/layout/paragraph_layout.rs:3640— LayoutEngine::layout_inline_table_paragraph has cognitive complexity 197 (threshold 15). Drivers by points: if/else 82 (167 pts), boolean chains 18, loops 6 (9 pts), match/switch 3 (nesting depth added 88). 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.
LayoutEngine::nested_table_mixed_fragment_heights (cognitive 192) src/renderer/layout/table_layout.rs:12693— LayoutEngine::nested_table_mixed_fragment_heights has cognitive complexity 192 (threshold 15). Drivers by points: if/else 58 (136 pts), boolean chains 33, loops 6 (16 pts), match/switch 2 (7 pts) (nesting depth added 93). 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.
LayoutEngine::layout_partial_table_item (cognitive 188) src/renderer/layout.rs:16344— LayoutEngine::layout_partial_table_item has cognitive complexity 188 (threshold 15). Drivers by points: if/else 58 (143 pts), boolean chains 33, match/switch 4 (12 pts) (nesting depth added 93). 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.
LayoutEngine::advance_row_cut_inner (cognitive 170) src/renderer/layout/table_layout.rs:23154— LayoutEngine::advance_row_cut_inner has cognitive complexity 170 (threshold 15). Drivers by points: if/else 35 (110 pts), boolean chains 53, match/switch 3 (4 pts), loops 2 (3 pts) (nesting depth added 77). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutEngine::render_para_border_groups (cognitive 142) src/renderer/layout.rs:7461— LayoutEngine::render_para_border_groups has cognitive complexity 142 (threshold 15). Drivers by points: if/else 36 (106 pts), loops 9 (22 pts), boolean chains 14 (nesting depth added 83). 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.
LayoutEngine::resolve_row_heights_with_common_fit (cognitive 132) src/renderer/layout/table_layout.rs:5565— LayoutEngine::resolve_row_heights_with_common_fit has cognitive complexity 132 (threshold 15). Drivers by points: if/else 49 (98 pts), boolean chains 27, loops 7 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutEngine::layout_embedded_table (cognitive 130) src/renderer/layout/table_cell_content.rs:811— LayoutEngine::layout_embedded_table has cognitive complexity 130 (threshold 15). Drivers by points: if/else 34 (85 pts), match/switch 8 (23 pts), loops 7 (16 pts), boolean chains 6 (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutEngine::native_saved_reset_cut_trailing_trim (cognitive 126) src/renderer/layout/table_layout.rs:19783— LayoutEngine::native_saved_reset_cut_trailing_trim has cognitive complexity 126 (threshold 15). Drivers by points: if/else 41 (106 pts), boolean chains 20 (nesting depth added 65). 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.
LayoutEngine::mixed_nested_split_from_cut (cognitive 126) src/renderer/layout/table_layout.rs:25962— LayoutEngine::mixed_nested_split_from_cut has cognitive complexity 126 (threshold 15). Drivers by points: if/else 58 (83 pts), boolean chains 30, loops 4 (9 pts), match/switch 3 (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.
LayoutEngine::layout_click_here_and_bookmark_markers (cognitive 118) src/renderer/layout/paragraph_layout.rs:10668— LayoutEngine::layout_click_here_and_bookmark_markers has cognitive complexity 118 (threshold 15). Drivers by points: if/else 29 (75 pts), boolean chains 18, loops 8 (14 pts), match/switch 2 (11 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.
Duplicated block (6 lines × 2) bindings/Native/src/gpu_d3d.rs:205— bindings/Native/src/gpu_d3d.rs:205-210 | bindings/Native/src/gpu_metal.rs:214-219 — before extracting anything, compare `bindings/Native/src/gpu_d3d.rs` and `bindings/Native/src/gpu_metal.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 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 `bindings/Native/src/gpu_d3d.rs:205` 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) mydocs/tech/investigations/issue-595/probes/inspect_595.rs:45— mydocs/tech/investigations/issue-595/probes/inspect_595.rs:45-50 | mydocs/tech/investigations/issue-595/probes/inspect_595.rs:56-61 — both copies are in the same file, so extract the 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 `mydocs/tech/investigations/issue-595/probes/inspect_595.rs:45` 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) src/bin/rhwp-q/more/inventory.rs:652— src/bin/rhwp-q/more/inventory.rs:652-657 | src/bin/rhwp-q/pack/inventory.rs:655-660 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:652` 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) src/bin/rhwp-q/more/inventory.rs:731— src/bin/rhwp-q/more/inventory.rs:731-736 | src/bin/rhwp-q/pack/inventory.rs:442-447 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:731` 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) src/bin/rhwp-q/pack/inventory.rs:286— src/bin/rhwp-q/pack/inventory.rs:286-291 | src/bin/rhwp-q/pack/inventory.rs:1168-1173 — both copies are in the same file, so extract the 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 `src/bin/rhwp-q/pack/inventory.rs:286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src/cli/commands/edit/cells.rs:163— src/cli/commands/edit/cells.rs:163-168 | src/document_core/commands/text_editing.rs:463-468 — 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 `src/cli/commands/edit/cells.rs:163` 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) src/cli/commands/edit/tables/grid.rs:332— src/cli/commands/edit/tables/grid.rs:332-337 | src/cli/commands/edit/tables/grid.rs:697-702 — both copies are in the same file, so extract the 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) src/cli/commands/edit/tables/layout.rs:105— src/cli/commands/edit/tables/layout.rs:105-110 | src/cli/commands/edit/tables/layout.rs:351-356 — both copies are in the same file, so extract the 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) src/cli/outputs/tabular.rs:267— src/cli/outputs/tabular.rs:267-272 | src/cli/outputs/tabular.rs:507-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/outputs/tabular.rs:267` 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) src/cli/queries/ir_comparison.rs:212— src/cli/queries/ir_comparison.rs:212-217 | src/cli/queries/ir_comparison.rs:457-463 — both copies are in the same file, so extract the 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 `src/cli/queries/ir_comparison.rs:212` 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 (6 lines × 2) src/diagnostics/render_geom_diff.rs:1016— src/diagnostics/render_geom_diff.rs:1016-1021 | src/diagnostics/render_geom_diff.rs:1029-1034 — both copies are in the same file, so extract the 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 `src/diagnostics/render_geom_diff.rs:1016` 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) src/document_core/commands/clipboard.rs:1442— src/document_core/commands/clipboard.rs:1442-1447 | src/document_core/commands/object_ops/table.rs:1345-1350 — 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 `src/document_core/commands/clipboard.rs:1442` 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) src/document_core/commands/object_ops/common.rs:437— src/document_core/commands/object_ops/common.rs:437-442 | src/document_core/commands/object_ops/picture.rs:1018-1023 — before extracting anything, compare `src/document_core/commands/object_ops/common.rs` and `src/document_core/commands/object_ops/picture.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) src/document_core/commands/object_ops/table.rs:616— src/document_core/commands/object_ops/table.rs:616-622 | src/scaffold/builder.rs:406-411 — before extracting anything, compare `src/document_core/commands/object_ops/table.rs` and `src/scaffold/builder.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/object_ops/table.rs:616` 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) src/document_core/commands/object_ops/table.rs:680— src/document_core/commands/object_ops/table.rs:680-685 | src/scaffold/builder.rs:453-458 — before extracting anything, compare `src/document_core/commands/object_ops/table.rs` and `src/scaffold/builder.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) src/document_core/commands/table_ops.rs:3960— src/document_core/commands/table_ops.rs:3960-3965 | src/document_core/commands/table_ops.rs:4037-4042 — both copies are in the same file, so extract the 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 `src/document_core/commands/table_ops.rs:3960` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) src/document_core/hwpjson/body.rs:164— src/document_core/hwpjson/body.rs:164-169 | src/document_core/hwpjson/body.rs:190-195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/hwpjson/body.rs:164` 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) src/document_core/queries/cursor_rect.rs:108— src/document_core/queries/cursor_rect.rs:108-113 | src/document_core/queries/cursor_rect.rs:3200-3205 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:108` 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) src/document_core/queries/cursor_rect.rs:5464— src/document_core/queries/cursor_rect.rs:5464-5469 | src/document_core/queries/cursor_rect.rs:5988-5993 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:5464` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `run` to `&HfRunInfo` in one and `&FnRunInfo` 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 (6 lines × 2) src/document_core/queries/hwpctrl_sets.rs:459— src/document_core/queries/hwpctrl_sets.rs:459-464 | src/document_core/queries/hwpctrl_sets.rs:1601-1606 — both copies are in the same file, so extract the 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) src/document_core/queries/memo_query.rs:488— src/document_core/queries/memo_query.rs:488-493 | src/document_core/queries/memo_query.rs:546-551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/queries/memo_query.rs:488` 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 (6 lines × 2) src/document_core/queries/rendering.rs:5483— src/document_core/queries/rendering.rs:5483-5488 | src/renderer/typeset/table/block.rs:83-88 — 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) src/document_core/queries/rendering.rs:7291— src/document_core/queries/rendering.rs:7291-7296 | src/document_core/queries/rendering.rs:7549-7556 — both copies are in the same file, so extract the 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 `src/document_core/queries/rendering.rs:7291` 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) src/document_core/queries/search_query.rs:95— src/document_core/queries/search_query.rs:95-100 | src/document_core/queries/search_query.rs:119-124 — both copies are in the same file, so extract the 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 `src/document_core/queries/search_query.rs:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src/model/table.rs:371— src/model/table.rs:371-376 | src/renderer/layout/table_layout.rs:12540-12545 — 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 `src/model/table.rs:371` 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.
LayoutEngine::layout_partial_table_cells (cyclomatic 555) src/renderer/layout/table_partial.rs:1077— LayoutEngine::layout_partial_table_cells has cyclomatic complexity 555 (threshold 15). Of this number, 551 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.
LayoutEngine::cell_units_uncached (cyclomatic 542) src/renderer/layout/table_layout.rs:14973— LayoutEngine::cell_units_uncached has cyclomatic complexity 542 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::build_single_column (cyclomatic 468) src/renderer/layout.rs:7866— LayoutEngine::build_single_column has cyclomatic complexity 468 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::layout_composed_paragraph_in_frame (cyclomatic 335) src/renderer/layout/paragraph_layout.rs:5656— LayoutEngine::layout_composed_paragraph_in_frame has cyclomatic complexity 335 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::layout_partial_table_resolved (cyclomatic 302) src/renderer/layout/table_partial.rs:6003— LayoutEngine::layout_partial_table_resolved has cyclomatic complexity 302 (threshold 15). Of this number, 295 points are the body's own statements and 7 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.
LayoutEngine::layout_horizontal_cell_paragraphs (cyclomatic 297) src/renderer/layout/table_layout.rs:7341— LayoutEngine::layout_horizontal_cell_paragraphs has cyclomatic complexity 297 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::layout_table_control_block (cyclomatic 237) src/renderer/layout.rs:12856— LayoutEngine::layout_table_control_block has cyclomatic complexity 237 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::layout_table_item (cyclomatic 183) src/renderer/layout.rs:14945— LayoutEngine::layout_table_item has cyclomatic complexity 183 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::emit_line_runs (cyclomatic 171) src/renderer/layout/paragraph_layout.rs:8880— LayoutEngine::emit_line_runs has cyclomatic complexity 171 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::layout_shape_object_with_group_origin (cyclomatic 123) src/renderer/layout/shape_layout.rs:1715— LayoutEngine::layout_shape_object_with_group_origin has cyclomatic complexity 123 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::layout_table_cells (cyclomatic 122) src/renderer/layout/table_layout.rs:10492— LayoutEngine::layout_table_cells has cyclomatic complexity 122 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::layout_textbox_content (cyclomatic 121) src/renderer/layout/shape_layout.rs:3304— LayoutEngine::layout_textbox_content has cyclomatic complexity 121 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::layout_table_with_wrapper_margin (cyclomatic 121) src/renderer/layout/table_layout.rs:3798— LayoutEngine::layout_table_with_wrapper_margin has cyclomatic complexity 121 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::layout_column_item (cyclomatic 114) src/renderer/layout.rs:11586— LayoutEngine::layout_column_item has cyclomatic complexity 114 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::advance_row_cut_inner (cyclomatic 93) src/renderer/layout/table_layout.rs:23154— LayoutEngine::advance_row_cut_inner has cyclomatic complexity 93 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::nested_table_mixed_fragment_heights (cyclomatic 88) src/renderer/layout/table_layout.rs:12693— LayoutEngine::nested_table_mixed_fragment_heights has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::layout_inline_table_paragraph (cyclomatic 86) src/renderer/layout/paragraph_layout.rs:3640— LayoutEngine::layout_inline_table_paragraph 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.
LayoutEngine::layout_partial_table_item (cyclomatic 85) src/renderer/layout.rs:16344— LayoutEngine::layout_partial_table_item has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::mixed_nested_split_from_cut (cyclomatic 83) src/renderer/layout/table_layout.rs:25962— LayoutEngine::mixed_nested_split_from_cut has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::layout_shape_item (cyclomatic 81) src/renderer/layout/shape_item.inc.rs:5— LayoutEngine::layout_shape_item has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::resolve_row_heights_with_common_fit (cyclomatic 76) src/renderer/layout/table_layout.rs:5565— LayoutEngine::resolve_row_heights_with_common_fit 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.
LayoutEngine::layout_vertical_cell_text (cyclomatic 63) src/renderer/layout/table_cell_content.rs:62— LayoutEngine::layout_vertical_cell_text has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::native_saved_reset_cut_trailing_trim (cyclomatic 60) src/renderer/layout/table_layout.rs:19783— LayoutEngine::native_saved_reset_cut_trailing_trim has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::layout_click_here_and_bookmark_markers (cyclomatic 53) src/renderer/layout/paragraph_layout.rs:10668— LayoutEngine::layout_click_here_and_bookmark_markers has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutEngine::render_para_border_groups (cyclomatic 52) src/renderer/layout.rs:7461— LayoutEngine::render_para_border_groups has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Duplicated block (8 lines × 2) crates/rhwp-password-crypto/src/lib.rs:776— crates/rhwp-password-crypto/src/lib.rs:776-783 | crates/rhwp-password-crypto/src/lib.rs:971-978 — both copies are in the same file, so extract the 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 `crates/rhwp-password-crypto/src/lib.rs:776` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) src/bin/rhwp-agent/envelope.rs:228— src/bin/rhwp-agent/envelope.rs:228-235 | src/bin/rhwp-agent/inspect.rs:411-418 — 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 `src/bin/rhwp-agent/envelope.rs:228` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) src/bin/rhwp-agent/fingerprint.rs:65— src/bin/rhwp-agent/fingerprint.rs:65-72 | src/bin/rhwp-agent/inspect.rs:45-52 — 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) src/bin/rhwp-agent/stats.rs:112— src/bin/rhwp-agent/stats.rs:112-119 | src/bin/rhwp-agent/stats.rs:242-249 — both copies are in the same file, so extract the 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) src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:73— src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:73-80 | src/bin/rhwp-q/commands/rhwp-q-objects.rs:73-80 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs` and `src/bin/rhwp-q/commands/rhwp-q-objects.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) src/bin/rhwp-q/kit/cell_shape.rs:13— src/bin/rhwp-q/kit/cell_shape.rs:13-20 | src/bin/rhwp-q/kit/footnote_footholds.rs:9-16 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) src/bin/rhwp-q/pack/inventory.rs:113— src/bin/rhwp-q/pack/inventory.rs:113-120 | src/bin/rhwp-q/pack/inventory.rs:786-793 — both copies are in the same file, so extract the 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 `src/bin/rhwp-q/pack/inventory.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.
Duplicated block (8 lines × 2) src/bin/rhwp-q/pack/inventory.rs:682— src/bin/rhwp-q/pack/inventory.rs:682-689 | src/bin/rhwp-q/pack/inventory.rs:1326-1333 — both copies are in the same file, so extract the 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 `src/bin/rhwp-q/pack/inventory.rs:682` 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 (8 lines × 2) src/cli/commands/edit/bookmarks.rs:34— src/cli/commands/edit/bookmarks.rs:34-41 | src/cli/commands/edit/bookmarks.rs:269-276 — both copies are in the same file, so extract the 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 `src/cli/commands/edit/bookmarks.rs: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 (8 lines × 2) src/cli/commands/edit/formatting.rs:81— src/cli/commands/edit/formatting.rs:81-88 | src/cli/commands/edit/formatting.rs:219-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) src/diagnostics/hwp5_roundtrip_batch.rs:640— src/diagnostics/hwp5_roundtrip_batch.rs:640-647 | src/diagnostics/hwpx_roundtrip_batch.rs:476-483 — before extracting anything, compare `src/diagnostics/hwp5_roundtrip_batch.rs` and `src/diagnostics/hwpx_roundtrip_batch.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 152 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 `src/diagnostics/hwp5_roundtrip_batch.rs:640` 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 (8 lines × 2) src/document_core/commands/clipboard.rs:627— src/document_core/commands/clipboard.rs:627-634 | src/document_core/commands/clipboard.rs:1573-1580 — both copies are in the same file, so extract the 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) src/document_core/commands/document.rs:772— src/document_core/commands/document.rs:772-779 | src/document_core/commands/document.rs:2364-2371 — both copies are in the same file, so extract the 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) src/document_core/commands/object_ops/table.rs:482— src/document_core/commands/object_ops/table.rs:482-489 | src/document_core/commands/object_ops/table.rs:1121-1128 — both copies are in the same file, so extract the 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 `src/document_core/commands/object_ops/table.rs:482` 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) src/document_core/commands/text_editing.rs:4550— src/document_core/commands/text_editing.rs:4550-4557 | src/document_core/commands/text_editing.rs:4606-4613 — both copies are in the same file, so extract the 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) src/document_core/html_table_import.rs:689— src/document_core/html_table_import.rs:689-696 | src/document_core/html_table_import.rs:1001-1008 — both copies are in the same file, so extract the 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) src/document_core/native_pua_fonts.rs:297— src/document_core/native_pua_fonts.rs:297-304 | src/document_core/queries/rendering.rs:5044-5051 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `&mut` in one and `crate) fn rebuild_derived_state(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) src/document_core/queries/injection_scan.rs:168— src/document_core/queries/injection_scan.rs:168-175 | src/document_core/queries/injection_scan.rs:195-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/queries/injection_scan.rs:168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) src/document_core/queries/injection_scan.rs:566— src/document_core/queries/injection_scan.rs:566-575 | src/document_core/queries/injection_scan.rs:613-620 — both copies are in the same file, so extract the 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) src/document_core/queries/rendering.rs:1803— src/document_core/queries/rendering.rs:1803-1810 | src/document_core/queries/rendering.rs:2581-2588 — both copies are in the same file, so extract the 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) src/model/hyperlink.rs:40— src/model/hyperlink.rs:40-47 | src/model/hyperlink.rs:148-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.
Duplicated block (8 lines × 2) src/model/table.rs:2268— src/model/table.rs:2268-2275 | src/model/table.rs:2400-2407 — both copies are in the same file, so extract the 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) src/native_host/gpu_d3d.rs:645— src/native_host/gpu_d3d.rs:645-652 | src/native_host/gpu_metal.rs:427-434 — before extracting anything, compare `src/native_host/gpu_d3d.rs` and `src/native_host/gpu_metal.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) src/paint/metafile_print/replay.rs:169— src/paint/metafile_print/replay.rs:169-176 | src/paint/metafile_print/text.rs:195-202 — 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 `src/paint/metafile_print/replay.rs:169` 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 (8 lines × 2) src/parser/control/shape.rs:172— src/parser/control/shape.rs:172-180 | src/parser/control/shape.rs:784-791 — both copies are in the same file, so extract the 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 `src/parser/control/shape.rs:172` 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.
DocumentCore::reflow_zero_height_paragraphs (cyclomatic 118) src/document_core/commands/document.rs:741— DocumentCore::reflow_zero_height_paragraphs has cyclomatic complexity 118 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DocumentCore::paginate_pass_with_storage (cyclomatic 103) src/document_core/queries/rendering.rs:5469— DocumentCore::paginate_pass_with_storage has cyclomatic complexity 103 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DocumentCore::set_table_properties_native (cyclomatic 96) src/document_core/commands/table_ops.rs:3067— DocumentCore::set_table_properties_native has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DocumentCore::hit_test_native (cyclomatic 94) src/document_core/queries/cursor_rect.rs:1605— DocumentCore::hit_test_native has cyclomatic complexity 94 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (DocumentCore::hit_test_native::collect_runs) 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.
DocumentCore::apply_picture_props_inner (cyclomatic 84) src/document_core/commands/object_ops/picture.rs:950— DocumentCore::apply_picture_props_inner has cyclomatic complexity 84 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DocumentCore::parse_table_html (cyclomatic 72) src/document_core/html_table_import.rs:11— DocumentCore::parse_table_html has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DocumentCore::navigate_next_editable (cyclomatic 59) src/document_core/queries/doc_tree_nav.rs:377— DocumentCore::navigate_next_editable 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.
DocumentCore::create_shape_control_native (cyclomatic 57) src/document_core/commands/object_ops/shape.rs:1039— DocumentCore::create_shape_control_native has cyclomatic complexity 57 (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.
DocumentCore::writeback_reflowed_table_frames_with_storage (cyclomatic 56) src/document_core/commands/document.rs:2649— DocumentCore::writeback_reflowed_table_frames_with_storage has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DocumentCore::compute_render_normalized_with_storage (cyclomatic 56) src/document_core/queries/rendering.rs:6363— DocumentCore::compute_render_normalized_with_storage has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DocumentCore::get_cursor_rect_by_path_with_hint (cyclomatic 54) src/document_core/queries/cursor_rect.rs:3838— DocumentCore::get_cursor_rect_by_path_with_hint has cyclomatic complexity 54 (threshold 15). Of this number, 16 points are the body's own statements and 38 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DocumentCore::get_page_control_layout_native::collect_controls (cyclomatic 54) src/document_core/queries/rendering.rs:4175— DocumentCore::get_page_control_layout_native::collect_controls has cyclomatic complexity 54 (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.
DocumentCore::set_shape_properties_native (cyclomatic 51) src/document_core/commands/object_ops/shape.rs:375— DocumentCore::set_shape_properties_native 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.
DocumentCore::grep_with_context (cyclomatic 50) src/document_core/queries/grep.rs:237— DocumentCore::grep_with_context has cyclomatic complexity 50 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
DocumentCore::apply_shape_props_inner (cyclomatic 49) src/document_core/commands/object_ops/shape.rs:770— DocumentCore::apply_shape_props_inner has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DocumentCore::get_selection_rects_for_target_native (cyclomatic 48) src/document_core/queries/cursor_nav.rs:1830— DocumentCore::get_selection_rects_for_target_native has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 3 other methods here (DocumentCore::get_selection_rects_for_target_native::find_body_cursor::visit, DocumentCore::get_selection_rects_for_target_native::find_cell_cursor::visit, DocumentCore::get_selection_rects_for_target_native::collect_rendered_line_starts) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
DocumentCore::apply_common_obj_attr_from_json (cyclomatic 47) src/document_core/commands/object_ops/common.rs:370— DocumentCore::apply_common_obj_attr_from_json has cyclomatic complexity 47 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DocumentCore::set_cell_properties_native (cyclomatic 47) src/document_core/commands/table_ops.rs:1282— DocumentCore::set_cell_properties_native has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DocumentCore::extract_page_markdown_with_images_native (cyclomatic 46) src/document_core/queries/rendering.rs:8816— DocumentCore::extract_page_markdown_with_images_native has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 8 of the 46 points are its own statements and the rest belongs to 6 function items inside it that branch (collect_line_text, collect_markdown_items, table_cell_text, …). 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.
DocumentCore::insert_footnote_native (cyclomatic 45) src/document_core/commands/object_ops/note.rs:284— DocumentCore::insert_footnote_native has cyclomatic complexity 45 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
DocumentCore::cursor_rect_in_cell_fast_on_page (cyclomatic 45) src/document_core/queries/cursor_rect.rs:3341— DocumentCore::cursor_rect_in_cell_fast_on_page has cyclomatic complexity 45 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DocumentCore::build_canvas_page_layer_tree_shared_with_profile (cyclomatic 42) src/document_core/queries/rendering.rs:1560— DocumentCore::build_canvas_page_layer_tree_shared_with_profile 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.
DocumentCore::parse_html_to_paragraphs_at_depth (cyclomatic 36) src/document_core/commands/html_import.rs:743— DocumentCore::parse_html_to_paragraphs_at_depth 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.
DocumentCore::get_cursor_rect_native::collect_inline_control_bboxes (cyclomatic 36) src/document_core/queries/cursor_rect.rs:494— DocumentCore::get_cursor_rect_native::collect_inline_control_bboxes 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. This shape REPEATS in the file: 4 other methods here (DocumentCore::get_cursor_rect_native, DocumentCore::get_cursor_rect_native::find_inline_flow_cursor_hit, DocumentCore::get_cursor_rect_native::find_cursor_in_node, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
DocumentCore::get_cursor_rect_native::find_cursor_in_node (cyclomatic 36) src/document_core/queries/cursor_rect.rs:898— DocumentCore::get_cursor_rect_native::find_cursor_in_node 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. This shape REPEATS in the file: 4 other methods here (DocumentCore::get_cursor_rect_native, DocumentCore::get_cursor_rect_native::collect_inline_control_bboxes, DocumentCore::get_cursor_rect_native::find_inline_flow_cursor_hit, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
Duplicated block (7 lines × 2) bindings/Native/src/gpu_gl.rs:262— bindings/Native/src/gpu_gl.rs:262-268 | bindings/Native/src/gpu_gl.rs:445-451 — both copies are in the same file, so extract the 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) src/cli/commands/edit/document_text.rs:194— src/cli/commands/edit/document_text.rs:194-200 | src/cli/commands/tabular_import.rs:426-432 — before extracting anything, compare `src/cli/commands/edit/document_text.rs` and `src/cli/commands/tabular_import.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 125 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/document_text.rs:194` 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) src/cli/commands/edit/equations.rs:121— src/cli/commands/edit/equations.rs:121-127 | src/cli/commands/edit/media.rs:521-527 — before extracting anything, compare `src/cli/commands/edit/equations.rs` and `src/cli/commands/edit/media.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 260 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) src/cli/outputs/tabular.rs:14— src/cli/outputs/tabular.rs:14-20 | src/cli/protocol/exchange/settlement.rs:144-150 — 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 `src/cli/outputs/tabular.rs:14` 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) src/cli/outputs/vector.rs:50— src/cli/outputs/vector.rs:50-56 | src/cli/outputs/vector.rs:556-562 — both copies are in the same file, so extract the 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) src/diagnostics/hwp5_cell_header_probe.rs:433— src/diagnostics/hwp5_cell_header_probe.rs:433-439 | src/diagnostics/hwp5_table_probe.rs:423-429 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_table_probe.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 462 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 `src/diagnostics/hwp5_cell_header_probe.rs:433` 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) src/document_core/commands/document.rs:2671— src/document_core/commands/document.rs:2671-2677 | src/renderer/layout/table_layout.rs:452-458 — 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 `src/document_core/commands/document.rs:2671` 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 × 2) src/document_core/commands/document/grown_table_heights.rs:60— src/document_core/commands/document/grown_table_heights.rs:60-66 | src/document_core/queries/rendering.rs:5519-5525 — 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 (7 lines × 2) src/document_core/queries/cursor_rect.rs:5265— src/document_core/queries/cursor_rect.rs:5265-5271 | src/document_core/queries/cursor_rect.rs:5558-5564 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:5265` 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) src/document_core/queries/cursor_rect.rs:5709— src/document_core/queries/cursor_rect.rs:5709-5715 | src/document_core/queries/cursor_rect.rs:6132-6138 — both copies are in the same file, so extract the 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) src/document_core/queries/grep.rs:280— src/document_core/queries/grep.rs:280-286 | src/document_core/queries/grep.rs:341-348 — both copies are in the same file, so extract the 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) src/emf/converter/player.rs:573— src/emf/converter/player.rs:573-579 | src/emf/converter/player.rs:627-633 — both copies are in the same file, so extract the 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 `src/emf/converter/player.rs:573` 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) src/paint/resources.rs:179— src/paint/resources.rs:179-185 | src/paint/resources.rs:216-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/paint/resources.rs:179` 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) src/parser/hwp3/mod.rs:1905— src/parser/hwp3/mod.rs:1905-1911 | src/parser/hwp3/mod.rs:2170-2176 — both copies are in the same file, so extract the 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) src/parser/hwpx/header.rs:225— src/parser/hwpx/header.rs:225-231 | src/parser/hwpx/header.rs:2006-2012 — both copies are in the same file, so extract the 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) src/parser/hwpx/header.rs:2150— src/parser/hwpx/header.rs:2150-2156 | src/parser/hwpx/header.rs:2285-2295 — both copies are in the same file, so extract the 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 `src/parser/hwpx/header.rs:2150` 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) src/parser/hwpx/section.rs:1299— src/parser/hwpx/section.rs:1299-1305 | src/parser/hwpx/section.rs:1331-1337 — both copies are in the same file, so extract the 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 `src/parser/hwpx/section.rs:1299` 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) src/parser/pdf/recognition.rs:651— src/parser/pdf/recognition.rs:651-657 | tools/pdf-ir-poc/src/recognition.rs:402-408 — before extracting anything, compare `src/parser/pdf/recognition.rs` and `tools/pdf-ir-poc/src/recognition.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) src/parser/pdf/recognition.rs:857— src/parser/pdf/recognition.rs:857-863 | tools/pdf-ir-poc/src/recognition.rs:579-587 — before extracting anything, compare `src/parser/pdf/recognition.rs` and `tools/pdf-ir-poc/src/recognition.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `tools/pdf-ir-poc/src/recognition.rs:579` 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) src/parser/pdf/recognition.rs:1005— src/parser/pdf/recognition.rs:1005-1011 | tools/pdf-ir-poc/src/recognition.rs:706-712 — before extracting anything, compare `src/parser/pdf/recognition.rs` and `tools/pdf-ir-poc/src/recognition.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/recognition.rs:1005` 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) src/parser/pdf/table_detection.rs:1054— src/parser/pdf/table_detection.rs:1054-1060 | tools/pdf-ir-poc/src/table_detection.rs:574-580 — before extracting anything, compare `src/parser/pdf/table_detection.rs` and `tools/pdf-ir-poc/src/table_detection.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/table_detection.rs:1054` 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) src/parser/pdf/table_detection.rs:1098— src/parser/pdf/table_detection.rs:1098-1104 | src/parser/pdf/table_detection/cell_regions.rs:82-88 — 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 (7 lines × 2) src/parser/pdf/table_detection/cell_regions.rs:349— src/parser/pdf/table_detection/cell_regions.rs:349-355 | src/parser/pdf/table_detection/cell_regions.rs:357-363 — both copies are in the same file, so extract the 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) src/parser/pdf/table_topology.rs:88— src/parser/pdf/table_topology.rs:88-94 | tools/pdf-ir-poc/src/table_topology.rs:59-65 — before extracting anything, compare `src/parser/pdf/table_topology.rs` and `tools/pdf-ir-poc/src/table_topology.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/table_topology.rs:88` 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 (7 lines × 2) src/renderer/composer/stored_cell_reflow.inc.rs:547— src/renderer/composer/stored_cell_reflow.inc.rs:547-554 | src/renderer/composer/supplemental_clusters.rs:197-203 — 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 `src/renderer/composer/stored_cell_reflow.inc.rs:547` 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) src/bin/rhwp-agent/safety.rs:219— src/bin/rhwp-agent/safety.rs:219-228 | src/bin/rhwp-agent/safety.rs:524-533 — both copies are in the same file, so extract the 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 `src/bin/rhwp-agent/safety.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 (10 lines × 2) src/bin/rhwp-agent/safety.rs:371— src/bin/rhwp-agent/safety.rs:371-380 | src/bin/rhwp-agent/tables.rs:70-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-agent/safety.rs:371` 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) src/bin/rhwp-q/kit/cursor_in_footnote.rs:69— src/bin/rhwp-q/kit/cursor_in_footnote.rs:69-78 | src/bin/rhwp-q/kit/footnote_info.rs:57-66 — before extracting anything, compare `src/bin/rhwp-q/kit/cursor_in_footnote.rs` and `src/bin/rhwp-q/kit/footnote_info.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 84 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 `src/bin/rhwp-q/kit/cursor_in_footnote.rs:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/bin/rhwp-q/kit/cursor_in_footnote.rs:79` calls `Some`, `take_usize` and `src/bin/rhwp-q/kit/footnote_info.rs:67` 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 (10 lines × 2) src/bin/rhwp-q/more/inventory.rs:706— src/bin/rhwp-q/more/inventory.rs:706-715 | src/bin/rhwp-q/more/inventory.rs:1159-1168 — both copies are in the same file, so extract the 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 `src/bin/rhwp-q/more/inventory.rs:706` 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) src/bin/rhwp-q/more/main.rs:42— src/bin/rhwp-q/more/main.rs:42-51 | src/bin/rhwp-q/pack/main.rs:42-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/main.rs:42` 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) src/cli/commands/edit/privacy.rs:583— src/cli/commands/edit/privacy.rs:583-592 | src/cli/outputs/preview.rs:19-28 — 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 `src/cli/commands/edit/privacy.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 (10 lines × 2) src/cli/commands/edit/tables/grid.rs:701— src/cli/commands/edit/tables/grid.rs:701-710 | src/cli/commands/edit/tables/layout.rs:353-362 — before extracting anything, compare `src/cli/commands/edit/tables/grid.rs` and `src/cli/commands/edit/tables/layout.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 253 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 `src/cli/commands/edit/tables/grid.rs:701` 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) src/cli/commands/tabular_import.rs:597— src/cli/commands/tabular_import.rs:597-606 | src/cli/commands/tabular_import.rs:638-647 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/tabular_import.rs:597` 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) src/cli/outputs/kitty.rs:159— src/cli/outputs/kitty.rs:159-168 | src/cli/outputs/sixel.rs:154-163 — before extracting anything, compare `src/cli/outputs/kitty.rs` and `src/cli/outputs/sixel.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 128 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 `src/cli/outputs/kitty.rs:159` 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) src/cli/outputs/tabular.rs:222— src/cli/outputs/tabular.rs:222-231 | src/cli/outputs/tabular.rs:462-471 — both copies are in the same file, so extract the 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 `src/cli/outputs/tabular.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 (10 lines × 2) src/cli/outputs/tabular.rs:250— src/cli/outputs/tabular.rs:250-259 | src/cli/outputs/tabular.rs:490-499 — both copies are in the same file, so extract the 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 `src/cli/outputs/tabular.rs:250` 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) src/cli/protocol/capsule/replay.rs:102— src/cli/protocol/capsule/replay.rs:102-111 | src/cli/protocol/harness.rs:146-155 — 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 `src/cli/protocol/capsule/replay.rs:102` 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) src/cli/protocol/capsule/signing.rs:7— src/cli/protocol/capsule/signing.rs:7-16 | src/cli/protocol/harness.rs:6-15 — before extracting anything, compare `src/cli/protocol/capsule/signing.rs` and `src/cli/protocol/harness.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/capsule/signing.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.
Duplicated block (10 lines × 2) src/cli/protocol/exchange/bundle.rs:9— src/cli/protocol/exchange/bundle.rs:9-18 | src/cli/protocol/exchange/disclosure.rs:7-16 — before extracting anything, compare `src/cli/protocol/exchange/bundle.rs` and `src/cli/protocol/exchange/disclosure.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 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 `src/cli/protocol/exchange/bundle.rs:9` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) src/cli/protocol/exchange/disclosure.rs:217— src/cli/protocol/exchange/disclosure.rs:217-226 | src/cli/protocol/trust/governance.rs:197-206 — before extracting anything, compare `src/cli/protocol/exchange/disclosure.rs` and `src/cli/protocol/trust/governance.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/exchange/disclosure.rs:217` 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) src/cli/protocol/exchange/settlement.rs:77— src/cli/protocol/exchange/settlement.rs:77-86 | src/cli/protocol/trust/governance.rs:380-389 — before extracting anything, compare `src/cli/protocol/exchange/settlement.rs` and `src/cli/protocol/trust/governance.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) src/cli/queries/security_inspection.rs:578— src/cli/queries/security_inspection.rs:578-587 | src/cli/queries/security_inspection.rs:850-859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/queries/security_inspection.rs:578` 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) src/diagnostics/hwp5_cell_header_probe.rs:678— src/diagnostics/hwp5_cell_header_probe.rs:678-687 | src/diagnostics/hwp5_mel_personnel_probe.rs:587-596 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_mel_personnel_probe.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 503 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. 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) src/document_core/commands/border_paint_edit.rs:142— src/document_core/commands/border_paint_edit.rs:142-151 | src/document_core/commands/border_paint_structure.rs:648-657 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/border_paint_edit.rs:142` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) src/document_core/commands/formatting.rs:2378— src/document_core/commands/formatting.rs:2378-2387 | src/document_core/commands/formatting.rs:2484-2493 — both copies are in the same file, so extract the 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 `src/document_core/commands/formatting.rs:2378` 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) src/document_core/commands/formatting.rs:2582— src/document_core/commands/formatting.rs:2582-2591 | src/document_core/commands/formatting.rs:2624-2633 — both copies are in the same file, so extract the 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) src/document_core/commands/object_ops/table.rs:1690— src/document_core/commands/object_ops/table.rs:1690-1699 | src/document_core/commands/object_ops/table.rs:1761-1771 — both copies are in the same file, so extract the 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 `src/document_core/commands/object_ops/table.rs:1690` 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) src/document_core/commands/object_ops/table.rs:1796— src/document_core/commands/object_ops/table.rs:1796-1805 | src/document_core/commands/object_ops/table.rs:1960-1969 — both copies are in the same file, so extract the 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 `src/document_core/commands/object_ops/table.rs:1796` 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) src/document_core/hyperlink.rs:415— src/document_core/hyperlink.rs:415-424 | src/document_core/queries/memo_query.rs:1964-1973 — 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) src/document_core/queries/bookmark_query.rs:461— src/document_core/queries/bookmark_query.rs:461-470 | src/document_core/queries/field_query.rs:2754-2763 — before extracting anything, compare `src/document_core/queries/bookmark_query.rs` and `src/document_core/queries/field_query.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 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 `src/document_core/queries/bookmark_query.rs:461` 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) src/bin/rhwp-agent/explorecmd.rs:46— src/bin/rhwp-agent/explorecmd.rs:46-54 | src/bin/rhwp-agent/safety.rs:695-703 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) src/bin/rhwp-agent/fingerprint.rs:148— src/bin/rhwp-agent/fingerprint.rs:148-157 | src/bin/rhwp-q/kit/source_image_bytes.rs:13-21 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-agent/fingerprint.rs:148` 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) src/bin/rhwp-q/more/inventory.rs:92— src/bin/rhwp-q/more/inventory.rs:92-100 | src/bin/rhwp-q/more/inventory.rs:1084-1092 — both copies are in the same file, so extract the 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) src/bin/rhwp-q/more/probe.rs:78— src/bin/rhwp-q/more/probe.rs:78-86 | src/bin/rhwp-q/pack/probe.rs:78-86 — `src/bin/rhwp-q/more/probe.rs` and `src/bin/rhwp-q/pack/probe.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 113 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/probe.rs:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) src/cli/commands/edit/cells.rs:210— src/cli/commands/edit/cells.rs:210-222 | src/cli/commands/tabular_import.rs:486-494 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/tabular_import.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/cells.rs:210` 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) src/cli/commands/edit/formatting.rs:244— src/cli/commands/edit/formatting.rs:244-252 | src/cli/commands/edit/formatting.rs:671-679 — both copies are in the same file, so extract the 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 `src/cli/commands/edit/formatting.rs:244` 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) src/cli/commands/edit/media.rs:106— src/cli/commands/edit/media.rs:106-115 | src/cli/commands/edit/media.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 `src/cli/commands/edit/media.rs:106` 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) src/cli/commands/edit/media.rs:352— src/cli/commands/edit/media.rs:352-361 | src/cli/commands/edit/media.rs:733-741 — both copies are in the same file, so extract the 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 `src/cli/commands/edit/media.rs:352` 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) src/cli/commands/edit/page.rs:350— src/cli/commands/edit/page.rs:350-358 | src/cli/commands/edit/tables/layout.rs:109-117 — before extracting anything, compare `src/cli/commands/edit/page.rs` and `src/cli/commands/edit/tables/layout.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/page.rs:350` 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) src/cli/commands/edit/tables/layout.rs:112— src/cli/commands/edit/tables/layout.rs:112-120 | src/cli/commands/edit/tables/layout.rs:357-365 — both copies are in the same file, so extract the 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 `src/cli/commands/edit/tables/layout.rs:112` 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) src/cli/outputs/tabular.rs:279— src/cli/outputs/tabular.rs:279-287 | src/cli/outputs/tabular.rs:520-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 `src/cli/outputs/tabular.rs:279` 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) src/cli/protocol/exchange/disclosure.rs:112— src/cli/protocol/exchange/disclosure.rs:112-120 | src/cli/protocol/exchange/disclosure.rs:211-219 — both copies are in the same file, so extract the 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 `src/cli/protocol/exchange/disclosure.rs:112` 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) src/cli/protocol/trust/governance.rs:329— src/cli/protocol/trust/governance.rs:329-337 | src/cli/protocol/trust/governance.rs:781-789 — both copies are in the same file, so extract the 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 `src/cli/protocol/trust/governance.rs:329` 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) src/diagnostics/hwp5_inventory_diff.rs:1274— src/diagnostics/hwp5_inventory_diff.rs:1274-1282 | src/diagnostics/hwp5_inventory_diff.rs:1322-1330 — both copies are in the same file, so extract the 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 `src/diagnostics/hwp5_inventory_diff.rs:1274` 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) src/diagnostics/hwp5_roundtrip_batch.rs:589— src/diagnostics/hwp5_roundtrip_batch.rs:589-597 | src/diagnostics/hwpx_roundtrip_batch.rs:425-433 — before extracting anything, compare `src/diagnostics/hwp5_roundtrip_batch.rs` and `src/diagnostics/hwpx_roundtrip_batch.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 152 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 (9 lines × 2) src/document_core/builders/exam_paper.rs:204— src/document_core/builders/exam_paper.rs:204-212 | src/scaffold/builder.rs:264-272 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `page_size` to `crate::parser::ingest::schema::PageSize` in one and `PageSize` 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) src/document_core/commands/clipboard.rs:735— src/document_core/commands/clipboard.rs:735-743 | src/document_core/commands/header_footer_ops.rs:755-763 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) src/document_core/commands/clipboard.rs:1564— src/document_core/commands/clipboard.rs:1564-1572 | src/document_core/commands/formatting.rs:261-269 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) src/document_core/commands/formatting.rs:2094— src/document_core/commands/formatting.rs:2094-2102 | src/document_core/commands/formatting.rs:2537-2545 — both copies are in the same file, so extract the 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 `src/document_core/commands/formatting.rs:2094` 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) src/document_core/commands/header_footer_ops.rs:294— src/document_core/commands/header_footer_ops.rs:294-302 | src/document_core/commands/header_footer_ops.rs:343-351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src/document_core/commands/text_editing.rs:5995— src/document_core/commands/text_editing.rs:5995-6003 | src/document_core/commands/text_editing.rs:6874-6882 — both copies are in the same file, so extract the 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) src/document_core/commands/text_editing.rs:6018— src/document_core/commands/text_editing.rs:6018-6026 | src/document_core/commands/text_editing.rs:6236-6244 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:6018` 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) src/document_core/converters/hwpx_master_page_slots.rs:31— src/document_core/converters/hwpx_master_page_slots.rs:31-39 | src/document_core/converters/hwpx_master_page_slots.rs:99-107 — both copies are in the same file, so extract the 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) src/document_core/queries/cursor_rect.rs:1985— src/document_core/queries/cursor_rect.rs:1985-1993 | src/document_core/queries/cursor_rect.rs:5953-5961 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:1985` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `run` to `&RunInfo` in one and `&FnRunInfo` 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) src/document_core/queries/cursor_rect.rs:5484— src/document_core/queries/cursor_rect.rs:5484-5492 | src/document_core/queries/cursor_rect.rs:6000-6008 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:5484` 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 (11 lines × 2) src/bin/rhwp-agent/explorecmd.rs:64— src/bin/rhwp-agent/explorecmd.rs:64-74 | src/cli/queries/explore.rs:91-101 — 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 `src/bin/rhwp-agent/explorecmd.rs:64` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src/bin/rhwp-agent/lookups.rs:257— src/bin/rhwp-agent/lookups.rs:257-267 | src/bin/rhwp-agent/lookups.rs:451-461 — both copies are in the same file, so extract the 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 `src/bin/rhwp-agent/lookups.rs:257` 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 (11 lines × 2) src/bin/rhwp-q/kit/covering_pages.rs:24— src/bin/rhwp-q/kit/covering_pages.rs:24-34 | src/bin/rhwp-q/kit/form_value.rs:30-40 — before extracting anything, compare `src/bin/rhwp-q/kit/covering_pages.rs` and `src/bin/rhwp-q/kit/form_value.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 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 `src/bin/rhwp-q/kit/covering_pages.rs:24` 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 (11 lines × 2) src/bin/rhwp-q/kit/cursor_in_footnote.rs:32— src/bin/rhwp-q/kit/cursor_in_footnote.rs:32-42 | src/bin/rhwp-q/kit/footnote_info.rs:26-36 — before extracting anything, compare `src/bin/rhwp-q/kit/cursor_in_footnote.rs` and `src/bin/rhwp-q/kit/footnote_info.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 84 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 `src/bin/rhwp-q/kit/cursor_in_footnote.rs:32` 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 (11 lines × 2) src/bin/rhwp-q/more/inventory.rs:31— src/bin/rhwp-q/more/inventory.rs:31-41 | src/bin/rhwp-q/pack/inventory.rs:61-71 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (11 lines × 2) src/bin/rhwp-q/more/inventory.rs:518— src/bin/rhwp-q/more/inventory.rs:518-528 | src/bin/rhwp-q/more/inventory.rs:545-555 — both copies are in the same file, so extract the 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 `src/bin/rhwp-q/more/inventory.rs:518` 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 (11 lines × 2) src/bin/rhwp-q/pack/inventory.rs:523— src/bin/rhwp-q/pack/inventory.rs:523-533 | src/bin/rhwp-q/pack/inventory.rs:964-974 — both copies are in the same file, so extract the 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 `src/bin/rhwp-q/pack/inventory.rs:523` 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 (11 lines × 2) src/bin/rhwp-q/pack/inventory.rs:602— src/bin/rhwp-q/pack/inventory.rs:602-612 | src/bin/rhwp-q/pack/inventory.rs:1219-1229 — both copies are in the same file, so extract the 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 `src/bin/rhwp-q/pack/inventory.rs:602` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) src/cli/commands/edit/tables/grid.rs:10— src/cli/commands/edit/tables/grid.rs:10-20 | src/cli/commands/edit/tables/grid.rs:118-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/tables/grid.rs:10` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src/cli/commands/generation.rs:154— src/cli/commands/generation.rs:154-164 | src/cli/commands/generation.rs:291-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 `src/cli/commands/generation.rs:154` 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, `src/cli/commands/generation.rs:289` calls `build_scaffold` and `src/cli/commands/generation.rs:152` 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 lines × 2) src/cli/outputs/doclang.rs:16— src/cli/outputs/doclang.rs:16-26 | src/cli/outputs/text.rs:427-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 `src/cli/outputs/doclang.rs:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src/cli/outputs/tabular.rs:120— src/cli/outputs/tabular.rs:120-130 | src/cli/outputs/tabular.rs:330-340 — both copies are in the same file, so extract the 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 `src/cli/outputs/tabular.rs:120` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src/cli/outputs/vector.rs:65— src/cli/outputs/vector.rs:65-75 | src/cli/outputs/vector.rs:562-572 — both copies are in the same file, so extract the 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 `src/cli/outputs/vector.rs:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src/cli/outputs/vector.rs:637— src/cli/outputs/vector.rs:637-647 | src/cli/queries/explain.rs:167-178 — 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 `src/cli/outputs/vector.rs:637` 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 (11 lines × 2) src/cli/protocol/exchange/settlement.rs:103— src/cli/protocol/exchange/settlement.rs:103-113 | src/cli/protocol/trust/governance.rs:396-406 — before extracting anything, compare `src/cli/protocol/exchange/settlement.rs` and `src/cli/protocol/trust/governance.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/exchange/settlement.rs:103` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src/diagnostics/hwp5_anchor_trace.rs:89— src/diagnostics/hwp5_anchor_trace.rs:89-99 | src/diagnostics/hwp5_first_para_control_probe.rs:141-151 — 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 `src/diagnostics/hwp5_anchor_trace.rs:89` 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 (11 lines × 2) src/diagnostics/hwp5_inventory.rs:166— src/diagnostics/hwp5_inventory.rs:166-176 | src/diagnostics/hwp5_inventory_diff.rs:313-323 — before extracting anything, compare `src/diagnostics/hwp5_inventory.rs` and `src/diagnostics/hwp5_inventory_diff.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 112 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 `src/diagnostics/hwp5_inventory.rs:166` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src/diagnostics/layout_anomaly.rs:822— src/diagnostics/layout_anomaly.rs:822-832 | src/diagnostics/layout_anomaly.rs:1042-1052 — both copies are in the same file, so extract the 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) src/document_core/builders/exam_paper.rs:272— src/document_core/builders/exam_paper.rs:272-282 | src/document_core/builders/exam_paper.rs:301-311 — both copies are in the same file, so extract the 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 `src/document_core/builders/exam_paper.rs:272` 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) src/document_core/commands/border_paint_edit.rs:202— src/document_core/commands/border_paint_edit.rs:202-212 | src/document_core/commands/border_paint_edit.rs:279-289 — both copies are in the same file, so extract the 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 `src/document_core/commands/border_paint_edit.rs:202` 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) src/document_core/commands/clipboard.rs:880— src/document_core/commands/clipboard.rs:880-890 | src/document_core/commands/html_import.rs:164-174 — before extracting anything, compare `src/document_core/commands/clipboard.rs` and `src/document_core/commands/html_import.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) src/document_core/commands/document.rs:935— src/document_core/commands/document.rs:935-945 | src/document_core/commands/document.rs:2475-2485 — both copies are in the same file, so extract the 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 `src/document_core/commands/document.rs:935` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) src/document_core/commands/formatting.rs:1589— src/document_core/commands/formatting.rs:1589-1599 | src/document_core/commands/formatting.rs:1652-1662 — both copies are in the same file, so extract the 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 `src/document_core/commands/formatting.rs:1589` 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) src/document_core/commands/formatting.rs:2470— src/document_core/commands/formatting.rs:2470-2480 | src/document_core/commands/formatting.rs:2529-2539 — both copies are in the same file, so extract the 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) src/document_core/commands/header_footer_ops.rs:182— src/document_core/commands/header_footer_ops.rs:182-192 | src/document_core/commands/header_footer_ops.rs:905-915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Repeated repair: src/renderer/equation/mod.rs src/renderer/equation/mod.rs:261— src/renderer/equation/mod.rs changed 73 times in last 90 days and 39 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 rhwp::renderer::equation::simple_math_frame_metrics at line 261), 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: 셀 도형 편집과 수식·연속 표의 원본 프레임·글꼴 보존 (#8754)”; “fix(equation): #8332를 기존 flow·paint 캐시와 중복 없이 통합”; “fix(equation): 구형 CHAR의 논리 전진과 그룹 소유를 공통 배치에 보존”; “fix(equation): COL 인자와 표시 세대별 오류를 공통 파서에서 처리”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/equation/mod.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: src/renderer/equation/parser.rs src/renderer/equation/parser.rs:477— src/renderer/equation/parser.rs changed 39 times in last 90 days and 29 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 EqParser::parse_fraction_in_range at line 477), 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(equation): 구형 그룹의 공통 좌표와 첨자 소유 보존”; “fix(equation): 구형 그룹의 글꼴 전환 범위를 복원”; “fix(equation): COL 인자와 표시 세대별 오류를 공통 파서에서 처리”; “Merge upstream/devel into fix/7873-equation-rm-space”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/equation/parser.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: src/renderer/typeset/state/commands.rs src/renderer/typeset/state/commands.rs:36— src/renderer/typeset/state/commands.rs changed 37 times in last 90 days and 22 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 TypesetState::consume_pending_table_terminal_gap at line 36), 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(layout): 다단 각주의 소유·예약·배치 프레임 공통화”; “fix(typeset): 본문 각주를 참조 줄 단위로 예약하고 각주 여유·꼬리말 밴드 회수를 없앤다 (#8468)”; “fix: HFT 원본 글꼴 공급과 한글 3.0 조판 보존 (#8397)”; “fix(typeset): 이어지는 쪽에서도 같은 문단의 다음 저장 쪽 reset 을 경계로 쓰고 그 조각의 자기 각주를 표시 쪽에 둔다”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/typeset/state/commands.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: src/renderer/equation/layout/source_font_symbol.rs src/renderer/equation/layout/source_font_symbol.rs:33— src/renderer/equation/layout/source_font_symbol.rs changed 19 times in last 90 days and 19 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 rhwp::renderer::equation::layout::source_font_symbol::operator_metrics at line 33), 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: 셀 도형 편집과 수식·연속 표의 원본 프레임·글꼴 보존 (#8754)”; “fix: 구형 문자 평면과 현대 수식 색상 경계를 공통 결과에 반영”; “fix: 한컴 수식 콜론·쉼표의 실제 글리프와 간격 보정”; “fix: 점 연산자의 em 표시 기하 공통화와 독립 Print 대조 기록”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/equation/layout/source_font_symbol.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: src/renderer/typeset/notes/endnotes/paragraph/reflow_fit.rs src/renderer/typeset/notes/endnotes/paragraph/reflow_fit.rs:50— src/renderer/typeset/notes/endnotes/paragraph/reflow_fit.rs changed 30 times in last 90 days and 16 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 TypesetEngine::query_reflowed_endnote_fit at line 50), 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: 저장 컷 전진량에서 별도 개체 방출의 글줄 중복 제외”; “fix: 저장 컷 뒤 줄의 소유를 실질 전진 회수와 함께 검증”; “fix: 저장 컷 판정이 공통 미주 줄 재발행 조회를 소비하도록 공개 범위 조정”; “fix: 유지된 저장 단 컷과 정상 글꼴의 괄호 전진폭을 보존”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/typeset/notes/endnotes/paragraph/reflow_fit.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: src/renderer/equation/layout/script_geometry.rs src/renderer/equation/layout/script_geometry.rs:62— src/renderer/equation/layout/script_geometry.rs changed 17 times in last 90 days and 14 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is EqLayout::script_subscript_geometry at line 62), 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: 셀 도형 편집과 수식·연속 표의 원본 프레임·글꼴 보존 (#8754)”; “fix(equation): 구형 CHAR의 논리 전진과 그룹 소유를 공통 배치에 보존”; “fix: 한컴 수식 구조 프레임과 저장 줄 없는 인라인 간격 보정”; “fix: HancomEQN 글리프와 첨자 메트릭을 실제 출력에 연결”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/equation/layout/script_geometry.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: src/renderer/layout/table_layout/row_physical_band.rs src/renderer/layout/table_layout/row_physical_band.rs:368— src/renderer/layout/table_layout/row_physical_band.rs 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 13 (its worst body is LayoutEngine::cut_trailing_advances at line 368), 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: 셀 도형 편집과 수식·연속 표의 원본 프레임·글꼴 보존 (#8754)”; “fix: 중첩 표 종료 행의 빈 최소와 물리 프레임을 공통 예산으로 배치”; “fix: 실제 내용 컷과 빈 이어받기 조각의 물리 여백 소유 보존”; “fix: 저장 컷의 수용 근거와 이어받기 행의 물리 프레임 복원”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/layout/table_layout/row_physical_band.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: src/renderer/typeset/table/scan/types.rs src/renderer/typeset/table/scan/types.rs:84— src/renderer/typeset/table/scan/types.rs changed 18 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 3 (its worst body is BlockRowScanVars::plain_row_available_height at line 84), 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: 일반 컷에서 확정한 빈 상자 소유를 스캔 결과로 전달”; “fix: 일반 컷의 실제 빈 상자와 추정 행 추가 띠 분리”; “fix: 수용한 빈 띠의 같은 물리 장부를 배치와 이어받기에 전달”; “fix: 최소 조각 검증과 배치가 같은 수용 행 상자를 사용”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/typeset/table/scan/types.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: src/renderer/typeset/paragraph/metrics.rs src/renderer/typeset/paragraph/metrics.rs:177— src/renderer/typeset/paragraph/metrics.rs changed 17 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is FormattedParagraph::flow_advance_height at line 177), 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: 저장 표의 후속 원점에 확정된 끝 줄간격 공유”; “fix: 재조판 호스트의 표 이월과 분할 조각 소유를 공유”; “fix: 표 앞뒤 호스트 줄의 구성과 소유 범위를 공유”; “fix: 다단 뒤 간격 소비와 한컴 수식 명령·첨자 입력 경계 보정”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/typeset/paragraph/metrics.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: src/renderer/equation/layout/fraction_geometry.rs src/renderer/equation/layout/fraction_geometry.rs:200— src/renderer/equation/layout/fraction_geometry.rs changed 15 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is EqLayout::layout_sqrt at line 200), 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: 셀 도형 편집과 수식·연속 표의 원본 프레임·글꼴 보존 (#8754)”; “fix: 한컴 수식 구조 프레임과 저장 줄 없는 인라인 간격 보정”; “fix: 조합과 ATOP의 독립 프레임 및 빈 수식 호스트 줄을 보정”; “fix: 독립 Print에 따라 정렬 행과 조합·긴 나눗셈·색 범위를 보정”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/equation/layout/fraction_geometry.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: src/renderer/equation/parser_terms.rs src/renderer/equation/parser_terms.rs:17— src/renderer/equation/parser_terms.rs changed 10 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is EqParser::parse_element_term at line 17), 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(equation): 구형 그룹의 글꼴 전환 범위를 복원”; “fix(equation): 구형 CHAR의 논리 전진과 그룹 소유를 공통 배치에 보존”; “Merge upstream/devel into fix/7873-equation-rm-space”; “fix(equation): rm·it 는 수식 끝까지 지속되는 글꼴 상태이고 뒤 공백 명령은 간격이다 (#7873)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/equation/parser_terms.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: src/renderer/typeset/table/scan/row.rs src/renderer/typeset/table/scan/row.rs:53— src/renderer/typeset/table/scan/row.rs changed 15 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is RowScanQuery::plain_cut_physical_height at line 53), 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(typeset): 병합 칸 안쪽 행은 내용이 들어가면 쪽 끝에서 끝낸다”; “fix: 걸침 셀의 물리 잔여와 내용 종료 요구 공유”; “fix: 최소 조각 검증과 배치가 같은 수용 행 상자를 사용”; “fix: 저장 행 상자의 기하 완결성으로 RowBreak 분할을 금지하지 않음”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/typeset/table/scan/row.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: src/renderer/equation/symbols.rs src/renderer/equation/symbols.rs:638— src/renderer/equation/symbols.rs changed 11 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is rhwp::renderer::equation::symbols::lookup_symbol at line 638), 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(equation): 전부 대문자로 쓴 그리스 문자 이름을 대문자 그리스 문자로 읽는다 (#7390)”; “fix: 명시적 공간의 항 소유와 Unicode 논리 기호를 보존”; “fix: 한컴 수식 콜론·쉼표의 실제 글리프와 간격 보정”; “fix: 그리스 기호의 변형과 라틴 스타일을 독립 Print 계약으로 구분”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/equation/symbols.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: src/renderer/equation/layout/source_font_text.rs src/renderer/equation/layout/source_font_text.rs:42— src/renderer/equation/layout/source_font_text.rs changed 10 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is rhwp::renderer::equation::layout::source_font_text::layout at line 42), 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: 한컴 행렬의 공통 줄 프레임과 근호 괄호 소속 보정”; “fix: 복합 위첨자의 대문자 여백과 논리 글자 전진을 공유”; “fix: 수학 변수의 정체와 합성 굵기 출력 계약 공통화”; “fix: 대문자 FontGlyph의 정적 face 참조 타입 교정”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/equation/layout/source_font_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.
Repeated repair: src/renderer/equation/font_frame_metrics.rs src/renderer/equation/font_frame_metrics.rs:200— src/renderer/equation/font_frame_metrics.rs changed 8 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is rhwp::renderer::equation::font_frame_metrics::accent_at_dpi at line 200), 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: 적분 첨자 인자와 축소 글자·근호 아래첨자 프레임을 보정”; “fix: 수식 전용 줄의 공통 기준선과 분수 첨자 프레임 보정”; “fix: 분수의 측정 프레임과 실제 글줄 기준선 공유”; “fix: 공개 MATH 화살촉과 장식 프레임을 각 출력에 공유”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/equation/font_frame_metrics.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: src/renderer/typeset/controls/shape_flow.rs src/renderer/typeset/controls/shape_flow.rs:21— src/renderer/typeset/controls/shape_flow.rs changed 11 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 13 (its worst body is rhwp::renderer::typeset::controls::shape_flow::prepare at line 21), 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(typeset): 문단 자기 줄 아래에 놓인 자리차지 개체는 그 줄들을 밀지 않는다 (#8491)”; “fix(typeset): 용지 밖으로 오프셋된 문단 기준 자리차지 개체는 흐름을 밀지 않는다 (#8462)”; “fix(typeset): 글줄로 이미 놓인 줄의 TAC 그림은 그 줄 높이를 다시 계상하지 않는다 (#8458)”; “fix(typeset): 저장 리셋으로 다음 쪽에 가는 문단 중간 줄의 자리차지 로고를 떠나는 쪽에 남긴다 (#8446)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/typeset/controls/shape_flow.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: src/renderer/layout/table_layout/reflow_block_frames.rs src/renderer/layout/table_layout/reflow_block_frames.rs:53— src/renderer/layout/table_layout/reflow_block_frames.rs changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is LayoutEngine::reflow_cellbreak_row_host_band_height at line 53), 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(table): 세로쓰기 칸이 있는 표를 쪽 경계에서 나누지 않는다 (#8470)”; “fix: 재조판 셀과 인라인 개체의 공통 줄 프레임 전달”; “fix: 외부 자손 점유와 부모 셀 물리 프레임 분리”; “fix: 재귀 셀 컷의 물리 프레임과 NO_LS 격자 예산 구분”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/layout/table_layout/reflow_block_frames.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: src/renderer/canvas_text_font.rs src/renderer/canvas_text_font.rs:89— src/renderer/canvas_text_font.rs changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is rhwp::renderer::canvas_text_font::family_chain at line 89), 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: 새 devel의 공통 조판 계약과 리베이스 소비 경로 연결”; “fix: 자소의 실제 전진과 강조점 소유·본문 기울임을 공통화”; “fix: Canvas 원 글꼴의 자체 굵기와 fallback 합성을 구분”; “fix(canvas): paint heavy display faces bold like SVG”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/canvas_text_font.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: src/native_host/editor.rs src/native_host/editor.rs:341— src/native_host/editor.rs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is NativeEditor::update_composition at line 341), 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: 누적 체리픽에 원 PR의 통합 해소 결과 보존”; “fix: reject lossy native clipboard and body edits”; “fix: guard native command spans before paragraph mutations”; “fix: reject semantic-control spans in native body edits”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/native_host/editor.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: src/renderer/layout/table_layout/stored_plain_row_frame.rs src/renderer/layout/table_layout/stored_plain_row_frame.rs:100— src/renderer/layout/table_layout/stored_plain_row_frame.rs changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is LayoutEngine::stored_empty_row_frame_height at line 100), 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(table): 세로쓰기 칸이 있는 표를 쪽 경계에서 나누지 않는다 (#8470)”; “fix: 저장 조각의 글줄 소유와 종료 프레임을 측정·배치에서 공유”; “fix: 저장 행 상자의 기하 완결성으로 RowBreak 분할을 금지하지 않음”; “fix(renderer): 원본 빈 행의 줄 상자를 보존해 쪽 끝에서 완결”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/layout/table_layout/stored_plain_row_frame.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: src/renderer/equation/ast.rs src/renderer/equation/ast.rs:196— src/renderer/equation/ast.rs changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is EqNode::simplify at line 196), 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(equation): 구형 CHAR의 논리 전진과 그룹 소유를 공통 배치에 보존”; “fix: 수식 정렬 칸과 명령형 첨자의 인자 소속을 보정”; “fix: 중위 왼쪽 첨자의 항 소속과 빈 수식 호스트 줄을 보정”; “fix: 조합과 ATOP의 독립 프레임 및 빈 수식 호스트 줄을 보정”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/equation/ast.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: src/renderer/skia/equation_conv/glyphs.rs src/renderer/skia/equation_conv/glyphs.rs:90— src/renderer/skia/equation_conv/glyphs.rs changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is rhwp::renderer::skia::equation_conv::glyphs::equation_typeface_chain at line 90), 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: 셀 도형 편집과 수식·연속 표의 원본 프레임·글꼴 보존 (#8754)”; “fix(native): decode equation font codes before character fallback”; “fix: apply character font fallback to positioned equations”; “fix: 본문 자동 줄과 명시적 글꼴 프로그램 요청의 경계 보정”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/skia/equation_conv/glyphs.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: src/renderer/equation/document_script.rs src/renderer/equation/document_script.rs:18— src/renderer/equation/document_script.rs changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is rhwp::renderer::equation::document_script::tokenize_with_display at line 18), 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(equation): 구형 명령 사전과 COL 닫힘 계약을 구분”; “fix(equation): COL 인자와 표시 세대별 오류를 공통 파서에서 처리”; “fix: 한컴 문서의 기호 별칭과 백슬래시 문자 글리프 전환 보정”; “fix: 다단 뒤 간격 소비와 한컴 수식 명령·첨자 입력 경계 보정”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/equation/document_script.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: src/renderer/equation/layout/decoration_geometry.rs src/renderer/equation/layout/decoration_geometry.rs:100— src/renderer/equation/layout/decoration_geometry.rs changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is EqLayout::layout_font_style at line 100), 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: 한컴 수식 구조 프레임과 저장 줄 없는 인라인 간격 보정”; “fix: 공개 MATH 화살촉과 장식 프레임을 각 출력에 공유”; “fix: 수학 점 기호의 논리 전진과 장식 본체 여유를 공유”; “fix: 수학 변수의 정체와 합성 굵기 출력 계약 공통화”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/equation/layout/decoration_geometry.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: src/renderer/typeset/table/continuation/job.rs src/renderer/typeset/table/continuation/job.rs:19— src/renderer/typeset/table/continuation/job.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is TypesetEngine::begin_resumable_table_pagination at line 19), 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(layout): 다단 각주의 소유·예약·배치 프레임 공통화”; “fix(typeset): 각주 예약 전환 후 제거된 꼬리말 호출 정리”; “fix(typeset): 본문 각주를 참조 줄 단위로 예약하고 각주 여유·꼬리말 밴드 회수를 없앤다 (#8468)”; “fix(table): 세로쓰기 칸이 있는 표를 쪽 경계에서 나누지 않는다 (#8470)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 09:27:49 +09:00' --until='2026-11-10 09:27:49 +09:00' --full-history --no-merges -- src/renderer/typeset/table/continuation/job.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.
Duplicated block (5 lines × 2) pdf/issue7998/cell-regions/generate_sources.rs:20— pdf/issue7998/cell-regions/generate_sources.rs:20-24 | pdf/issue7998/local-regions/generate_sources.rs:34-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pdf/issue7998/cell-regions/generate_sources.rs:20` 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) src/cli/commands/edit/cells.rs:205— src/cli/commands/edit/cells.rs:205-209 | src/cli/commands/edit/cells.rs:488-492 — both copies are in the same file, so extract the 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) src/cli/commands/edit/cells.rs:658— src/cli/commands/edit/cells.rs:658-662 | src/cli/commands/edit/formatting.rs:281-285 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/formatting.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 232 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) src/cli/commands/edit/cells.rs:833— src/cli/commands/edit/cells.rs:833-837 | src/cli/commands/edit/tables/grid.rs:581-585 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/tables/grid.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 189 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) src/cli/commands/edit/document_objects.rs:408— src/cli/commands/edit/document_objects.rs:408-412 | src/cli/commands/edit/header_footer_properties.rs:9-13 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/header_footer_properties.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 192 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) src/cli/commands/edit/tables/coordinates.rs:39— src/cli/commands/edit/tables/coordinates.rs:39-43 | src/cli/commands/tabular_import.rs:235-239 — 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 `src/cli/commands/edit/tables/coordinates.rs:39` 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) src/diagnostics/hwp5_contract_probe.rs:411— src/diagnostics/hwp5_contract_probe.rs:411-416 | src/diagnostics/hwp5_contract_probe.rs:577-581 — both copies are in the same file, so extract the 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 `src/diagnostics/hwp5_contract_probe.rs:411` 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) src/diagnostics/ir_field_sweep.rs:615— src/diagnostics/ir_field_sweep.rs:615-619 | src/diagnostics/ir_field_sweep.rs:716-720 — both copies are in the same file, so extract the 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 `src/diagnostics/ir_field_sweep.rs:615` 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 first that the copies are not typed on the same thing: the declarations holding them bind `a` to `&[Paragraph]` in one and `&[Control]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) src/document_core/commands/object_ops/equation.rs:216— src/document_core/commands/object_ops/equation.rs:216-220 | src/document_core/commands/object_ops/table.rs:330-334 — before extracting anything, compare `src/document_core/commands/object_ops/equation.rs` and `src/document_core/commands/object_ops/table.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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 `src/document_core/commands/object_ops/equation.rs:216` 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) src/document_core/commands/table_ops.rs:4105— src/document_core/commands/table_ops.rs:4105-4110 | src/document_core/commands/table_ops.rs:4134-4138 — both copies are in the same file, so extract the 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 `src/document_core/commands/table_ops.rs:4105` 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) src/document_core/queries/cursor_rect.rs:3997— src/document_core/queries/cursor_rect.rs:3997-4001 | src/document_core/queries/cursor_rect.rs:4011-4015 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:3997` 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 × 2) src/document_core/queries/doc_tree_nav.rs:1422— src/document_core/queries/doc_tree_nav.rs:1422-1426 | src/renderer/layout/shape_layout.rs:893-897 — before extracting anything, compare `src/document_core/queries/doc_tree_nav.rs` and `src/renderer/layout/shape_layout.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/queries/doc_tree_nav.rs:1422` 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) src/eps.rs:1177— src/eps.rs:1177-1181 | src/eps.rs:1624-1628 — both copies are in the same file, so extract the 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) src/model/paragraph.rs:3648— src/model/paragraph.rs:3648-3652 | src/model/paragraph.rs:3728-3732 — both copies are in the same file, so extract the 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) src/native_host/gpu_d3d.rs:149— src/native_host/gpu_d3d.rs:149-153 | src/native_host/gpu_metal.rs:90-94 — before extracting anything, compare `src/native_host/gpu_d3d.rs` and `src/native_host/gpu_metal.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 170 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 `target` to `NativeD3dTarget` in one and `NativeMetalTarget` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) src/parser/pdf/table_detection.rs:448— src/parser/pdf/table_detection.rs:448-452 | tools/pdf-ir-poc/src/table_detection.rs:226-230 — before extracting anything, compare `src/parser/pdf/table_detection.rs` and `tools/pdf-ir-poc/src/table_detection.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/table_detection.rs:448` 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) src/renderer/composer/line_breaking.rs:5111— src/renderer/composer/line_breaking.rs:5111-5115 | src/renderer/composer/line_breaking.rs:5980-5984 — both copies are in the same file, so extract the 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) src/renderer/equation/canvas_render.rs:478— src/renderer/equation/canvas_render.rs:478-482 | src/renderer/equation/canvas_render.rs:528-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/equation/canvas_render.rs:478` 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) src/renderer/font_metric_math_symbols.rs:78— src/renderer/font_metric_math_symbols.rs:78-82 | src/renderer/font_metrics_technical_symbols.rs:93-97 — 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 `src/renderer/font_metric_math_symbols.rs:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src/renderer/height_measurer.rs:1004— src/renderer/height_measurer.rs:1004-1008 | src/renderer/height_measurer.rs:1256-1260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src/renderer/height_measurer.rs:3884— src/renderer/height_measurer.rs:3884-3888 | src/renderer/height_measurer.rs:4473-4479 — both copies are in the same file, so extract the 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 `src/renderer/height_measurer.rs:3884` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) src/renderer/image_resolver/picture_adjustments.rs:114— src/renderer/image_resolver/picture_adjustments.rs:114-119 | src/renderer/image_resolver/wmf_picture.rs:114-118 — 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 `src/renderer/image_resolver/picture_adjustments.rs:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src/renderer/layout.rs:14604— src/renderer/layout.rs:14604-14609 | src/renderer/layout.rs:14677-14681 — both copies are in the same file, so extract the 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 `src/renderer/layout.rs:14604` 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) src/renderer/layout/paragraph_layout.rs:3657— src/renderer/layout/paragraph_layout.rs:3657-3661 | src/renderer/typeset/controls/empty_float.rs:114-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) src/renderer/layout/table_layout.rs:24448— src/renderer/layout/table_layout.rs:24448-24452 | src/renderer/layout/table_layout.rs:24952-24956 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:24448` 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) src/bin/rhwp-agent/chunkplan.rs:70— src/bin/rhwp-agent/chunkplan.rs:70-81 | src/bin/rhwp-agent/safety.rs:417-428 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-agent/chunkplan.rs:70` 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 lines × 2) src/bin/rhwp-agent/compare.rs:19— src/bin/rhwp-agent/compare.rs:19-30 | src/bin/rhwp-agent/compare.rs:53-64 — both copies are in the same file, so extract the 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) src/bin/rhwp-agent/difftext.rs:296— src/bin/rhwp-agent/difftext.rs:296-307 | src/bin/rhwp-agent/evidence.rs:104-115 — 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 `src/bin/rhwp-agent/difftext.rs:296` 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) src/bin/rhwp-agent/envelope.rs:134— src/bin/rhwp-agent/envelope.rs:134-145 | src/cli/queries/scan.rs:112-123 — 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 (12 lines × 2) src/bin/rhwp-agent/safety.rs:302— src/bin/rhwp-agent/safety.rs:302-313 | src/bin/rhwp-agent/safety.rs:606-617 — both copies are in the same file, so extract the 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 `src/bin/rhwp-agent/safety.rs:302` 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 lines × 2) src/bin/rhwp-agent/stats.rs:190— src/bin/rhwp-agent/stats.rs:190-201 | src/bin/rhwp-agent/stats.rs:216-227 — both copies are in the same file, so extract the 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) src/cli/queries/control_dump/mod.rs:217— src/cli/queries/control_dump/mod.rs:217-228 | src/cli/queries/control_dump/shape.rs:259-270 — 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 `src/cli/queries/control_dump/mod.rs:217` 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) src/diagnostics/hwp5_cell_header_probe.rs:937— src/diagnostics/hwp5_cell_header_probe.rs:937-948 | src/diagnostics/hwp5_table_probe.rs:694-705 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_table_probe.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 462 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 `src/diagnostics/hwp5_cell_header_probe.rs:937` 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) src/document_core/commands/object_ops/chart.rs:830— src/document_core/commands/object_ops/chart.rs:830-841 | src/document_core/commands/object_ops/chart.rs:847-858 — both copies are in the same file, so extract the 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 `src/document_core/commands/object_ops/chart.rs:830` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) src/document_core/commands/object_ops/table.rs:162— src/document_core/commands/object_ops/table.rs:162-173 | src/document_core/commands/text_editing.rs:6383-6394 — before extracting anything, compare `src/document_core/commands/object_ops/table.rs` and `src/document_core/commands/text_editing.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) src/document_core/commands/object_ops/table.rs:1753— src/document_core/commands/object_ops/table.rs:1753-1764 | src/document_core/commands/object_ops/table.rs:1935-1946 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/object_ops/table.rs:1753` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src/document_core/commands/text_editing.rs:822— src/document_core/commands/text_editing.rs:822-833 | src/document_core/commands/text_editing.rs:1048-1059 — both copies are in the same file, so extract the 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) src/document_core/html_table_import.rs:784— src/document_core/html_table_import.rs:784-795 | src/document_core/html_table_import.rs:928-939 — both copies are in the same file, so extract the 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 `src/document_core/html_table_import.rs:784` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src/document_core/queries/bookmark_query.rs:127— src/document_core/queries/bookmark_query.rs:127-138 | src/document_core/queries/bookmark_query.rs:236-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 `src/document_core/queries/bookmark_query.rs:127` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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) src/document_core/queries/cursor_nav.rs:2050— src/document_core/queries/cursor_nav.rs:2050-2061 | src/document_core/queries/cursor_nav.rs:2094-2105 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_nav.rs:2050` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src/document_core/queries/cursor_rect.rs:207— src/document_core/queries/cursor_rect.rs:207-218 | src/document_core/queries/cursor_rect.rs:3148-3159 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:207` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src/document_core/queries/cursor_rect.rs:5694— src/document_core/queries/cursor_rect.rs:5694-5705 | src/document_core/queries/cursor_rect.rs:6116-6127 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:5694` 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 lines × 2) src/document_core/queries/cursor_rect.rs:6242— src/document_core/queries/cursor_rect.rs:6242-6253 | src/document_core/queries/cursor_rect.rs:6569-6580 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:6242` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src/document_core/queries/form_action.rs:94— src/document_core/queries/form_action.rs:94-105 | src/document_core/queries/form_action.rs:162-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) src/document_core/queries/hyperlink_geometry.rs:104— src/document_core/queries/hyperlink_geometry.rs:104-115 | src/document_core/queries/hyperlink_geometry.rs:228-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/queries/hyperlink_geometry.rs:104` 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, `src/document_core/queries/hyperlink_geometry.rs:225` calls `is_empty` and `src/document_core/queries/hyperlink_geometry.rs:103` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) src/model/paragraph.rs:2252— src/model/paragraph.rs:2252-2263 | src/model/paragraph.rs:2634-2645 — both copies are in the same file, so extract the 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) src/paint/device_clip.rs:8— src/paint/device_clip.rs:8-19 | src/paint/device_fill.rs:42-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, 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) src/paint/shaping_glyph.rs:797— src/paint/shaping_glyph.rs:797-808 | src/paint/shaping_glyph.rs:1190-1201 — both copies are in the same file, so extract the 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 `src/paint/shaping_glyph.rs:797` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src/parser/control/shape.rs:1022— src/parser/control/shape.rs:1022-1033 | src/parser/doc_info.rs:718-729 — 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 `src/parser/control/shape.rs:1022` 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) src/parser/pdf/recognition.rs:659— src/parser/pdf/recognition.rs:659-670 | tools/pdf-ir-poc/src/recognition.rs:410-421 — before extracting anything, compare `src/parser/pdf/recognition.rs` and `tools/pdf-ir-poc/src/recognition.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) src/bin/rhwp-agent/chunkplan.rs:74— src/bin/rhwp-agent/chunkplan.rs:74-86 | src/bin/rhwp-agent/verify.rs:168-180 — 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 `src/bin/rhwp-agent/chunkplan.rs:74` 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 (13 lines × 2) src/bin/rhwp-q/kit/chart_csv.rs:103— src/bin/rhwp-q/kit/chart_csv.rs:103-115 | src/cli/outputs/tabular.rs:422-434 — 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 `src/bin/rhwp-q/kit/chart_csv.rs:103` 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 (13 lines × 2) src/cli/commands/caption_validation.rs:91— src/cli/commands/caption_validation.rs:91-103 | src/document_core/commands/object_ops/picture.rs:75-87 — 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 `src/cli/commands/caption_validation.rs:91` 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) src/cli/commands/edit/document_text.rs:736— src/cli/commands/edit/document_text.rs:736-748 | src/cli/commands/edit/formatting.rs:24-36 — before extracting anything, compare `src/cli/commands/edit/document_text.rs` and `src/cli/commands/edit/formatting.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 218 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 `src/cli/commands/edit/document_text.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 (13 lines × 2) src/cli/commands/edit/formatting.rs:90— src/cli/commands/edit/formatting.rs:90-102 | src/cli/commands/edit/formatting.rs:432-444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/formatting.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 (13 lines × 2) src/cli/commands/edit/formatting.rs:97— src/cli/commands/edit/formatting.rs:97-109 | src/cli/commands/edit/formatting.rs:235-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 `src/cli/commands/edit/formatting.rs:97` 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 (13 lines × 2) src/cli/commands/edit/media.rs:161— src/cli/commands/edit/media.rs:161-173 | src/cli/commands/edit/privacy.rs:121-133 — before extracting anything, compare `src/cli/commands/edit/media.rs` and `src/cli/commands/edit/privacy.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 78 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 `src/cli/commands/edit/media.rs:161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src/cli/commands/generation.rs:29— src/cli/commands/generation.rs:29-41 | src/cli/commands/generation.rs:214-226 — both copies are in the same file, so extract the 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 `src/cli/commands/generation.rs:29` 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) src/cli/outputs/raster.rs:76— src/cli/outputs/raster.rs:76-88 | src/cli/outputs/text.rs:432-444 — before extracting anything, compare `src/cli/outputs/raster.rs` and `src/cli/outputs/text.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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 (13 lines × 2) src/cli/protocol/harness.rs:382— src/cli/protocol/harness.rs:382-394 | src/cli/protocol/trust/governance.rs:247-259 — before extracting anything, compare `src/cli/protocol/harness.rs` and `src/cli/protocol/trust/governance.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/harness.rs:382` 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 (13 lines × 2) src/cli/queries/diagnostics.rs:286— src/cli/queries/diagnostics.rs:286-298 | src/cli/queries/diagnostics.rs:325-337 — both copies are in the same file, so extract the 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) src/diagnostics/hwp5_char_shape_audit.rs:182— src/diagnostics/hwp5_char_shape_audit.rs:182-194 | src/diagnostics/hwp5_ctrl_data_trace.rs:54-66 — before extracting anything, compare `src/diagnostics/hwp5_char_shape_audit.rs` and `src/diagnostics/hwp5_ctrl_data_trace.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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 `src/diagnostics/hwp5_char_shape_audit.rs:182` 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) src/diagnostics/ir_field_sweep.rs:1163— src/diagnostics/ir_field_sweep.rs:1163-1175 | src/serializer/hwpx/roundtrip.rs:1810-1822 — 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 `src/diagnostics/ir_field_sweep.rs:1163` 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 `s` to `&ShapeObject` in one and `&crate::model::shape::ShapeObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13 lines × 2) src/document_core/commands/document.rs:443— src/document_core/commands/document.rs:443-455 | src/document_core/mod.rs:600-612 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/document_core/commands/document.rs:457` calls `collect`, `repeat_n`, `map_err` and `src/document_core/mod.rs:613` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) src/document_core/commands/header_footer_ops.rs:315— src/document_core/commands/header_footer_ops.rs:315-327 | src/document_core/commands/header_footer_ops.rs:1279-1291 — both copies are in the same file, so extract the 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 `src/document_core/commands/header_footer_ops.rs:315` 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) src/document_core/commands/object_ops/chart.rs:916— src/document_core/commands/object_ops/chart.rs:916-928 | src/document_core/commands/object_ops/chart.rs:1062-1074 — both copies are in the same file, so extract the 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, `src/document_core/commands/object_ops/chart.rs:1076` calls `to_vec` and `src/document_core/commands/object_ops/chart.rs:930` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) src/document_core/commands/object_ops/picture.rs:928— src/document_core/commands/object_ops/picture.rs:928-940 | src/document_core/commands/object_ops/table.rs:220-232 — before extracting anything, compare `src/document_core/commands/object_ops/picture.rs` and `src/document_core/commands/object_ops/table.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 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 (13 lines × 2) src/document_core/commands/object_ops/picture.rs:1728— src/document_core/commands/object_ops/picture.rs:1728-1740 | src/document_core/commands/object_ops/table.rs:475-487 — before extracting anything, compare `src/document_core/commands/object_ops/picture.rs` and `src/document_core/commands/object_ops/table.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) src/document_core/commands/paragraph_block/import.rs:237— src/document_core/commands/paragraph_block/import.rs:237-249 | src/document_core/commands/paragraph_block/repeat.rs:158-170 — 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 `src/document_core/commands/paragraph_block/import.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/document_core/commands/paragraph_block/import.rs:250` calls `clone`, `measure`, `to_vec` and `src/document_core/commands/paragraph_block/repeat.rs:171` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) src/document_core/queries/rendering.rs:1136— src/document_core/queries/rendering.rs:1136-1148 | src/document_core/queries/rendering.rs:1150-1162 — both copies are in the same file, so extract the 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) src/document_core/queries/rendering.rs:5718— src/document_core/queries/rendering.rs:5718-5730 | src/document_core/queries/rendering.rs:5741-5753 — both copies are in the same file, so extract the 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) src/document_core/queries/rendering.rs:6311— src/document_core/queries/rendering.rs:6311-6323 | src/document_core/queries/rendering.rs:6336-6348 — both copies are in the same file, so extract the 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 `src/document_core/queries/rendering.rs:6311` 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) src/document_core/queries/rendering.rs:7742— src/document_core/queries/rendering.rs:7742-7754 | src/document_core/queries/rendering.rs:7824-7836 — both copies are in the same file, so extract the 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 `src/document_core/queries/rendering.rs:7742` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src/paint/paint_op.rs:1344— src/paint/paint_op.rs:1344-1356 | src/paint/paint_op.rs:1375-1387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) src/parser/hwp3/johab.rs:144— src/parser/hwp3/johab.rs:144-156 | src/parser/hwp3/johab.rs:163-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 lines × 2) mydocs/tech/investigations/issue-1061/probes/dump_equation_records.rs:171— mydocs/tech/investigations/issue-1061/probes/dump_equation_records.rs:171-184 | mydocs/tech/investigations/issue-1067/probes/dump_polygon_transform.rs:87-100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mydocs/tech/investigations/issue-1061/probes/dump_equation_records.rs:171` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mydocs/tech/investigations/issue-1061/probes/dump_equation_records.rs:185` calls `dump_raw_records` and `mydocs/tech/investigations/issue-1067/probes/dump_polygon_transform.rs:101` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) src/bin/rhwp-agent/safety.rs:785— src/bin/rhwp-agent/safety.rs:785-798 | src/cli/queries/security_inspection.rs:815-828 — 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 `src/bin/rhwp-agent/safety.rs:785` 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) src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:148— src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:148-161 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:149-162 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs` and `src/bin/rhwp-q/commands/rhwp-q-text-layout.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 208 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 `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:148` 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) src/cli/commands/conversion.rs:326— src/cli/commands/conversion.rs:326-339 | src/cli/commands/conversion.rs:527-540 — both copies are in the same file, so extract the 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 `src/cli/commands/conversion.rs:326` 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 (14 lines × 2) src/cli/commands/edit/note_content.rs:465— src/cli/commands/edit/note_content.rs:465-478 | src/cli/commands/edit/note_content.rs:578-591 — both copies are in the same file, so extract the 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 `src/cli/commands/edit/note_content.rs:465` 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) src/cli/outputs/text.rs:109— src/cli/outputs/text.rs:109-122 | src/cli/outputs/text.rs:571-584 — both copies are in the same file, so extract the 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 `src/cli/outputs/text.rs:109` 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 (14 lines × 2) src/cli/protocol/exchange/settlement.rs:28— src/cli/protocol/exchange/settlement.rs:28-41 | src/cli/protocol/harness.rs:114-127 — before extracting anything, compare `src/cli/protocol/exchange/settlement.rs` and `src/cli/protocol/harness.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/exchange/settlement.rs:28` 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) src/cli/queries/diagnostics.rs:15— src/cli/queries/diagnostics.rs:15-28 | src/cli/queries/diagnostics.rs:829-842 — both copies are in the same file, so extract the 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 `src/cli/queries/diagnostics.rs:15` 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) src/cli/queries/diagnostics.rs:596— src/cli/queries/diagnostics.rs:596-609 | src/cli/queries/page_dump.rs:68-81 — 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 `src/cli/queries/diagnostics.rs:596` 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) src/cli/queries/digest.rs:255— src/cli/queries/digest.rs:255-268 | src/cli/queries/digest.rs:304-317 — both copies are in the same file, so extract the 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 `src/cli/queries/digest.rs:255` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) src/cli/queries/structured_objects.rs:44— src/cli/queries/structured_objects.rs:44-57 | src/cli/queries/structured_objects.rs:170-183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/queries/structured_objects.rs:44` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) src/diagnostics/layout_anomaly.rs:376— src/diagnostics/layout_anomaly.rs:376-389 | src/diagnostics/layout_anomaly.rs:646-659 — both copies are in the same file, so extract the 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 `src/diagnostics/layout_anomaly.rs:376` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/diagnostics/layout_anomaly.rs:390` calls `TextLine` and `src/diagnostics/layout_anomaly.rs:660` 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 (14 lines × 2) src/document_core/commands/border_paint_structure.rs:324— src/document_core/commands/border_paint_structure.rs:324-337 | src/parser/pdf/table_paint/compound.rs:126-139 — 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 `src/document_core/commands/border_paint_structure.rs:324` 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 (14 lines × 2) src/document_core/commands/border_paint_structure.rs:605— src/document_core/commands/border_paint_structure.rs:605-618 | src/document_core/commands/border_paint_structure.rs:944-957 — both copies are in the same file, so extract the 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 `src/document_core/commands/border_paint_structure.rs:605` 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) src/document_core/commands/object_ops/picture.rs:367— src/document_core/commands/object_ops/picture.rs:367-380 | src/document_core/commands/object_ops/picture.rs:741-754 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/object_ops/picture.rs:367` 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 (14 lines × 2) src/document_core/commands/object_ops/table.rs:1080— src/document_core/commands/object_ops/table.rs:1080-1093 | src/scaffold/builder.rs:462-475 — before extracting anything, compare `src/document_core/commands/object_ops/table.rs` and `src/scaffold/builder.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/object_ops/table.rs:1080` 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) src/document_core/commands/table_ops.rs:2468— src/document_core/commands/table_ops.rs:2468-2481 | src/document_core/queries/cursor_nav.rs:640-653 — 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 `src/document_core/commands/table_ops.rs:2468` 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) src/document_core/commands/text_editing.rs:6709— src/document_core/commands/text_editing.rs:6709-6722 | src/document_core/commands/text_editing.rs:6824-6837 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:6709` 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, `src/document_core/commands/text_editing.rs:6708` calls `reflow_cell_paragraph_by_path` and `src/document_core/commands/text_editing.rs:6823` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) src/document_core/commands/text_editing.rs:6724— src/document_core/commands/text_editing.rs:6724-6737 | src/document_core/commands/text_editing.rs:6839-6852 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:6724` 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) src/document_core/queries/bookmark_query.rs:58— src/document_core/queries/bookmark_query.rs:58-71 | src/document_core/queries/bookmark_query.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 `src/document_core/queries/bookmark_query.rs:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) src/document_core/queries/cursor_nav.rs:1958— src/document_core/queries/cursor_nav.rs:1958-1971 | src/document_core/queries/cursor_nav.rs:2108-2121 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_nav.rs:1958` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) src/parser/hwpx/header.rs:1792— src/parser/hwpx/header.rs:1792-1805 | src/parser/hwpx/section.rs:4433-4446 — before extracting anything, compare `src/parser/hwpx/header.rs` and `src/parser/hwpx/section.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 162 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 `src/parser/hwpx/header.rs:1792` 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) src/parser/hwpx/section.rs:4771— src/parser/hwpx/section.rs:4771-4784 | src/parser/hwpx/section.rs:5130-5143 — both copies are in the same file, so extract the 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 `src/parser/hwpx/section.rs:4771` 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) src/parser/pdf/structured_lowering.rs:2296— src/parser/pdf/structured_lowering.rs:2296-2309 | tools/pdf-ir-poc/src/structured_lowering.rs:817-830 — before extracting anything, compare `src/parser/pdf/structured_lowering.rs` and `tools/pdf-ir-poc/src/structured_lowering.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 309 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/structured_lowering.rs:2296` 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) src/renderer/composer/stored_lines_runs.inc.rs:385— src/renderer/composer/stored_lines_runs.inc.rs:385-398 | src/renderer/composer/stored_lines_runs.inc.rs:458-471 — both copies are in the same file, so extract the 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 `src/renderer/composer/stored_lines_runs.inc.rs:385` 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
ClassTooLong: HwpDocument rhwp-studio/public/rhwp.js:73— ClassTooLong — 7330 significant lines (blank, comment-only and punctuation-only lines excluded), 565 methods. The bar is 400 significant lines; this is 6930 over it, 18.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: HwpDocument src/wasm_api.rs:433— ClassTooLong — 6644 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 582 methods, 7 blocks, lines 433-10370. The bar is 400 significant lines; this is 6244 over it, 16.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: CanvasKitReadinessBlocker rhwp-studio/src/view/canvaskit-renderer.ts:376— ClassTooLong — 4824 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 4424 over it, 12.06× 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: InputHandler rhwp-studio/src/engine/input-handler.ts:333— ClassTooLong — 4188 significant lines (blank, comment-only and punctuation-only lines excluded), 294 methods. The bar is 400 significant lines; this is 3788 over it, 10.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: HeightMeasurer src/renderer/height_measurer.rs:1819— ClassTooLong — 3163 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 63 methods, 3 blocks, lines 1819-7033. The bar is 400 significant lines; this is 2763 over it, 7.91× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WebCanvasRenderer src/renderer/web_canvas.rs:413— ClassTooLong — 2984 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 61 methods, 6 blocks, lines 413-4530. The bar is 400 significant lines; this is 2584 over it, 7.46× 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: SvgRenderer src/renderer/svg.rs:96— ClassTooLong — 2807 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 62 methods, 3 blocks, lines 96-4280. The bar is 400 significant lines; this is 2407 over it, 7.02× 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: WasmBridge rhwp-studio/src/core/wasm-bridge.ts:339— ClassTooLong — 2455 significant lines (blank, comment-only and punctuation-only lines excluded), 393 methods. The bar is 400 significant lines; this is 2055 over it, 6.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TypesetEngine src/renderer/typeset.rs:371— ClassTooLong — 2299 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 182 methods, 2 blocks, lines 371-6707. The bar is 400 significant lines; this is 1899 over it, 5.75× 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: Paragraph src/model/paragraph.rs:38— ClassTooLong — 2127 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 87 methods, 3 blocks, lines 38-3932. The bar is 400 significant lines; this is 1727 over it, 5.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: PicturePropsDialog rhwp-studio/src/ui/picture-props-dialog.ts:83— ClassTooLong — 1932 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 1532 over it, 4.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: HeightCursor src/renderer/height_cursor.rs:186— ClassTooLong — 1929 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 2 blocks, lines 186-2916. The bar is 400 significant lines; this is 1529 over it, 4.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: CanvasView rhwp-studio/src/view/canvas-view.ts:111— ClassTooLong — 1718 significant lines (blank, comment-only and punctuation-only lines excluded), 99 methods. The bar is 400 significant lines; this is 1318 over it, 4.30× 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: SVGPlayer src/wmf/converter/svg/mod.rs:26— ClassTooLong — 1687 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 9 methods, 3 blocks, lines 26-2446. The bar is 400 significant lines; this is 1287 over it, 4.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CursorState rhwp-studio/src/engine/cursor.ts:50— ClassTooLong — 1656 significant lines (blank, comment-only and punctuation-only lines excluded), 121 methods. The bar is 400 significant lines; this is 1256 over it, 4.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SkiaLayerRenderer src/renderer/skia/renderer.rs:496— ClassTooLong — 1582 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 36 methods, 4 blocks, lines 496-2610. The bar is 400 significant lines; this is 1182 over it, 3.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: HwpCtrl npm/hwpctrl-ocx/src/index.mjs:980— ClassTooLong — 1524 significant lines (blank, comment-only and punctuation-only lines excluded), 104 methods. The bar is 400 significant lines; this is 1124 over it, 3.81× 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: Table src/model/table.rs:44— ClassTooLong — 1244 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 62 methods, 2 blocks, lines 44-2638. The bar is 400 significant lines; this is 844 over it, 3.11× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TableCellPropsDialog rhwp-studio/src/ui/table-cell-props-dialog.ts:42— ClassTooLong — 1156 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 756 over it, 2.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: TypesetState src/renderer/typeset/state.rs:1455— ClassTooLong — 974 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 305 methods, 4 blocks, lines 36-1471. The bar is 400 significant lines; this is 574 over it, 2.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: PageRenderer rhwp-studio/src/view/page-renderer.ts:93— ClassTooLong — 957 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods. The bar is 400 significant lines; this is 557 over it, 2.39× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ReadState src/parser/hml/reader.rs:193— ClassTooLong — 909 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 59 methods, 2 blocks, lines 193-1434. The bar is 400 significant lines; this is 509 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SkiaTextReplay src/renderer/skia/text_replay.rs:28— ClassTooLong — 868 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 2 methods, 2 blocks, lines 28-1150. The bar is 400 significant lines; this is 468 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CellBorderBgDialog rhwp-studio/src/ui/cell-border-bg-dialog.ts:85— ClassTooLong — 817 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 417 over it, 2.04× 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: CharShapeDialog rhwp-studio/src/ui/char-shape-dialog.ts:105— ClassTooLong — 755 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 355 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.
TypesetEngine::emit_table_fragment (cognitive 408) src/renderer/typeset/table/continuation/fragment/emit.rs:13— TypesetEngine::emit_table_fragment has cognitive complexity 408 (threshold 15). Drivers by points: if/else 168 (244 pts), boolean chains 155, match/switch 3 (6 pts), loops 1 (3 pts) (nesting depth added 81). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypesetEngine::prepare_block_table_entry (cognitive 401) src/renderer/typeset/table/block/entry.rs:15— TypesetEngine::prepare_block_table_entry has cognitive complexity 401 (threshold 15). Drivers by points: if/else 151 (237 pts), boolean chains 148, match/switch 7 (9 pts), loops 5 (7 pts) (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.
TypesetEngine::scan_ordinary_row_step (cognitive 395) src/renderer/typeset/table/scan/runner/row_step.rs:15— TypesetEngine::scan_ordinary_row_step has cognitive complexity 395 (threshold 15). Drivers by points: if/else 138 (253 pts), boolean chains 141, loops 1 (nesting depth added 115). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypesetEngine::typeset_endnote_paragraphs (cognitive 320) src/renderer/typeset/notes/endnotes/paragraph.rs:43— TypesetEngine::typeset_endnote_paragraphs has cognitive complexity 320 (threshold 15). Drivers by points: if/else 107 (191 pts), boolean chains 103, loops 5 (15 pts), match/switch 4 (11 pts) (nesting depth added 101). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypesetEngine::place_paragraph_controls_with_storage (cognitive 277) src/renderer/typeset/section/controls.rs:39— TypesetEngine::place_paragraph_controls_with_storage has cognitive complexity 277 (threshold 15). Drivers by points: if/else 40 (175 pts), loops 7 (37 pts), match/switch 9 (37 pts), boolean chains 28 (nesting depth added 193). 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.
TypesetEngine::prepare_table_fragment_budget (cognitive 261) src/renderer/typeset/table/continuation/fragment/budget.rs:16— TypesetEngine::prepare_table_fragment_budget has cognitive complexity 261 (threshold 15). Drivers by points: if/else 114 (129 pts), boolean chains 124, match/switch 3 (6 pts), loops 2 (nesting depth added 18). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
TypesetEngine::place_table_with_text (cognitive 247) src/renderer/typeset.rs:5062— TypesetEngine::place_table_with_text has cognitive complexity 247 (threshold 15). Drivers by points: if/else 106 (164 pts), boolean chains 81, loops 1 (2 pts) (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypesetEngine::prepare_block_table_continuation (cognitive 238) src/renderer/typeset/table/block/prepare.rs:18— TypesetEngine::prepare_block_table_continuation has cognitive complexity 238 (threshold 15). Drivers by points: boolean chains 119, if/else 85 (115 pts), loops 2, match/switch 2 (nesting depth added 30). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
TypesetEngine::scan_table_fragment (cognitive 181) src/renderer/typeset/table/continuation/fragment/scan.rs:26— TypesetEngine::scan_table_fragment has cognitive complexity 181 (threshold 15). Drivers by points: if/else 78 (136 pts), boolean chains 45 (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypesetEngine::place_paragraph_flow_with_storage (cognitive 141) src/renderer/typeset/section/flow.rs:10— TypesetEngine::place_paragraph_flow_with_storage has cognitive complexity 141 (threshold 15). Drivers by points: if/else 37 (107 pts), boolean chains 23, loops 2 (9 pts), match/switch 1 (2 pts) (nesting depth added 78). 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.
TypesetEngine::prepare_endnote_emit (cognitive 118) src/renderer/typeset/notes/endnotes/prepare.rs:20— TypesetEngine::prepare_endnote_emit has cognitive complexity 118 (threshold 15). Drivers by points: if/else 35 (82 pts), boolean chains 35, loops 1 (nesting depth added 47). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TypesetEngine::typeset_tac_table (cognitive 101) src/renderer/typeset.rs:4290— TypesetEngine::typeset_tac_table has cognitive complexity 101 (threshold 15). Drivers by points: if/else 48 (58 pts), boolean chains 41, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
TypesetEngine::apply_stored_paragraph_boundary_with_storage (cognitive 95) src/renderer/typeset/section/stored_reset.rs:44— TypesetEngine::apply_stored_paragraph_boundary_with_storage has cognitive complexity 95 (threshold 15). Drivers by points: boolean chains 46, if/else 15 (40 pts), match/switch 3 (9 pts) (nesting depth added 31). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
TypesetEngine::finish_paragraph_anchor_state (cognitive 93) src/renderer/typeset/section/post_flow.rs:71— TypesetEngine::finish_paragraph_anchor_state has cognitive complexity 93 (threshold 15). Drivers by points: if/else 26 (66 pts), boolean chains 15, match/switch 3 (12 pts) (nesting depth added 49). 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.
TypesetEngine::query_initial_fit (cognitive 90) src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:76— TypesetEngine::query_initial_fit has cognitive complexity 90 (threshold 15). Drivers by points: if/else 45 (52 pts), boolean chains 33, loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TypesetEngine::replay_endnote_column (cognitive 83) src/renderer/typeset/notes/endnotes/measure.rs:213— TypesetEngine::replay_endnote_column has cognitive complexity 83 (threshold 15). Drivers by points: if/else 24 (51 pts), loops 6 (12 pts), boolean chains 11, match/switch 4 (9 pts) (nesting depth added 38). 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.
TypesetEngine::absorb_section_tail_with_storage (cognitive 78) src/renderer/typeset/section/tail.rs:40— TypesetEngine::absorb_section_tail_with_storage has cognitive complexity 78 (threshold 15). Drivers by points: if/else 27 (46 pts), boolean chains 22, match/switch 3 (9 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.
TypesetEngine::register_body_footnote (cognitive 71) src/renderer/typeset/notes/footnotes/body.rs:15— TypesetEngine::register_body_footnote has cognitive complexity 71 (threshold 15). Drivers by points: if/else 24 (43 pts), boolean chains 23, match/switch 2 (5 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypesetEngine::query_tail_fit (cognitive 70) src/renderer/typeset/notes/endnotes/paragraph/tail_fit.rs:110— TypesetEngine::query_tail_fit has cognitive complexity 70 (threshold 15). Drivers by points: boolean chains 60, if/else 9 (10 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.
TypesetEngine::prepare_paragraph_boundary_with_storage (cognitive 63) src/renderer/typeset/section/entry.rs:55— TypesetEngine::prepare_paragraph_boundary_with_storage has cognitive complexity 63 (threshold 15). Drivers by points: boolean chains 36, if/else 22 (27 pts) (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
TypesetEngine::record_stored_fragment_rows (cognitive 62) src/renderer/typeset/table/continuation/fragment/physical_rows.rs:602— TypesetEngine::record_stored_fragment_rows has cognitive complexity 62 (threshold 15). Drivers by points: if/else 24 (45 pts), boolean chains 16, 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.
TypesetEngine::compute_endnote_metrics (cognitive 56) src/renderer/typeset/notes/endnotes/metrics.rs:12— TypesetEngine::compute_endnote_metrics has cognitive complexity 56 (threshold 15). Drivers by points: if/else 23 (42 pts), boolean chains 14 (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.
TypesetEngine::scan_block_table_split_rows (cognitive 54) src/renderer/typeset/table/scan/runner.rs:44— TypesetEngine::scan_block_table_split_rows has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (43 pts), boolean chains 9, loops 2 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TypesetEngine::process_multicolumn_break (cognitive 51) src/renderer/typeset/section/columns.rs:8— TypesetEngine::process_multicolumn_break has cognitive complexity 51 (threshold 15). Drivers by points: if/else 25 (34 pts), boolean chains 12, loops 2 (3 pts), match/switch 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.
TypesetEngine::run_section_with_storage (cognitive 51) src/renderer/typeset/section.rs:22— TypesetEngine::run_section_with_storage has cognitive complexity 51 (threshold 15). Drivers by points: if/else 23 (42 pts), boolean chains 8, 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.
Duplicated block (15 lines × 2) src/bin/rhwp-agent/difftext.rs:253— src/bin/rhwp-agent/difftext.rs:253-267 | src/bin/rhwp-agent/evidence.rs:42-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-agent/difftext.rs:253` 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 (15 lines × 2) src/bin/rhwp-agent/explaincmd.rs:11— src/bin/rhwp-agent/explaincmd.rs:11-25 | src/bin/rhwp-agent/inspect.rs:10-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) src/bin/rhwp-agent/stats.rs:26— src/bin/rhwp-agent/stats.rs:26-40 | src/bin/rhwp-agent/stats.rs:71-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 `src/bin/rhwp-agent/stats.rs:26` 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 (15 lines × 2) src/cli/commands/edit/cells.rs:351— src/cli/commands/edit/cells.rs:351-365 | src/cli/commands/tabular_import.rs:324-338 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/tabular_import.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/cells.rs:351` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2) src/cli/commands/edit/privacy.rs:252— src/cli/commands/edit/privacy.rs:252-266 | src/cli/commands/edit/text.rs:167-181 — before extracting anything, compare `src/cli/commands/edit/privacy.rs` and `src/cli/commands/edit/text.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 98 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 `src/cli/commands/edit/privacy.rs:252` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) src/cli/commands/edit/tables/grid.rs:122— src/cli/commands/edit/tables/grid.rs:122-136 | src/cli/commands/edit/tables/grid.rs:478-492 — both copies are in the same file, so extract the 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 `src/cli/commands/edit/tables/grid.rs:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) src/cli/outputs/doclang.rs:43— src/cli/outputs/doclang.rs:43-57 | src/cli/outputs/vector.rs:620-634 — 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 `src/cli/outputs/doclang.rs:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) src/cli/outputs/kitty.rs:128— src/cli/outputs/kitty.rs:128-142 | src/cli/outputs/sixel.rs:128-142 — before extracting anything, compare `src/cli/outputs/kitty.rs` and `src/cli/outputs/sixel.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 128 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 `src/cli/outputs/kitty.rs:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) src/document_core/commands/table_ops.rs:2281— src/document_core/commands/table_ops.rs:2281-2295 | src/document_core/commands/table_ops.rs:2297-2311 — both copies are in the same file, so extract the 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) src/document_core/queries/doc_tree_nav.rs:549— src/document_core/queries/doc_tree_nav.rs:549-563 | src/document_core/queries/doc_tree_nav.rs:859-873 — both copies are in the same file, so extract the 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 `src/document_core/queries/doc_tree_nav.rs:549` 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 (15 lines × 2) src/document_core/queries/rendering.rs:4570— src/document_core/queries/rendering.rs:4570-4584 | src/document_core/queries/rendering.rs:4614-4628 — both copies are in the same file, so extract the 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 `src/document_core/queries/rendering.rs:4570` 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 (15 lines × 2) src/model/table.rs:1803— src/model/table.rs:1803-1817 | src/model/table.rs:1932-1946 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/model/table.rs:1803` 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) src/native_host/presentation.rs:813— src/native_host/presentation.rs:813-827 | src/native_host/presentation.rs:929-943 — both copies are in the same file, so extract the 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 `src/native_host/presentation.rs:813` 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) src/paint/dot_leader.rs:126— src/paint/dot_leader.rs:126-140 | src/renderer/arrow.rs:94-108 — 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 (15 lines × 2) src/parser/cfb_reader.rs:1013— src/parser/cfb_reader.rs:1013-1027 | src/parser/cfb_reader.rs:1037-1051 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) src/parser/hwp3/mod.rs:5613— src/parser/hwp3/mod.rs:5613-5627 | src/parser/hwp3/mod.rs:5686-5700 — both copies are in the same file, so extract the 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 `src/parser/hwp3/mod.rs:5613` 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) src/parser/hwpx/section.rs:3379— src/parser/hwpx/section.rs:3379-3393 | src/parser/hwpx/section.rs:4003-4017 — both copies are in the same file, so extract the 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 `src/parser/hwpx/section.rs:3379` 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 (15 lines × 2) src/parser/hwpx/section.rs:7761— src/parser/hwpx/section.rs:7761-7775 | src/serializer/control.rs:2439-2453 — 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 (15 lines × 2) src/parser/pdf/structured_lowering.rs:1463— src/parser/pdf/structured_lowering.rs:1463-1477 | tools/pdf-ir-poc/src/structured_lowering.rs:387-401 — before extracting anything, compare `src/parser/pdf/structured_lowering.rs` and `tools/pdf-ir-poc/src/structured_lowering.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 309 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/structured_lowering.rs:1463` 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) src/parser/pdf/structured_lowering.rs:2121— src/parser/pdf/structured_lowering.rs:2121-2135 | tools/pdf-ir-poc/src/structured_lowering.rs:777-791 — before extracting anything, compare `src/parser/pdf/structured_lowering.rs` and `tools/pdf-ir-poc/src/structured_lowering.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 309 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (15 lines × 2) src/renderer/composer/stored_lines_runs.inc.rs:493— src/renderer/composer/stored_lines_runs.inc.rs:493-507 | src/renderer/composer/stored_lines_runs.inc.rs:545-559 — both copies are in the same file, so extract the 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 `src/renderer/composer/stored_lines_runs.inc.rs:493` 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) src/renderer/equation/brace_stretch.rs:100— src/renderer/equation/brace_stretch.rs:100-114 | src/renderer/equation/round_stretch.rs:33-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) src/renderer/float_placement.rs:2613— src/renderer/float_placement.rs:2613-2627 | src/renderer/float_placement.rs:2654-2668 — both copies are in the same file, so extract the 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 `src/renderer/float_placement.rs:2613` 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) src/renderer/html.rs:546— src/renderer/html.rs:546-560 | src/renderer/svg.rs:5536-5550 — before extracting anything, compare `src/renderer/html.rs` and `src/renderer/svg.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 76 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 `src/renderer/html.rs:546` 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) src/renderer/layout/border_rendering.rs:1203— src/renderer/layout/border_rendering.rs:1203-1217 | src/renderer/layout/border_rendering.rs:1223-1237 — both copies are in the same file, so extract the 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 `src/renderer/layout/border_rendering.rs:1203` 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.
TypesetEngine::emit_table_fragment (cyclomatic 288) src/renderer/typeset/table/continuation/fragment/emit.rs:13— TypesetEngine::emit_table_fragment has cyclomatic complexity 288 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypesetEngine::prepare_block_table_entry (cyclomatic 284) src/renderer/typeset/table/block/entry.rs:15— TypesetEngine::prepare_block_table_entry has cyclomatic complexity 284 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypesetEngine::scan_ordinary_row_step (cyclomatic 258) src/renderer/typeset/table/scan/runner/row_step.rs:15— TypesetEngine::scan_ordinary_row_step has cyclomatic complexity 258 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypesetEngine::prepare_table_fragment_budget (cyclomatic 203) src/renderer/typeset/table/continuation/fragment/budget.rs:16— TypesetEngine::prepare_table_fragment_budget has cyclomatic complexity 203 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TypesetEngine::typeset_endnote_paragraphs (cyclomatic 199) src/renderer/typeset/notes/endnotes/paragraph.rs:43— TypesetEngine::typeset_endnote_paragraphs has cyclomatic complexity 199 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypesetEngine::prepare_block_table_continuation (cyclomatic 186) src/renderer/typeset/table/block/prepare.rs:18— TypesetEngine::prepare_block_table_continuation has cyclomatic complexity 186 (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.
TypesetEngine::place_table_with_text (cyclomatic 169) src/renderer/typeset.rs:5062— TypesetEngine::place_table_with_text has cyclomatic complexity 169 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypesetEngine::scan_table_fragment (cyclomatic 109) src/renderer/typeset/table/continuation/fragment/scan.rs:26— TypesetEngine::scan_table_fragment has cyclomatic complexity 109 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypesetEngine::place_paragraph_controls_with_storage (cyclomatic 87) src/renderer/typeset/section/controls.rs:39— TypesetEngine::place_paragraph_controls_with_storage has cyclomatic complexity 87 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypesetEngine::typeset_tac_table (cyclomatic 77) src/renderer/typeset.rs:4290— TypesetEngine::typeset_tac_table has cyclomatic complexity 77 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TypesetEngine::prepare_endnote_emit (cyclomatic 69) src/renderer/typeset/notes/endnotes/prepare.rs:20— TypesetEngine::prepare_endnote_emit 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.
TypesetEngine::query_tail_fit (cyclomatic 66) src/renderer/typeset/notes/endnotes/paragraph/tail_fit.rs:110— TypesetEngine::query_tail_fit has cyclomatic complexity 66 (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.
TypesetEngine::query_initial_fit (cyclomatic 62) src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:76— TypesetEngine::query_initial_fit has cyclomatic complexity 62 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TypesetEngine::apply_stored_paragraph_boundary_with_storage (cyclomatic 62) src/renderer/typeset/section/stored_reset.rs:44— TypesetEngine::apply_stored_paragraph_boundary_with_storage has cyclomatic complexity 62 (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.
TypesetEngine::place_paragraph_flow_with_storage (cyclomatic 61) src/renderer/typeset/section/flow.rs:10— TypesetEngine::place_paragraph_flow_with_storage has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypesetEngine::prepare_paragraph_boundary_with_storage (cyclomatic 57) src/renderer/typeset/section/entry.rs:55— TypesetEngine::prepare_paragraph_boundary_with_storage has cyclomatic complexity 57 (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.
TypesetEngine::absorb_section_tail_with_storage (cyclomatic 50) src/renderer/typeset/section/tail.rs:40— TypesetEngine::absorb_section_tail_with_storage has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypesetEngine::replay_endnote_column (cyclomatic 46) src/renderer/typeset/notes/endnotes/measure.rs:213— TypesetEngine::replay_endnote_column 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.
TypesetEngine::register_body_footnote (cyclomatic 44) src/renderer/typeset/notes/footnotes/body.rs:15— TypesetEngine::register_body_footnote 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.
TypesetEngine::finish_paragraph_anchor_state (cyclomatic 42) src/renderer/typeset/section/post_flow.rs:71— TypesetEngine::finish_paragraph_anchor_state 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.
TypesetEngine::query_whole_table_fit (cyclomatic 39) src/renderer/typeset/table/block/whole_fit.rs:472— TypesetEngine::query_whole_table_fit has cyclomatic complexity 39 (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.
TypesetEngine::record_stored_fragment_rows (cyclomatic 38) src/renderer/typeset/table/continuation/fragment/physical_rows.rs:602— TypesetEngine::record_stored_fragment_rows has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TypesetEngine::query_new_note_fit (cyclomatic 37) src/renderer/typeset/notes/endnotes/paragraph/new_note_fit.rs:80— TypesetEngine::query_new_note_fit has cyclomatic complexity 37 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
TypesetEngine::stored_fragment_row_plan (cyclomatic 36) src/renderer/typeset/table/continuation/fragment/physical_rows.rs:313— TypesetEngine::stored_fragment_row_plan 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.
TypesetEngine::vpos_snap_current_height_with_storage (cyclomatic 35) src/renderer/typeset/section/vpos.rs:130— TypesetEngine::vpos_snap_current_height_with_storage has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Duplicated block (16 lines × 2) bindings/Native/src/gpu_d3d.rs:227— bindings/Native/src/gpu_d3d.rs:227-242 | bindings/Native/src/gpu_metal.rs:236-251 — before extracting anything, compare `bindings/Native/src/gpu_d3d.rs` and `bindings/Native/src/gpu_metal.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 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 `bindings/Native/src/gpu_d3d.rs:227` 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 (16 lines × 2) src/bin/rhwp-agent/difftext.rs:250— src/bin/rhwp-agent/difftext.rs:250-265 | src/bin/rhwp-agent/scan.rs:89-104 — 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 `src/bin/rhwp-agent/difftext.rs:250` 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 (16 lines × 2) src/bin/rhwp-agent/lookups.rs:79— src/bin/rhwp-agent/lookups.rs:79-94 | src/bin/rhwp-agent/safety.rs:374-389 — before extracting anything, compare `src/bin/rhwp-agent/lookups.rs` and `src/bin/rhwp-agent/safety.rs` as WHOLE FILES: this scan already matched 4 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 `src/bin/rhwp-agent/lookups.rs:79` 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) src/bin/rhwp-agent/safety.rs:229— src/bin/rhwp-agent/safety.rs:229-244 | src/cli/queries/security_inspection.rs:859-874 — 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 `src/bin/rhwp-agent/safety.rs:229` 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 (16 lines × 2) src/bin/rhwp-q/more/main.rs:24— src/bin/rhwp-q/more/main.rs:24-39 | src/bin/rhwp-q/pack/main.rs:24-39 — 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 `src/bin/rhwp-q/more/main.rs:24` 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 (16 lines × 2) src/cli/commands/edit/equations.rs:157— src/cli/commands/edit/equations.rs:157-172 | src/cli/commands/edit/tables/insert.rs:52-67 — before extracting anything, compare `src/cli/commands/edit/equations.rs` and `src/cli/commands/edit/tables/insert.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/equations.rs:157` 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 (16 lines × 2) src/cli/commands/edit/formatting.rs:655— src/cli/commands/edit/formatting.rs:655-670 | src/cli/commands/edit/formatting.rs:790-805 — both copies are in the same file, so extract the 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 `src/cli/commands/edit/formatting.rs:655` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) src/cli/outputs/tabular.rs:233— src/cli/outputs/tabular.rs:233-248 | src/cli/outputs/tabular.rs:473-488 — both copies are in the same file, so extract the 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 `src/cli/outputs/tabular.rs:233` 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) src/diagnostics/hwp5_cell_header_probe.rs:905— src/diagnostics/hwp5_cell_header_probe.rs:905-920 | src/diagnostics/hwp5_mel_personnel_probe.rs:819-834 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_mel_personnel_probe.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 503 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 `src/diagnostics/hwp5_cell_header_probe.rs:905` 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) src/diagnostics/hwp5_roundtrip_batch.rs:367— src/diagnostics/hwp5_roundtrip_batch.rs:367-382 | src/diagnostics/hwpx_roundtrip_batch.rs:245-260 — before extracting anything, compare `src/diagnostics/hwp5_roundtrip_batch.rs` and `src/diagnostics/hwpx_roundtrip_batch.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 152 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 `src/diagnostics/hwp5_roundtrip_batch.rs:367` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) src/document_core/commands/text_editing.rs:4407— src/document_core/commands/text_editing.rs:4407-4422 | src/document_core/commands/text_editing.rs:4437-4452 — both copies are in the same file, so extract the 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) src/document_core/queries/cursor_nav.rs:859— src/document_core/queries/cursor_nav.rs:859-874 | src/document_core/queries/cursor_nav.rs:969-984 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/queries/cursor_nav.rs:859` 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) src/document_core/queries/field_query.rs:2507— src/document_core/queries/field_query.rs:2507-2522 | src/document_core/queries/memo_query.rs:1774-1789 — before extracting anything, compare `src/document_core/queries/field_query.rs` and `src/document_core/queries/memo_query.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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 (16 lines × 2) src/document_core/queries/grep.rs:377— src/document_core/queries/grep.rs:377-392 | src/document_core/queries/grep.rs:460-475 — both copies are in the same file, so extract the 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 `src/document_core/queries/grep.rs:377` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) src/document_core/queries/hwpctrl_sets.rs:1030— src/document_core/queries/hwpctrl_sets.rs:1030-1045 | src/document_core/queries/hwpctrl_sets.rs:1104-1119 — both copies are in the same file, so extract the 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 `src/document_core/queries/hwpctrl_sets.rs:1030` 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) src/document_core/queries/rendering.rs:7628— src/document_core/queries/rendering.rs:7628-7643 | src/document_core/queries/rendering.rs:7868-7883 — both copies are in the same file, so extract the 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) src/native_host/gpu_d3d.rs:364— src/native_host/gpu_d3d.rs:364-379 | src/native_host/gpu_metal.rs:250-265 — before extracting anything, compare `src/native_host/gpu_d3d.rs` and `src/native_host/gpu_metal.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 170 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 `src/native_host/gpu_d3d.rs:364` 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) src/parser/hwpx/header.rs:792— src/parser/hwpx/header.rs:792-807 | src/parser/hwpx/header.rs:824-839 — both copies are in the same file, so extract the 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 `src/parser/hwpx/header.rs:792` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/parser/hwpx/header.rs:841` calls `parse_color` and `src/parser/hwpx/header.rs:808` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) src/parser/pdf/table_detection.rs:396— src/parser/pdf/table_detection.rs:396-411 | tools/pdf-ir-poc/src/table_detection.rs:179-194 — before extracting anything, compare `src/parser/pdf/table_detection.rs` and `tools/pdf-ir-poc/src/table_detection.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/table_detection.rs:396` 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) src/parser/pdf/table_detection.rs:466— src/parser/pdf/table_detection.rs:466-481 | tools/pdf-ir-poc/src/table_detection.rs:240-255 — before extracting anything, compare `src/parser/pdf/table_detection.rs` and `tools/pdf-ir-poc/src/table_detection.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/table_detection.rs:466` 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) src/renderer/height_measurer.rs:4597— src/renderer/height_measurer.rs:4597-4612 | src/renderer/height_measurer.rs:4646-4661 — both copies are in the same file, so extract the 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) src/renderer/layer_renderer.rs:610— src/renderer/layer_renderer.rs:610-625 | src/renderer/layer_renderer.rs:629-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.
Duplicated block (16 lines × 2) src/renderer/layout.rs:9730— src/renderer/layout.rs:9730-9745 | src/renderer/layout.rs:9754-9769 — both copies are in the same file, so extract the 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 `src/renderer/layout.rs:9730` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) src/renderer/layout/shape_layout.rs:2304— src/renderer/layout/shape_layout.rs:2304-2319 | src/renderer/layout/shape_layout.rs:2427-2442 — both copies are in the same file, so extract the 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 `src/renderer/layout/shape_layout.rs:2304` 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, `src/renderer/layout/shape_layout.rs:2302` calls `has_saved_affine_geometry`, `is_some` and `src/renderer/layout/shape_layout.rs:2425` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) src/renderer/layout/shape_layout.rs:4991— src/renderer/layout/shape_layout.rs:4991-5006 | src/renderer/layout/table_cell_content.rs:627-642 — before extracting anything, compare `src/renderer/layout/shape_layout.rs` and `src/renderer/layout/table_cell_content.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 185 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 `src/renderer/layout/shape_layout.rs:4991` 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.
TooManyMethods: DocumentCore src/document_core/mod.rs:208— TooManyMethods — 1079 methods, declared across 85 files: queries/rendering.rs (136), commands/text_editing.rs (87), commands/document.rs (81), commands/table_ops.rs (65), +81 more file(s). The bar is 30 methods; this is 1049 over it, 35.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: LayoutEngine src/renderer/layout.rs:3649— TooManyMethods — 732 methods, declared across 72 files: layout/table_layout.rs (276), renderer/layout.rs (127), layout/paragraph_layout.rs (25), layout/shape_layout.rs (22), +68 more file(s). The bar is 30 methods; this is 702 over it, 24.40× 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: HwpDocument src/wasm_api.rs:433— TooManyMethods — 582 methods, declared across 10 files: src/wasm_api.rs (536), wasm_api/layer_export.rs (21), wasm_api/host_font_environment.rs (6), wasm_api/hyperlink.rs (6), +6 more file(s). The bar is 30 methods; this is 552 over it, 19.40× 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: HwpDocument rhwp-studio/public/rhwp.js:73— TooManyMethods — 565 methods. The bar is 30 methods; this is 535 over it, 18.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WasmBridge rhwp-studio/src/core/wasm-bridge.ts:339— TooManyMethods — 393 methods. The bar is 30 methods; this is 363 over it, 13.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: TypesetState src/renderer/typeset/state.rs:1455— TooManyMethods — 305 methods, declared across 11 files: state/commands.rs (120), typeset/state.rs (107), state/transition.rs (35), state/notes.rs (22), +7 more file(s). The bar is 30 methods; this is 275 over it, 10.17× 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: InputHandler rhwp-studio/src/engine/input-handler.ts:333— TooManyMethods — 294 methods. The bar is 30 methods; this is 264 over it, 9.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TypesetEngine src/renderer/typeset.rs:371— TooManyMethods — 182 methods, declared across 51 files: renderer/typeset.rs (42), endnotes/fit.rs (26), paragraph/reflow_fit.rs (12), endnotes/measure.rs (8), +47 more file(s). The bar is 30 methods; this is 152 over it, 6.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: CanvasKitLayerRenderer rhwp-studio/src/view/canvaskit-renderer.ts:383— TooManyMethods — 138 methods. The bar is 30 methods; this is 108 over it, 4.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: CursorState rhwp-studio/src/engine/cursor.ts:50— TooManyMethods — 121 methods. The bar is 30 methods; this is 91 over it, 4.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: HwpCtrl npm/hwpctrl-ocx/src/index.mjs:980— TooManyMethods — 104 methods. The bar is 30 methods; this is 74 over it, 3.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: CanvasView rhwp-studio/src/view/canvas-view.ts:111— TooManyMethods — 99 methods. The bar is 30 methods; this is 69 over it, 3.30× 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: Paragraph src/model/paragraph.rs:38— TooManyMethods — 87 methods, declared across 2 files: model/paragraph.rs (85), paragraph/control_source.rs (2). The bar is 30 methods; this is 57 over it, 2.90× 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: EqParser src/renderer/equation/parser.rs:62— TooManyMethods — 73 methods, declared across 13 files: equation/parser.rs (24), equation/parser_fractions.rs (11), equation/parser_groups.rs (8), equation/parser_structures.rs (6), +9 more file(s). The bar is 30 methods; this is 43 over it, 2.43× 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: EqLayout src/renderer/equation/layout.rs:51— TooManyMethods — 66 methods, declared across 24 files: equation/layout.rs (14), layout/matrix_geometry.rs (7), layout/script_geometry.rs (7), layout/legacy_original_geometry.rs (6), +20 more file(s). The bar is 30 methods; this is 36 over it, 2.20× 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: NativeEditor src/native_host/editor.rs:71— TooManyMethods — 63 methods, declared across 4 files: native_host/editor.rs (45), native_host/commands.rs (8), native_host/ime_edit.rs (6), native_host/clipboard.rs (4). The bar is 30 methods; this is 33 over it, 2.10× 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: HeightMeasurer src/renderer/height_measurer.rs:1819— TooManyMethods — 63 methods, declared across 2 files: renderer/height_measurer.rs (59), height_measurer/reflow_cell_frames.rs (4). The bar is 30 methods; this is 33 over it, 2.10× 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: Table src/model/table.rs:44— TooManyMethods — 62 methods, declared across 5 files: model/table.rs (51), table/contradictory_grid.rs (4), model/table_inline_grid.rs (3), table/row_frames.rs (2), +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: SvgRenderer src/renderer/svg.rs:96— TooManyMethods — 62 methods, declared across 3 files: renderer/svg.rs (58), svg/char_overlap.rs (3), svg/pua_glyph.rs (1). 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: WebCanvasRenderer src/renderer/web_canvas.rs:413— TooManyMethods — 61 methods, declared across 5 files: renderer/web_canvas.rs (56), web_canvas/text_italic.rs (2), web_canvas/char_overlap.rs (1), web_canvas/hft_outline.rs (1), +1 more file(s). 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: ReadState src/parser/hml/reader.rs:193— TooManyMethods — 59 methods. The bar is 30 methods; this is 29 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.
TooManyMethods: EndnoteShapeDialog rhwp-studio/src/ui/endnote-shape-dialog.ts:115— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× 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: PageRenderer rhwp-studio/src/view/page-renderer.ts:93— 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: META_ESCAPE src/wmf/parser/records/escape/mod.rs:54— TooManyMethods — 44 methods, declared across 44 files: escape/abort_doc.rs (1), escape/begin_path.rs (1), escape/check_jpeg_format.rs (1), escape/check_png_format.rs (1), +40 more file(s). The bar is 30 methods; this is 14 over it, 1.47× 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: PageBorderDialog rhwp-studio/src/ui/page-border-dialog.ts:32— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× 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.
+ 15 more in this group — see findings.md.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×40
Members sharing a duplicated core (4 members, 50+ identical tokens) src/anchor_log.rs:34— src/anchor_log.rs:34-44 | src/audit_standard.rs:29-39 | src/disclose.rs:29-39 | src/settle.rs:33-43 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/bin/rhwp-agent/envelope.rs:26— src/bin/rhwp-agent/envelope.rs:26-39 | src/bin/rhwp-q/kit/envelope.rs:16-29 | src/bin/rhwp-q/more/envelope.rs:12-25 | src/bin/rhwp-q/pack/envelope.rs:12-25 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/bin/rhwp-q/commands/rhwp-q-font-layout-evidence.rs:33— src/bin/rhwp-q/commands/rhwp-q-font-layout-evidence.rs:33-101 | src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:76-150 | src/bin/rhwp-q/commands/rhwp-q-page-items.rs:61-133 | src/bin/rhwp-q/commands/rhwp-q-scan-items.rs:49-113 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/bin/rhwp-q/kit/chart_list.rs:12— src/bin/rhwp-q/kit/chart_list.rs:12-39 | src/bin/rhwp-q/kit/empty_doc.rs:8-24 | src/bin/rhwp-q/kit/overflow_cells.rs:10-32 | src/bin/rhwp-q/kit/table_overlaps.rs:10-50 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/cli/commands/edit/header_footer_content.rs:8— src/cli/commands/edit/header_footer_content.rs:8-125 | src/cli/commands/edit/header_footer_content.rs:128-246 | src/cli/commands/edit/header_footer_properties.rs:139-274 | src/cli/queries/structured_objects.rs:122-256 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/cli/queries/security_inspection.rs:571— src/cli/queries/security_inspection.rs:571-799 | src/cli/queries/security_inspection.rs:843-1062 | src/document_core/queries/memo_query.rs:910-958 | src/document_core/queries/search_query.rs:225-298 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/diagnostics/hwp5_cell_header_probe.rs:415— src/diagnostics/hwp5_cell_header_probe.rs:415-501 | src/diagnostics/hwp5_first_para_control_probe.rs:765-783 | src/diagnostics/hwp5_mel_personnel_probe.rs:363-484 | src/diagnostics/hwp5_table_probe.rs:411-500 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/diagnostics/hwp5_cell_header_probe.rs:856— src/diagnostics/hwp5_cell_header_probe.rs:856-865 | src/diagnostics/hwp5_contract_probe.rs:774-783 | src/diagnostics/hwp5_mel_personnel_probe.rs:770-779 | src/diagnostics/hwp5_table_probe.rs:625-634 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/diagnostics/ir_field_sweep.rs:626— src/diagnostics/ir_field_sweep.rs:626-713 | src/diagnostics/ir_field_sweep.rs:871-915 | src/diagnostics/ir_field_sweep.rs:934-1011 | src/diagnostics/ir_field_sweep.rs:1014-1065 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/document_core/commands/clipboard.rs:582— src/document_core/commands/clipboard.rs:582-604 | src/document_core/commands/clipboard.rs:617-695 | src/document_core/commands/clipboard.rs:707-754 | src/document_core/commands/header_footer_ops.rs:703-773 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/document_core/commands/clipboard.rs:2072— src/document_core/commands/clipboard.rs:2072-2107 | src/document_core/commands/clipboard.rs:2116-2153 | src/document_core/commands/clipboard.rs:2156-2172 | src/document_core/commands/clipboard.rs:2175-2193 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/document_core/commands/formatting.rs:1167— src/document_core/commands/formatting.rs:1167-1233 | src/document_core/commands/formatting.rs:1247-1309 | src/document_core/commands/formatting.rs:1670-1790 | src/document_core/commands/formatting.rs:1802-1874 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/document_core/commands/text_editing.rs:4549— src/document_core/commands/text_editing.rs:4549-4597 | src/document_core/commands/text_editing.rs:4605-4651 | src/document_core/queries/cursor_rect.rs:6354-6393 | src/document_core/queries/cursor_rect.rs:6402-6453 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/document_core/helpers.rs:515— src/document_core/helpers.rs:515-533 | src/document_core/helpers.rs:536-554 | src/document_core/helpers.rs:557-575 | src/document_core/helpers.rs:786-803 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/document_core/hyperlink.rs:388— src/document_core/hyperlink.rs:388-439 | src/document_core/queries/bookmark_query.rs:125-210 | src/document_core/queries/field_query.rs:2598-2672 | src/document_core/queries/memo_query.rs:1914-1977 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/document_core/queries/rendering.rs:5473— src/document_core/queries/rendering.rs:5473-6306 | src/renderer/layout.rs:7883-11386 | src/renderer/pagination.rs:1544-1553 | src/renderer/pagination/engine.rs:3225-3242 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/paint/json.rs:548— src/paint/json.rs:548-561 | src/paint/text_v2_export.rs:41-202 | src/paint/text_v2_slots.rs:145-256 | src/renderer/skia/cache.rs:194-261 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/paint/json.rs:2733— src/paint/json.rs:2733-2750 | src/paint/json.rs:2769-2793 | src/paint/json.rs:2798-2819 | src/paint/json.rs:2824-2848 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/renderer/equation/brace_outline.rs:34— src/renderer/equation/brace_outline.rs:34-52 | src/renderer/equation/integral_outline.rs:40-59 | src/renderer/equation/multiplication_outline.rs:31-50 | src/renderer/equation/radical_outline.rs:40-67 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/renderer/float_placement/stored_nested_before_host.rs:16— src/renderer/float_placement/stored_nested_before_host.rs:16-30 | src/renderer/layout/table_layout/stored_deferred_picture_frame.rs:8-18 | src/renderer/layout/table_layout/stored_mixed_opening_frame.rs:286-296 | src/renderer/render_normalization/stored_nested_text_frames.rs:44-55 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/renderer/height_measurer.rs:2303— src/renderer/height_measurer.rs:2303-2670 | src/renderer/layout/paragraph_layout.rs:5680-8874 | src/renderer/layout/picture_footnote.rs:1929-2128 | src/renderer/typeset/paragraph/format.rs:405-834 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/renderer/layout/picture_footnote.rs:386— src/renderer/layout/picture_footnote.rs:386-694 | src/renderer/layout/shape_layout.rs:925-1348 | src/renderer/layout/table_layout.rs:3828-5030 | src/renderer/layout/table_partial.rs:6034-8394 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/renderer/layout/table_layout.rs:2476— src/renderer/layout/table_layout.rs:2476-2519 | src/renderer/layout/table_layout.rs:2529-2557 | src/renderer/layout/table_layout/empty_line_flow.rs:204-323 | src/renderer/typeset/paragraph/format.rs:405-834 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/renderer/layout/table_layout.rs:6227— src/renderer/layout/table_layout.rs:6227-6256 | src/renderer/layout/table_layout.rs:10535-11482 | src/renderer/layout/table_layout.rs:12697-13318 | src/renderer/layout/table_layout.rs:14234-14259 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/renderer/layout/table_layout.rs:12032— src/renderer/layout/table_layout.rs:12032-12319 | src/renderer/layout/table_layout.rs:12697-13318 | src/renderer/layout/table_layout.rs:14978-18506 | src/renderer/layout/table_layout.rs:28590-28764 — 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.
Sync-over-async blocking mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:21— `readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:24— `readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:25— `readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:26— `readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:27— `readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:74— `mkdirSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:89— `writeFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:90— `writeFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:95— `writeFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:97— `readFileSync` in `hash` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:103— `writeFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking rhwp-vscode/src/extension.ts:73— `fs.writeFileSync` in `callback to provider.sendExportSvg` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking rhwp-vscode/src/extension.ts:118— `fs.writeFileSync` in `callback to provider.sendDebugOverlay` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking rhwp-vscode/src/extension.ts:133— `fs.readFileSync` in `cmdDumpParagraph` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking rhwp-vscode/src/hwp-editor-provider.ts:144— `fs.writeFileSync` in `callback to webview.onDidReceiveMessage` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/collect-postmerge-duration-data.mjs:208— `fs.mkdirSync` in `collectPostmergeDurations` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/collect-postmerge-duration-data.mjs:209— `fs.writeFileSync` in `collectPostmergeDurations` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/export-wasm-for-sweep.mjs:24— `readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/export-wasm-for-sweep.mjs:27— `readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/export-wasm-for-sweep.mjs:28— `readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/export-wasm-for-sweep.mjs:29— `readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/export-wasm-for-sweep.mjs:62— `mkdirSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/export-wasm-for-sweep.mjs:72— `writeFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/export-wasm-for-sweep.mjs:73— `writeFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/export-wasm-for-sweep.mjs:78— `writeFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
+ 15 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file rhwp-desk/ui/js/main.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 rhwp-firefox/content-script.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 rhwp-safari/src/content-script.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 rhwp-desk/ui/js/cards.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 rhwp-desk/ui/js/palette.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 rhwp-desk/ui/js/agent.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 rhwp-studio/src/ui/validation-modal.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 rhwp-safari/src/options.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 mydocs/tech/investigations/issue-8403/validation/browser-verify.mjs: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 mydocs/pr/assets/semanticist21_20261105/validation-r5/api/claim-probe.mjs: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 mydocs/working/assets/issue6042-stage5-correction/summarize.mjs: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 rhwp-chrome/build.mjs: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 rhwp-firefox/build.mjs: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 rhwp-firefox/dev-tools-inject.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 mydocs/pr/assets/pr8187/browser-api.mjs: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 rhwp-desk/ui/js/viewer.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 rhwp-desk/ui/js/ontology.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 mydocs/working/assets/issue6042/check-retained.mjs: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 mydocs/working/assets/issue7001/inventory.mjs: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 mydocs/tech/investigations/issue-3587/probes/template-contract.mjs: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 rhwp-shared/security/filename-sanitizer.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 mydocs/tech/investigations/issue-3587/probes/import-wasm-contract.mjs: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 rhwp-desk/ui/js/batch.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 mydocs/pr/assets/semanticist21-20261005/browser-review.mjs: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 mydocs/report/issue8168_topandbottom_tac_picture/make_unverified_inputs.mjs: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.
Duplicated block (10 lines × 3) src/bin/rhwp-agent/chunkplan.rs:73— src/bin/rhwp-agent/chunkplan.rs:73-82 | src/bin/rhwp-agent/safety.rs:420-429 | src/bin/rhwp-agent/verify.rs:167-176 — 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 `src/bin/rhwp-agent/chunkplan.rs:73` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) src/bin/rhwp-agent/harvest.rs:102— src/bin/rhwp-agent/harvest.rs:102-111 | src/bin/rhwp-agent/lookups.rs:227-236 | src/bin/rhwp-agent/lookups.rs:375-384 — before extracting anything, compare `src/bin/rhwp-agent/harvest.rs` and `src/bin/rhwp-agent/lookups.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-agent/harvest.rs:102` 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 × 3) src/bin/rhwp-q/kit/covering_pages.rs:13— src/bin/rhwp-q/kit/covering_pages.rs:13-22 | src/bin/rhwp-q/kit/form_value.rs:19-28 | src/bin/rhwp-q/kit/page_border_fill.rs:15-24 — before extracting anything, compare `src/bin/rhwp-q/kit/covering_pages.rs` and `src/bin/rhwp-q/kit/form_value.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 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 `src/bin/rhwp-q/kit/covering_pages.rs:13` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) src/bin/rhwp-q/kit/cursor_in_cell.rs:89— src/bin/rhwp-q/kit/cursor_in_cell.rs:89-98 | src/bin/rhwp-q/kit/cursor_in_footnote.rs:80-89 | src/bin/rhwp-q/kit/cursor_in_note.rs:84-93 — before extracting anything, compare `src/bin/rhwp-q/kit/cursor_in_cell.rs` and `src/bin/rhwp-q/kit/cursor_in_footnote.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 63 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 `src/bin/rhwp-q/kit/cursor_in_cell.rs:89` 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) src/bin/rhwp-q/kit/cursor_in_hf.rs:78— src/bin/rhwp-q/kit/cursor_in_hf.rs:78-87 | src/bin/rhwp-q/kit/hf_edit_target.rs:18-27 | src/bin/rhwp-q/kit/hit_in_hf.rs:20-29 — before extracting anything, compare `src/bin/rhwp-q/kit/hf_edit_target.rs` and `src/bin/rhwp-q/kit/hit_in_hf.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 102 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 `src/bin/rhwp-q/kit/cursor_in_hf.rs:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) src/bin/rhwp-q/kit/cursor_in_hf.rs:105— src/bin/rhwp-q/kit/cursor_in_hf.rs:105-114 | src/bin/rhwp-q/kit/flow_images.rs:59-68 | src/bin/rhwp-q/kit/overlay_images.rs:63-72 — before extracting anything, compare `src/bin/rhwp-q/kit/cursor_in_hf.rs` and `src/bin/rhwp-q/kit/flow_images.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 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 `src/bin/rhwp-q/kit/cursor_in_hf.rs: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 (10 lines × 3) src/bin/rhwp-q/kit/form_at.rs:90— src/bin/rhwp-q/kit/form_at.rs:90-99 | src/bin/rhwp-q/kit/hit_fn_marker.rs:91-100 | src/bin/rhwp-q/kit/hit_in_footnote.rs:91-100 — before extracting anything, compare `src/bin/rhwp-q/kit/form_at.rs` and `src/bin/rhwp-q/kit/hit_fn_marker.rs` as WHOLE FILES: this scan already matched 11 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 `src/bin/rhwp-q/kit/form_at.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.
Duplicated block (10 lines × 3) src/bin/rhwp-q/more/inventory.rs:679— src/bin/rhwp-q/more/inventory.rs:679-688 | src/bin/rhwp-q/pack/inventory.rs:136-145 | src/bin/rhwp-q/pack/inventory.rs:1245-1254 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:679` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) src/bin/rhwp-q/more/inventory.rs:756— src/bin/rhwp-q/more/inventory.rs:756-765 | src/bin/rhwp-q/pack/inventory.rs:161-170 | src/bin/rhwp-q/pack/inventory.rs:809-818 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:756` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) src/bin/rhwp-q/more/inventory.rs:781— src/bin/rhwp-q/more/inventory.rs:781-790 | src/bin/rhwp-q/pack/inventory.rs:186-195 | src/bin/rhwp-q/pack/inventory.rs:834-843 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:781` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) src/bin/rhwp-q/more/inventory.rs:806— src/bin/rhwp-q/more/inventory.rs:806-815 | src/bin/rhwp-q/pack/inventory.rs:211-220 | src/bin/rhwp-q/pack/inventory.rs:859-868 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:806` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) src/bin/rhwp-q/more/inventory.rs:831— src/bin/rhwp-q/more/inventory.rs:831-840 | src/bin/rhwp-q/pack/inventory.rs:236-245 | src/bin/rhwp-q/pack/inventory.rs:884-893 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:831` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) src/bin/rhwp-q/more/inventory.rs:856— src/bin/rhwp-q/more/inventory.rs:856-865 | src/bin/rhwp-q/pack/inventory.rs:705-714 | src/bin/rhwp-q/pack/inventory.rs:1193-1202 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:856` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) src/cli/commands/edit/document_objects.rs:23— src/cli/commands/edit/document_objects.rs:23-32 | src/cli/commands/tabular_import.rs:509-518 | src/cli/outputs/tabular.rs:341-350 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/tabular_import.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) src/cli/commands/edit/document_objects.rs:153— src/cli/commands/edit/document_objects.rs:153-162 | src/cli/commands/edit/document_text.rs:731-740 | src/cli/commands/edit/formatting.rs:19-28 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 213 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 `src/cli/commands/edit/document_objects.rs: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.
Duplicated block (10 lines × 3) src/cli/protocol/trust/anchor.rs:9— src/cli/protocol/trust/anchor.rs:9-18 | src/cli/protocol/trust/anchor.rs:84-93 | src/cli/protocol/trust/anchor.rs:159-168 — 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 `src/cli/protocol/trust/anchor.rs:9` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) src/diagnostics/hwp5_anchor_trace.rs:107— src/diagnostics/hwp5_anchor_trace.rs:107-116 | src/diagnostics/hwp5_inventory.rs:164-173 | src/diagnostics/hwp5_inventory_diff.rs:311-320 — before extracting anything, compare `src/diagnostics/hwp5_anchor_trace.rs` and `src/diagnostics/hwp5_inventory.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/diagnostics/hwp5_anchor_trace.rs:107` 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 × 3) src/document_core/hyperlink.rs:416— src/document_core/hyperlink.rs:416-425 | src/document_core/queries/bookmark_query.rs:183-192 | src/document_core/queries/field_query.rs:2661-2670 — before extracting anything, compare `src/document_core/queries/bookmark_query.rs` and `src/document_core/queries/field_query.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 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 (10 lines × 3) src/model/document.rs:793— src/model/document.rs:793-802 | src/wasm_api.rs:394-403 | src/wasm_api.rs:4575-4584 — 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 `src/model/document.rs:793` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) src/native_host/gpu_d3d.rs:370— src/native_host/gpu_d3d.rs:370-379 | src/native_host/gpu_gl.rs:445-454 | src/native_host/gpu_metal.rs:256-265 — before extracting anything, compare `src/native_host/gpu_d3d.rs` and `src/native_host/gpu_metal.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 170 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 (10 lines × 3) src/renderer/svg.rs:3662— src/renderer/svg.rs:3662-3671 | src/renderer/svg.rs:3738-3747 | src/renderer/web_canvas.rs:2792-2801 — before extracting anything, compare `src/renderer/svg.rs` and `src/renderer/web_canvas.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 321 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 `src/renderer/svg.rs:3662` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) src/serializer/hwpx/master_page.rs:88— src/serializer/hwpx/master_page.rs:88-97 | src/serializer/hwpx/section.rs:4042-4051 | src/serializer/hwpx/section.rs:4952-4961 — before extracting anything, compare `src/serializer/hwpx/master_page.rs` and `src/serializer/hwpx/section.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/serializer/hwpx/master_page.rs:87` calls `check_storage` and `src/serializer/hwpx/section.rs:4041` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 3) src/parser/hwpx/section.rs:2610— src/parser/hwpx/section.rs:2610-2619 | src/parser/hwpx/section.rs:2950-2959 | src/parser/hwpx/section.rs:3075-3084 — 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/parser/hwpx/section.rs:2621` calls `default` and `src/parser/hwpx/section.rs:2962` 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 (10 lines × 3) src/serializer/hwpx/picture.rs:809— src/serializer/hwpx/picture.rs:809-818 | src/serializer/hwpx/shape.rs:1770-1779 | src/serializer/hwpx/table.rs:778-787 — before extracting anything, compare `src/serializer/hwpx/picture.rs` and `src/serializer/hwpx/shape.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 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 (10 lines × 3) src/serializer/hwpx/picture.rs:820— src/serializer/hwpx/picture.rs:820-829 | src/serializer/hwpx/shape.rs:1781-1790 | src/serializer/hwpx/table.rs:789-798 — before extracting anything, compare `src/serializer/hwpx/picture.rs` and `src/serializer/hwpx/shape.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) src/bin/rhwp-q/more/inventory.rs:881— src/bin/rhwp-q/more/inventory.rs:881-886 | src/bin/rhwp-q/pack/inventory.rs:111-116 | src/bin/rhwp-q/pack/inventory.rs:784-789 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:881` 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) src/cli/commands/edit/header_footer_content.rs:251— src/cli/commands/edit/header_footer_content.rs:251-256 | src/cli/commands/edit/header_footer_content.rs:409-414 | src/cli/commands/edit/header_footer_properties.rs:393-398 — before extracting anything, compare `src/cli/commands/edit/header_footer_content.rs` and `src/cli/commands/edit/header_footer_properties.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 296 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) src/document_core/commands/document/grown_table_heights.rs:61— src/document_core/commands/document/grown_table_heights.rs:61-66 | src/document_core/queries/rendering.rs:5123-5128 | src/document_core/queries/rendering.rs:5520-5525 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) src/document_core/commands/document/stored_table_tail.rs:39— src/document_core/commands/document/stored_table_tail.rs:39-44 | src/renderer/float_placement/stored_header_frame.rs:254-259 | src/renderer/layout/table_layout.rs:12386-12391 — 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 `src/document_core/commands/document/stored_table_tail.rs:39` 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) src/document_core/commands/object_ops/common.rs:308— src/document_core/commands/object_ops/common.rs:308-313 | src/document_core/commands/object_ops/picture.rs:393-398 | src/document_core/commands/table_ops.rs:3024-3029 — before extracting anything, compare `src/document_core/commands/object_ops/common.rs` and `src/document_core/commands/object_ops/picture.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (6 lines × 3) src/document_core/commands/object_ops/common.rs:321— src/document_core/commands/object_ops/common.rs:321-326 | src/document_core/commands/object_ops/picture.rs:406-411 | src/document_core/commands/table_ops.rs:3037-3042 — before extracting anything, compare `src/document_core/commands/object_ops/common.rs` and `src/document_core/commands/object_ops/picture.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (6 lines × 3) src/document_core/commands/object_ops/table.rs:641— src/document_core/commands/object_ops/table.rs:641-646 | src/document_core/commands/object_ops/table.rs:1042-1047 | src/scaffold/builder.rs:425-432 — before extracting anything, compare `src/document_core/commands/object_ops/table.rs` and `src/scaffold/builder.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/object_ops/table.rs:641` 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, `src/document_core/commands/object_ops/table.rs:640` calls `copy_from_slice`, `to_le_bytes` and `src/scaffold/builder.rs:424` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) src/document_core/helpers.rs:807— src/document_core/helpers.rs:807-812 | src/document_core/helpers.rs:824-829 | src/document_core/helpers.rs:892-897 — 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 (6 lines × 3) src/document_core/queries/doc_tree_nav.rs:1384— src/document_core/queries/doc_tree_nav.rs:1384-1389 | src/renderer/layout/shape_layout.rs:855-860 | src/renderer/layout/shape_layout.rs:3597-3602 — before extracting anything, compare `src/document_core/queries/doc_tree_nav.rs` and `src/renderer/layout/shape_layout.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/queries/doc_tree_nav.rs:1384` 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 × 3) src/document_core/queries/rendering.rs:6233— src/document_core/queries/rendering.rs:6233-6238 | src/renderer/layout.rs:8524-8529 | src/renderer/pagination/engine.rs:3228-3233 — 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 `src/document_core/queries/rendering.rs:6233` 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) src/parser/control.rs:294— src/parser/control.rs:294-299 | src/parser/control.rs:391-396 | src/parser/control/shape.rs:945-950 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) src/parser/hml/reader.rs:829— src/parser/hml/reader.rs:829-834 | src/parser/hml/reader.rs:880-885 | src/parser/hml/reader.rs:1357-1362 — 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 `src/parser/hml/reader.rs:829` 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 × 3) src/parser/hwpx/header.rs:693— src/parser/hwpx/header.rs:693-698 | src/parser/hwpx/header.rs:1690-1695 | src/parser/hwpx/section.rs:4398-4403 — before extracting anything, compare `src/parser/hwpx/header.rs` and `src/parser/hwpx/section.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 162 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 `src/parser/hwpx/header.rs:693` 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) src/parser/hwpx/section.rs:3198— src/parser/hwpx/section.rs:3198-3203 | src/parser/hwpx/section.rs:4756-4763 | src/parser/hwpx/section.rs:5116-5121 — 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 `src/parser/hwpx/section.rs:3198` 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) src/renderer/float_placement.rs:1704— src/renderer/float_placement.rs:1704-1709 | src/renderer/float_placement.rs:4638-4645 | src/renderer/layout/table_layout.rs:12528-12535 — 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 `src/renderer/float_placement.rs:1704` 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 × 3) src/renderer/layout/picture_footnote.rs:530— src/renderer/layout/picture_footnote.rs:530-535 | src/renderer/layout/shape_layout.rs:4121-4126 | src/renderer/layout/table_cell_content.rs:702-707 — before extracting anything, compare `src/renderer/layout/shape_layout.rs` and `src/renderer/layout/table_cell_content.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 185 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. 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 (6 lines × 3) src/renderer/typeset/section/controls.rs:311— src/renderer/typeset/section/controls.rs:311-316 | src/renderer/typeset/section/controls.rs:333-338 | src/renderer/typeset/section/controls.rs:394-399 — 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 `src/renderer/typeset/section/controls.rs:311` 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) src/serializer/hwpx/shape.rs:109— src/serializer/hwpx/shape.rs:109-114 | src/serializer/hwpx/shape.rs:391-396 | src/serializer/hwpx/shape.rs:800-805 — 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 (6 lines × 3) src/wasm_api.rs:5901— src/wasm_api.rs:5901-5906 | src/wasm_api.rs:5959-5964 | src/wasm_api.rs:6011-6016 — 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 `src/wasm_api.rs:5901` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/wasm_api.rs:5957` calls `json_bool`, `unwrap_or` and `src/wasm_api.rs:5899` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) src/document_core/commands/border_paint_edit.rs:133— src/document_core/commands/border_paint_edit.rs:133-138 | src/document_core/commands/border_paint_edit.rs:166-171 | src/document_core/commands/border_paint_edit.rs:231-236 — 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 (6 lines × 3) src/renderer/layout/shape_layout.rs:5059— src/renderer/layout/shape_layout.rs:5059-5064 | src/renderer/layout/shape_layout.rs:5276-5281 | src/renderer/typeset.rs:6728-6733 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) src/serializer/hwpx/picture.rs:369— src/serializer/hwpx/picture.rs:369-374 | src/serializer/hwpx/table.rs:310-315 | src/serializer/hwpx/table.rs:700-705 — before extracting anything, compare `src/serializer/hwpx/picture.rs` and `src/serializer/hwpx/table.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 83 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 `src/serializer/hwpx/picture.rs:369` 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) src/parser/pdf/table_detection.rs:562— src/parser/pdf/table_detection.rs:562-567 | src/parser/pdf/table_inference.rs:67-72 | tools/pdf-ir-poc/src/table_detection.rs:302-307 — before extracting anything, compare `src/parser/pdf/table_detection.rs` and `tools/pdf-ir-poc/src/table_detection.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) src/document_core/commands/document.rs:2977— src/document_core/commands/document.rs:2977-2982 | src/model/paragraph.rs:682-687 | src/model/paragraph.rs:3252-3257 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) src/document_core/loaded_frame_restore.rs:143— src/document_core/loaded_frame_restore.rs:143-148 | src/document_core/loaded_frame_restore.rs:163-168 | src/renderer/height_measurer.rs:2775-2780 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (17 lines × 2) crates/rhwp-ooxml-chart/src/renderer.rs:223— crates/rhwp-ooxml-chart/src/renderer.rs:223-239 | src/emf/converter/svg.rs:57-73 — 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 (17 lines × 2) src/cli/commands/edit/bookmarks.rs:16— src/cli/commands/edit/bookmarks.rs:16-32 | src/cli/commands/edit/bookmarks.rs:251-267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/bookmarks.rs:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) src/cli/commands/edit/header_footer_content.rs:265— src/cli/commands/edit/header_footer_content.rs:265-281 | src/cli/commands/edit/header_footer_content.rs:422-438 — both copies are in the same file, so extract the 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 `src/cli/commands/edit/header_footer_content.rs:265` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) src/cli/protocol/exchange/settlement.rs:10— src/cli/protocol/exchange/settlement.rs:10-26 | src/cli/protocol/exchange/settlement.rs:146-162 — both copies are in the same file, so extract the 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 `src/cli/protocol/exchange/settlement.rs:10` 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) src/cli/protocol/trust/gate.rs:21— src/cli/protocol/trust/gate.rs:21-37 | src/cli/protocol/trust/governance.rs:177-193 — before extracting anything, compare `src/cli/protocol/trust/gate.rs` and `src/cli/protocol/trust/governance.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 53 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 `src/cli/protocol/trust/gate.rs:21` 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) src/cli/queries/security_inspection.rs:233— src/cli/queries/security_inspection.rs:233-249 | src/cli/queries/security_inspection.rs:501-517 — both copies are in the same file, so extract the 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) src/diagnostics/hwp5_cell_header_probe.rs:468— src/diagnostics/hwp5_cell_header_probe.rs:468-484 | src/diagnostics/hwp5_mel_personnel_probe.rs:451-467 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_mel_personnel_probe.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 503 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 `src/diagnostics/hwp5_cell_header_probe.rs:468` 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 (17 lines × 2) src/diagnostics/hwp5_roundtrip_batch.rs:683— src/diagnostics/hwp5_roundtrip_batch.rs:683-699 | src/diagnostics/hwpx_roundtrip_batch.rs:496-512 — before extracting anything, compare `src/diagnostics/hwp5_roundtrip_batch.rs` and `src/diagnostics/hwpx_roundtrip_batch.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 152 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 `src/diagnostics/hwp5_roundtrip_batch.rs:683` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) src/document_core/commands/text_editing.rs:2349— src/document_core/commands/text_editing.rs:2349-2365 | src/document_core/commands/text_editing.rs:2718-2734 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:2349` 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 (17 lines × 2) src/document_core/queries/field_query.rs:2528— src/document_core/queries/field_query.rs:2528-2544 | src/document_core/queries/memo_query.rs:1802-1818 — before extracting anything, compare `src/document_core/queries/field_query.rs` and `src/document_core/queries/memo_query.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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 (17 lines × 2) src/native_host/clipboard.rs:315— src/native_host/clipboard.rs:315-331 | src/native_host/clipboard.rs:382-398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/native_host/clipboard.rs:315` 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 (17 lines × 2) src/native_host/gpu_d3d.rs:382— src/native_host/gpu_d3d.rs:382-398 | src/native_host/gpu_metal.rs:268-284 — before extracting anything, compare `src/native_host/gpu_d3d.rs` and `src/native_host/gpu_metal.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 170 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 `src/native_host/gpu_d3d.rs:382` 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 (17 lines × 2) src/parser/hwp3/mod.rs:2103— src/parser/hwp3/mod.rs:2103-2119 | src/parser/hwp3/mod.rs:2121-2137 — both copies are in the same file, so extract the 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 `src/parser/hwp3/mod.rs:2103` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) src/parser/hwp3/mod.rs:4539— src/parser/hwp3/mod.rs:4539-4555 | src/parser/hwp3/mod.rs:4619-4635 — both copies are in the same file, so extract the 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 `src/parser/hwp3/mod.rs:4539` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) src/parser/pdf/body_regions.rs:210— src/parser/pdf/body_regions.rs:210-226 | src/parser/pdf/body_regions.rs:252-268 — both copies are in the same file, so extract the 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 `src/parser/pdf/body_regions.rs:210` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) src/parser/pdf/structured_lowering.rs:1897— src/parser/pdf/structured_lowering.rs:1897-1913 | src/parser/pdf/structured_lowering.rs:1973-1989 — both copies are in the same file, so extract the 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, `src/parser/pdf/structured_lowering.rs:1895` calls `try_from`, `map_err` and `src/parser/pdf/structured_lowering.rs:1972` 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) src/renderer/composer/stored_tac_display.inc.rs:564— src/renderer/composer/stored_tac_display.inc.rs:564-580 | src/renderer/composer/stored_tac_display.inc.rs:582-598 — both copies are in the same file, so extract the 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) src/renderer/layout/border_rendering.rs:1057— src/renderer/layout/border_rendering.rs:1057-1073 | src/renderer/layout/border_rendering.rs:1100-1116 — both copies are in the same file, so extract the 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 `src/renderer/layout/border_rendering.rs:1057` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) src/renderer/layout/border_rendering.rs:1915— src/renderer/layout/border_rendering.rs:1915-1931 | src/renderer/layout/border_rendering.rs:1936-1952 — both copies are in the same file, so extract the 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 `src/renderer/layout/border_rendering.rs:1915` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) src/renderer/layout/paragraph_layout.rs:5282— src/renderer/layout/paragraph_layout.rs:5282-5298 | src/renderer/layout/paragraph_layout.rs:10469-10485 — both copies are in the same file, so extract the 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 `src/renderer/layout/paragraph_layout.rs:5282` 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 (17 lines × 2) src/renderer/layout/paragraph_layout.rs:9971— src/renderer/layout/paragraph_layout.rs:9971-9987 | src/renderer/layout/paragraph_layout.rs:10540-10556 — both copies are in the same file, so extract the 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) src/renderer/layout/shape_layout.rs:4579— src/renderer/layout/shape_layout.rs:4579-4595 | src/renderer/layout/table_layout.rs:9422-9438 — before extracting anything, compare `src/renderer/layout/shape_layout.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 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 `src/renderer/layout/shape_layout.rs:4579` 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 (17 lines × 2) src/renderer/mod.rs:4171— src/renderer/mod.rs:4171-4187 | src/renderer/mod.rs:4215-4231 — both copies are in the same file, so extract the 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 `src/renderer/mod.rs:4171` 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) src/renderer/skia/hft_outline.rs:67— src/renderer/skia/hft_outline.rs:67-83 | src/renderer/skia/renderer.rs:2640-2656 — 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 `src/renderer/skia/hft_outline.rs:67` 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) src/renderer/svg.rs:2526— src/renderer/svg.rs:2526-2542 | src/renderer/web_canvas.rs:4452-4468 — before extracting anything, compare `src/renderer/svg.rs` and `src/renderer/web_canvas.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 321 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 (18 lines × 2) mydocs/tech/investigations/issue-595/probes/inspect_595.rs:138— mydocs/tech/investigations/issue-595/probes/inspect_595.rs:138-155 | mydocs/tech/investigations/issue-595/probes/inspect_595_regression.rs:66-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mydocs/tech/investigations/issue-595/probes/inspect_595_regression.rs:85` calls `default` and `mydocs/tech/investigations/issue-595/probes/inspect_595.rs:157` 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 (18 lines × 2) src/bin/rhwp-agent/chunkplan.rs:62— src/bin/rhwp-agent/chunkplan.rs:62-79 | src/bin/rhwp-agent/piiscan.rs:95-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-agent/chunkplan.rs:62` 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) src/bin/rhwp-agent/safety.rs:324— src/bin/rhwp-agent/safety.rs:324-342 | src/bin/rhwp-agent/safety.rs:628-645 — both copies are in the same file, so extract the 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 `src/bin/rhwp-agent/safety.rs:324` 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) src/bin/rhwp-q/kit/covering_pages.rs:14— src/bin/rhwp-q/kit/covering_pages.rs:14-31 | src/bin/rhwp-q/kit/page_border_fill.rs:16-33 — before extracting anything, compare `src/bin/rhwp-q/kit/covering_pages.rs` and `src/bin/rhwp-q/kit/page_border_fill.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 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 `src/bin/rhwp-q/kit/covering_pages.rs:14` 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 (18 lines × 2) src/bin/rhwp-q/more/probe.rs:188— src/bin/rhwp-q/more/probe.rs:188-205 | src/bin/rhwp-q/pack/probe.rs:178-195 — `src/bin/rhwp-q/more/probe.rs` and `src/bin/rhwp-q/pack/probe.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 113 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (18 lines × 2) src/cli/commands/edit/formatting.rs:175— src/cli/commands/edit/formatting.rs:175-192 | src/cli/commands/edit/note_content.rs:596-613 — before extracting anything, compare `src/cli/commands/edit/formatting.rs` and `src/cli/commands/edit/note_content.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 282 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/formatting.rs:175` 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) src/cli/commands/generation.rs:95— src/cli/commands/generation.rs:95-112 | src/cli/commands/generation.rs:262-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/generation.rs:95` 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) src/cli/outputs/tabular.rs:168— src/cli/outputs/tabular.rs:168-185 | src/cli/outputs/tabular.rs:378-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 `src/cli/outputs/tabular.rs:168` 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) src/diagnostics/hwp5_inventory.rs:120— src/diagnostics/hwp5_inventory.rs:120-137 | src/diagnostics/hwp5_inventory_diff.rs:233-250 — before extracting anything, compare `src/diagnostics/hwp5_inventory.rs` and `src/diagnostics/hwp5_inventory_diff.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 112 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 `src/diagnostics/hwp5_inventory.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 (18 lines × 2) src/diagnostics/hwp5_roundtrip_batch.rs:347— src/diagnostics/hwp5_roundtrip_batch.rs:347-364 | src/diagnostics/hwpx_roundtrip_batch.rs:225-242 — before extracting anything, compare `src/diagnostics/hwp5_roundtrip_batch.rs` and `src/diagnostics/hwpx_roundtrip_batch.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 152 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 `src/diagnostics/hwp5_roundtrip_batch.rs:347` 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) src/document_core/commands/text_editing.rs:2249— src/document_core/commands/text_editing.rs:2249-2266 | src/document_core/commands/text_editing.rs:2624-2641 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) src/document_core/commands/text_editing.rs:5717— src/document_core/commands/text_editing.rs:5717-5734 | src/document_core/commands/text_editing.rs:5807-5824 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:5717` 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) src/document_core/queries/cursor_rect.rs:6355— src/document_core/queries/cursor_rect.rs:6355-6372 | src/document_core/queries/cursor_rect.rs:6403-6420 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:6355` 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 (18 lines × 2) src/document_core/queries/hwpctrl_sets.rs:587— src/document_core/queries/hwpctrl_sets.rs:587-604 | src/document_core/queries/hwpctrl_sets.rs:2086-2103 — both copies are in the same file, so extract the 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 `src/document_core/queries/hwpctrl_sets.rs:587` 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 (18 lines × 2) src/renderer/bitmap_raster.rs:203— src/renderer/bitmap_raster.rs:203-220 | src/renderer/bitmap_raster/cropped_window.rs:94-111 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/bitmap_raster.rs:203` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) src/renderer/equation/svg_render.rs:431— src/renderer/equation/svg_render.rs:431-448 | src/renderer/equation/svg_render.rs:457-474 — both copies are in the same file, so extract the 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 `src/renderer/equation/svg_render.rs:431` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) src/renderer/float_placement.rs:3629— src/renderer/float_placement.rs:3629-3646 | src/renderer/float_placement.rs:3686-3703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) src/renderer/layout/shape_layout.rs:3574— src/renderer/layout/shape_layout.rs:3574-3591 | src/renderer/layout/shape_layout.rs:3641-3658 — both copies are in the same file, so extract the 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 `src/renderer/layout/shape_layout.rs:3574` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (18 lines × 2) src/renderer/layout/shape_layout.rs:4959— src/renderer/layout/shape_layout.rs:4959-4976 | src/renderer/layout/table_cell_content.rs:576-593 — before extracting anything, compare `src/renderer/layout/shape_layout.rs` and `src/renderer/layout/table_cell_content.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 185 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 `src/renderer/layout/shape_layout.rs:4959` 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) src/renderer/layout/table_cell_content.rs:862— src/renderer/layout/table_cell_content.rs:862-879 | src/renderer/layout/table_partial.rs:7155-7172 — before extracting anything, compare `src/renderer/layout/table_cell_content.rs` and `src/renderer/layout/table_partial.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 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 (18 lines × 2) src/renderer/skia/anisotropic_image.rs:19— src/renderer/skia/anisotropic_image.rs:19-36 | src/renderer/skia/anisotropic_image.rs:91-108 — both copies are in the same file, so extract the 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 `src/renderer/skia/anisotropic_image.rs:19` 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 (18 lines × 2) src/renderer/skia/equation_conv.rs:751— src/renderer/skia/equation_conv.rs:751-768 | src/renderer/skia/equation_glyph.rs:17-34 — 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 `src/renderer/skia/equation_conv.rs:751` 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) src/serializer/hwpx/section.rs:1374— src/serializer/hwpx/section.rs:1374-1391 | src/serializer/hwpx/section.rs:1472-1489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/serializer/hwpx/section.rs:1374` 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 (18 lines × 2) bindings/Native/src/gpu_d3d.rs:259— bindings/Native/src/gpu_d3d.rs:259-276 | bindings/Native/src/gpu_metal.rs:268-285 — before extracting anything, compare `bindings/Native/src/gpu_d3d.rs` and `bindings/Native/src/gpu_metal.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 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 `bindings/Native/src/gpu_d3d.rs:259` 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 (18 lines × 2) src/renderer/height_measurer.rs:4908— src/renderer/height_measurer.rs:4908-4925 | src/renderer/layout/table_layout.rs:5866-5883 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 300 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/height_measurer.rs:4908` 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.
+ 5 more in this group — see findings.md.
AC3 · Page structure· Page without a main landmark · ×28
Page without a main landmark data/font-metrics/adobe-core14/MustRead.html:1— 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 mydocs/metrics/2026-07-04-r1/dashboard.html: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 mydocs/metrics/2026-07-04/dashboard.html: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 mydocs/metrics/2026-07-05/dashboard.html: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 mydocs/metrics/2026-07-06-r3/dashboard.html: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 mydocs/metrics/2026-07-06-r4/dashboard.html: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 mydocs/metrics/2026-07-07-r5/dashboard.html: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 mydocs/metrics/2026-07-08-r6/dashboard.html: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 mydocs/metrics/2026-07-08-r7/dashboard.html: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 mydocs/metrics/2026-07-08-r8/dashboard.html: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 mydocs/metrics/2026-07-09-phase2/dashboard.html: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 mydocs/metrics/2026-07-09-r10/dashboard.html: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 mydocs/metrics/2026-07-09-r11/dashboard.html: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 mydocs/metrics/2026-07-09-r12/dashboard.html: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 mydocs/metrics/2026-07-09-r13/dashboard.html: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 mydocs/metrics/2026-07-09-r15/dashboard.html: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 mydocs/metrics/2026-07-09-r17/dashboard.html: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 mydocs/metrics/2026-07-09-r9/dashboard.html: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 mydocs/metrics/2026-07-10-c2r1/dashboard.html: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 mydocs/metrics/2026-07-11-c2r2/dashboard.html: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 mydocs/metrics/dashboard.html: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 mydocs/pr/assets/issue7470_rowbreak_stage1/gallery.html:1— 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 mydocs/pr/assets/pr7109_hancom_pdf_bbox.html:1— 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 mydocs/pr/assets/pr7152_comparison.html:1— 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 mydocs/pr/assets/pr7152_negative_report.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
+ 3 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×27
Edited copy of a member (9 corresponding lines) src/document_core/converters/hwpx_to_hwp.rs:2181— src/document_core/converters/hwpx_to_hwp.rs:2181-2206 | src/document_core/converters/hwpx_to_hwp.rs:2569-2599 — 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) src/paint/paint_bounds.rs:745— src/paint/paint_bounds.rs:745-764 | src/renderer/render_tree.rs:1337-1345 — 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) mydocs/tech/investigations/issue-658/probes/inspect_658_selection.rs:15— mydocs/tech/investigations/issue-658/probes/inspect_658_selection.rs:15-23 | src/document_core/commands/table_ops.rs:2824-2835 — 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) gym/core/checks.py:355— gym/core/checks.py:355-363 | gym/core/checks.py:469-477 — 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) src/diagnostics/ir_field_sweep.rs:614— src/diagnostics/ir_field_sweep.rs:614-622 | src/diagnostics/ir_field_sweep.rs:715-723 — 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) src/renderer/composer/line_breaking.rs:3243— src/renderer/composer/line_breaking.rs:3243-3252 | src/renderer/mod.rs:2384-2392 — 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) src/renderer/typeset.rs:1189— src/renderer/typeset.rs:1189-1203 | src/renderer/typeset.rs:1207-1215 — 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) gym/tools/build_baseline.py:830— gym/tools/build_baseline.py:830-840 | gym/tools/discriminate.py:350-358 — 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) src/eps.rs:120— src/eps.rs:120-128 | src/eps.rs:134-142 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/model/bin_data.rs:279— src/model/bin_data.rs:279-287 | src/model/bin_data.rs:290-300 — 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) src/ole_chart/grid.rs:498— src/ole_chart/grid.rs:498-506 | src/ole_chart/parser.rs:400-408 — 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) src/paint/metafile_print/images.rs:15— src/paint/metafile_print/images.rs:15-25 | src/paint/metafile_print/text.rs:18-26 — 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) src/parser/hwpx/contract_streams.rs:142— src/parser/hwpx/contract_streams.rs:142-150 | src/parser/hwpx/contract_streams.rs:153-161 — 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) src/model/control.rs:107— src/model/control.rs:107-116 | src/renderer/typeset/controls/stored_tac.rs:26-34 — 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) src/native_host/gpu_d3d.rs:333— src/native_host/gpu_d3d.rs:333-341 | src/native_host/gpu_metal.rs:222-232 — 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) src/renderer/shaping_vertical.rs:609— src/renderer/shaping_vertical.rs:609-619 | src/renderer/shaping_context.rs:349-357 — 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) src/renderer/composer/line_breaking.rs:4275— src/renderer/composer/line_breaking.rs:4275-4284 | src/renderer/composer/line_breaking.rs:4332-4340 — 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) src/diagnostics/hwp5_roundtrip_batch.rs:258— src/diagnostics/hwp5_roundtrip_batch.rs:258-269 | src/diagnostics/hwpx_roundtrip_batch.rs:133-141 — 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) src/parser/hwp3/mod.rs:5528— src/parser/hwp3/mod.rs:5528-5540 | src/serializer/hwpx/roundtrip.rs:774-782 — 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) tools/task2279/hancom_metric_visual_check.py:35— tools/task2279/hancom_metric_visual_check.py:35-43 | tools/task2279/visual_evidence.py:44-53 — 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) scripts/font_oracle_inventory.py:41— scripts/font_oracle_inventory.py:41-49 | scripts/font_rank8_metric_hypothesis.py:82-90 — 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) tools/verify_hangul_pages.py:54— tools/verify_hangul_pages.py:54-62 | tools/verify_pi_page_roundtrip.py:160-168 — 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) tools/oracle_page_count/regenerate.py:253— tools/oracle_page_count/regenerate.py:253-263 | tools/oracle_page_count/sweep.py:107-115 — 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) tools/skill_router/audit_skill_commands.py:149— tools/skill_router/audit_skill_commands.py:149-157 | tools/skill_router/gate_new_skill.py:321-329 — 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) tools/llm_verifier/claim_bind/src/coords.rs:170— tools/llm_verifier/claim_bind/src/coords.rs:170-178 | tools/llm_verifier/verdict_protocol/src/extract.rs:15-23 — 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.
+ 2 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×27
Edited copy of a member (8 corresponding lines) src/cli/protocol/plan/template.rs:20— src/cli/protocol/plan/template.rs:20-27 | src/cli/protocol/plan/template.rs:33-40 — 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) src/parser/pdf/recognition.rs:650— src/parser/pdf/recognition.rs:650-657 | tools/pdf-ir-poc/src/recognition.rs:401-408 — 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) src/model/style.rs:677— src/model/style.rs:677-684 | src/model/style.rs:686-693 — 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) src/wmf/parser/objects/structure/bitmap_info_header/mod.rs:167— src/wmf/parser/objects/structure/bitmap_info_header/mod.rs:167-177 | src/wmf/parser/objects/structure/bitmap_info_header/mod.rs:179-186 — 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) src/cli/document_io.rs:78— src/cli/document_io.rs:78-85 | src/cli/document_io.rs:90-97 — 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) src/mcp_serve.rs:1768— src/mcp_serve.rs:1768-1775 | src/mcp_serve.rs:1777-1784 — 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) src/document_core/commands/formatting.rs:2877— src/document_core/commands/formatting.rs:2877-2887 | src/renderer/mod.rs:2865-2872 — 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) src/parser/hwp_summary.rs:28— src/parser/hwp_summary.rs:28-38 | src/parser/hwp_summary.rs:46-53 — 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) gym/tools/robustness.py:1149— gym/tools/robustness.py:1149-1156 | gym/tools/robustness.py:1160-1172 — 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) src/renderer/typeset.rs:969— src/renderer/typeset.rs:969-977 | src/renderer/typeset.rs:2529-2536 — 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) src/parser/pdf/structured_lowering.rs:1496— src/parser/pdf/structured_lowering.rs:1496-1504 | tools/pdf-ir-poc/src/structured_lowering.rs:417-424 — 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) src/renderer/layout.rs:4448— src/renderer/layout.rs:4448-4456 | src/parser/pdf/structured_lowering.rs:2137-2144 — 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) src/document_core/commands/document.rs:1952— src/document_core/commands/document.rs:1952-1960 | src/renderer/pagination.rs:181-188 — 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) src/parser/pdf/allocation.rs:218— src/parser/pdf/allocation.rs:218-225 | src/storage.rs:187-194 — 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) src/parser/pdf/allocation.rs:206— src/parser/pdf/allocation.rs:206-213 | src/storage.rs:170-178 — 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) src/document_core/commands/object_ops/common.rs:179— src/document_core/commands/object_ops/common.rs:179-186 | src/renderer/typeset.rs:1043-1050 — 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) bindings/Native/src/lib.rs:483— bindings/Native/src/lib.rs:483-494 | src/serializer/hwpx/roundtrip.rs:1849-1856 — 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) mydocs/tech/investigations/issue-8174/probes/library_consumer.rs:8— mydocs/tech/investigations/issue-8174/probes/library_consumer.rs:8-15 | src/document_core/queries/memo_query.rs:224-231 — 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) src/renderer/composer.rs:176— src/renderer/composer.rs:176-183 | src/renderer/composer/line_breaking.rs:459-466 — 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) src/renderer/hft_outline.rs:30— src/renderer/hft_outline.rs:30-37 | src/renderer/pua_glyph.rs:107-115 — 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) tools/dar/transaction.py:310— tools/dar/transaction.py:310-317 | tools/dar/transaction.py:455-463 — 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) tools/hangul_row_heights2.py:130— tools/hangul_row_heights2.py:130-140 | tools/probe_width_ladder.py:78-85 — 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) scripts/oracle_stage4_contract.py:46— scripts/oracle_stage4_contract.py:46-53 | scripts/oracle_stage4_reproduction_compare.py:45-52 — 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) tools/task2279/hancom_metric_visual_check.py:19— tools/task2279/hancom_metric_visual_check.py:19-26 | tools/task2279/visual_evidence.py:28-35 — 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) tools/oracle_public/page_smoke.py:297— tools/oracle_public/page_smoke.py:297-305 | tools/oracle_public/sweep_runner.py:719-726 — 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.
Duplicated block (5 lines × 3) bindings/Native/src/gpu_d3d.rs:258— bindings/Native/src/gpu_d3d.rs:258-262 | bindings/Native/src/gpu_gl.rs:356-360 | bindings/Native/src/gpu_metal.rs:267-271 — before extracting anything, compare `bindings/Native/src/gpu_d3d.rs` and `bindings/Native/src/gpu_metal.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 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 `bindings/Native/src/gpu_d3d.rs:258` 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 × 3) src/cli/batch/query.rs:89— src/cli/batch/query.rs:89-94 | src/cli/queries/data_extraction.rs:97-102 | src/mcp_serve.rs:1974-1978 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (5 lines × 3) src/cli/commands/edit/cell_paragraphs.rs:170— src/cli/commands/edit/cell_paragraphs.rs:170-174 | src/cli/commands/edit/formatting.rs:708-712 | src/cli/commands/edit/formatting.rs:860-864 — before extracting anything, compare `src/cli/commands/edit/cell_paragraphs.rs` and `src/cli/commands/edit/formatting.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 240 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) src/cli/commands/edit/cells.rs:162— src/cli/commands/edit/cells.rs:162-166 | src/document_core/commands/text_editing.rs:462-466 | src/document_core/commands/text_editing.rs:6202-6206 — 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 `src/cli/commands/edit/cells.rs:162` 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 × 3) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:538— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:538-542 | src/diagnostics/hwp5_cell_header_probe.rs:888-892 | src/diagnostics/hwp5_mel_personnel_probe.rs:802-806 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 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 `src/diagnostics/hwp5_borderfill_diagonal_probe.rs:538` 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 × 3) src/diagnostics/hwp5_inventory.rs:559— src/diagnostics/hwp5_inventory.rs:559-563 | src/diagnostics/hwp5_inventory_diff.rs:1511-1515 | src/diagnostics/hwp5_inventory_diff.rs:2237-2241 — before extracting anything, compare `src/diagnostics/hwp5_inventory.rs` and `src/diagnostics/hwp5_inventory_diff.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) src/document_core/commands/clipboard.rs:989— src/document_core/commands/clipboard.rs:989-996 | src/document_core/commands/foreign_paste.rs:214-218 | src/document_core/commands/html_import.rs:397-406 — before extracting anything, compare `src/document_core/commands/clipboard.rs` and `src/document_core/commands/foreign_paste.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 134 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 `src/document_core/commands/html_import.rs:397` 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 × 3) src/paint/metafile_surface.rs:164— src/paint/metafile_surface.rs:164-168 | src/paint/metafile_surface.rs:242-246 | src/paint/metafile_surface.rs:378-382 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) src/renderer/composer/line_breaking.rs:360— src/renderer/composer/line_breaking.rs:360-365 | src/renderer/layout/text_measurement.rs:2977-2981 | src/renderer/layout/text_measurement.rs:3149-3153 — 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 `src/renderer/layout/text_measurement.rs:2977` 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 × 3) src/renderer/height_measurer.rs:1458— src/renderer/height_measurer.rs:1458-1462 | src/renderer/height_measurer.rs:1631-1635 | src/renderer/height_measurer.rs:1709-1713 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) src/renderer/image_resolver/print_alpha_2024.rs:26— src/renderer/image_resolver/print_alpha_2024.rs:26-32 | src/renderer/image_resolver/print_codec.rs:57-63 | src/renderer/image_resolver/print_picture_resample.rs:52-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/image_resolver/print_alpha_2024.rs:26` 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 3) src/renderer/layout/table_layout.rs:5664— src/renderer/layout/table_layout.rs:5664-5668 | src/renderer/layout/table_layout.rs:14493-14497 | src/renderer/layout/table_layout.rs:14568-14572 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) src/renderer/pagination/engine.rs:3166— src/renderer/pagination/engine.rs:3166-3170 | src/renderer/pagination/engine.rs:3184-3188 | src/renderer/typeset/state/finalize.rs:144-148 — before extracting anything, compare `src/renderer/pagination/engine.rs` and `src/renderer/typeset/state/finalize.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/pagination/engine.rs:3166` 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) src/wmf/converter/svg/mod.rs:719— src/wmf/converter/svg/mod.rs:719-724 | src/wmf/converter/svg/mod.rs:1186-1190 | src/wmf/converter/svg/mod.rs:1316-1320 — 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 `src/wmf/converter/svg/mod.rs:719` 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, `src/wmf/converter/svg/mod.rs:1321` calls `push_element` and `src/wmf/converter/svg/mod.rs:726` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) src/wmf/parser/objects/structure/bitmap_info_header/v4.rs:167— src/wmf/parser/objects/structure/bitmap_info_header/v4.rs:167-171 | src/wmf/parser/objects/structure/log_color_space.rs:78-82 | src/wmf/parser/objects/structure/log_color_space_w.rs:78-82 — before extracting anything, compare `src/wmf/parser/objects/structure/log_color_space.rs` and `src/wmf/parser/objects/structure/log_color_space_w.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 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 `src/wmf/parser/objects/structure/bitmap_info_header/v4.rs:167` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/wmf/parser/objects/structure/log_color_space.rs:76` calls `parse` and `src/wmf/parser/objects/structure/bitmap_info_header/v4.rs:165` 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 × 3) src/wmf/parser/objects/structure/rect.rs:29— src/wmf/parser/objects/structure/rect.rs:29-33 | src/wmf/parser/records/state/exclude_clip_rect.rs:50-54 | src/wmf/parser/records/state/intersect_clip_rect.rs:50-54 — before extracting anything, compare `src/wmf/parser/records/state/exclude_clip_rect.rs` and `src/wmf/parser/records/state/intersect_clip_rect.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 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 `src/wmf/parser/objects/structure/rect.rs:29` 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) src/renderer/height_measurer.rs:3994— src/renderer/height_measurer.rs:3994-3998 | src/renderer/height_measurer.rs:5029-5033 | src/renderer/height_measurer.rs:5819-5823 — 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 `src/renderer/height_measurer.rs:3994` 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 (5 lines × 3) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:513— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:513-517 | src/diagnostics/hwp5_inventory_diff.rs:1794-1798 | src/renderer/image_header.rs:250-254 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_inventory_diff.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) src/paint/shaping_glyph.rs:323— src/paint/shaping_glyph.rs:323-327 | src/renderer/shaping_composition.rs:486-490 | src/renderer/shaping_vertical.rs:839-843 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (5 lines × 3) src/renderer/float_placement.rs:8887— src/renderer/float_placement.rs:8887-8891 | src/renderer/layout.rs:1254-1258 | src/renderer/typeset.rs:756-760 — before extracting anything, compare `src/renderer/layout.rs` and `src/renderer/typeset.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) src/document_core/commands/html_import.rs:821— src/document_core/commands/html_import.rs:821-826 | src/document_core/commands/html_import.rs:857-862 | src/document_core/commands/html_import.rs:906-910 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 3) src/cli/commands/edit/document_text.rs:195— src/cli/commands/edit/document_text.rs:195-199 | src/cli/commands/edit/fields.rs:351-355 | src/cli/commands/tabular_import.rs:427-431 — before extracting anything, compare `src/cli/commands/edit/document_text.rs` and `src/cli/commands/edit/fields.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 `src/cli/commands/edit/document_text.rs:195` 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 × 3) src/renderer/layout.rs:15382— src/renderer/layout.rs:15382-15386 | src/renderer/layout.rs:16437-16441 | src/renderer/layout.rs:16645-16649 — 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 `src/renderer/layout.rs:15382` 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 (5 lines × 3) gym/core/checks.py:28— gym/core/checks.py:28-32 | tools/provenance_chain.py:35-39 | tools/scale_ladder_real.py:151-155 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `path` to `Path` in one and `str` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 3) tools/fidelity_compare/fidelity_compare.py:1438— tools/fidelity_compare/fidelity_compare.py:1438-1442 | tools/fidelity_compare/fidelity_compare.py:1629-1633 | tools/fidelity_compare/fidelity_compare.py:2097-2101 — 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.
+ 2 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×25
Edited copy of a member (13 corresponding lines) src/renderer/equation/font_frame_metrics.rs:184— src/renderer/equation/font_frame_metrics.rs:184-196 | src/renderer/equation/font_frame_metrics.rs:217-229 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/model/shape.rs:576— src/model/shape.rs:576-588 | src/model/shape.rs:591-603 — 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) gym/core/checks.py:260— gym/core/checks.py:260-272 | gym/core/checks.py:428-440 — 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) src/native_host/gpu_d3d.rs:125— src/native_host/gpu_d3d.rs:125-137 | src/native_host/gpu_metal.rs:66-78 — 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) src/wasm_api.rs:5365— src/wasm_api.rs:5365-5377 | src/wasm_api.rs:9152-9165 — 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) gym/tools/fuzz_corpus.py:1283— gym/tools/fuzz_corpus.py:1283-1295 | gym/tools/robustness.py:1112-1130 — 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) src/renderer/float_placement.rs:6296— src/renderer/float_placement.rs:6296-6309 | src/renderer/float_placement.rs:6311-6323 — 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) src/document_core/queries/chart_extract.rs:271— src/document_core/queries/chart_extract.rs:271-283 | src/document_core/queries/table_extract.rs:292-304 — 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) src/wasm_api/hyperlink.rs:81— src/wasm_api/hyperlink.rs:81-93 | src/wasm_api/hyperlink.rs:96-108 — 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) src/diagnostics/hwp5_roundtrip_batch.rs:588— src/diagnostics/hwp5_roundtrip_batch.rs:588-600 | src/diagnostics/hwpx_roundtrip_batch.rs:424-436 — 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) src/parser/hwpx/header.rs:463— src/parser/hwpx/header.rs:463-475 | src/parser/hwpx/section.rs:1796-1815 — 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) src/document_core/native_pua_fonts.rs:294— src/document_core/native_pua_fonts.rs:294-306 | src/document_core/queries/rendering.rs:5040-5054 — 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) src/renderer/image_resolver.rs:832— src/renderer/image_resolver.rs:832-844 | src/renderer/image_resolver.rs:952-964 — 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) src/native_host/gpu_d3d.rs:436— src/native_host/gpu_d3d.rs:436-448 | src/native_host/gpu_metal.rs:322-334 — 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) src/parser/hwp3/ole.rs:80— src/parser/hwp3/ole.rs:80-93 | src/parser/hwp3/records.rs:293-305 — 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) src/wasm_api.rs:6373— src/wasm_api.rs:6373-6385 | src/wasm_api.rs:6398-6414 — 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) src/native_host/mod.rs:302— src/native_host/mod.rs:302-314 | src/native_host/mod.rs:323-335 — 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) src/serializer/control.rs:980— src/serializer/control.rs:980-992 | src/serializer/control.rs:1110-1122 — 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) src/renderer/layout/table_layout.rs:6490— src/renderer/layout/table_layout.rs:6490-6503 | src/renderer/layout/table_layout.rs:22704-22716 — 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) src/diagnostics/hwp5_cell_header_probe.rs:663— src/diagnostics/hwp5_cell_header_probe.rs:663-675 | src/diagnostics/hwp5_mel_personnel_probe.rs:572-584 — 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) samples/continuation_reset/gen_continuation_reset.py:57— samples/continuation_reset/gen_continuation_reset.py:57-72 | samples/issue8468/gen_line_reserve.py:57-69 — 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) scripts/font_kerning_cohort.py:81— scripts/font_kerning_cohort.py:81-93 | scripts/font_rank8_qualification.py:67-79 — 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) tools/task2070/make_hy_ladder4.py:136— tools/task2070/make_hy_ladder4.py:136-148 | tools/task2097/make_cellcompress_ladder.py:48-60 — 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) tools/llm_verifier/repeat_eval/src/exit_class.rs:74— tools/llm_verifier/repeat_eval/src/exit_class.rs:74-86 | tools/llm_verifier/verdict_protocol/src/exit_class.rs:91-103 — 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) tools/llm_verifier/criteria_decomp/src/envelope.rs:31— tools/llm_verifier/criteria_decomp/src/envelope.rs:31-43 | tools/llm_verifier/repeat_eval/src/envelope.rs:93-108 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×25
Edited copy of a member (7 corresponding lines) pdf/issue7998/generate_compound_variations.py:9— pdf/issue7998/generate_compound_variations.py:9-15 | pdf/issue7998/raster-strokes/generate_sources.py:9-15 — 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) src/renderer/mod.rs:1265— src/renderer/mod.rs:1265-1271 | src/renderer/mod.rs:1282-1292 — 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) src/renderer/skia/equation_conv.rs:789— src/renderer/skia/equation_conv.rs:789-795 | src/renderer/skia/renderer.rs:2623-2629 — 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) src/renderer/anisotropic_sampling.rs:10— src/renderer/anisotropic_sampling.rs:10-16 | src/renderer/cubic_sampling.rs:9-18 — 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) src/parser/hwp3/drawing.rs:378— src/parser/hwp3/drawing.rs:378-390 | src/parser/hwp3/records.rs:433-439 — 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) src/parser/pdf/allocation.rs:54— src/parser/pdf/allocation.rs:54-60 | src/parser/pdf/allocation.rs:74-80 — 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) src/renderer/equation/variable_outline.rs:188— src/renderer/equation/variable_outline.rs:188-194 | src/renderer/hft_outline.rs:156-162 — 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) src/document_core/hwpjson/body.rs:151— src/document_core/hwpjson/body.rs:151-157 | src/document_core/hwpjson/fonts_charpr.rs:94-104 — 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) src/document_core/commands/object_ops/chart.rs:180— src/document_core/commands/object_ops/chart.rs:180-186 | src/document_core/commands/object_ops/chart.rs:193-204 — 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) src/renderer/float_placement.rs:7954— src/renderer/float_placement.rs:7954-7960 | src/renderer/float_placement.rs:8593-8602 — 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) src/document_core/converters/hwpx_to_hwp.rs:2601— src/document_core/converters/hwpx_to_hwp.rs:2601-2607 | src/renderer/layout/shape_layout.rs:123-129 — 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) src/document_core/queries/hwpctrl_sets.rs:41— src/document_core/queries/hwpctrl_sets.rs:41-48 | src/parser/pdf/table_paint.rs:108-114 — 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) src/renderer/height_cursor.rs:131— src/renderer/height_cursor.rs:131-137 | src/renderer/typeset.rs:926-932 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/diagnostics/hwp5_contract_analyze.rs:646— src/diagnostics/hwp5_contract_analyze.rs:646-652 | src/diagnostics/hwp5_inventory_diff.rs:2225-2231 — 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) src/parser/hwp3/mod.rs:544— src/parser/hwp3/mod.rs:544-550 | src/renderer/pagination.rs:1534-1540 — 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) src/paint/metafile_picture.rs:72— src/paint/metafile_picture.rs:72-79 | src/renderer/image_resolver/print_picture_resample.rs:62-68 — 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) src/renderer/height_cursor.rs:139— src/renderer/height_cursor.rs:139-145 | src/renderer/typeset.rs:910-916 — 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) samples/issue1937/gen_cell_notes_multipage.py:95— samples/issue1937/gen_cell_notes_multipage.py:95-103 | samples/issue8081/gen_fn_table.py:91-97 — 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) scripts/font_kerning_cohort.py:123— scripts/font_kerning_cohort.py:123-129 | scripts/font_rank8_qualification.py:120-126 — 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) tools/table_exchange/cases.py:300— tools/table_exchange/cases.py:300-306 | tools/table_exchange/cases.py:310-316 — 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) bindings/Native/examples/native_host.py:66— bindings/Native/examples/native_host.py:66-72 | bindings/Native/examples/native_host.py:75-85 — 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) tools/task2373/ladder_diff.py:19— tools/task2373/ladder_diff.py:19-25 | tools/task2373/ladder_diff.py:29-35 — 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) tools/render_backend/gen_m06f.py:92— tools/render_backend/gen_m06f.py:92-98 | tools/render_backend/harness.py:42-48 — 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) tools/scale_ladder.py:172— tools/scale_ladder.py:172-179 | tools/scale_ladder.py:183-189 — 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) scripts/font_oracle_inventory.py:238— scripts/font_oracle_inventory.py:238-248 | scripts/pdf_oracle_observe.py:313-319 — 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 (8 lines × 3) src/bin/rhwp-agent/stats.rs:25— src/bin/rhwp-agent/stats.rs:25-32 | src/bin/rhwp-agent/stats.rs:70-77 | src/bin/rhwp-agent/stats.rs:132-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.
Duplicated block (8 lines × 3) src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:124— src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:124-131 | src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:24-31 | src/bin/rhwp-q/commands/rhwp-q-objects.rs:24-31 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs` and `src/bin/rhwp-q/commands/rhwp-q-objects.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 114 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 `src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) src/bin/rhwp-q/commands/rhwp-q-markdown.rs:53— src/bin/rhwp-q/commands/rhwp-q-markdown.rs:53-60 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:52-59 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:53-60 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-markdown.rs` and `src/bin/rhwp-q/commands/rhwp-q-page-images.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 166 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 `src/bin/rhwp-q/commands/rhwp-q-markdown.rs:53` 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 (8 lines × 3) src/bin/rhwp-q/pack/inventory.rs:419— src/bin/rhwp-q/pack/inventory.rs:419-426 | src/bin/rhwp-q/pack/inventory.rs:1019-1026 | src/bin/rhwp-q/pack/inventory.rs:1044-1051 — 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 `src/bin/rhwp-q/pack/inventory.rs:419` 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 (8 lines × 3) src/cli/protocol/exchange/disclosure.rs:21— src/cli/protocol/exchange/disclosure.rs:21-28 | src/cli/protocol/exchange/disclosure.rs:224-231 | src/cli/protocol/exchange/settlement.rs:175-182 — before extracting anything, compare `src/cli/protocol/exchange/disclosure.rs` and `src/cli/protocol/exchange/settlement.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 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 `src/cli/protocol/exchange/disclosure.rs:21` 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 × 3) src/document_core/commands/text_editing.rs:5281— src/document_core/commands/text_editing.rs:5281-5289 | src/document_core/commands/text_editing.rs:6563-6571 | src/document_core/commands/text_editing.rs:6613-6620 — 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 `src/document_core/commands/text_editing.rs:5281` 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) src/document_core/queries/cursor_rect.rs:1989— src/document_core/queries/cursor_rect.rs:1989-1996 | src/document_core/queries/cursor_rect.rs:5419-5426 | src/document_core/queries/cursor_rect.rs:5957-5964 — 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 `src/document_core/queries/cursor_rect.rs:1989` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `run` to `&RunInfo` in one and `&HfRunInfo` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 3) src/document_core/queries/hwpctrl_sets.rs:1031— src/document_core/queries/hwpctrl_sets.rs:1031-1038 | src/document_core/queries/hwpctrl_sets.rs:1105-1112 | src/document_core/queries/hwpctrl_sets.rs:1172-1179 — 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 (8 lines × 3) src/renderer/canvas.rs:333— src/renderer/canvas.rs:333-340 | src/renderer/svg.rs:1487-1494 | src/renderer/web_canvas.rs:1810-1817 — before extracting anything, compare `src/renderer/svg.rs` and `src/renderer/web_canvas.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 321 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) src/renderer/html.rs:497— src/renderer/html.rs:497-504 | src/renderer/svg.rs:4238-4245 | src/renderer/web_canvas.rs:3378-3385 — before extracting anything, compare `src/renderer/html.rs` and `src/renderer/svg.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 76 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 `src/renderer/html.rs:497` 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 × 3) src/renderer/layout/table_layout.rs:20959— src/renderer/layout/table_layout.rs:20959-20966 | src/renderer/layout/table_layout.rs:21046-21053 | src/renderer/layout/table_layout.rs:21935-21942 — 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 `src/renderer/layout/table_layout.rs:20959` 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 × 3) src/renderer/layout/table_layout.rs:21376— src/renderer/layout/table_layout.rs:21376-21383 | src/renderer/layout/table_layout.rs:24205-24212 | src/renderer/layout/table_layout/stored_inline_row_frame.rs:24-31 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 3) src/renderer/layout/table_layout.rs:22241— src/renderer/layout/table_layout.rs:22241-22248 | src/renderer/layout/table_layout.rs:22278-22285 | src/renderer/layout/table_layout.rs:22338-22345 — 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 `src/renderer/layout/table_layout.rs:22241` 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 × 3) src/renderer/pagination/engine.rs:1127— src/renderer/pagination/engine.rs:1127-1136 | src/renderer/pagination/engine.rs:1170-1177 | src/renderer/typeset/controls/host_wrap.rs:32-39 — before extracting anything, compare `src/renderer/pagination/engine.rs` and `src/renderer/typeset/controls/host_wrap.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/pagination/engine.rs:1127` 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 × 3) src/wmf/converter/svg/mod.rs:720— src/wmf/converter/svg/mod.rs:720-727 | src/wmf/converter/svg/mod.rs:1186-1193 | src/wmf/converter/svg/mod.rs:1363-1370 — 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 `src/wmf/converter/svg/mod.rs:720` 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 lines × 3) src/renderer/layout/table_layout.rs:5633— src/renderer/layout/table_layout.rs:5633-5640 | src/renderer/layout/table_layout.rs:5642-5649 | src/renderer/layout/table_layout.rs:5650-5663 — 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 `src/renderer/layout/table_layout.rs:5633` 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 (8 lines × 3) src/document_core/queries/rendering.rs:6159— src/document_core/queries/rendering.rs:6159-6166 | src/renderer/pagination/engine.rs:3177-3184 | src/renderer/typeset/state/finalize.rs:137-144 — before extracting anything, compare `src/renderer/pagination/engine.rs` and `src/renderer/typeset/state/finalize.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/queries/rendering.rs:6159` 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) src/native_host/render_snapshot.rs:35— src/native_host/render_snapshot.rs:35-42 | src/paint/json.rs:3798-3805 | src/renderer/canvaskit_policy.rs:1155-1162 — before extracting anything, compare `src/paint/json.rs` and `src/renderer/canvaskit_policy.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) src/serializer/hwpx/picture.rs:781— src/serializer/hwpx/picture.rs:781-788 | src/serializer/hwpx/shape.rs:1742-1749 | src/serializer/hwpx/table.rs:734-741 — before extracting anything, compare `src/serializer/hwpx/picture.rs` and `src/serializer/hwpx/shape.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) src/wmf/parser/objects/graphics/region.rs:96— src/wmf/parser/objects/graphics/region.rs:96-103 | src/wmf/parser/records/drawing/poly_line.rs:51-60 | src/wmf/parser/records/drawing/polygon.rs:53-62 — 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 `src/wmf/parser/objects/graphics/region.rs:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) src/cli/queries/document_inventory.rs:128— src/cli/queries/document_inventory.rs:128-135 | src/cli/queries/document_inventory.rs:200-207 | src/cli/queries/structured_objects.rs:310-317 — before extracting anything, compare `src/cli/queries/document_inventory.rs` and `src/cli/queries/structured_objects.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 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 `src/cli/queries/document_inventory.rs:128` 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) src/diagnostics/hwp5_cell_header_probe.rs:939— src/diagnostics/hwp5_cell_header_probe.rs:939-946 | src/diagnostics/hwp5_contract_probe.rs:858-865 | src/diagnostics/hwp5_table_probe.rs:696-703 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_contract_probe.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 370 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) tools/llm_verifier/process_steps/src/exit_class.rs:66— tools/llm_verifier/process_steps/src/exit_class.rs:66-73 | tools/llm_verifier/repeat_eval/src/exit_class.rs:75-82 | tools/llm_verifier/verdict_protocol/src/exit_class.rs:92-99 — before extracting anything, compare `tools/llm_verifier/process_steps/src/exit_class.rs` and `tools/llm_verifier/repeat_eval/src/exit_class.rs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `tools/llm_verifier/process_steps/src/exit_class.rs:66` 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) tools/oracle_public/page_smoke.py:177— tools/oracle_public/page_smoke.py:177-184 | tools/oracle_public/sweep_runner.py:590-597 | tools/page_roundtrip/harness.py:262-269 — before extracting anything, compare `tools/oracle_public/page_smoke.py` and `tools/oracle_public/sweep_runner.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×23
Edited copy of a member (6 corresponding lines) mydocs/pr/assets/issue_536_seo_rii_20261021/consumer_probe.rs:5— mydocs/pr/assets/issue_536_seo_rii_20261021/consumer_probe.rs:5-10 | mydocs/pr/assets/seo_rii_20261030/consumer_probe.rs:5-10 — 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) src/paint/shaping_glyph.rs:592— src/paint/shaping_glyph.rs:592-598 | src/paint/shaping_glyph.rs:600-605 — 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) gym/report.py:250— gym/report.py:250-256 | gym/certify.py:256-261 — 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) src/renderer/layout/table_layout.rs:871— src/renderer/layout/table_layout.rs:871-876 | src/renderer/layout/table_layout.rs:894-899 — 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) src/renderer/layout/shape_layout.rs:3201— src/renderer/layout/shape_layout.rs:3201-3209 | src/renderer/layout/shape_layout.rs:3211-3216 — 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) src/document_core/helpers.rs:1046— src/document_core/helpers.rs:1046-1051 | src/emf/converter/svg.rs:47-52 — 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) src/diagnostics/hwp5_contract_analyze.rs:961— src/diagnostics/hwp5_contract_analyze.rs:961-966 | src/serializer/hwpx/section.rs:4080-4085 — 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) src/wasm_api.rs:1164— src/wasm_api.rs:1164-1169 | src/wasm_api/layer_export.rs:103-108 — 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) src/renderer/equation/svg_render.rs:791— src/renderer/equation/svg_render.rs:791-796 | src/serializer/hwpx/form.rs:55-60 — 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) src/doclang/resources.rs:239— src/doclang/resources.rs:239-244 | src/doclang/writer/mod.rs:309-314 — 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) src/renderer/equation/layout/symbol_advances.rs:201— src/renderer/equation/layout/symbol_advances.rs:201-206 | src/renderer/hancom_pua.rs:104-110 — 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) src/renderer/layout_frame.rs:508— src/renderer/layout_frame.rs:508-513 | src/renderer/supplemental_metrics.rs:474-479 — 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) gym/report.py:304— gym/report.py:304-309 | gym/tools/discriminate.py:637-642 — 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) src/renderer/composer/line_breaking.rs:1853— src/renderer/composer/line_breaking.rs:1853-1858 | src/renderer/layout_frame.rs:774-779 — 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) src/paint/json.rs:2344— src/paint/json.rs:2344-2350 | src/paint/paint_op.rs:913-918 — 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) src/document_core/queries/rendering.rs:1819— src/document_core/queries/rendering.rs:1819-1825 | src/renderer/layout/utils.rs:44-49 — 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) bindings/Native/examples/qt_native_host.py:1408— bindings/Native/examples/qt_native_host.py:1408-1415 | bindings/Native/examples/qt_native_host.py:1430-1435 — 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) samples/issue1937/gen_cell_notes_multipage.py:59— samples/issue1937/gen_cell_notes_multipage.py:59-64 | samples/issue8081/gen_fn_table.py:55-60 — 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) samples/issue1937/gen_row_trim.py:61— samples/issue1937/gen_row_trim.py:61-66 | samples/issue8464/gen_row_content_fit.py:71-76 — 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) scripts/oracle_stage4_profile.py:649— scripts/oracle_stage4_profile.py:649-655 | scripts/oracle_stage5_rank8_profile.py:485-490 — 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) tools/oracle_public/sweep_runner.py:524— tools/oracle_public/sweep_runner.py:524-529 | tools/skill_router/route.py:115-120 — 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) tools/verify_hangul_pages.py:44— tools/verify_hangul_pages.py:44-50 | tools/verify_pi_page_roundtrip.py:111-116 — 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) tools/llm_verifier/process_steps/src/loader.rs:66— tools/llm_verifier/process_steps/src/loader.rs:66-71 | tools/llm_verifier/verdict_protocol/src/loader.rs:62-67 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×23
Edited copy of a member (14 corresponding lines) src/paint/paint_op.rs:1154— src/paint/paint_op.rs:1154-1169 | src/renderer/pdf.rs:363-376 — 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) src/renderer/equation/canvas_render.rs:470— src/renderer/equation/canvas_render.rs:470-483 | src/renderer/equation/canvas_render.rs:492-507 — 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) src/document_core/hwpjson/fonts_charpr.rs:166— src/document_core/hwpjson/fonts_charpr.rs:166-180 | src/document_core/hwpjson/fonts_charpr.rs:182-195 — 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) src/native_host/editor.rs:453— src/native_host/editor.rs:453-466 | src/native_host/editor.rs:468-481 — 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) src/document_core/queries/cursor_nav.rs:584— src/document_core/queries/cursor_nav.rs:584-597 | src/document_core/queries/cursor_nav.rs:600-613 — 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) mydocs/tech/investigations/issue-7441/probes/check_7441_footer_area_cover.rs:28— mydocs/tech/investigations/issue-7441/probes/check_7441_footer_area_cover.rs:28-44 | mydocs/tech/investigations/issue-7441/probes/repro_7441_reporter_geometry.rs:34-47 — 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) gym/tools/competitive_bench.py:310— gym/tools/competitive_bench.py:310-323 | gym/tools/competitive_bench.py:349-362 — 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) src/paint/replay_order.rs:98— src/paint/replay_order.rs:98-111 | src/renderer/svg_layer.rs:222-236 — 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) src/renderer/scheduler.rs:277— src/renderer/scheduler.rs:277-297 | src/renderer/scheduler.rs:365-378 — 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) src/renderer/height_cursor.rs:2883— src/renderer/height_cursor.rs:2883-2896 | src/renderer/height_cursor.rs:2902-2915 — 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) src/paint/json.rs:1652— src/paint/json.rs:1652-1672 | src/paint/json.rs:1674-1687 — 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) src/renderer/layout/table_layout.rs:18789— src/renderer/layout/table_layout.rs:18789-18802 | src/renderer/layout/table_layout.rs:18813-18826 — 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) src/serializer/control.rs:1283— src/serializer/control.rs:1283-1297 | src/serializer/control.rs:3104-3117 — 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) src/paint/json.rs:483— src/paint/json.rs:483-500 | src/paint/text_v2.rs:745-758 — 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) crates/rhwp-password-crypto/src/lib.rs:736— crates/rhwp-password-crypto/src/lib.rs:736-749 | src/parser/hwp3/mod.rs:109-124 — 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) src/renderer/font_metric_contextual_scripts.rs:688— src/renderer/font_metric_contextual_scripts.rs:688-701 | src/renderer/font_metric_supplementary_pictographs.rs:254-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) src/model/paragraph.rs:804— src/model/paragraph.rs:804-818 | src/renderer/composer/line_breaking.rs:3629-3642 — 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) src/model/shape.rs:617— src/model/shape.rs:617-630 | src/model/shape.rs:632-651 — 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) src/parser/body_text.rs:898— src/parser/body_text.rs:898-912 | src/parser/body_text.rs:954-967 — 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) src/renderer/composer/nested_table_frames.rs:28— src/renderer/composer/nested_table_frames.rs:28-44 | src/renderer/float_placement/reflow_block_lines.rs:20-33 — 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) src/render_backend/png_adapter.rs:89— src/render_backend/png_adapter.rs:89-102 | src/render_backend/skia_adapter.rs:101-114 — 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) samples/issue1937/gen_row_trim.py:70— samples/issue1937/gen_row_trim.py:70-83 | samples/issue8464/gen_row_content_fit.py:80-93 — 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) tools/oracle_public/oracle_resolver.py:259— tools/oracle_public/oracle_resolver.py:259-285 | tools/oracle_public/sweep_runner.py:434-447 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×22
Edited copy of a member (10 corresponding lines) mydocs/tech/investigations/issue-1113/probes/repro_1113_round1.rs:2— mydocs/tech/investigations/issue-1113/probes/repro_1113_round1.rs:2-11 | mydocs/tech/investigations/issue-1113/probes/repro_1113_save.rs:4-19 — 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) src/document_core/helpers.rs:873— src/document_core/helpers.rs:873-882 | src/renderer/skia/renderer.rs:2612-2621 — 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) gym/certify.py:367— gym/certify.py:367-376 | gym/report.py:410-419 — 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) src/document_core/helpers.rs:215— src/document_core/helpers.rs:215-224 | src/document_core/helpers.rs:229-238 — 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) bindings/swift/Sources/Rhwp/RhwpNativeHost.swift:17— bindings/swift/Sources/Rhwp/RhwpNativeHost.swift:17-26 | bindings/swift/Sources/Rhwp/RhwpNativeHost.swift:37-47 — 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) src/parser/pdf/allocation.rs:394— src/parser/pdf/allocation.rs:394-403 | src/parser/pdf/allocation.rs:511-521 — 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) src/document_core/queries/rendering.rs:1847— src/document_core/queries/rendering.rs:1847-1859 | src/document_core/queries/rendering.rs:2216-2225 — 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) src/serializer/hwpx/writer.rs:76— src/serializer/hwpx/writer.rs:76-85 | src/serializer/hwpx/writer.rs:88-97 — 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) src/cli/outputs/vector.rs:863— src/cli/outputs/vector.rs:863-872 | src/document_core/html_table_import.rs:1087-1099 — 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) src/diagnostics/hwp5_char_shape_audit.rs:552— src/diagnostics/hwp5_char_shape_audit.rs:552-561 | src/diagnostics/hwp5_contract_probe.rs:514-523 — 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) src/renderer/equation/logical_font_frame.rs:54— src/renderer/equation/logical_font_frame.rs:54-63 | src/renderer/equation/stored_alignment_metrics.rs:7-16 — 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) src/parser/cfb_reader.rs:283— src/parser/cfb_reader.rs:283-295 | src/parser/cfb_reader.rs:309-318 — 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) src/serializer/hml/head.rs:157— src/serializer/hml/head.rs:157-166 | src/serializer/hml/head.rs:200-229 — 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) gym/tools/differential.py:444— gym/tools/differential.py:444-455 | gym/tools/release_diff.py:500-509 — 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) src/doclang/resources.rs:123— src/doclang/resources.rs:123-132 | src/serializer/hwpx/context.rs:891-901 — 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) src/paint/json.rs:3764— src/paint/json.rs:3764-3774 | src/renderer/canvaskit_policy.rs:2436-2445 — 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) src/parser/hml/reader.rs:1847— src/parser/hml/reader.rs:1847-1856 | src/parser/hwpx/header.rs:31-40 — 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) src/renderer/composer/supplemental_clusters.rs:14— src/renderer/composer/supplemental_clusters.rs:14-23 | src/renderer/layout/text_measurement.rs:895-905 — 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) samples/issue8470/gen_vertical_cell_table.py:92— samples/issue8470/gen_vertical_cell_table.py:92-101 | samples/issue8471/gen_pushed_none_table.py:87-98 — 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) tools/llm_verifier/lineage_chain/corpus_io.py:58— tools/llm_verifier/lineage_chain/corpus_io.py:58-67 | tools/llm_verifier/third_party_replay/corpus_io.py:58-67 — 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) tools/inspect_msec/gen_msec_fixtures.py:595— tools/inspect_msec/gen_msec_fixtures.py:595-606 | tools/render_backend/gen_m06f.py:659-668 — 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) tools/llm_verifier/process_steps/generate_corpus.py:765— tools/llm_verifier/process_steps/generate_corpus.py:765-775 | tools/llm_verifier/verdict_protocol/generate_corpus.py:794-803 — 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.
Duplicated block (19 lines × 2) crates/rhwp-ooxml-chart/src/patch.rs:813— crates/rhwp-ooxml-chart/src/patch.rs:813-831 | crates/rhwp-ooxml-chart/src/patch.rs:840-858 — both copies are in the same file, so extract the 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 `crates/rhwp-ooxml-chart/src/patch.rs:813` 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) crates/rhwp-ooxml-chart/src/renderer.rs:959— crates/rhwp-ooxml-chart/src/renderer.rs:959-977 | crates/rhwp-ooxml-chart/src/renderer.rs:1064-1082 — both copies are in the same file, so extract the 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 `crates/rhwp-ooxml-chart/src/renderer.rs:959` 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) src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:59— src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:59-77 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:59-77 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-page-caret.rs` and `src/bin/rhwp-q/commands/rhwp-q-section-starts.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 128 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 `src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:59` 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) src/bin/rhwp-q/kit/line_starts.rs:54— src/bin/rhwp-q/kit/line_starts.rs:54-72 | src/bin/rhwp-q/kit/para_bounds.rs:54-72 — before extracting anything, compare `src/bin/rhwp-q/kit/line_starts.rs` and `src/bin/rhwp-q/kit/para_bounds.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 146 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 `src/bin/rhwp-q/kit/line_starts.rs:54` 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) src/cli/outputs/raster.rs:211— src/cli/outputs/raster.rs:211-229 | src/cli/outputs/text.rs:457-475 — before extracting anything, compare `src/cli/outputs/raster.rs` and `src/cli/outputs/text.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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 `src/cli/outputs/raster.rs:211` 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) src/document_core/commands/text_editing.rs:1689— src/document_core/commands/text_editing.rs:1689-1707 | src/document_core/commands/text_editing.rs:1942-1960 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:1689` 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) src/document_core/queries/rendering.rs:1415— src/document_core/queries/rendering.rs:1415-1433 | src/document_core/queries/rendering.rs:1456-1474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) src/document_core/queries/rendering.rs:1636— src/document_core/queries/rendering.rs:1636-1654 | src/document_core/queries/rendering.rs:1677-1695 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) src/document_core/queries/rendering.rs:4459— src/document_core/queries/rendering.rs:4459-4477 | src/document_core/queries/rendering.rs:4480-4498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/document_core/queries/rendering.rs:4479` calls `Placeholder` and `src/document_core/queries/rendering.rs:4504` 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 (19 lines × 2) src/parser/hwp3/mod.rs:1737— src/parser/hwp3/mod.rs:1737-1755 | src/parser/hwp3/mod.rs:1957-1975 — both copies are in the same file, so extract the 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) src/parser/hwpx/section.rs:2962— src/parser/hwpx/section.rs:2962-2980 | src/parser/hwpx/section.rs:3014-3032 — both copies are in the same file, so extract the 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 (19 lines × 2) src/renderer/equation/operator_outline.rs:79— src/renderer/equation/operator_outline.rs:79-97 | src/renderer/equation/relation_outline.rs:142-160 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/equation/operator_outline.rs:79` 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) src/renderer/layout/picture_footnote.rs:956— src/renderer/layout/picture_footnote.rs:956-974 | src/renderer/layout/tac_picture_item.inc.rs:416-434 — 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 `src/renderer/layout/picture_footnote.rs:956` 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 after the matched lines, `src/renderer/layout/tac_picture_item.inc.rs:435` calls `Some` and `src/renderer/layout/picture_footnote.rs:975` 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 (19 lines × 2) src/renderer/layout/tac_picture_item.inc.rs:344— src/renderer/layout/tac_picture_item.inc.rs:344-362 | src/renderer/layout/tac_picture_item.inc.rs:370-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 `src/renderer/layout/tac_picture_item.inc.rs:344` 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) src/renderer/render_normalization/math_table.rs:220— src/renderer/render_normalization/math_table.rs:220-238 | src/renderer/render_normalization/math_textbox.rs:162-180 — before extracting anything, compare `src/renderer/render_normalization/math_table.rs` and `src/renderer/render_normalization/math_textbox.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 57 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 `src/renderer/render_normalization/math_table.rs:220` 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 (19 lines × 2) src/renderer/svg.rs:2940— src/renderer/svg.rs:2940-2958 | src/renderer/svg.rs:2967-2985 — both copies are in the same file, so extract the 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 `src/renderer/svg.rs:2940` 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) src/renderer/web_canvas.rs:3950— src/renderer/web_canvas.rs:3950-3968 | src/renderer/web_canvas.rs:4092-4110 — both copies are in the same file, so extract the 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) src/serializer/body_text.rs:1189— src/serializer/body_text.rs:1189-1207 | src/serializer/body_text.rs:1217-1235 — both copies are in the same file, so extract the 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 (19 lines × 2) src/wmf/parser/records/drawing/flood_fill.rs:42— src/wmf/parser/records/drawing/flood_fill.rs:42-60 | src/wmf/parser/records/drawing/set_pixel.rs:41-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/wmf/parser/records/drawing/flood_fill.rs:42` 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) src/document_core/commands/object_ops/chart.rs:956— src/document_core/commands/object_ops/chart.rs:956-974 | src/document_core/commands/object_ops/chart.rs:1105-1123 — both copies are in the same file, so extract the 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) tools/llm_verifier/repeat_eval/generate_corpus.py:1035— tools/llm_verifier/repeat_eval/generate_corpus.py:1035-1053 | tools/llm_verifier/repeat_eval/generate_corpus.py:1063-1081 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) tools/skill_router/install_git_hook.py:52— tools/skill_router/install_git_hook.py:52-70 | tools/skill_router/precommit_skill_gate.py:76-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 3) src/bin/rhwp-q/more/inventory.rs:572— src/bin/rhwp-q/more/inventory.rs:572-582 | src/bin/rhwp-q/more/inventory.rs:599-609 | src/bin/rhwp-q/more/inventory.rs:626-636 — 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 `src/bin/rhwp-q/more/inventory.rs:572` 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 (11 lines × 3) src/cli/outputs/raster.rs:300— src/cli/outputs/raster.rs:300-310 | src/cli/outputs/text.rs:558-568 | src/cli/outputs/vector.rs:341-352 — before extracting anything, compare `src/cli/outputs/raster.rs` and `src/cli/outputs/text.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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 `src/cli/outputs/raster.rs:300` 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 (11 lines × 3) src/cli/protocol/trust/gate.rs:29— src/cli/protocol/trust/gate.rs:29-39 | src/cli/protocol/trust/governance.rs:185-195 | src/cli/protocol/trust/governance.rs:580-590 — before extracting anything, compare `src/cli/protocol/trust/gate.rs` and `src/cli/protocol/trust/governance.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 53 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 `src/cli/protocol/trust/gate.rs:29` 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 (11 lines × 3) src/document_core/commands/header_footer_ops.rs:610— src/document_core/commands/header_footer_ops.rs:610-620 | src/document_core/commands/header_footer_ops.rs:711-721 | src/document_core/queries/cursor_rect.rs:5569-5579 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 3) src/document_core/commands/text_editing.rs:4258— src/document_core/commands/text_editing.rs:4258-4268 | src/document_core/commands/text_editing.rs:4360-4370 | src/document_core/commands/text_editing.rs:5134-5144 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) src/document_core/helpers.rs:523— src/document_core/helpers.rs:523-533 | src/document_core/helpers.rs:544-554 | src/document_core/helpers.rs:565-575 — 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 `src/document_core/helpers.rs:523` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) src/document_core/queries/cursor_rect.rs:5693— src/document_core/queries/cursor_rect.rs:5693-5703 | src/document_core/queries/cursor_rect.rs:6115-6125 | src/document_core/queries/cursor_rect.rs:6227-6237 — 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 `src/document_core/queries/cursor_rect.rs:5693` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) src/native_host/gpu_d3d.rs:616— src/native_host/gpu_d3d.rs:616-626 | src/native_host/gpu_gl.rs:668-678 | src/native_host/gpu_metal.rs:407-417 — before extracting anything, compare `src/native_host/gpu_d3d.rs` and `src/native_host/gpu_metal.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 170 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 `src/native_host/gpu_d3d.rs:616` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) src/paint/json.rs:2779— src/paint/json.rs:2779-2789 | src/paint/json.rs:2805-2815 | src/paint/json.rs:2834-2844 — 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 `src/paint/json.rs:2779` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `gradient_path` to `&crate::paint::ColorPaintLinearGradientPathNode` in one and `&crate::paint::ColorPaintRadialGradientPathNode` 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 × 3) src/renderer/layout/paragraph_layout.rs:4176— src/renderer/layout/paragraph_layout.rs:4176-4186 | src/renderer/layout/paragraph_layout.rs:4347-4357 | src/renderer/layout/paragraph_layout.rs:4445-4455 — 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 `src/renderer/layout/paragraph_layout.rs:4176` 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, `src/renderer/layout/paragraph_layout.rs:4442` calls `with_stored_tabs` and `src/renderer/layout/paragraph_layout.rs:4342` 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 lines × 3) src/renderer/layout/paragraph_layout.rs:10792— src/renderer/layout/paragraph_layout.rs:10792-10802 | src/renderer/layout/paragraph_layout.rs:10973-10983 | src/renderer/layout/paragraph_layout.rs:11019-11029 — 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 `src/renderer/layout/paragraph_layout.rs:10792` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) src/renderer/skia/glyph_replay.rs:757— src/renderer/skia/glyph_replay.rs:757-767 | src/renderer/skia/glyph_replay.rs:788-798 | src/renderer/skia/glyph_replay.rs:823-833 — 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 `src/renderer/skia/glyph_replay.rs:757` 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 (11 lines × 3) src/wmf/parser/objects/structure/log_color_space.rs:62— src/wmf/parser/objects/structure/log_color_space.rs:62-72 | src/wmf/parser/objects/structure/log_color_space_w.rs:62-72 | src/wmf/parser/records/bitmap/set_dib_to_dev.rs:70-80 — before extracting anything, compare `src/wmf/parser/objects/structure/log_color_space.rs` and `src/wmf/parser/objects/structure/log_color_space_w.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 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 `src/wmf/parser/objects/structure/log_color_space.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 (11 lines × 3) src/bin/rhwp-q/kit/cursor_in_cell.rs:76— src/bin/rhwp-q/kit/cursor_in_cell.rs:76-86 | src/bin/rhwp-q/kit/cursor_in_note.rs:72-82 | src/bin/rhwp-q/kit/note_edit_info.rs:61-71 — before extracting anything, compare `src/bin/rhwp-q/kit/cursor_in_cell.rs` and `src/bin/rhwp-q/kit/cursor_in_note.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 109 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 `src/bin/rhwp-q/kit/cursor_in_cell.rs:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/bin/rhwp-q/kit/cursor_in_cell.rs:89` calls `Some`, `take_usize` and `src/bin/rhwp-q/kit/cursor_in_note.rs:85` 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 lines × 3) src/parser/hwp3/drawing.rs:350— src/parser/hwp3/drawing.rs:350-360 | src/parser/hwp3/drawing.rs:403-413 | src/parser/hwp3/drawing.rs:456-466 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) src/diagnostics/hwp5_contract_analyze.rs:251— src/diagnostics/hwp5_contract_analyze.rs:251-261 | src/diagnostics/hwp5_contract_analyze.rs:472-482 | src/diagnostics/hwp5_contract_analyze.rs:544-554 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) src/diagnostics/hwp5_inventory_diff.rs:763— src/diagnostics/hwp5_inventory_diff.rs:763-773 | src/diagnostics/hwp5_inventory_diff.rs:865-875 | src/diagnostics/hwp5_inventory_diff.rs:931-941 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/diagnostics/hwp5_inventory_diff.rs:863` calls `as_str` and `src/diagnostics/hwp5_inventory_diff.rs:761` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 3) src/serializer/hwpx/picture.rs:769— src/serializer/hwpx/picture.rs:769-779 | src/serializer/hwpx/shape.rs:1730-1740 | src/serializer/hwpx/table.rs:722-732 — before extracting anything, compare `src/serializer/hwpx/picture.rs` and `src/serializer/hwpx/shape.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 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 × 3) src/renderer/height_measurer.rs:6143— src/renderer/height_measurer.rs:6143-6153 | src/renderer/page_layout.rs:62-72 | src/renderer/pagination.rs:856-866 — 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 `src/renderer/pagination.rs:856` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) src/parser/hwpx/section.rs:3248— src/parser/hwpx/section.rs:3248-3260 | src/parser/hwpx/section.rs:3871-3881 | src/parser/hwpx/section.rs:7853-7865 — 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 `src/parser/hwpx/section.rs:3248` 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 (11 lines × 3) src/bin/rhwp-q/kit/canvaskit_preflight.rs:79— src/bin/rhwp-q/kit/canvaskit_preflight.rs:79-89 | src/bin/rhwp-q/kit/layer_tree.rs:60-70 | src/bin/rhwp-q/kit/page_border_fill.rs:60-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/kit/canvaskit_preflight.rs:79` 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 (11 lines × 3) src/cli/protocol/exchange/disclosure.rs:30— src/cli/protocol/exchange/disclosure.rs:30-40 | src/cli/protocol/trust/anchor.rs:28-38 | src/cli/protocol/trust/anchor.rs:182-192 — before extracting anything, compare `src/cli/protocol/exchange/disclosure.rs` and `src/cli/protocol/trust/anchor.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/exchange/disclosure.rs:30` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×21
Edited copy of a member (15 corresponding lines) src/parser/control.rs:656— src/parser/control.rs:656-683 | src/parser/control.rs:707-721 — 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) src/diagnostics/hwp5_roundtrip_batch.rs:570— src/diagnostics/hwp5_roundtrip_batch.rs:570-585 | src/diagnostics/hwpx_roundtrip_batch.rs:407-421 — 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) src/parser/pdf/recognition.rs:806— src/parser/pdf/recognition.rs:806-828 | tools/pdf-ir-poc/src/recognition.rs:549-563 — 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) src/diagnostics/ir_field_sweep.rs:1161— src/diagnostics/ir_field_sweep.rs:1161-1175 | src/serializer/hwpx/roundtrip.rs:1808-1822 — 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) src/document_core/commands/header_footer_ops.rs:246— src/document_core/commands/header_footer_ops.rs:246-260 | src/document_core/commands/header_footer_ops.rs:268-282 — 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) src/bin/rhwp-q/more/inventory.rs:90— src/bin/rhwp-q/more/inventory.rs:90-104 | src/bin/rhwp-q/more/inventory.rs:1082-1099 — 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) src/renderer/cubic_sampling.rs:45— src/renderer/cubic_sampling.rs:45-59 | src/renderer/image_resolver/print_alpha.rs:153-168 — 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) src/renderer/typeset/controls/deferred.rs:76— src/renderer/typeset/controls/deferred.rs:76-91 | src/renderer/typeset/controls/deferred.rs:96-110 — 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) src/renderer/layout.rs:4095— src/renderer/layout.rs:4095-4109 | src/renderer/layout.rs:4114-4128 — 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) src/document_core/hwpjson/pack.rs:160— src/document_core/hwpjson/pack.rs:160-174 | src/document_core/hwpjson/pack.rs:205-222 — 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) src/eps.rs:1929— src/eps.rs:1929-1943 | src/renderer/html.rs:583-598 — 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) src/document_core/commands/object_ops/picture.rs:299— src/document_core/commands/object_ops/picture.rs:299-313 | src/document_core/commands/object_ops/picture.rs:314-328 — 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) src/renderer/layout/paragraph_layout.rs:1157— src/renderer/layout/paragraph_layout.rs:1157-1171 | src/renderer/typeset/paragraph/line_queries.rs:12-26 — 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) mydocs/tech/investigations/issue-1061/probes/dump_equation_records.rs:64— mydocs/tech/investigations/issue-1061/probes/dump_equation_records.rs:64-79 | mydocs/tech/investigations/issue-1067/probes/dump_polygon_transform.rs:67-81 — 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) gym/tools/audit.py:498— gym/tools/audit.py:498-512 | gym/tools/release_gate.py:564-582 — 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) src/parser/crypto.rs:151— src/parser/crypto.rs:151-165 | src/parser/crypto.rs:190-204 — 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) src/native_host/gpu_gl.rs:1037— src/native_host/gpu_gl.rs:1037-1053 | src/native_host/gpu_gl.rs:1057-1071 — 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) src/document_core/commands/text_editing.rs:6434— src/document_core/commands/text_editing.rs:6434-6448 | src/document_core/queries/cursor_nav.rs:788-802 — 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) src/parser/hwpx/section.rs:2197— src/parser/hwpx/section.rs:2197-2211 | src/parser/hwpx/section.rs:7046-7061 — 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) src/renderer/layout/shape_layout.rs:256— src/renderer/layout/shape_layout.rs:256-272 | src/renderer/layout/shape_layout.rs:298-312 — 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) tools/llm_verifier/claim_bind/src/loader.rs:67— tools/llm_verifier/claim_bind/src/loader.rs:67-81 | tools/llm_verifier/criteria_decomp/src/loader.rs:68-82 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×21
Edited copy of a member (12 corresponding lines) src/renderer/font_metric_math_symbol_blocks.rs:265— src/renderer/font_metric_math_symbol_blocks.rs:265-276 | src/renderer/font_metric_math_symbols.rs:77-92 — 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) src/doclang/eqedit/latex.rs:399— src/doclang/eqedit/latex.rs:399-410 | src/doclang/eqedit/latex.rs:415-427 — 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) src/renderer/layout/text_measurement.rs:2970— src/renderer/layout/text_measurement.rs:2970-2981 | src/renderer/layout/text_measurement.rs:3135-3153 — 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) src/renderer/web_canvas/image_coverage.rs:11— src/renderer/web_canvas/image_coverage.rs:11-22 | src/renderer/web_canvas/rectangle_fill.rs:11-32 — 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) src/paint/metafile_print/images.rs:28— src/paint/metafile_print/images.rs:28-39 | src/paint/metafile_print/text.rs:29-40 — 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) src/parser/hwpx/header.rs:1233— src/parser/hwpx/header.rs:1233-1244 | src/parser/hwpx/section.rs:510-523 — 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) src/security_trailer.rs:161— src/security_trailer.rs:161-172 | src/security_trailer.rs:366-378 — 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) src/renderer/layout/paragraph_layout.rs:1263— src/renderer/layout/paragraph_layout.rs:1263-1274 | src/renderer/typeset.rs:1481-1492 — 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) src/parser/cfb_reader.rs:175— src/parser/cfb_reader.rs:175-186 | src/parser/cfb_reader.rs:196-207 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/renderer/float_placement.rs:9096— src/renderer/float_placement.rs:9096-9107 | src/renderer/float_placement.rs:9109-9122 — 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) src/document_core/queries/stego_scan.rs:280— src/document_core/queries/stego_scan.rs:280-291 | src/document_core/text_security.rs:660-671 — 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) src/parser/hwp3/drawing.rs:135— src/parser/hwp3/drawing.rs:135-148 | src/parser/hwp3/drawing.rs:431-442 — 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) src/serializer/hwpx/picture.rs:368— src/serializer/hwpx/picture.rs:368-379 | src/serializer/hwpx/table.rs:309-325 — 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) src/serializer/hwpx/picture.rs:746— src/serializer/hwpx/picture.rs:746-757 | src/serializer/hwpx/shape.rs:1659-1670 — 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) src/diagnostics/hwp5_roundtrip_batch.rs:273— src/diagnostics/hwp5_roundtrip_batch.rs:273-284 | src/diagnostics/hwpx_roundtrip_batch.rs:145-156 — 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) src/renderer/typeset.rs:1161— src/renderer/typeset.rs:1161-1174 | src/renderer/typeset.rs:1176-1187 — 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) src/document_core/commands/formatting.rs:260— src/document_core/commands/formatting.rs:260-271 | src/document_core/queries/cursor_nav.rs:911-923 — 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) src/document_core/queries/font_metric_coverage/report.rs:66— src/document_core/queries/font_metric_coverage/report.rs:66-77 | src/service/open.rs:391-402 — 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) src/rag/chunker.rs:48— src/rag/chunker.rs:48-59 | src/renderer/composer/line_breaking.rs:1371-1385 — 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) tools/task2287/delta_staircase.py:65— tools/task2287/delta_staircase.py:65-79 | tools/verify_pi_page_vs_hangul.py: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) scripts/font_rank1_metric_hypothesis.py:286— scripts/font_rank1_metric_hypothesis.py:286-297 | scripts/font_rank8_metric_hypothesis.py:308-319 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×21
Edited copy of a member (11 corresponding lines) src/parser/hwp3/mod.rs:449— src/parser/hwp3/mod.rs:449-459 | src/parser/hwp3/mod.rs:473-485 — 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) src/bin/rhwp-agent/envelope.rs:179— src/bin/rhwp-agent/envelope.rs:179-189 | src/cli/metadata/capabilities/mod.rs:454-465 — 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) src/renderer/skia/font_lookup.rs:123— src/renderer/skia/font_lookup.rs:123-139 | src/renderer/skia/font_lookup.rs:518-528 — 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) src/main.rs:482— src/main.rs:482-492 | src/service/open.rs:348-359 — 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) rhwp-desk/src/commands.rs:141— rhwp-desk/src/commands.rs:141-152 | rhwp-desk/src/commands.rs:426-436 — 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) src/document_core/helpers.rs:149— src/document_core/helpers.rs:149-159 | src/document_core/helpers.rs:183-193 — 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) .claude/skills/rhwp-knowledge-map/references/_gen_pack.py:301— .claude/skills/rhwp-knowledge-map/references/_gen_pack.py:301-311 | .claude/skills/rhwp-recipes/references/_gen_pack.py:392-402 — 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) src/renderer/skia/synthetic_typeface.rs:67— src/renderer/skia/synthetic_typeface.rs:67-77 | src/renderer/skia/synthetic_typeface.rs:122-135 — 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) src/parser/hwpx/section.rs:5571— src/parser/hwpx/section.rs:5571-5581 | src/parser/hwpx/section.rs:5583-5596 — 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) src/renderer/layout/paragraph_border.rs:14— src/renderer/layout/paragraph_border.rs:14-24 | src/renderer/layout/table_inline_picture_origin.rs:64-75 — 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) src/renderer/pdf_synthetic_bold.rs:94— src/renderer/pdf_synthetic_bold.rs:94-104 | src/renderer/pdf_synthetic_italic.rs:80-90 — 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) src/renderer/layout/table_layout.rs:11525— src/renderer/layout/table_layout.rs:11525-11540 | src/renderer/layout/table_layout.rs:13735-13745 — 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) src/renderer/image_resolver.rs:306— src/renderer/image_resolver.rs:306-318 | src/renderer/image_resolver.rs:330-340 — 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) src/render_backend/png_adapter.rs:119— src/render_backend/png_adapter.rs:119-129 | src/render_backend/skia_adapter.rs:131-141 — 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) src/document_core/commands/object_ops/chart.rs:1266— src/document_core/commands/object_ops/chart.rs:1266-1276 | src/document_core/commands/object_ops/chart.rs:1309-1322 — 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) src/serializer/hwpx/header.rs:590— src/serializer/hwpx/header.rs:590-600 | src/serializer/hwpx/header.rs:609-628 — 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) src/parser/body_text.rs:398— src/parser/body_text.rs:398-408 | src/parser/hwpx/section.rs:605-616 — 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) scripts/secd_tail_survey.py:151— scripts/secd_tail_survey.py:151-165 | tools/issue5162_field_wraps_table.py:82-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) scripts/extract_char_shape_ir.py:107— scripts/extract_char_shape_ir.py:107-117 | scripts/extract_char_shape_ir.py:120-130 — 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) tools/scale_ladder.py:198— tools/scale_ladder.py:198-210 | tools/scale_ladder_real.py:545-555 — 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) tools/fork_harvest/harvest.py:225— tools/fork_harvest/harvest.py:225-246 | tools/fork_harvest/harvest.py:250-260 — 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.
Duplicated block (12 lines × 3) src/bin/rhwp-q/kit/cursor_in_cell.rs:33— src/bin/rhwp-q/kit/cursor_in_cell.rs:33-44 | src/bin/rhwp-q/kit/cursor_in_note.rs:32-43 | src/bin/rhwp-q/kit/note_edit_info.rs:27-38 — before extracting anything, compare `src/bin/rhwp-q/kit/cursor_in_cell.rs` and `src/bin/rhwp-q/kit/cursor_in_note.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 109 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 `src/bin/rhwp-q/kit/cursor_in_cell.rs:33` 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 lines × 3) src/bin/rhwp-q/kit/cursor_in_cell.rs:91— src/bin/rhwp-q/kit/cursor_in_cell.rs:91-102 | src/bin/rhwp-q/kit/cursor_in_note.rs:86-97 | src/bin/rhwp-q/kit/note_edit_info.rs:73-84 — before extracting anything, compare `src/bin/rhwp-q/kit/cursor_in_cell.rs` and `src/bin/rhwp-q/kit/cursor_in_note.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 109 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 `src/bin/rhwp-q/kit/cursor_in_cell.rs:91` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/bin/rhwp-q/kit/cursor_in_cell.rs:105` calls `require` and `src/bin/rhwp-q/kit/cursor_in_note.rs:100` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 3) src/cli/commands/edit/equations.rs:71— src/cli/commands/edit/equations.rs:71-82 | src/cli/commands/edit/formatting.rs:941-952 | src/cli/commands/edit/note_content.rs:638-649 — before extracting anything, compare `src/cli/commands/edit/equations.rs` and `src/cli/commands/edit/formatting.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 178 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 `src/cli/commands/edit/equations.rs:71` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 3) src/doclang/adapter/inline.rs:136— src/doclang/adapter/inline.rs:136-147 | src/doclang/adapter/inline.rs:157-168 | src/doclang/adapter/inline.rs:204-215 — 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 `src/doclang/adapter/inline.rs:136` 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 lines × 3) src/document_core/queries/cursor_nav.rs:675— src/document_core/queries/cursor_nav.rs:675-686 | src/document_core/queries/cursor_nav.rs:811-822 | src/document_core/queries/cursor_nav.rs:932-943 — 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 (12 lines × 3) src/document_core/queries/cursor_nav.rs:746— src/document_core/queries/cursor_nav.rs:746-757 | src/document_core/queries/cursor_nav.rs:862-873 | src/document_core/queries/cursor_nav.rs:972-983 — 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 (12 lines × 3) src/document_core/queries/cursor_rect.rs:4456— src/document_core/queries/cursor_rect.rs:4456-4467 | src/document_core/queries/cursor_rect.rs:4477-4488 | src/document_core/queries/cursor_rect.rs:4494-4505 — 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 (12 lines × 3) src/document_core/queries/field_query.rs:656— src/document_core/queries/field_query.rs:656-667 | src/document_core/queries/memo_query.rs:1434-1445 | src/document_core/queries/memo_query.rs:1501-1512 — before extracting anything, compare `src/document_core/queries/field_query.rs` and `src/document_core/queries/memo_query.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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 `src/document_core/queries/field_query.rs:656` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) src/document_core/queries/rendering.rs:4569— src/document_core/queries/rendering.rs:4569-4580 | src/document_core/queries/rendering.rs:4592-4603 | src/document_core/queries/rendering.rs:4613-4624 — 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 `src/document_core/queries/rendering.rs:4569` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) src/parser/hwp3/mod.rs:4543— src/parser/hwp3/mod.rs:4543-4554 | src/parser/hwp3/mod.rs:4575-4586 | src/parser/hwp3/mod.rs:4623-4634 — 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 `src/parser/hwp3/mod.rs:4543` 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 × 3) src/parser/hwpx/section.rs:761— src/parser/hwpx/section.rs:761-772 | src/parser/hwpx/section.rs:978-989 | src/parser/hwpx/section.rs:2302-2313 — 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 `src/parser/hwpx/section.rs:2302` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) src/renderer/composer/stored_row_projection.rs:48— src/renderer/composer/stored_row_projection.rs:48-59 | src/renderer/render_normalization/math_table.rs:194-205 | src/renderer/render_normalization/math_textbox.rs:150-161 — before extracting anything, compare `src/renderer/render_normalization/math_table.rs` and `src/renderer/render_normalization/math_textbox.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 57 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 `src/renderer/composer/stored_row_projection.rs:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/renderer/render_normalization/math_table.rs:191` calls `has_math_table` and `src/renderer/composer/stored_row_projection.rs:47` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 3) src/renderer/composer/stored_tac_host_frame.rs:34— src/renderer/composer/stored_tac_host_frame.rs:34-45 | src/renderer/typeset/controls/square_host_frame.rs:53-64 | src/renderer/typeset/state/paragraph_fragment.rs:78-89 — 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 `src/renderer/composer/stored_tac_host_frame.rs:34` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 3) src/renderer/equation/canvas_render.rs:323— src/renderer/equation/canvas_render.rs:323-334 | src/renderer/equation/svg_render.rs:383-395 | src/renderer/skia/equation_conv.rs:455-466 — before extracting anything, compare `src/renderer/equation/canvas_render.rs` and `src/renderer/equation/svg_render.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 198 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 `src/renderer/equation/canvas_render.rs:323` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) src/renderer/layout.rs:3183— src/renderer/layout.rs:3183-3194 | src/renderer/layout/paragraph_layout.rs:5594-5605 | src/renderer/layout/shape_layout.rs:352-363 — 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 `src/renderer/layout.rs:3183` 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 lines × 3) src/renderer/layout/paragraph_layout.rs:9835— src/renderer/layout/paragraph_layout.rs:9835-9846 | src/renderer/layout/paragraph_layout.rs:10024-10035 | src/renderer/layout/paragraph_layout.rs:10594-10605 — 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 `src/renderer/layout/paragraph_layout.rs:9835` 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 lines × 3) src/wmf/parser/records/bitmap/set_dib_to_dev.rs:103— src/wmf/parser/records/bitmap/set_dib_to_dev.rs:103-114 | src/wmf/parser/records/bitmap/stretch_dib.rs:117-128 | src/wmf/parser/records/object/dib_create_pattern_brush.rs:65-76 — before extracting anything, compare `src/wmf/parser/records/bitmap/set_dib_to_dev.rs` and `src/wmf/parser/records/bitmap/stretch_dib.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 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 `src/wmf/parser/records/bitmap/set_dib_to_dev.rs:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) src/bin/rhwp-q/kit/cell_shape.rs:58— src/bin/rhwp-q/kit/cell_shape.rs:58-69 | src/bin/rhwp-q/kit/flow_images.rs:61-72 | src/bin/rhwp-q/kit/overlay_images.rs:65-76 — before extracting anything, compare `src/bin/rhwp-q/kit/cell_shape.rs` and `src/bin/rhwp-q/kit/flow_images.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 47 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 `src/bin/rhwp-q/kit/cell_shape.rs:58` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) src/cli/commands/edit/media.rs:160— src/cli/commands/edit/media.rs:160-171 | src/cli/commands/edit/privacy.rs:120-131 | src/cli/queries/info.rs:66-77 — before extracting anything, compare `src/cli/commands/edit/media.rs` and `src/cli/commands/edit/privacy.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 78 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 `src/cli/commands/edit/media.rs:160` 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 × 3) bindings/Native/src/gpu_d3d.rs:188— bindings/Native/src/gpu_d3d.rs:188-199 | bindings/Native/src/gpu_gl.rs:274-285 | bindings/Native/src/gpu_metal.rs:198-209 — before extracting anything, compare `bindings/Native/src/gpu_d3d.rs` and `bindings/Native/src/gpu_metal.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 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 `bindings/Native/src/gpu_d3d.rs:188` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) tools/oracle_public/coverage_report.py:101— tools/oracle_public/coverage_report.py:101-112 | tools/oracle_public/oracle_resolver.py:95-106 | tools/oracle_public/sweep_runner.py:283-294 — before extracting anything, compare `tools/oracle_public/coverage_report.py` and `tools/oracle_public/oracle_resolver.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 187 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `tools/oracle_public/coverage_report.py:113` calls `is_deferred_regression_input` and `tools/oracle_public/oracle_resolver.py:107` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) src/cli/commands/edit/fields.rs:222— src/cli/commands/edit/fields.rs:222-228 | src/cli/protocol/plan/execution.rs:591-597 | src/mcp_serve.rs:2237-2243 — before extracting anything, compare `src/cli/commands/edit/fields.rs` and `src/mcp_serve.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/fields.rs:222` 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 × 3) src/cli/commands/edit/fields.rs:269— src/cli/commands/edit/fields.rs:269-275 | src/cli/protocol/plan/execution.rs:283-292 | src/mcp_serve.rs:2282-2288 — before extracting anything, compare `src/cli/commands/edit/fields.rs` and `src/mcp_serve.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 × 3) src/cli/protocol/exchange/disclosure.rs:110— src/cli/protocol/exchange/disclosure.rs:110-116 | src/cli/protocol/exchange/settlement.rs:8-14 | src/cli/protocol/harness.rs:102-108 — before extracting anything, compare `src/cli/protocol/exchange/disclosure.rs` and `src/cli/protocol/exchange/settlement.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 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 `src/cli/protocol/exchange/disclosure.rs:110` 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 × 3) src/document_core/queries/cursor_rect.rs:2848— src/document_core/queries/cursor_rect.rs:2848-2854 | src/document_core/queries/cursor_rect.rs:5485-5492 | src/document_core/queries/cursor_rect.rs:6001-6008 — 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 `src/document_core/queries/cursor_rect.rs:2848` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) src/paint/text_v2_export.rs:47— src/paint/text_v2_export.rs:47-53 | src/paint/text_v2_slots.rs:150-156 | src/renderer/skia/cache.rs:198-204 — 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 `src/paint/text_v2_export.rs:47` 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 × 3) src/renderer/composer/inline_control_flow.rs:28— src/renderer/composer/inline_control_flow.rs:28-34 | src/renderer/composer/inline_control_projection.inc.rs:125-131 | src/renderer/composer/inline_control_projection.inc.rs:180-186 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) src/renderer/composer/stored_tac_display.inc.rs:107— src/renderer/composer/stored_tac_display.inc.rs:107-115 | src/renderer/layout/table_layout/stored_inline_row_frame.rs:71-79 | src/renderer/layout/table_layout/stored_inline_row_frame.rs:221-227 — 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 `src/renderer/composer/stored_tac_display.inc.rs:107` 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 (7 lines × 3) src/renderer/equation/operator_outline.rs:97— src/renderer/equation/operator_outline.rs:97-103 | src/renderer/equation/relation_outline.rs:160-166 | src/renderer/equation/relation_outline.rs:192-198 — 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 `src/renderer/equation/operator_outline.rs:97` 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 × 3) src/renderer/height_measurer.rs:2845— src/renderer/height_measurer.rs:2845-2851 | src/renderer/height_measurer.rs:5531-5537 | src/renderer/table_row_frame.rs:271-277 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) src/renderer/web_canvas.rs:2400— src/renderer/web_canvas.rs:2400-2406 | src/renderer/web_canvas.rs:2409-2415 | src/renderer/web_canvas.rs:2418-2424 — 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 `src/renderer/web_canvas.rs:2400` 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 × 3) src/wasm_api/print_image_sampling.rs:92— src/wasm_api/print_image_sampling.rs:92-98 | src/wasm_api/print_image_sampling.rs:107-113 | src/wasm_api/print_image_sampling.rs:126-132 — 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 lines × 3) src/parser/hwpx/section.rs:6360— src/parser/hwpx/section.rs:6360-6366 | src/parser/hwpx/section.rs:6391-6397 | src/parser/hwpx/section.rs:6425-6431 — 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 lines × 3) src/bin/rhwp-agent/contextcost.rs:46— src/bin/rhwp-agent/contextcost.rs:46-52 | src/diagnostics/hwp5_ctrl_data_trace.rs:371-377 | src/parser/control.rs:1073-1079 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 3) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:304— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:304-310 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:299-305 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:285-291 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-form-info.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 182 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) src/serializer/hwpx/section.rs:4912— src/serializer/hwpx/section.rs:4912-4918 | src/serializer/hwpx/shape.rs:1602-1608 | src/serializer/hwpx/table.rs:214-220 — before extracting anything, compare `src/serializer/hwpx/section.rs` and `src/serializer/hwpx/shape.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) src/bin/rhwp-agent/locate.rs:87— src/bin/rhwp-agent/locate.rs:87-93 | src/bin/rhwp-agent/locate.rs:178-184 | src/bin/rhwp-agent/locate.rs:294-300 — 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 `src/bin/rhwp-agent/locate.rs:87` 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 (7 lines × 3) src/parser/hwpx/section.rs:2109— src/parser/hwpx/section.rs:2109-2115 | src/parser/hwpx/section.rs:6174-6180 | src/parser/hwpx/section.rs:6839-6845 — 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 lines × 3) src/bin/rhwp-agent/grepcmd.rs:48— src/bin/rhwp-agent/grepcmd.rs:48-54 | src/bin/rhwp-agent/inspect.rs:163-169 | src/bin/rhwp-agent/locate.rs:231-237 — before extracting anything, compare `src/bin/rhwp-agent/grepcmd.rs` and `src/bin/rhwp-agent/inspect.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 × 3) mydocs/tech/investigations/issue-1058/probes/dump_footnote_inner.rs:76— mydocs/tech/investigations/issue-1058/probes/dump_footnote_inner.rs:76-82 | mydocs/tech/investigations/issue-1061/probes/dump_equation_records.rs:171-177 | mydocs/tech/investigations/issue-1067/probes/dump_polygon_transform.rs:87-93 — 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 `mydocs/tech/investigations/issue-1058/probes/dump_footnote_inner.rs:76` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) tools/llm_verifier/abstain/schema.py:77— tools/llm_verifier/abstain/schema.py:77-83 | tools/llm_verifier/lineage_chain/schema.py:72-78 | tools/llm_verifier/third_party_replay/schema.py:59-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) tools/oracle_public/coverage_report.py:91— tools/oracle_public/coverage_report.py:91-97 | tools/oracle_public/oracle_resolver.py:85-91 | tools/oracle_public/sweep_runner.py:273-279 — before extracting anything, compare `tools/oracle_public/coverage_report.py` and `tools/oracle_public/oracle_resolver.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 187 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-04-r1/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-04/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-05/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-06-r3/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-06-r4/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-07-r5/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-08-r6/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-08-r7/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-08-r8/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-09-phase2/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-09-r10/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-09-r11/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-09-r12/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-09-r13/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-09-r15/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-09-r17/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-09-r9/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-10-c2r1/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/2026-07-11-c2r2/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.4:1) mydocs/metrics/dashboard.html:31— `.chart-desc` sets color: #888 on background-color: #f8f9fa — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
TooManyFields: StateView src/renderer/typeset/state/data.rs:13— TooManyFields — 132 stored fields. The bar is 30 stored fields; this is 102 over it, 4.40× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: TextStyle src/renderer/mod.rs:332— TooManyFields — 76 stored fields beside 12 methods. The bar is 30 stored fields; this is 46 over it, 2.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: LayoutEngine src/renderer/layout.rs:3649— TooManyFields — 70 stored fields beside 732 methods. The bar is 30 stored fields; this is 40 over it, 2.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: TailFitInput src/renderer/typeset/notes/endnotes/paragraph/tail_fit.rs:19— TooManyFields — 69 stored fields. The bar is 30 stored fields; this is 39 over it, 2.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: DocumentCore src/document_core/mod.rs:208— TooManyFields — 61 stored fields beside 1079 methods. The bar is 30 stored fields; this is 31 over it, 2.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: NewNoteFitInput src/renderer/typeset/notes/endnotes/paragraph/new_note_fit.rs:14— TooManyFields — 55 stored fields. The bar is 30 stored fields; this is 25 over it, 1.83× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ResolvedCharStyle src/renderer/style_resolver/resolved.rs:7— TooManyFields — 46 stored fields beside 16 methods. The bar is 30 stored fields; this is 16 over it, 1.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: AdapterReport src/document_core/converters/hwpx_to_hwp.rs:44— TooManyFields — 41 stored fields beside 3 methods. The bar is 30 stored fields; this is 11 over it, 1.37× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Paragraph src/model/paragraph.rs:38— TooManyFields — 40 stored fields beside 87 methods. The bar is 30 stored fields; this is 10 over it, 1.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: BlockTableContinuationPreparedState src/renderer/typeset/table/continuation.rs:141— TooManyFields — 39 stored fields. The bar is 30 stored fields; this is 9 over it, 1.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Hwp3DocInfo src/parser/hwp3/records.rs:10— TooManyFields — 38 stored fields beside 1 method. The bar is 30 stored fields; this is 8 over it, 1.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: InitialFitInput src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:15— TooManyFields — 38 stored fields. The bar is 30 stored fields; this is 8 over it, 1.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RewindTailInput src/renderer/typeset/notes/endnotes/paragraph/rewind_tail.rs:9— TooManyFields — 35 stored fields. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: SvgRenderer src/renderer/svg.rs:96— TooManyFields — 33 stored fields beside 62 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ParseState crates/rhwp-ooxml-chart/src/parser.rs:69— TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: LayerRenderDiagnostics src/renderer/layer_renderer.rs:86— TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CommonObjAttr src/model/shape.rs:33— TooManyFields — 32 stored fields. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CharShape src/model/style.rs:116— TooManyFields — 32 stored fields. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RunEmitVars src/renderer/layout/paragraph_layout.rs:1359— TooManyFields — 32 stored fields. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: HeightCursor src/renderer/height_cursor.rs:186— TooManyFields — 31 stored fields beside 11 methods. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×20
Members sharing a duplicated core (5 members, 50+ identical tokens) bindings/Native/src/lib.rs:496— bindings/Native/src/lib.rs:496-510 | src/document_core/queries/bookmark_query.rs:458-476 | src/document_core/queries/field_query.rs:2751-2769 | src/render_backend/fixture.rs:88-103 | src/renderer/render_tree.rs:445-461 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:86— src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:86-113 | src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:152-186 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:86-119 | src/bin/rhwp-q/commands/rhwp-q-scan-items.rs:115-142 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:86-113 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:115— src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:115-131 | src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:16-31 | src/bin/rhwp-q/commands/rhwp-q-objects.rs:16-31 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:196-248 | src/cli/outputs/preview.rs:11-165 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/bin/rhwp-q/more/inventory.rs:52— src/bin/rhwp-q/more/inventory.rs:52-68 | src/bin/rhwp-q/more/inventory.rs:70-88 | src/bin/rhwp-q/more/inventory.rs:106-119 | src/bin/rhwp-q/more/inventory.rs:121-135 | src/bin/rhwp-q/more/inventory.rs:1066-1080 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/cli/commands/edit/media.rs:95— src/cli/commands/edit/media.rs:95-199 | src/cli/commands/edit/privacy.rs:50-175 | src/cli/commands/edit/text.rs:267-376 | src/cli/commands/tabular_import.rs:34-109 | src/cli/queries/info.rs:59-88 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/cli/protocol/plan/mod.rs:10— src/cli/protocol/plan/mod.rs:10-129 | src/main.rs:1063-1135 | src/main.rs:1143-1214 | src/main.rs:1217-1289 | src/main.rs:1299-1372 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/diagnostics/hwp5_cell_header_probe.rs:721— src/diagnostics/hwp5_cell_header_probe.rs:721-733 | src/diagnostics/hwp5_contract_probe.rs:639-651 | src/diagnostics/hwp5_first_para_control_probe.rs:1321-1333 | src/diagnostics/hwp5_mel_personnel_probe.rs:635-647 | src/diagnostics/hwp5_table_probe.rs:380-392 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/diagnostics/hwp5_cell_header_probe.rs:789— src/diagnostics/hwp5_cell_header_probe.rs:789-802 | src/diagnostics/hwp5_contract_probe.rs:707-720 | src/diagnostics/hwp5_first_para_control_probe.rs:1389-1402 | src/diagnostics/hwp5_mel_personnel_probe.rs:703-716 | src/diagnostics/hwp5_table_probe.rs:554-567 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/diagnostics/hwp5_cell_header_probe.rs:809— src/diagnostics/hwp5_cell_header_probe.rs:809-854 | src/diagnostics/hwp5_contract_probe.rs:727-772 | src/diagnostics/hwp5_inventory_diff.rs:536-586 | src/diagnostics/hwp5_mel_personnel_probe.rs:723-768 | src/diagnostics/hwp5_table_probe.rs:578-623 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/diagnostics/hwp5_inventory_diff.rs:755— src/diagnostics/hwp5_inventory_diff.rs:755-850 | src/diagnostics/hwp5_inventory_diff.rs:852-904 | src/diagnostics/hwp5_inventory_diff.rs:910-969 | src/diagnostics/hwp5_inventory_diff.rs:971-1031 | src/diagnostics/hwp5_inventory_diff.rs:1033-1159 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/document_core/commands/object_ops/table.rs:1114— src/document_core/commands/object_ops/table.rs:1114-1242 | src/document_core/commands/text_editing.rs:1398-1546 | src/document_core/commands/text_editing.rs:1551-1564 | src/document_core/commands/text_editing.rs:1639-1761 | src/document_core/commands/text_editing.rs:1919-2000 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/document_core/commands/text_editing.rs:1398— src/document_core/commands/text_editing.rs:1398-1546 | src/document_core/commands/text_editing.rs:1639-1761 | src/document_core/commands/text_editing.rs:1794-1836 | src/document_core/commands/text_editing.rs:1891-1908 | src/document_core/commands/text_editing.rs:4216-4466 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/document_core/queries/cursor_rect.rs:1605— src/document_core/queries/cursor_rect.rs:1605-2873 | src/document_core/queries/cursor_rect.rs:5264-5540 | src/document_core/queries/cursor_rect.rs:5814-6033 | src/document_core/queries/cursor_rect.rs:6181-6273 | src/document_core/queries/cursor_rect.rs:6464-6601 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/document_core/queries/hwpctrl_sets.rs:586— src/document_core/queries/hwpctrl_sets.rs:586-624 | src/document_core/queries/hwpctrl_sets.rs:637-661 | src/document_core/queries/hwpctrl_sets.rs:983-1007 | src/document_core/queries/hwpctrl_sets.rs:2085-2124 | src/document_core/queries/hwpctrl_sets.rs:2419-2449 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/document_core/queries/rendering_metafile_resources.rs:166— src/document_core/queries/rendering_metafile_resources.rs:166-246 | src/renderer/layout.rs:1121-1130 | src/renderer/layout.rs:6738-7175 | src/renderer/layout.rs:7883-11386 | src/renderer/typeset.rs:1311-1320 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/parser/hwpx/section.rs:2407— src/parser/hwpx/section.rs:2407-2673 | src/parser/hwpx/section.rs:3114-3528 | src/parser/hwpx/section.rs:3783-3844 | src/parser/hwpx/section.rs:7498-7605 | src/parser/hwpx/section.rs:7611-7740 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/renderer/float_placement.rs:2961— src/renderer/float_placement.rs:2961-3133 | src/renderer/float_placement.rs:3802-3841 | src/renderer/float_placement/stored_cut_outer_frame.rs:14-50 | src/renderer/float_placement/stored_header_frame.rs:13-72 | src/renderer/float_placement/stored_header_frame.rs:77-99 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/serializer/hwpx/master_page.rs:79— src/serializer/hwpx/master_page.rs:79-130 | src/serializer/hwpx/section.rs:713-921 | src/serializer/hwpx/section.rs:4013-4065 | src/serializer/hwpx/section.rs:4939-4975 | src/serializer/hwpx/section.rs:4994-5022 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/wmf/converter/svg/mod.rs:183— src/wmf/converter/svg/mod.rs:183-250 | src/wmf/converter/svg/mod.rs:261-328 | src/wmf/converter/svg/mod.rs:339-445 | src/wmf/converter/svg/mod.rs:470-537 | src/wmf/converter/svg/mod.rs:548-609 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) src/wmf/parser/records/state/set_bk_mode.rs:38— src/wmf/parser/records/state/set_bk_mode.rs:38-64 | src/wmf/parser/records/state/set_polyfill_mode.rs:37-62 | src/wmf/parser/records/state/set_rop2.rs:39-65 | src/wmf/parser/records/state/set_stretch_blt_mode.rs:37-63 | src/wmf/parser/records/state/set_text_align.rs:38-65 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
WebCanvasRenderer::draw_text_positioned (cognitive 155) src/renderer/web_canvas.rs:2679— WebCanvasRenderer::draw_text_positioned has cognitive complexity 155 (threshold 15). Drivers by points: if/else 43 (120 pts), loops 8 (20 pts), boolean chains 9, match/switch 2 (6 pts) (nesting depth added 93). 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.
WebCanvasRenderer::draw_text_with_effects (cognitive 52) src/renderer/web_canvas.rs:3638— WebCanvasRenderer::draw_text_with_effects has cognitive complexity 52 (threshold 15). Drivers by points: if/else 24 (39 pts), boolean chains 8, loops 3 (5 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebCanvasRenderer::draw_image (cognitive 49) src/renderer/web_canvas.rs:3257— WebCanvasRenderer::draw_image has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (31 pts), match/switch 6 (11 pts), boolean chains 7 (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.
WebCanvasRenderer::draw_image_with_fill_mode (cognitive 49) src/renderer/web_canvas.rs:4323— WebCanvasRenderer::draw_image_with_fill_mode has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 4 (13 pts), match/switch 5 (10 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.
WebCanvasRenderer::render_text_run (cognitive 48) src/renderer/web_canvas.rs:1049— WebCanvasRenderer::render_text_run has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (42 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebCanvasRenderer::render_image_with_sampling (cognitive 48) src/renderer/web_canvas.rs:1401— WebCanvasRenderer::render_image_with_sampling has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (33 pts), boolean chains 7, match/switch 2 (6 pts), loops 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebCanvasRenderer::draw_char_overlap (cognitive 43) src/renderer/web_canvas.rs:3901— WebCanvasRenderer::draw_char_overlap has cognitive complexity 43 (threshold 15). Drivers by points: if/else 23 (35 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebCanvasRenderer::draw_path_with_gradient (cognitive 40) src/renderer/web_canvas.rs:2380— WebCanvasRenderer::draw_path_with_gradient has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (32 pts), loops 2 (4 pts), boolean chains 2, match/switch 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.
WebCanvasRenderer::draw_rect_with_gradient (cognitive 38) src/renderer/web_canvas.rs:2230— WebCanvasRenderer::draw_rect_with_gradient has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (38 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.
WebCanvasRenderer::render_page_background (cognitive 36) src/renderer/web_canvas.rs:961— WebCanvasRenderer::render_page_background has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (31 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebCanvasRenderer::render_node (cognitive 29) src/renderer/web_canvas.rs:619— WebCanvasRenderer::render_node has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebCanvasRenderer::render_layer_node (cognitive 24) src/renderer/web_canvas.rs:1697— WebCanvasRenderer::render_layer_node has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WebCanvasRenderer::draw_char_overlap_combined (cognitive 23) src/renderer/web_canvas.rs:4072— WebCanvasRenderer::draw_char_overlap_combined has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 3 (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.
WebCanvasRenderer::apply_square_gradient_fill (cognitive 21) src/renderer/web_canvas.rs:2112— WebCanvasRenderer::apply_square_gradient_fill has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), loops 3 (4 pts), boolean chains 3 (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.
WebCanvasRenderer::render_composed_overlap (cognitive 18) src/renderer/web_canvas/char_overlap.rs:6— WebCanvasRenderer::render_composed_overlap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebCanvasRenderer::apply_pattern_fill (cognitive 17) src/renderer/web_canvas.rs:1919— WebCanvasRenderer::apply_pattern_fill has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 8 (10 pts), if/else 2 (5 pts), loops 1 (2 pts) (nesting depth added 6). 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.
WebCanvasRenderer::draw_image_cropped (cognitive 17) src/renderer/web_canvas.rs:3480— WebCanvasRenderer::draw_image_cropped has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebCanvasRenderer::draw_line_with_resolved_width (cognitive 16) src/renderer/web_canvas.rs:1249— WebCanvasRenderer::draw_line_with_resolved_width has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 2 (4 pts), match/switch 2 (3 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.
WebCanvasRenderer::render_form_object (cognitive 16) src/renderer/web_canvas.rs:2539— WebCanvasRenderer::render_form_object has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 pts), match/switch 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.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×18
Edited copy of a member (17 corresponding lines) src/parser/cfb_reader.rs:1012— src/parser/cfb_reader.rs:1012-1029 | src/parser/cfb_reader.rs:1036-1053 — 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) src/bin/rhwp-q/more/main.rs:22— src/bin/rhwp-q/more/main.rs:22-39 | src/bin/rhwp-q/pack/main.rs:22-39 — 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) bindings/Native/src/gpu_d3d.rs:127— bindings/Native/src/gpu_d3d.rs:127-143 | bindings/Native/src/gpu_metal.rs:9-28 — 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) src/native_host/gpu_d3d.rs:139— src/native_host/gpu_d3d.rs:139-155 | src/native_host/gpu_metal.rs:80-96 — 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) src/renderer/height_measurer.rs:2026— src/renderer/height_measurer.rs:2026-2045 | src/renderer/layout/table_layout.rs:3228-3244 — 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) src/model/control.rs:563— src/model/control.rs:563-579 | src/parser/hwpx/section.rs:6191-6209 — 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) src/document_core/commands/clipboard.rs:876— src/document_core/commands/clipboard.rs:876-893 | src/document_core/commands/html_import.rs:163-179 — 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) src/diagnostics/layout_anomaly.rs:375— src/diagnostics/layout_anomaly.rs:375-392 | src/diagnostics/layout_anomaly.rs:645-661 — 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) src/parser/hwpx/mod.rs:90— src/parser/hwpx/mod.rs:90-113 | src/parser/hwpx/mod.rs:115-131 — 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) src/wmf/parser/records/state/animate_palette.rs:41— src/wmf/parser/records/state/animate_palette.rs:41-57 | src/wmf/parser/records/state/set_pal_entries.rs:32-48 — 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) src/wmf/parser/records/state/set_bk_color.rs:33— src/wmf/parser/records/state/set_bk_color.rs:33-49 | src/wmf/parser/records/state/set_text_color.rs:32-48 — 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) src/document_core/commands/paragraph_block/template_operation.rs:137— src/document_core/commands/paragraph_block/template_operation.rs:137-153 | src/document_core/commands/paragraph_block/template_operation.rs:158-174 — 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) src/native_host/accessibility.rs:612— src/native_host/accessibility.rs:612-628 | src/native_host/accessibility.rs:632-652 — 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) src/renderer/layout/table_layout/reflow_block_frames.rs:150— src/renderer/layout/table_layout/reflow_block_frames.rs:150-166 | src/renderer/layout/table_layout/reflow_block_frames.rs:210-227 — 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) src/serializer/hwpx/section.rs:4098— src/serializer/hwpx/section.rs:4098-4114 | src/serializer/hwpx/section.rs:4127-4143 — 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) src/renderer/equation_tac_flow.rs:253— src/renderer/equation_tac_flow.rs:253-269 | src/renderer/layout/table_layout.rs:146-163 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/renderer/layout/paragraph_layout.rs:4746— src/renderer/layout/paragraph_layout.rs:4746-4762 | src/renderer/layout/shape_layout.rs:1595-1615 — 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) tools/llm_verifier/oracle_vs_self/generate_corpus.py:236— tools/llm_verifier/oracle_vs_self/generate_corpus.py:236-256 | tools/llm_verifier/shadow_agree/generate_corpus.py:210-226 — 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.
Duplicated block (9 lines × 3) src/bin/rhwp-agent/harvest.rs:19— src/bin/rhwp-agent/harvest.rs:19-27 | src/bin/rhwp-agent/safety.rs:220-229 | src/bin/rhwp-agent/safety.rs:525-534 — before extracting anything, compare `src/bin/rhwp-agent/harvest.rs` and `src/bin/rhwp-agent/safety.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 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 `src/bin/rhwp-agent/harvest.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. 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 × 3) src/bin/rhwp-q/kit/form_at.rs:77— src/bin/rhwp-q/kit/form_at.rs:77-85 | src/bin/rhwp-q/kit/hit_fn_marker.rs:78-86 | src/bin/rhwp-q/kit/hit_in_footnote.rs:78-86 — before extracting anything, compare `src/bin/rhwp-q/kit/form_at.rs` and `src/bin/rhwp-q/kit/hit_fn_marker.rs` as WHOLE FILES: this scan already matched 11 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 (9 lines × 3) src/cli/commands/edit/tables/grid.rs:226— src/cli/commands/edit/tables/grid.rs:226-234 | src/cli/commands/edit/tables/grid.rs:475-483 | src/cli/commands/edit/tables/structure.rs:11-19 — before extracting anything, compare `src/cli/commands/edit/tables/grid.rs` and `src/cli/commands/edit/tables/structure.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 187 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 `src/cli/commands/edit/tables/grid.rs:226` 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) src/document_core/commands/object_ops/equation.rs:472— src/document_core/commands/object_ops/equation.rs:472-480 | src/document_core/commands/object_ops/picture.rs:1425-1433 | src/document_core/commands/text_editing.rs:2913-2921 — before extracting anything, compare `src/document_core/commands/object_ops/equation.rs` and `src/document_core/commands/object_ops/picture.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 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 `src/document_core/commands/object_ops/equation.rs:472` 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) src/document_core/commands/text_editing.rs:6560— src/document_core/commands/text_editing.rs:6560-6568 | src/document_core/commands/text_editing.rs:6724-6732 | src/document_core/commands/text_editing.rs:6839-6847 — 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 `src/document_core/commands/text_editing.rs:6560` 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 × 3) src/document_core/queries/bookmark_query.rs:64— src/document_core/queries/bookmark_query.rs:64-72 | src/document_core/queries/bookmark_query.rs:126-134 | src/document_core/queries/bookmark_query.rs:235-243 — 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 × 3) src/document_core/queries/bookmark_query.rs:459— src/document_core/queries/bookmark_query.rs:459-467 | src/document_core/queries/field_query.rs:2752-2760 | src/renderer/render_tree.rs:446-454 — before extracting anything, compare `src/document_core/queries/bookmark_query.rs` and `src/document_core/queries/field_query.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 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 `src/document_core/queries/bookmark_query.rs:459` 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) src/renderer/float_placement.rs:7018— src/renderer/float_placement.rs:7018-7026 | src/renderer/float_placement.rs:7051-7059 | src/renderer/float_placement.rs:7091-7099 — 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 `src/renderer/float_placement.rs:7018` 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 × 3) src/renderer/web_canvas.rs:2285— src/renderer/web_canvas.rs:2285-2293 | src/renderer/web_canvas.rs:2367-2375 | src/renderer/web_canvas.rs:2491-2499 — 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 `src/renderer/web_canvas.rs:2285` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/renderer/web_canvas.rs:2283` calls `clear_shadow` and `src/renderer/web_canvas.rs:2364` 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 × 3) src/bin/rhwp-q/kit/envelope.rs:41— src/bin/rhwp-q/kit/envelope.rs:41-49 | src/bin/rhwp-q/more/envelope.rs:37-45 | src/bin/rhwp-q/pack/envelope.rs:37-45 — `src/bin/rhwp-q/kit/envelope.rs` and `src/bin/rhwp-q/more/envelope.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) src/serializer/hwpx/section.rs:4897— src/serializer/hwpx/section.rs:4897-4905 | src/serializer/hwpx/shape.rs:1587-1595 | src/serializer/hwpx/table.rs:199-207 — before extracting anything, compare `src/serializer/hwpx/section.rs` and `src/serializer/hwpx/shape.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 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 (9 lines × 3) crates/rhwp-contracts/src/ir_schema.rs:847— crates/rhwp-contracts/src/ir_schema.rs:847-855 | src/capabilities_schema.rs:528-548 | src/capabilities_schema.rs:564-583 — 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 `crates/rhwp-contracts/src/ir_schema.rs:847` 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 × 3) src/cli/commands/edit/header_footer_content.rs:525— src/cli/commands/edit/header_footer_content.rs:525-533 | src/cli/queries/structured_objects.rs:75-83 | src/cli/queries/structured_objects.rs:203-211 — before extracting anything, compare `src/cli/commands/edit/header_footer_content.rs` and `src/cli/queries/structured_objects.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/header_footer_content.rs:525` 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 × 3) src/cli/protocol/exchange/bundle.rs:87— src/cli/protocol/exchange/bundle.rs:87-95 | src/cli/protocol/exchange/settlement.rs:190-198 | src/cli/protocol/exchange/settlement.rs:338-346 — 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 `src/cli/protocol/exchange/bundle.rs:87` 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 × 3) src/document_core/queries/rendering.rs:7666— src/document_core/queries/rendering.rs:7666-7674 | src/document_core/queries/rendering.rs:7743-7751 | src/document_core/queries/rendering.rs:7825-7833 — 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 `src/document_core/queries/rendering.rs:7666` 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 × 3) tools/llm_verifier/process_steps/src/exit_class.rs:41— tools/llm_verifier/process_steps/src/exit_class.rs:41-49 | tools/llm_verifier/repeat_eval/src/exit_class.rs:41-49 | tools/llm_verifier/verdict_protocol/src/exit_class.rs:46-54 — before extracting anything, compare `tools/llm_verifier/process_steps/src/exit_class.rs` and `tools/llm_verifier/repeat_eval/src/exit_class.rs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) tools/gate_3798_page_end_spill.py:60— tools/gate_3798_page_end_spill.py:60-68 | tools/task2287/delta_staircase.py:39-47 | tools/verify_pi_page_vs_hangul.py:90-101 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) samples/issue8474/gen_section_top_spacing.py:65— samples/issue8474/gen_section_top_spacing.py:65-73 | samples/issue8474/gen_top_tac_cases.py:65-73 | samples/issue8478/gen_span_page_bottom.py:94-102 — before extracting anything, compare `samples/issue8474/gen_section_top_spacing.py` and `samples/issue8474/gen_top_tac_cases.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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.
Boundary violation [package:relative-cross-package] mydocs/pr/assets/pr8300-maintainer-20261101/browser-review.mjs:5— mydocs/pr/assets/pr8300-maintainer-20261101/browser-review.mjs:5 reaches into another package with a relative path (../../../../rhwp-studio/e2e/helpers.mjs) — import the package by name instead.
Boundary violation [package:test-suite-dependency] mydocs/pr/assets/pr8300-maintainer-20261101/browser-review.mjs:5— mydocs/pr/assets/pr8300-maintainer-20261101/browser-review.mjs:5 imports rhwp-studio/e2e/helpers.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
Boundary violation [package:relative-cross-package] mydocs/pr/assets/pr_7487/reproduce-wasm.mjs:6— mydocs/pr/assets/pr_7487/reproduce-wasm.mjs:6 reaches into another package with a relative path (../../../../pkg/rhwp.js) — import the package by name instead.
Boundary violation [package:relative-cross-package] mydocs/tech/investigations/issue-8403/validation/browser-verify.mjs:5— mydocs/tech/investigations/issue-8403/validation/browser-verify.mjs:5 reaches into another package with a relative path (../../../../../rhwp-studio/e2e/helpers.mjs) — import the package by name instead.
Boundary violation [package:test-suite-dependency] mydocs/tech/investigations/issue-8403/validation/browser-verify.mjs:5— mydocs/tech/investigations/issue-8403/validation/browser-verify.mjs:5 imports rhwp-studio/e2e/helpers.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
Boundary violation [package:relative-cross-package] rhwp-shared/pdf/import-worker.js:2— rhwp-shared/pdf/import-worker.js:2 reaches into another package with a relative path (../../pkg/rhwp.js) — import the package by name instead.
Boundary violation [package:third-party-deep-import] rhwp-studio/src/ai/provider/claude.ts:18— rhwp-studio/src/ai/provider/claude.ts:18 imports @anthropic-ai/sdk/lib/transform-json-schema, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:relative-cross-package] rhwp-studio/src/core/pdf-open.ts:3— rhwp-studio/src/core/pdf-open.ts:3 reaches into another package with a relative path (../../../rhwp-shared/pdf/import-session.js) — import the package by name instead.
Boundary violation [package:relative-cross-package] rhwp-studio/src/core/wasm-bridge.ts:4074— rhwp-studio/src/core/wasm-bridge.ts:4074 reaches into another package with a relative path (../../../rhwp-shared/forms/action-runtime) — import the package by name instead.
Boundary violation [package:relative-cross-package] rhwp-studio/src/core/wasm-bridge.ts:4078— rhwp-studio/src/core/wasm-bridge.ts:4078 reaches into another package with a relative path (../../../rhwp-shared/forms/action-runtime) — import the package by name instead.
Boundary violation [package:relative-cross-package] rhwp-studio/src/engine/form-action-worker.ts:1— rhwp-studio/src/engine/form-action-worker.ts:1 reaches into another package with a relative path (../../../rhwp-shared/forms/action-runtime.ts) — import the package by name instead.
Boundary violation [package:relative-cross-package] rhwp-studio/src/engine/input-handler-form-action.ts:1— rhwp-studio/src/engine/input-handler-form-action.ts:1 reaches into another package with a relative path (../../../rhwp-shared/forms/action-runtime) — import the package by name instead.
Boundary violation [package:relative-cross-package] rhwp-studio/src/engine/input-handler.ts:3— rhwp-studio/src/engine/input-handler.ts:3 reaches into another package with a relative path (../../../rhwp-shared/forms/action-runtime) — import the package by name instead.
Boundary violation [package:relative-cross-package] rhwp-studio/src/ui/pdf-import-dialog.ts:4— rhwp-studio/src/ui/pdf-import-dialog.ts:4 reaches into another package with a relative path (../../../rhwp-shared/pdf/import-session.js) — import the package by name instead.
Boundary violation [package:relative-cross-package] rhwp-vscode/src/webview/canvaskit-wasm-url.ts:1— rhwp-vscode/src/webview/canvaskit-wasm-url.ts:1 reaches into another package with a relative path (../../node_modules/canvaskit-wasm/bin/canvaskit.wasm?url) — import the package by name instead.
Boundary violation [package:relative-cross-package] scripts/font_rule_runtime_snapshot.mjs:8— scripts/font_rule_runtime_snapshot.mjs:8 reaches into another package with a relative path (../rhwp-studio/src/core/font-loader.ts) — import the package by name instead.
Boundary violation [package:relative-cross-package] scripts/font_rule_runtime_snapshot.mjs:14— scripts/font_rule_runtime_snapshot.mjs:14 reaches into another package with a relative path (../rhwp-studio/src/core/font-substitution.ts) — import the package by name instead.
Boundary violation [package:relative-cross-package] scripts/visual-sweep-font-registration.mjs:1— scripts/visual-sweep-font-registration.mjs:1 reaches into another package with a relative path (../rhwp-studio/src/core/canvas-intrinsic-font.mjs) — import the package by name instead.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×17
Edited copy of a member (4 corresponding lines) src/parser/pdf/lowering.rs:35— src/parser/pdf/lowering.rs:35-38 | tools/pdf-ir-poc/src/lowering.rs:30-33 — 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) tools/agent_dominance_metrics.py:129— tools/agent_dominance_metrics.py:129-133 | .claude/skills/rhwp-explore/references/_gen_pack.py:1357-1360 — 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) src/serializer/char_shape.rs:90— src/serializer/char_shape.rs:90-93 | src/serializer/hwpx/char_shape_tables/attr_bits.rs:57-60 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) .claude/skills/rhwp-chief/_gen_pack.py:92— .claude/skills/rhwp-chief/_gen_pack.py:92-95 | tools/provenance_map/fatten_provenance_map.py:64-67 — 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) gym/certify.py:273— gym/certify.py:273-276 | gym/report.py:344-347 — 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) tools/fidelity_compare/oracle_pair_index.py:51— tools/fidelity_compare/oracle_pair_index.py:51-55 | tools/oracle_page_count/regenerate.py:178-181 — 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) tools/hwp5_inventory/catalog.py:87— tools/hwp5_inventory/catalog.py:87-90 | tools/hwp5_inventory/model.py:74-77 — 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) tools/forms/build_간이기안문_서식.py:25— tools/forms/build_간이기안문_서식.py:25-28 | tools/forms/build_일반기안문_서식.py:27-31 — 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) tools/inspect_msec/gen_msec_fixtures.py:584— tools/inspect_msec/gen_msec_fixtures.py:584-587 | tools/proptest_roundtrip/gen_m04f_catalogs.py:319-322 — 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) scripts/oracle_stage4_profile.py:666— scripts/oracle_stage4_profile.py:666-669 | scripts/oracle_stage5_rank8_profile.py:501-507 — 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) scripts/workflow_promotion_evidence.py:445— scripts/workflow_promotion_evidence.py:445-448 | scripts/workflow_promotion_preflight.py:981-984 — 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) tools/llm_verifier/process_steps/src/loader.rs:82— tools/llm_verifier/process_steps/src/loader.rs:82-85 | tools/llm_verifier/verdict_protocol/src/loader.rs:83-86 — 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) scripts/oracle_stage5_rank16_disposition.py:57— scripts/oracle_stage5_rank16_disposition.py:57-64 | scripts/oracle_stage5_rank8_profile.py:113-116 — 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) samples/issue8493/gen_table_tail.py:22— samples/issue8493/gen_table_tail.py:22-25 | samples/issue8518/gen_table_host_top.py:28-31 — 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) scripts/font_kerning_cohort.py:105— scripts/font_kerning_cohort.py:105-108 | scripts/font_rank8_qualification.py:113-116 — 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) scripts/font_rank1_metric_hypothesis.py:68— scripts/font_rank1_metric_hypothesis.py:68-71 | scripts/font_rank8_metric_hypothesis.py:323-326 — 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) scripts/oracle_stage4_reproduction_compare.py:56— scripts/oracle_stage4_reproduction_compare.py:56-59 | scripts/oracle_stage5_rank8_profile.py:120-123 — 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 (20 lines × 2) crates/rhwp-ooxml-chart/src/renderer.rs:451— crates/rhwp-ooxml-chart/src/renderer.rs:451-470 | crates/rhwp-ooxml-chart/src/renderer.rs:498-517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) src/bin/rhwp-agent/safety.rs:53— src/bin/rhwp-agent/safety.rs:53-72 | src/bin/rhwp-agent/stats.rs:158-177 — 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 `src/bin/rhwp-agent/safety.rs:53` 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) src/bin/rhwp-q/kit/flow_images.rs:53— src/bin/rhwp-q/kit/flow_images.rs:53-72 | src/bin/rhwp-q/kit/overlay_images.rs:57-76 — before extracting anything, compare `src/bin/rhwp-q/kit/flow_images.rs` and `src/bin/rhwp-q/kit/overlay_images.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 128 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 `src/bin/rhwp-q/kit/flow_images.rs:53` 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 (20 lines × 2) src/bin/rhwp-q/kit/footnote_hit.rs:26— src/bin/rhwp-q/kit/footnote_hit.rs:26-45 | src/bin/rhwp-q/kit/hit_header.rs:26-45 — before extracting anything, compare `src/bin/rhwp-q/kit/footnote_hit.rs` and `src/bin/rhwp-q/kit/hit_header.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 125 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 `src/bin/rhwp-q/kit/footnote_hit.rs:26` 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 (20 lines × 2) src/cli/commands/edit/text.rs:335— src/cli/commands/edit/text.rs:335-354 | src/cli/commands/tabular_import.rs:75-94 — before extracting anything, compare `src/cli/commands/edit/text.rs` and `src/cli/commands/tabular_import.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/text.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 (20 lines × 2) src/cli/protocol/exchange/settlement.rs:187— src/cli/protocol/exchange/settlement.rs:187-206 | src/cli/protocol/exchange/settlement.rs:335-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 `src/cli/protocol/exchange/settlement.rs:187` 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 (20 lines × 2) src/diagnostics/hwp5_cell_header_probe.rs:584— src/diagnostics/hwp5_cell_header_probe.rs:584-603 | src/diagnostics/hwp5_mel_personnel_probe.rs:522-541 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_mel_personnel_probe.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 503 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 `src/diagnostics/hwp5_cell_header_probe.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/diagnostics/hwp5_cell_header_probe.rs:604` calls `find_host_para_index` and `src/diagnostics/hwp5_mel_personnel_probe.rs:542` 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 (20 lines × 2) src/document_core/queries/bookmark_query.rs:160— src/document_core/queries/bookmark_query.rs:160-179 | src/document_core/queries/field_query.rs:2626-2645 — before extracting anything, compare `src/document_core/queries/bookmark_query.rs` and `src/document_core/queries/field_query.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 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 (20 lines × 2) src/renderer/layout.rs:11688— src/renderer/layout.rs:11688-11707 | src/renderer/layout.rs:12394-12413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) src/renderer/layout/border_rendering.rs:1466— src/renderer/layout/border_rendering.rs:1466-1485 | src/renderer/layout/border_rendering.rs:1514-1533 — both copies are in the same file, so extract the 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 `src/renderer/layout/border_rendering.rs:1466` 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 (20 lines × 2) src/renderer/layout/table_layout/reflow_external_cut.rs:92— src/renderer/layout/table_layout/reflow_external_cut.rs:92-111 | src/renderer/layout/table_layout/reflow_fragment_content.rs:234-253 — 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 `src/renderer/layout/table_layout/reflow_external_cut.rs:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) src/renderer/layout/table_partial.rs:8244— src/renderer/layout/table_partial.rs:8244-8263 | src/renderer/layout/table_partial.rs:8271-8290 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_partial.rs:8244` 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) src/parser/hwpx/section.rs:5749— src/parser/hwpx/section.rs:5749-5768 | src/parser/hwpx/section.rs:5778-5797 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) gym/tools/build_baseline.py:377— gym/tools/build_baseline.py:377-396 | gym/tools/discriminate.py:302-321 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) scripts/font_kerning_cohort.py:145— scripts/font_kerning_cohort.py:145-164 | scripts/font_rank8_qualification.py:221-240 — before extracting anything, compare `scripts/font_kerning_cohort.py` and `scripts/font_rank8_qualification.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (20 lines × 2) scripts/visual_sweep.py:3503— scripts/visual_sweep.py:3503-3522 | scripts/visual_sweep.py:3528-3547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (20 lines × 2) tools/skill_router/audit_skill_commands.py:240— tools/skill_router/audit_skill_commands.py:240-259 | tools/skill_router/gate_new_skill.py:448-467 — before extracting anything, compare `tools/skill_router/audit_skill_commands.py` and `tools/skill_router/gate_new_skill.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 124 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 (10 lines × 4) src/anchor_log.rs:35— src/anchor_log.rs:35-44 | src/audit_standard.rs:30-39 | src/disclose.rs:30-39 | src/settle.rs:34-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. 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 × 4) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:94— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:94-103 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:93-102 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:97-106 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:91-100 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 188 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 `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:94` 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 × 4) src/bin/rhwp-q/kit/bin_data.rs:11— src/bin/rhwp-q/kit/bin_data.rs:11-20 | src/bin/rhwp-q/kit/chart_csv.rs:26-35 | src/bin/rhwp-q/kit/page_border_fill.rs:12-21 | src/bin/rhwp-q/kit/page_text.rs:12-21 — before extracting anything, compare `src/bin/rhwp-q/kit/chart_csv.rs` and `src/bin/rhwp-q/kit/page_border_fill.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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 `src/bin/rhwp-q/kit/bin_data.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 (10 lines × 4) src/bin/rhwp-q/kit/char_index.rs:53— src/bin/rhwp-q/kit/char_index.rs:53-62 | src/bin/rhwp-q/kit/cur_field_state.rs:53-62 | src/bin/rhwp-q/kit/field_info_at.rs:53-62 | src/bin/rhwp-q/kit/word_end.rs:53-62 — before extracting anything, compare `src/bin/rhwp-q/kit/char_index.rs` and `src/bin/rhwp-q/kit/cur_field_state.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 69 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 `src/bin/rhwp-q/kit/char_index.rs:53` 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 × 4) src/bin/rhwp-q/more/inventory.rs:465— src/bin/rhwp-q/more/inventory.rs:465-474 | src/bin/rhwp-q/more/inventory.rs:492-501 | src/bin/rhwp-q/more/inventory.rs:962-971 | src/bin/rhwp-q/more/inventory.rs:1294-1303 — 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 `src/bin/rhwp-q/more/inventory.rs:465` 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 × 4) src/cli/commands/edit/document_text.rs:38— src/cli/commands/edit/document_text.rs:38-47 | src/cli/commands/edit/document_text.rs:242-251 | src/cli/commands/edit/document_text.rs:352-361 | src/cli/commands/edit/document_text.rs:488-497 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 4) src/paint/json.rs:2741— src/paint/json.rs:2741-2750 | src/paint/json.rs:2784-2793 | src/paint/json.rs:2810-2819 | src/paint/json.rs:2839-2848 — 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 `src/paint/json.rs:2741` 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 `gradient_path` to `&crate::paint::ColorPaintLinearGradientPathNode` in one and `&crate::paint::ColorPaintRadialGradientPathNode` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 4) src/renderer/layout/shape_layout.rs:1869— src/renderer/layout/shape_layout.rs:1869-1878 | src/renderer/layout/shape_layout.rs:2197-2206 | src/renderer/layout/shape_layout.rs:2303-2312 | src/renderer/layout/shape_layout.rs:2426-2435 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/renderer/layout/shape_layout.rs:2302` calls `has_saved_affine_geometry`, `is_some` and `src/renderer/layout/shape_layout.rs:2196` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 4) src/renderer/layout/table_layout.rs:6236— src/renderer/layout/table_layout.rs:6236-6245 | src/renderer/layout/table_layout.rs:13066-13075 | src/renderer/layout/table_layout.rs:13248-13257 | src/renderer/layout/table_layout.rs:14238-14247 — 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 `src/renderer/layout/table_layout.rs:6236` 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 × 4) src/renderer/typeset/notes/endnotes/paragraph/tail_fit.rs:484— src/renderer/typeset/notes/endnotes/paragraph/tail_fit.rs:484-493 | src/renderer/typeset/notes/endnotes/paragraph/tail_fit.rs:732-741 | src/renderer/typeset/notes/endnotes/paragraph/tail_fit.rs:764-773 | src/renderer/typeset/notes/endnotes/paragraph/tail_fit.rs:856-865 — 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 `src/renderer/typeset/notes/endnotes/paragraph/tail_fit.rs:484` 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 × 4) src/wmf/converter/svg/mod.rs:194— src/wmf/converter/svg/mod.rs:194-203 | src/wmf/converter/svg/mod.rs:272-281 | src/wmf/converter/svg/mod.rs:481-490 | src/wmf/converter/svg/mod.rs:563-572 — 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 `src/wmf/converter/svg/mod.rs:194` 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 × 4) src/serializer/hwpx/master_page.rs:91— src/serializer/hwpx/master_page.rs:91-100 | src/serializer/hwpx/section.rs:4045-4054 | src/serializer/hwpx/section.rs:4955-4964 | src/serializer/hwpx/section.rs:5008-5017 — before extracting anything, compare `src/serializer/hwpx/master_page.rs` and `src/serializer/hwpx/section.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/serializer/hwpx/master_page.rs:91` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/serializer/hwpx/master_page.rs:90` calls `effective_style_id` and `src/serializer/hwpx/section.rs:5007` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 4) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:171— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:171-180 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:170-179 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:174-183 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:154-163 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 188 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 (10 lines × 4) src/diagnostics/hwp5_anchor_trace.rs:450— src/diagnostics/hwp5_anchor_trace.rs:450-459 | src/diagnostics/hwp5_ctrl_data_trace.rs:402-411 | src/diagnostics/hwp5_inventory.rs:503-512 | src/diagnostics/hwp5_inventory_diff.rs:1812-1821 — before extracting anything, compare `src/diagnostics/hwp5_anchor_trace.rs` and `src/diagnostics/hwp5_inventory.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) src/renderer/height_measurer.rs:2692— src/renderer/height_measurer.rs:2692-2701 | src/renderer/render_normalization.rs:562-571 | src/renderer/typeset/state.rs:387-396 | src/renderer/typeset/state.rs:1042-1051 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/render_normalization.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 `src/renderer/height_measurer.rs:2692` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `&mut` in one and `super) fn emit_decoration_table(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 4) src/parser/hwpx/section.rs:1019— src/parser/hwpx/section.rs:1019-1028 | src/parser/hwpx/section.rs:1349-1360 | src/parser/hwpx/section.rs:3484-3493 | src/parser/hwpx/section.rs:5393-5402 — 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 `src/parser/hwpx/section.rs:1019` 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 × 4) src/cli/commands/edit/document_text.rs:108— src/cli/commands/edit/document_text.rs:108-117 | src/cli/commands/edit/document_text.rs:413-422 | src/cli/commands/edit/document_text.rs:549-558 | src/cli/commands/edit/media.rs:718-727 — before extracting anything, compare `src/cli/commands/edit/document_text.rs` and `src/cli/commands/edit/media.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 261 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 `src/cli/commands/edit/document_text.rs:108` 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.
rhwp_ooxml_chart::parser::handle_start (cognitive 222) crates/rhwp-ooxml-chart/src/parser.rs:239— rhwp_ooxml_chart::parser::handle_start has cognitive complexity 222 (threshold 15). Drivers by points: if/else 79 (188 pts), match/switch 9 (26 pts), boolean chains 8 (nesting depth added 126). 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.
rhwp_ooxml_chart::data::scan_chart_values (cognitive 178) crates/rhwp-ooxml-chart/src/data.rs:575— rhwp_ooxml_chart::data::scan_chart_values has cognitive complexity 178 (threshold 15). Drivers by points: if/else 38 (160 pts), match/switch 4 (11 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 130). 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.
rhwp_ooxml_chart::renderer::render_bars (cognitive 133) crates/rhwp-ooxml-chart/src/renderer.rs:646— rhwp_ooxml_chart::renderer::render_bars has cognitive complexity 133 (threshold 15). Drivers by points: if/else 40 (102 pts), loops 5 (16 pts), match/switch 2 (12 pts), boolean chains 3 (nesting depth added 83). 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.
rhwp_ooxml_chart::drawing_style::resolve (cognitive 86) crates/rhwp-ooxml-chart/src/drawing_style.rs:71— rhwp_ooxml_chart::drawing_style::resolve has cognitive complexity 86 (threshold 15). Drivers by points: if/else 20 (68 pts), match/switch 4 (13 pts), boolean chains 3, loops 2 (nesting depth added 57). 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.
rhwp_ooxml_chart::parser::handle_end (cognitive 55) crates/rhwp-ooxml-chart/src/parser.rs:763— rhwp_ooxml_chart::parser::handle_end has cognitive complexity 55 (threshold 15). Drivers by points: if/else 20 (47 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 30). 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.
rhwp_ooxml_chart::renderer::chart_3d::render_bars_3d (cognitive 53) crates/rhwp-ooxml-chart/src/renderer/chart_3d.rs:398— rhwp_ooxml_chart::renderer::chart_3d::render_bars_3d has cognitive complexity 53 (threshold 15). Drivers by points: if/else 26 (43 pts), loops 4 (10 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp_ooxml_chart::parser::parse_chart_xml (cognitive 48) crates/rhwp-ooxml-chart/src/parser.rs:123— rhwp_ooxml_chart::parser::parse_chart_xml has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (34 pts), match/switch 3 (7 pts), loops 4 (5 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.
rhwp_ooxml_chart::renderer::render_value_grid (cognitive 38) crates/rhwp-ooxml-chart/src/renderer.rs:1897— rhwp_ooxml_chart::renderer::render_value_grid has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (31 pts), boolean chains 5, loops 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp_ooxml_chart::renderer::render_chart_svg_with_text_measure (cognitive 35) crates/rhwp-ooxml-chart/src/renderer.rs:313— rhwp_ooxml_chart::renderer::render_chart_svg_with_text_measure has cognitive complexity 35 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 6, match/switch 3 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
rhwp_ooxml_chart::renderer::render_of_pie (cognitive 35) crates/rhwp-ooxml-chart/src/renderer.rs:1463— rhwp_ooxml_chart::renderer::render_of_pie has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 4 (10 pts), match/switch 4 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp_ooxml_chart::renderer::render_combo (cognitive 33) crates/rhwp-ooxml-chart/src/renderer.rs:1729— rhwp_ooxml_chart::renderer::render_combo has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 5 (8 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.
rhwp_ooxml_chart::renderer::render_stock (cognitive 29) crates/rhwp-ooxml-chart/src/renderer.rs:1046— rhwp_ooxml_chart::renderer::render_stock has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp_ooxml_chart::renderer::render_line (cognitive 28) crates/rhwp-ooxml-chart/src/renderer.rs:937— rhwp_ooxml_chart::renderer::render_line has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp_ooxml_chart::renderer::render_category_labels_at (cognitive 27) crates/rhwp-ooxml-chart/src/renderer.rs:2073— rhwp_ooxml_chart::renderer::render_category_labels_at has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 3 (7 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp_ooxml_chart::renderer::render_scatter (cognitive 17) crates/rhwp-ooxml-chart/src/renderer.rs:1210— rhwp_ooxml_chart::renderer::render_scatter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp_ooxml_chart::data::attr_value_span_in_tag (cognitive 16) crates/rhwp-ooxml-chart/src/data.rs:416— rhwp_ooxml_chart::data::attr_value_span_in_tag has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (6 pts), boolean chains 5, if/else 2 (5 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.
Table::split_cell_into (cognitive 76) src/model/table.rs:2383— Table::split_cell_into has cognitive complexity 76 (threshold 15). Drivers by points: if/else 37 (56 pts), boolean chains 13, loops 6 (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.
Table::equalize_cell_block (cognitive 69) src/model/table_equal_size.rs:67— Table::equalize_cell_block has cognitive complexity 69 (threshold 15). Drivers by points: if/else 31 (52 pts), loops 8 (10 pts), boolean chains 7 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Table::closing_row_frames_with_storage (cognitive 46) src/model/table/row_frames.rs:22— Table::closing_row_frames_with_storage has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 10 (17 pts), boolean chains 5, match/switch 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.
Table::insert_row_inheriting (cognitive 35) src/model/table.rs:1708— Table::insert_row_inheriting has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 4 (6 pts), boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Table::insert_column_inheriting (cognitive 35) src/model/table.rs:1849— Table::insert_column_inheriting has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 4 (6 pts), boolean chains 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Table::restore_stored_cell_frame_widths (cognitive 33) src/model/table.rs:606— Table::restore_stored_cell_frame_widths has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 5 (8 pts), boolean chains 6 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Table::fallback_paragraph_frame_owner_widths_with_storage (cognitive 33) src/model/table.rs:797— Table::fallback_paragraph_frame_owner_widths_with_storage has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 6 (9 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Table::rowspan_declared_overflow_shrink (cognitive 31) src/model/table.rs:1013— Table::rowspan_declared_overflow_shrink has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Table::merge_cells (cognitive 24) src/model/table.rs:2127— Table::merge_cells has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 8, 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.
Table::delete_column (cognitive 23) src/model/table.rs:2049— Table::delete_column has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, 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.
Table::split_cell (cognitive 23) src/model/table.rs:2266— Table::split_cell has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
Table::contradictory_column_boundaries_hu_with_storage (cognitive 21) src/model/table/contradictory_grid.rs:35— Table::contradictory_column_boundaries_hu_with_storage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 5 (6 pts), boolean chains 3, match/switch 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.
Table::declared_width_rows_exceeding_with_storage (cognitive 19) src/model/table.rs:942— Table::declared_width_rows_exceeding_with_storage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Table::closed_inline_grid_width_hu_with_storage (cognitive 18) src/model/table_inline_grid.rs:35— Table::closed_inline_grid_width_hu_with_storage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 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.
Table::column_bounds (cognitive 17) src/model/table_equal_size.rs:24— Table::column_bounds has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (6 pts), if/else 2 (5 pts), match/switch 1 (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.
EqParser::parse_eqalign (cognitive 43) src/renderer/equation/parser_alignment.rs:55— EqParser::parse_eqalign has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 3 (8 pts), boolean chains 4 (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.
EqParser::parse_element_atom (cognitive 37) src/renderer/equation/parser_atoms.rs:7— EqParser::parse_element_atom has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EqParser::try_parse_scripts (cognitive 35) src/renderer/equation/parser_attached_scripts.rs:9— EqParser::try_parse_scripts has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 9, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EqParser::parse_script_span (cognitive 35) src/renderer/equation/parser_script_operand.rs:15— EqParser::parse_script_span has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 11, 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.
EqParser::parse_matrix (cognitive 28) src/renderer/equation/parser_structures.rs:25— EqParser::parse_matrix has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 5, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EqParser::parse_command_inner (cognitive 27) src/renderer/equation/parser_commands.rs:33— EqParser::parse_command_inner has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 10). 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.
EqParser::parse_fraction (cognitive 27) src/renderer/equation/parser_fractions.rs:8— EqParser::parse_fraction has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 5, loops 3, match/switch 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.
EqParser::parse_command_fallback (cognitive 25) src/renderer/equation/parser_commands.rs:227— EqParser::parse_command_fallback has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5, 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.
EqParser::parse_latex_env_eqalign (cognitive 24) src/renderer/equation/parser_fractions.rs:287— EqParser::parse_latex_env_eqalign has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, 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.
EqParser::finish_named_scripts (cognitive 22) src/renderer/equation/parser_left_scripts.rs:20— EqParser::finish_named_scripts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 4 (6 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EqParser::parse_latex_env_matrix (cognitive 20) src/renderer/equation/parser_fractions.rs:217— EqParser::parse_latex_env_matrix has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EqParser::parse_sqrt (cognitive 20) src/renderer/equation/parser_root.rs:7— EqParser::parse_sqrt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7, 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.
EqParser::parse_cases (cognitive 19) src/renderer/equation/parser_alignment.rs:7— EqParser::parse_cases has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EqParser::parse_fraction_in_range (cognitive 18) src/renderer/equation/parser.rs:477— EqParser::parse_fraction_in_range has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
EqParser::try_consume_infix_over_atop (cognitive 17) src/renderer/equation/parser.rs:259— EqParser::try_consume_infix_over_atop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×15
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×15
Edited copy of a member (19 corresponding lines) src/parser/hwpx/section.rs:6751— src/parser/hwpx/section.rs:6751-6780 | src/parser/hwpx/section.rs:6855-6891 — 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) src/renderer/skia/equation_conv.rs:746— src/renderer/skia/equation_conv.rs:746-770 | src/renderer/skia/equation_glyph.rs:13-54 — 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) src/diagnostics/layout_anomaly.rs:621— src/diagnostics/layout_anomaly.rs:621-639 | src/diagnostics/layout_anomaly.rs:758-776 — 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) src/renderer/image_resolver/print_alpha_2024.rs:17— src/renderer/image_resolver/print_alpha_2024.rs:17-36 | src/renderer/image_resolver/print_picture_resample.rs:42-60 — 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) bindings/Native/src/gpu_d3d.rs:224— bindings/Native/src/gpu_d3d.rs:224-242 | bindings/Native/src/gpu_metal.rs:233-251 — 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) src/parser/hwpx/section.rs:1687— src/parser/hwpx/section.rs:1687-1711 | src/parser/hwpx/section.rs:3631-3649 — 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) src/renderer/equation/multiplication_outline.rs:52— src/renderer/equation/multiplication_outline.rs:52-70 | src/renderer/equation/svg_render.rs:529-548 — 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) src/renderer/skia/text_replay/decorations.rs:12— src/renderer/skia/text_replay/decorations.rs:12-30 | src/renderer/skia/text_replay/lines.rs:66-84 — 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) src/parser/hwp3/ole.rs:127— src/parser/hwp3/ole.rs:127-150 | src/parser/hwp3/paragraph.rs:77-95 — 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) src/renderer/typeset/table/continuation/fragment/physical_rows.rs:35— src/renderer/typeset/table/continuation/fragment/physical_rows.rs:35-53 | src/renderer/typeset/table/scan/row.rs:288-308 — 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) src/wasm_api.rs:4320— src/wasm_api.rs:4320-4343 | src/wasm_api.rs:4500-4518 — 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) src/document_core/commands/clipboard.rs:192— src/document_core/commands/clipboard.rs:192-210 | src/document_core/helpers.rs:83-101 — 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) tools/skill_router/audit_skill_commands.py:175— tools/skill_router/audit_skill_commands.py:175-193 | tools/skill_router/gate_new_skill.py:383-401 — 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) tools/render_backend/gen_m06f.py:102— tools/render_backend/gen_m06f.py:102-123 | tools/render_backend/harness.py:52-70 — 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) tools/llm_verifier/process_steps/src/loader.rs:100— tools/llm_verifier/process_steps/src/loader.rs:100-118 | tools/llm_verifier/verdict_protocol/src/loader.rs:106-124 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×15
Edited copy of a member (20 corresponding lines) src/cli/queries/ir_comparison.rs:121— src/cli/queries/ir_comparison.rs:121-145 | src/cli/queries/ir_comparison.rs:319-338 — 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) src/parser/pdf/table_detection.rs:525— src/parser/pdf/table_detection.rs:525-549 | tools/pdf-ir-poc/src/table_detection.rs:277-296 — 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) src/bin/rhwp-agent/scan.rs:271— src/bin/rhwp-agent/scan.rs:271-292 | src/cli/queries/scan.rs:131-150 — 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) src/renderer/font_metrics_data.rs:409— src/renderer/font_metrics_data.rs:409-432 | src/renderer/layout/text_measurement.rs:1291-1310 — 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) src/document_core/commands/paragraph_block/import_json.rs:21— src/document_core/commands/paragraph_block/import_json.rs:21-41 | src/document_core/commands/paragraph_block/template_operation.rs:112-131 — 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) crates/rhwp-ooxml-chart/src/renderer.rs:222— crates/rhwp-ooxml-chart/src/renderer.rs:222-241 | src/emf/converter/svg.rs:56-75 — 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) mydocs/tech/investigations/issue-1139/probes/diag_1139_para_shape.rs:9— mydocs/tech/investigations/issue-1139/probes/diag_1139_para_shape.rs:9-28 | src/document_core/commands/object_ops/footnote_shape.rs:172-191 — 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) src/native_host/presentation.rs:342— src/native_host/presentation.rs:342-361 | src/native_host/presentation.rs:364-387 — 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) gym/certify.py:280— gym/certify.py:280-300 | gym/report.py:321-340 — 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) src/renderer/layout/text_measurement.rs:1152— src/renderer/layout/text_measurement.rs:1152-1174 | src/renderer/layout/text_measurement.rs:1181-1200 — 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) src/diagnostics/hwp5_first_para_control_probe.rs:1037— src/diagnostics/hwp5_first_para_control_probe.rs:1037-1056 | src/diagnostics/hwp5_first_para_control_probe.rs:1066-1092 — 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) src/wasm_api.rs:4968— src/wasm_api.rs:4968-4987 | src/wasm_api.rs:5001-5021 — 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) src/wasm_api.rs:3371— src/wasm_api.rs:3371-3390 | src/wasm_api.rs:5764-5784 — 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) tools/skill_router/install_git_hook.py:52— tools/skill_router/install_git_hook.py:52-71 | tools/skill_router/precommit_skill_gate.py:76-100 — 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) tools/llm_verifier/process_steps/generate_corpus.py:808— tools/llm_verifier/process_steps/generate_corpus.py:808-832 | tools/llm_verifier/verdict_protocol/generate_corpus.py:835-854 — 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.
Duplicated block (22 lines × 2) src/cli/outputs/tabular.rs:21— src/cli/outputs/tabular.rs:21-42 | src/cli/outputs/text.rs:272-293 — before extracting anything, compare `src/cli/outputs/tabular.rs` and `src/cli/outputs/text.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 116 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 `src/cli/outputs/tabular.rs:21` 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 (22 lines × 2) src/cli/queries/security_inspection.rs:601— src/cli/queries/security_inspection.rs:601-622 | src/cli/queries/security_inspection.rs:873-894 — both copies are in the same file, so extract the 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 `src/cli/queries/security_inspection.rs:601` 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) src/native_host/gpu_d3d.rs:405— src/native_host/gpu_d3d.rs:405-426 | src/native_host/gpu_metal.rs:291-312 — before extracting anything, compare `src/native_host/gpu_d3d.rs` and `src/native_host/gpu_metal.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 170 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 `target` to `NativeD3dTarget` in one and `NativeMetalTarget` 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 (22 lines × 2) src/parser/control.rs:516— src/parser/control.rs:516-537 | src/parser/control.rs:546-567 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) src/parser/hwp3/mod.rs:5125— src/parser/hwp3/mod.rs:5125-5146 | src/parser/hwpx/note_line_positions.rs:71-92 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/hwp3/mod.rs:5125` 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 (22 lines × 2) src/renderer/height_measurer.rs:2175— src/renderer/height_measurer.rs:2175-2196 | src/renderer/layout/table_layout.rs:3538-3559 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 300 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/height_measurer.rs:2175` 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 (22 lines × 2) src/renderer/height_measurer.rs:3637— src/renderer/height_measurer.rs:3637-3658 | src/renderer/layout/table_layout.rs:11860-11881 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 300 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/height_measurer.rs:3637` 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 (22 lines × 2) src/renderer/height_measurer.rs:4804— src/renderer/height_measurer.rs:4804-4825 | src/renderer/height_measurer.rs:5321-5342 — both copies are in the same file, so extract the 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 (22 lines × 2) src/renderer/kerning.rs:1625— src/renderer/kerning.rs:1625-1647 | src/renderer/kerning.rs:1664-1685 — both copies are in the same file, so extract the 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 `src/renderer/kerning.rs:1625` 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 (22 lines × 2) src/serializer/hwpx/shape.rs:91— src/serializer/hwpx/shape.rs:91-113 | src/serializer/hwpx/shape.rs:374-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 `src/serializer/hwpx/shape.rs:91` 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) src/parser/pdf/recognition.rs:589— src/parser/pdf/recognition.rs:589-610 | tools/pdf-ir-poc/src/recognition.rs:362-383 — before extracting anything, compare `src/parser/pdf/recognition.rs` and `tools/pdf-ir-poc/src/recognition.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 2) src/security_trailer.rs:188— src/security_trailer.rs:188-209 | src/security_trailer.rs:435-456 — both copies are in the same file, so extract the 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 `src/security_trailer.rs:188` 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 (22 lines × 2) tools/oracle_public/coverage_report.py:570— tools/oracle_public/coverage_report.py:570-591 | tools/oracle_public/oracle_resolver.py:386-407 — before extracting anything, compare `tools/oracle_public/coverage_report.py` and `tools/oracle_public/oracle_resolver.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 187 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 `tools/oracle_public/coverage_report.py:570` 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 (22 lines × 2) tools/oracle_public/page_smoke.py:144— tools/oracle_public/page_smoke.py:144-165 | tools/page_roundtrip/harness.py:200-221 — 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 (22 lines × 2) tools/skill_router/audit_skill_commands.py:211— tools/skill_router/audit_skill_commands.py:211-232 | tools/skill_router/gate_new_skill.py:419-440 — before extracting anything, compare `tools/skill_router/audit_skill_commands.py` and `tools/skill_router/gate_new_skill.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–11 lines × 2) bindings/Native/src/lib.rs:499— bindings/Native/src/lib.rs:499-509 | src/renderer/render_tree.rs:449-458 — 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 `bindings/Native/src/lib.rs:499` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/renderer/render_tree.rs:459` calls `push` and `bindings/Native/src/lib.rs:509` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 2) src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:198— src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:198-208 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:198-207 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs` and `src/bin/rhwp-q/commands/rhwp-q-text-layout.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 208 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 `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:198` 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–11 lines × 2) src/cli/batch/mod.rs:406— src/cli/batch/mod.rs:406-416 | src/cli/commands/batch_fill.rs:222-231 — before extracting anything, compare `src/cli/batch/mod.rs` and `src/cli/commands/batch_fill.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/batch/mod.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 (10–11 lines × 2) src/cli/commands/edit/document_text.rs:19— src/cli/commands/edit/document_text.rs:19-29 | src/cli/commands/edit/note_content.rs:236-245 — before extracting anything, compare `src/cli/commands/edit/document_text.rs` and `src/cli/commands/edit/note_content.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 232 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 `src/cli/commands/edit/document_text.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.
Duplicated block (10–11 lines × 2) src/cli/outputs/pdf.rs:137— src/cli/outputs/pdf.rs:137-146 | src/cli/outputs/pdf.rs:154-164 — both copies are in the same file, so extract the 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 `src/cli/outputs/pdf.rs:137` 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 (10–11 lines × 2) src/document_core/queries/field_query.rs:252— src/document_core/queries/field_query.rs:252-262 | src/document_core/queries/field_query.rs:312-321 — both copies are in the same file, so extract the 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 `src/document_core/queries/field_query.rs:252` 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–11 lines × 2) src/document_core/queries/rendering.rs:4207— src/document_core/queries/rendering.rs:4207-4217 | src/document_core/queries/rendering.rs:4388-4397 — both copies are in the same file, so extract the 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 `src/document_core/queries/rendering.rs:4207` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) src/model/document.rs:794— src/model/document.rs:794-803 | src/wasm_api.rs:4576-4586 — 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 `src/model/document.rs:794` 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 (10–11 lines × 2) src/renderer/composer/line_breaking.rs:6690— src/renderer/composer/line_breaking.rs:6690-6700 | src/renderer/typeset.rs:3366-3375 — 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 (10–11 lines × 2) src/renderer/layout.rs:15936— src/renderer/layout.rs:15936-15946 | src/renderer/layout.rs:16049-16058 — both copies are in the same file, so extract the 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 `src/renderer/layout.rs:15936` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) src/renderer/layout/shape_layout.rs:1301— src/renderer/layout/shape_layout.rs:1301-1311 | src/renderer/layout/table_layout.rs:4906-4915 — before extracting anything, compare `src/renderer/layout/shape_layout.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 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 `src/renderer/layout/shape_layout.rs:1301` 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 (10–11 lines × 2) src/renderer/layout/shape_layout.rs:3269— src/renderer/layout/shape_layout.rs:3269-3278 | src/renderer/layout/shape_layout.rs:3289-3299 — both copies are in the same file, so extract the 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 `src/renderer/layout/shape_layout.rs:3269` 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–11 lines × 2) src/document_core/commands/bullet_create.rs:142— src/document_core/commands/bullet_create.rs:142-152 | src/document_core/commands/numbering_char_shape.rs:42-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/bullet_create.rs:142` 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–11 lines × 2) src/parser/pdf/recognition.rs:1174— src/parser/pdf/recognition.rs:1174-1184 | tools/pdf-ir-poc/src/recognition.rs:830-839 — before extracting anything, compare `src/parser/pdf/recognition.rs` and `tools/pdf-ir-poc/src/recognition.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/recognition.rs:1174` 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 (10–11 lines × 2) scripts/font_rank1_qualification.py:65— scripts/font_rank1_qualification.py:65-75 | scripts/font_rank7_qualification.py:78-87 — before extracting anything, compare `scripts/font_rank1_qualification.py` and `scripts/font_rank7_qualification.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 128 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 `scripts/font_rank1_qualification.py:65` 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) src/diagnostics/hwp5_inventory_diff.rs:387— src/diagnostics/hwp5_inventory_diff.rs:387-393 | src/diagnostics/hwp5_inventory_diff.rs:443-450 — both copies are in the same file, so extract the 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 `src/diagnostics/hwp5_inventory_diff.rs:387` 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–8 lines × 2) src/paint/equation_print_frame.rs:13— src/paint/equation_print_frame.rs:13-19 | src/paint/paper_viewport.rs:267-274 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/paint/equation_print_frame.rs:13` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `sources` to `&HashSet<NodeId>` in one and `&std::collections::HashSet<u32>` 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 (7–8 lines × 2) src/parser/hwp3/mod.rs:2438— src/parser/hwp3/mod.rs:2438-2444 | src/parser/hwp3/mod.rs:2448-2455 — both copies are in the same file, so extract the 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 `src/parser/hwp3/mod.rs:2438` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) src/renderer/height_measurer.rs:2540— src/renderer/height_measurer.rs:2540-2546 | src/renderer/height_measurer.rs:2553-2560 — both copies are in the same file, so extract the 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 `src/renderer/height_measurer.rs:2540` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/renderer/height_measurer.rs:2538` calls `skip` and `src/renderer/height_measurer.rs:2551` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–8 lines × 2) src/renderer/height_measurer.rs:5531— src/renderer/height_measurer.rs:5531-5538 | src/renderer/table_row_frame.rs:271-277 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) src/renderer/layout.rs:14378— src/renderer/layout.rs:14378-14385 | src/renderer/typeset.rs:5773-5779 — before extracting anything, compare `src/renderer/layout.rs` and `src/renderer/typeset.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–8 lines × 2) src/renderer/layout/border_rendering.rs:878— src/renderer/layout/border_rendering.rs:878-885 | src/renderer/layout/border_rendering.rs:889-895 — both copies are in the same file, so extract the 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 `src/renderer/layout/border_rendering.rs:878` 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–8 lines × 2) src/renderer/layout/paragraph_layout.rs:1487— src/renderer/layout/paragraph_layout.rs:1487-1494 | src/renderer/layout/paragraph_layout.rs:9444-9450 — both copies are in the same file, so extract the 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 `src/renderer/layout/paragraph_layout.rs:9444` 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 (7–8 lines × 2) src/renderer/layout/picture_footnote.rs:529— src/renderer/layout/picture_footnote.rs:529-536 | src/renderer/layout/table_cell_content.rs:701-707 — 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 `src/renderer/layout/picture_footnote.rs:529` 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) src/renderer/layout/table_layout.rs:24265— src/renderer/layout/table_layout.rs:24265-24272 | src/renderer/layout/table_layout/stored_text_frame_owner.rs:242-248 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7–8 lines × 2) src/renderer/layout/table_layout/empty_line_flow.rs:56— src/renderer/layout/table_layout/empty_line_flow.rs:56-63 | src/renderer/stored_page_origin.rs:292-298 — 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 (7–8 lines × 2) src/renderer/layout/text_measurement.rs:604— src/renderer/layout/text_measurement.rs:604-611 | src/renderer/layout/text_measurement.rs:785-791 — both copies are in the same file, so extract the 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 `src/renderer/layout/text_measurement.rs:604` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) src/renderer/svg.rs:1297— src/renderer/svg.rs:1297-1304 | src/renderer/svg.rs:1344-1350 — both copies are in the same file, so extract the 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 `src/renderer/svg.rs:1297` 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–8 lines × 2) src/parser/pdf/table_hierarchy.rs:95— src/parser/pdf/table_hierarchy.rs:95-101 | tools/pdf-ir-poc/src/table_hierarchy.rs:100-107 — before extracting anything, compare `src/parser/pdf/table_hierarchy.rs` and `tools/pdf-ir-poc/src/table_hierarchy.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `tools/pdf-ir-poc/src/table_hierarchy.rs:100` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) tools/task2279/pi78_split_ladder.py:75— tools/task2279/pi78_split_ladder.py:75-81 | tools/task2279/subpixel_align_harness.py:39-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×14
Edited copy of a member (23 corresponding lines) gym/certify.py:314— gym/certify.py:314-336 | gym/report.py:361-384 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) bindings/Native/src/gpu_d3d.rs:254— bindings/Native/src/gpu_d3d.rs:254-276 | bindings/Native/src/gpu_metal.rs:263-285 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/renderer/native_pua_fonts.rs:84— src/renderer/native_pua_fonts.rs:84-106 | src/renderer/native_pua_fonts.rs:138-166 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/document_core/hwpjson/body.rs:160— src/document_core/hwpjson/body.rs:160-182 | src/document_core/hwpjson/body.rs:186-210 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/renderer/layout.rs:755— src/renderer/layout.rs:755-777 | src/renderer/layout/table_layout/deferred_flow_units.rs:117-141 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/wmf/parser/records/drawing/flood_fill.rs:38— src/wmf/parser/records/drawing/flood_fill.rs:38-60 | src/wmf/parser/records/drawing/set_pixel.rs:37-59 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/renderer/composer/line_breaking.rs:3769— src/renderer/composer/line_breaking.rs:3769-3791 | src/renderer/composer/line_breaking.rs:3797-3819 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/document_core/helpers.rs:1639— src/document_core/helpers.rs:1639-1662 | src/renderer/layout/border_rendering.rs:1598-1620 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/renderer/svg.rs:1711— src/renderer/svg.rs:1711-1737 | src/renderer/svg.rs:1748-1770 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/diagnostics/hwp5_roundtrip_batch.rs:224— src/diagnostics/hwp5_roundtrip_batch.rs:224-250 | src/diagnostics/hwpx_roundtrip_batch.rs:108-130 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/serializer/hwpx/char_shapes.rs:116— src/serializer/hwpx/char_shapes.rs:116-138 | src/serializer/hwpx/header.rs:311-336 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/document_core/commands/compose_controls.rs:122— src/document_core/commands/compose_controls.rs:122-146 | src/document_core/commands/compose_controls.rs:148-170 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/renderer/float_placement.rs:2605— src/renderer/float_placement.rs:2605-2627 | src/renderer/stored_line_ladder.rs:150-176 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) tools/oracle_public/page_smoke.py:439— tools/oracle_public/page_smoke.py:439-462 | tools/page_roundtrip/harness.py:370-392 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (21 lines × 2) src/cli/batch/mod.rs:304— src/cli/batch/mod.rs:304-324 | src/cli/commands/batch_fill.rs:144-164 — before extracting anything, compare `src/cli/batch/mod.rs` and `src/cli/commands/batch_fill.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/batch/mod.rs:304` 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) src/cli/queries/explain.rs:174— src/cli/queries/explain.rs:174-194 | src/cli/queries/explore.rs:53-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 `src/cli/queries/explain.rs:174` 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 (21 lines × 2) src/cli/queries/security_inspection.rs:711— src/cli/queries/security_inspection.rs:711-731 | src/cli/queries/security_inspection.rs:983-1003 — both copies are in the same file, so extract the 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 `src/cli/queries/security_inspection.rs:711` 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 (21 lines × 2) src/diagnostics/hwp5_roundtrip_batch.rs:157— src/diagnostics/hwp5_roundtrip_batch.rs:157-177 | src/diagnostics/hwpx_roundtrip_batch.rs:46-66 — before extracting anything, compare `src/diagnostics/hwp5_roundtrip_batch.rs` and `src/diagnostics/hwpx_roundtrip_batch.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 152 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 `src/diagnostics/hwp5_roundtrip_batch.rs:157` 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) src/diagnostics/ir_field_sweep.rs:873— src/diagnostics/ir_field_sweep.rs:873-893 | src/diagnostics/ir_field_sweep.rs:1022-1042 — both copies are in the same file, so extract the 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 `src/diagnostics/ir_field_sweep.rs:873` 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 (21 lines × 2) src/document_core/commands/object_ops/common.rs:593— src/document_core/commands/object_ops/common.rs:593-613 | src/document_core/commands/object_ops/equation.rs:598-618 — before extracting anything, compare `src/document_core/commands/object_ops/common.rs` and `src/document_core/commands/object_ops/equation.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/object_ops/common.rs:593` 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) src/document_core/commands/text_editing.rs:5009— src/document_core/commands/text_editing.rs:5009-5029 | src/document_core/commands/text_editing.rs:5042-5062 — both copies are in the same file, so extract the 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 (21 lines × 2) src/model/table.rs:1952— src/model/table.rs:1952-1972 | src/model/table.rs:2101-2121 — both copies are in the same file, so extract the 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 `src/model/table.rs:1952` 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 (21 lines × 2) src/paint/json.rs:3733— src/paint/json.rs:3733-3753 | src/renderer/canvaskit_policy.rs:2414-2434 — before extracting anything, compare `src/paint/json.rs` and `src/renderer/canvaskit_policy.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 lines × 2) src/parser/auto_numbers.rs:362— src/parser/auto_numbers.rs:362-382 | src/parser/auto_numbers.rs:384-404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 lines × 2) src/renderer/equation/canvas_render.rs:394— src/renderer/equation/canvas_render.rs:394-414 | src/renderer/equation/svg_render.rs:462-482 — before extracting anything, compare `src/renderer/equation/canvas_render.rs` and `src/renderer/equation/svg_render.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 198 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 `src/renderer/equation/canvas_render.rs:394` 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) src/renderer/skia/text_replay.rs:267— src/renderer/skia/text_replay.rs:267-287 | src/renderer/skia/text_replay.rs:300-320 — both copies are in the same file, so extract the 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 (21 lines × 2) src/renderer/typeset/notes/endnotes/paragraph/reflow_fit.rs:101— src/renderer/typeset/notes/endnotes/paragraph/reflow_fit.rs:101-121 | src/renderer/typeset/notes/endnotes/paragraph/reflow_fit.rs:443-463 — both copies are in the same file, so extract the 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 `src/renderer/typeset/notes/endnotes/paragraph/reflow_fit.rs:101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/renderer/typeset/notes/endnotes/paragraph/reflow_fit.rs:464` calls `var_os`, `is_some` and `src/renderer/typeset/notes/endnotes/paragraph/reflow_fit.rs:122` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (21 lines × 2) src/renderer/composer/stored_cell_reflow.inc.rs:28— src/renderer/composer/stored_cell_reflow.inc.rs:28-48 | src/renderer/typeset/paragraph.rs:810-830 — before extracting anything, compare `src/renderer/composer/stored_cell_reflow.inc.rs` and `src/renderer/typeset/paragraph.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/composer/stored_cell_reflow.inc.rs:28` 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.
WebCanvasRenderer::draw_text_positioned (cyclomatic 64) src/renderer/web_canvas.rs:2679— WebCanvasRenderer::draw_text_positioned has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WebCanvasRenderer::draw_image (cyclomatic 33) src/renderer/web_canvas.rs:3257— WebCanvasRenderer::draw_image has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WebCanvasRenderer::render_node (cyclomatic 32) src/renderer/web_canvas.rs:619— WebCanvasRenderer::render_node 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.
WebCanvasRenderer::draw_image_with_fill_mode (cyclomatic 32) src/renderer/web_canvas.rs:4323— WebCanvasRenderer::draw_image_with_fill_mode has cyclomatic complexity 32 (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.
WebCanvasRenderer::draw_text_with_effects (cyclomatic 30) src/renderer/web_canvas.rs:3638— WebCanvasRenderer::draw_text_with_effects 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.
WebCanvasRenderer::render_image_with_sampling (cyclomatic 28) src/renderer/web_canvas.rs:1401— WebCanvasRenderer::render_image_with_sampling 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.
WebCanvasRenderer::draw_char_overlap (cyclomatic 26) src/renderer/web_canvas.rs:3901— WebCanvasRenderer::draw_char_overlap 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.
WebCanvasRenderer::draw_path_with_gradient (cyclomatic 24) src/renderer/web_canvas.rs:2380— WebCanvasRenderer::draw_path_with_gradient 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.
WebCanvasRenderer::apply_square_gradient_fill (cyclomatic 20) src/renderer/web_canvas.rs:2112— WebCanvasRenderer::apply_square_gradient_fill 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.
WebCanvasRenderer::draw_rect_with_gradient (cyclomatic 20) src/renderer/web_canvas.rs:2230— WebCanvasRenderer::draw_rect_with_gradient 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.
WebCanvasRenderer::render_text_run (cyclomatic 19) src/renderer/web_canvas.rs:1049— WebCanvasRenderer::render_text_run has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WebCanvasRenderer::render_page_background (cyclomatic 18) src/renderer/web_canvas.rs:961— WebCanvasRenderer::render_page_background 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.
WebCanvasRenderer::apply_pattern_fill (cyclomatic 17) src/renderer/web_canvas.rs:1919— WebCanvasRenderer::apply_pattern_fill has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
EqLayout::layout_aligned_rows (cognitive 34) src/renderer/equation/layout/matrix_geometry.rs:276— EqLayout::layout_aligned_rows has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22 (30 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EqLayout::row_children (cognitive 34) src/renderer/equation/layout/symbol_spacing.rs:168— EqLayout::row_children has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 7, match/switch 3 (5 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
EqLayout::layout_plain_matrix (cognitive 29) src/renderer/equation/layout/plain_matrix_geometry.rs:9— EqLayout::layout_plain_matrix has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 5 (8 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.
EqLayout::layout_ladder (cognitive 28) src/renderer/equation/layout/ladder_geometry.rs:11— EqLayout::layout_ladder has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 6 (9 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EqLayout::layout_matrix (cognitive 26) src/renderer/equation/layout/matrix_geometry.rs:20— EqLayout::layout_matrix has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 6 (9 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EqLayout::layout_symbol (cognitive 26) src/renderer/equation/layout.rs:595— EqLayout::layout_symbol has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 5, 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.
EqLayout::layout_math_symbol (cognitive 26) src/renderer/equation/layout.rs:660— EqLayout::layout_math_symbol has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 2 (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.
EqLayout::layout_sqrt (cognitive 23) src/renderer/equation/layout/fraction_geometry.rs:200— EqLayout::layout_sqrt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20 (21 pts), boolean chains 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.
EqLayout::layout_paren (cognitive 20) src/renderer/equation/layout/paren_geometry.rs:7— EqLayout::layout_paren has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, boolean chains 7. 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.
EqLayout::layout_legacy_paren (cognitive 20) src/renderer/equation/layout/paren_geometry.rs:122— EqLayout::layout_legacy_paren 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.
EqLayout::layout_text (cognitive 20) src/renderer/equation/layout.rs:485— EqLayout::layout_text has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 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.
EqLayout::layout_big_op (cognitive 18) src/renderer/equation/layout/big_op_geometry.rs:9— EqLayout::layout_big_op has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 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.
EqLayout::layout (cognitive 16) src/renderer/equation/layout.rs:222— EqLayout::layout has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 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.
Duplicated block (14 lines × 3) src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:71— src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:71-84 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:71-84 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:71-84 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs` and `src/bin/rhwp-q/commands/rhwp-q-page-caret.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 101 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 `src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:71` 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) src/cli/commands/edit/formatting.rs:314— src/cli/commands/edit/formatting.rs:314-327 | src/cli/commands/edit/tables/grid.rs:360-373 | src/cli/commands/edit/tables/grid.rs:729-742 — before extracting anything, compare `src/cli/commands/edit/formatting.rs` and `src/cli/commands/edit/tables/grid.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 167 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) src/cli/commands/edit/privacy.rs:102— src/cli/commands/edit/privacy.rs:102-115 | src/cli/commands/edit/text.rs:301-314 | src/cli/commands/tabular_import.rs:65-78 — before extracting anything, compare `src/cli/commands/edit/privacy.rs` and `src/cli/commands/edit/text.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 98 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 `src/cli/commands/edit/privacy.rs:102` 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 (14 lines × 3) src/document_core/commands/object_ops/picture.rs:1431— src/document_core/commands/object_ops/picture.rs:1431-1444 | src/document_core/commands/table_ops.rs:3757-3770 | src/document_core/commands/text_editing.rs:2919-2932 — before extracting anything, compare `src/document_core/commands/object_ops/picture.rs` and `src/document_core/commands/table_ops.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 3) src/document_core/commands/section_ops.rs:33— src/document_core/commands/section_ops.rs:33-46 | src/document_core/commands/text_editing.rs:5460-5473 | src/document_core/commands/text_editing.rs:5862-5875 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (14 lines × 3) src/document_core/queries/cursor_rect.rs:317— src/document_core/queries/cursor_rect.rs:317-330 | src/document_core/queries/cursor_rect.rs:5371-5384 | src/document_core/queries/cursor_rect.rs:5937-5950 — 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. 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 lines × 3) src/document_core/queries/grep.rs:156— src/document_core/queries/grep.rs:156-169 | src/document_core/queries/hidden_text.rs:541-554 | src/document_core/queries/injection_scan.rs:1227-1240 — before extracting anything, compare `src/document_core/queries/grep.rs` and `src/document_core/queries/injection_scan.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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 `src/document_core/queries/grep.rs:156` 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) src/renderer/equation/canvas_render.rs:352— src/renderer/equation/canvas_render.rs:352-366 | src/renderer/equation/svg_render.rs:413-428 | src/renderer/skia/equation_conv.rs:484-497 — before extracting anything, compare `src/renderer/equation/canvas_render.rs` and `src/renderer/equation/svg_render.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 198 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 `src/renderer/equation/canvas_render.rs:352` 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) src/renderer/layout/picture_footnote.rs:2023— src/renderer/layout/picture_footnote.rs:2023-2036 | src/renderer/layout/table_layout.rs:9246-9259 | src/renderer/layout/table_layout.rs:10378-10391 — 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 `src/renderer/layout/picture_footnote.rs:2023` 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 (14 lines × 3) src/renderer/layout/shape_layout.rs:4556— src/renderer/layout/shape_layout.rs:4556-4569 | src/renderer/layout/table_layout.rs:9399-9412 | src/renderer/layout/table_partial.rs:4437-4450 — before extracting anything, compare `src/renderer/layout/shape_layout.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 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 `src/renderer/layout/shape_layout.rs:4556` 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) src/renderer/layout/table_cell_content.rs:945— src/renderer/layout/table_cell_content.rs:945-958 | src/renderer/layout/table_layout.rs:4597-4610 | src/renderer/layout/table_partial.rs:7353-7366 — before extracting anything, compare `src/renderer/layout/table_cell_content.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 97 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 `src/renderer/layout/table_cell_content.rs:945` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/renderer/layout/table_layout.rs:4593` calls `publish_table_paint_layer` and `src/renderer/layout/table_cell_content.rs:941` 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 (14 lines × 3) src/renderer/layout/table_partial.rs:813— src/renderer/layout/table_partial.rs:813-826 | src/renderer/layout/table_partial.rs:900-913 | src/renderer/layout/table_partial.rs:1223-1236 — 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 `src/renderer/layout/table_partial.rs:813` 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) src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:214— src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:214-227 | src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:235-248 | src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:254-267 — 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 `src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:214` 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–9 lines × 2) src/cli/commands/edit/fields.rs:243— src/cli/commands/edit/fields.rs:243-251 | src/cli/protocol/plan/execution.rs:266-273 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/fields.rs:243` 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–9 lines × 2) src/document_core/commands/clipboard.rs:923— src/document_core/commands/clipboard.rs:923-930 | src/document_core/commands/html_import.rs:224-232 — before extracting anything, compare `src/document_core/commands/clipboard.rs` and `src/document_core/commands/html_import.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 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 `src/document_core/commands/clipboard.rs:923` 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–9 lines × 2) src/document_core/commands/clipboard.rs:1391— src/document_core/commands/clipboard.rs:1391-1398 | src/document_core/commands/object_ops/table.rs:817-825 — 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 `src/document_core/commands/clipboard.rs:1391` 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, `src/document_core/commands/object_ops/table.rs:826` calls `Some`, `get_mut`, `shift_for_insert` and `src/document_core/commands/clipboard.rs:1399` 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–9 lines × 2) src/document_core/queries/cursor_rect.rs:5337— src/document_core/queries/cursor_rect.rs:5337-5345 | src/document_core/queries/cursor_rect.rs:5876-5883 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:5337` 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 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) src/parser/hwpx/section.rs:2505— src/parser/hwpx/section.rs:2505-2512 | src/parser/hwpx/section.rs:7237-7245 — both copies are in the same file, so extract the 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 `src/parser/hwpx/section.rs:2505` 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–9 lines × 2) src/parser/pdf/structured_lowering.rs:1061— src/parser/pdf/structured_lowering.rs:1061-1069 | src/parser/pdf/structured_lowering.rs:1073-1080 — both copies are in the same file, so extract the 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 `src/parser/pdf/structured_lowering.rs:1061` 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 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) src/renderer/float_placement.rs:6657— src/renderer/float_placement.rs:6657-6664 | src/renderer/float_placement.rs:6780-6788 — both copies are in the same file, so extract the 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 `src/renderer/float_placement.rs:6657` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/renderer/float_placement.rs:6668` calls `shares_float_anchor`, `then_some` and `src/renderer/float_placement.rs:6789` 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–9 lines × 2) src/renderer/layout.rs:6816— src/renderer/layout.rs:6816-6823 | src/renderer/layout.rs:10089-10097 — both copies are in the same file, so extract the 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 `src/renderer/layout.rs:6816` 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 (8–9 lines × 2) src/renderer/native_webfonts.rs:370— src/renderer/native_webfonts.rs:370-378 | src/renderer/native_webfonts.rs:444-451 — both copies are in the same file, so extract the 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 `src/renderer/native_webfonts.rs:370` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) src/renderer/typeset/controls/wrap_absorption.rs:41— src/renderer/typeset/controls/wrap_absorption.rs:41-49 | src/renderer/typeset/controls/wrap_absorption.rs:84-91 — both copies are in the same file, so extract the 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 `src/renderer/typeset/controls/wrap_absorption.rs:41` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/renderer/typeset/controls/wrap_absorption.rs:83` calls `take` and `src/renderer/typeset/controls/wrap_absorption.rs:40` 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 (8–9 lines × 2) src/serializer/hwpx/shape.rs:129— src/serializer/hwpx/shape.rs:129-136 | src/serializer/hwpx/shape.rs:320-328 — both copies are in the same file, so extract the 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, `src/serializer/hwpx/shape.rs:127` calls `write_rect_pts_with_storage` and `src/serializer/hwpx/shape.rs:318` 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–9 lines × 2) tools/issue5162_field_wraps_table.py:82— tools/issue5162_field_wraps_table.py:82-90 | tools/issue5169_bodytext_vs_viewtext.py:26-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 (8–9 lines × 2) tools/task2279/footer_flip_run.py:121— tools/task2279/footer_flip_run.py:121-128 | tools/task2279/footer_flip_worker.py:32-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.
Duplicated block (6 lines × 4) mydocs/tech/investigations/issue-1061/probes/dump_eqedit_raw.rs:33— mydocs/tech/investigations/issue-1061/probes/dump_eqedit_raw.rs:33-38 | mydocs/tech/investigations/issue-1061/probes/dump_equation_records.rs:119-124 | mydocs/tech/investigations/issue-1064/probes/dump_table_ctrl_data.rs:130-135 | mydocs/tech/investigations/issue-1064/probes/repro_1064_save.rs:46-51 — before extracting anything, compare `mydocs/tech/investigations/issue-1061/probes/dump_equation_records.rs` and `mydocs/tech/investigations/issue-1064/probes/repro_1064_save.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) src/bin/rhwp-q/more/inventory.rs:517— src/bin/rhwp-q/more/inventory.rs:517-522 | src/bin/rhwp-q/more/inventory.rs:544-549 | src/bin/rhwp-q/pack/inventory.rs:601-606 | src/bin/rhwp-q/pack/inventory.rs:1218-1223 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:517` 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 × 4) src/bin/rhwp-q/more/inventory.rs:571— src/bin/rhwp-q/more/inventory.rs:571-576 | src/bin/rhwp-q/more/inventory.rs:598-603 | src/bin/rhwp-q/more/inventory.rs:625-630 | src/bin/rhwp-q/pack/inventory.rs:628-633 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.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 (6 lines × 4) src/cli/outputs/pdf.rs:81— src/cli/outputs/pdf.rs:81-86 | src/cli/outputs/text.rs:445-450 | src/cli/outputs/vector.rs:79-84 | src/cli/outputs/vector.rs:576-581 — before extracting anything, compare `src/cli/outputs/pdf.rs` and `src/cli/outputs/vector.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 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 `src/cli/outputs/pdf.rs:81` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) src/document_core/commands/clipboard.rs:590— src/document_core/commands/clipboard.rs:590-597 | src/document_core/commands/clipboard.rs:678-685 | src/document_core/commands/clipboard.rs:739-744 | src/document_core/commands/header_footer_ops.rs:759-764 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/clipboard.rs:590` 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 × 4) src/document_core/helpers.rs:516— src/document_core/helpers.rs:516-521 | src/document_core/helpers.rs:537-542 | src/document_core/helpers.rs:558-563 | src/document_core/helpers.rs:787-792 — 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.
Duplicated block (6 lines × 4) src/document_core/queries/cursor_rect.rs:6248— src/document_core/queries/cursor_rect.rs:6248-6253 | src/document_core/queries/cursor_rect.rs:6263-6268 | src/document_core/queries/cursor_rect.rs:6575-6580 | src/document_core/queries/cursor_rect.rs:6591-6596 — 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 `src/document_core/queries/cursor_rect.rs:6248` 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 × 4) src/paint/json.rs:550— src/paint/json.rs:550-555 | src/paint/text_v2_export.rs:46-51 | src/paint/text_v2_slots.rs:149-154 | src/renderer/skia/cache.rs:197-202 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/paint/json.rs:550` 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 × 4) src/renderer/layout/table_layout.rs:8268— src/renderer/layout/table_layout.rs:8268-8275 | src/renderer/layout/table_partial.rs:3499-3504 | src/renderer/layout/table_partial.rs:3658-3669 | src/renderer/layout/table_partial.rs:3755-3764 — before extracting anything, compare `src/renderer/layout/table_layout.rs` and `src/renderer/layout/table_partial.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 327 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 `src/renderer/layout/table_layout.rs:8268` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/renderer/layout/table_layout.rs:8278` calls `Some`, `get` and `src/renderer/layout/table_partial.rs:3672` 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 × 4) src/renderer/web_canvas.rs:2284— src/renderer/web_canvas.rs:2284-2289 | src/renderer/web_canvas.rs:2312-2317 | src/renderer/web_canvas.rs:2366-2371 | src/renderer/web_canvas.rs:2490-2495 — 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 `src/renderer/web_canvas.rs:2284` 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, `src/renderer/web_canvas.rs:2283` calls `clear_shadow` and `src/renderer/web_canvas.rs:2364` 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 × 4) src/serializer/body_text.rs:1163— src/serializer/body_text.rs:1163-1168 | src/serializer/body_text.rs:1190-1195 | src/serializer/body_text.rs:1218-1223 | src/serializer/body_text.rs:1241-1246 — 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.
Duplicated block (6 lines × 4) tools/layout_anomaly_batch_report.py:734— tools/layout_anomaly_batch_report.py:734-739 | tools/oracle_public/coverage_report.py:556-561 | tools/oracle_public/oracle_resolver.py:377-382 | tools/oracle_public/sweep_runner.py:1222-1227 — 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. The matched lines also transfer control out of the body holding them, 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, `tools/oracle_public/coverage_report.py:564` calls `emit_json`, `dumps`, `emit_text` and `tools/oracle_public/oracle_resolver.py:385` 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 × 4) tools/llm_verifier/abstain/corpus_io.py:52— tools/llm_verifier/abstain/corpus_io.py:52-57 | tools/llm_verifier/oracle_vs_self/corpus_io.py:47-52 | tools/llm_verifier/shadow_agree/corpus_io.py:52-57 | tools/llm_verifier/untrusted_sandbox/corpus_io.py:53-58 — `tools/llm_verifier/abstain/corpus_io.py` and `tools/llm_verifier/oracle_vs_self/corpus_io.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 2 separate duplicated blocks between them, totalling at least 21 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Low cohesion: SVGPlayer (LCOM4 26) src/wmf/converter/svg/mod.rs:26— SVGPlayer's methods fall into 26 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 26 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: f32x8 (LCOM4 13) vendor/rhwp-hayro-jpeg2000/src/math.rs:17— f32x8's methods fall into 13 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 13 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: DeviceContext (LCOM4 12) src/wmf/converter/svg/device_context.rs:4— DeviceContext's methods fall into 12 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 12 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: NameAllocator (LCOM4 6) vendor/svg2pdf/src/util/allocate.rs:26— NameAllocator's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: u32x8 (LCOM4 5) vendor/rhwp-hayro-jbig2/src/simd.rs:30— u32x8'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: ParentFieldConfig (LCOM4 5) vendor/rhwp-pdf-import-backend/src/editor/form_fields.rs:276— ParentFieldConfig'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: TextRasterizer (LCOM4 5) vendor/rhwp-pdf-import-backend/src/rendering/text_rasterizer.rs:411— TextRasterizer'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: DocumentCore (LCOM4 4) src/document_core/mod.rs:208— DocumentCore'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: PdfDocument (LCOM4 4) vendor/rhwp-pdf-import-backend/src/document.rs:374— PdfDocument'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: ImageContent (LCOM4 4) vendor/rhwp-pdf-import-backend/src/elements/image.rs:12— ImageContent'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: PathContent (LCOM4 4) vendor/rhwp-pdf-import-backend/src/elements/path.rs:103— PathContent'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: Layer (LCOM4 4) vendor/rhwp-pdf-import-backend/src/writer/layers.rs:50— Layer'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: YmmRegister (LCOM4 4) vendor/rhwp-zune-jpeg/src/unsafe_utils_neon.rs:27— YmmRegister'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.
AC1 · Text alternatives· <canvas> without a text alternative · ×12
<canvas> without a text alternative mydocs/pr/assets/semanticist21-20261005/browser-review.mjs:15— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative mydocs/pr/assets/semanticist21-20261005/combobox-browser.mjs:23— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative mydocs/pr/assets/semanticist21-20261005/combobox-browser.mjs:60— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative mydocs/pr/assets/semanticist21-20261005/kerning-browser.mjs:18— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:59— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative mydocs/report/edit_demo_4664/park.html:198— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative mydocs/report/edit_demo_4664/park.html:199— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative rhwp-studio/index.html:673— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative rhwp-studio/index.html:674— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative rhwp-studio/src/view/canvas-view.ts:1075— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative rhwp-studio/src/view/canvas-view.ts:1097— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative rhwp-studio/src/view/page-renderer.ts:767— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
Table::split_cell_into (cyclomatic 50) src/model/table.rs:2383— Table::split_cell_into has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Table::equalize_cell_block (cyclomatic 39) src/model/table_equal_size.rs:67— Table::equalize_cell_block has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Table::closing_row_frames_with_storage (cyclomatic 30) src/model/table/row_frames.rs:22— Table::closing_row_frames_with_storage 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.
Table::restore_stored_cell_frame_widths (cyclomatic 24) src/model/table.rs:606— Table::restore_stored_cell_frame_widths 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.
Table::fallback_paragraph_frame_owner_widths_with_storage (cyclomatic 22) src/model/table.rs:797— Table::fallback_paragraph_frame_owner_widths_with_storage 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.
Table::insert_row_inheriting (cyclomatic 21) src/model/table.rs:1708— Table::insert_row_inheriting 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.
Table::insert_column_inheriting (cyclomatic 21) src/model/table.rs:1849— Table::insert_column_inheriting 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.
Table::merge_cells (cyclomatic 21) src/model/table.rs:2127— Table::merge_cells 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.
Table::rowspan_declared_overflow_shrink (cyclomatic 19) src/model/table.rs:1013— Table::rowspan_declared_overflow_shrink 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.
Table::split_cell (cyclomatic 18) src/model/table.rs:2266— Table::split_cell 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.
Table::contradictory_column_boundaries_hu_with_storage (cyclomatic 17) src/model/table/contradictory_grid.rs:35— Table::contradictory_column_boundaries_hu_with_storage 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.
Table::delete_column (cyclomatic 16) src/model/table.rs:2049— Table::delete_column 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 (25 corresponding lines) · ×12
Edited copy of a member (25 corresponding lines) src/parser/pdf/structured_lowering.rs:834— src/parser/pdf/structured_lowering.rs:834-870 | tools/pdf-ir-poc/src/structured_lowering.rs:85-109 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/renderer/mod.rs:3744— src/renderer/mod.rs:3744-3774 | src/renderer/mod.rs:3781-3805 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/parser/hwpx/section.rs:2098— src/parser/hwpx/section.rs:2098-2122 | src/parser/hwpx/section.rs:6543-6575 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/bin/rhwp-q/kit/flow_images.rs:48— src/bin/rhwp-q/kit/flow_images.rs:48-72 | src/bin/rhwp-q/kit/overlay_images.rs:52-76 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:278— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:278-302 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:259-283 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/parser/hml/reader.rs:265— src/parser/hml/reader.rs:265-289 | src/parser/hml/reader.rs:297-325 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/parser/cfb_reader.rs:874— src/parser/cfb_reader.rs:874-898 | src/parser/cfb_reader.rs:905-931 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/rhwp-ooxml-chart/src/renderer.rs:536— crates/rhwp-ooxml-chart/src/renderer.rs:536-562 | crates/rhwp-ooxml-chart/src/renderer.rs:618-642 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) scripts/visual_sweep_handbook.py:57— scripts/visual_sweep_handbook.py:57-88 | scripts/visual_sweep_native_webfonts.py:94-118 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) tools/oracle_public/page_smoke.py:169— tools/oracle_public/page_smoke.py:169-199 | tools/oracle_public/sweep_runner.py:585-609 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) tools/llm_verifier/process_steps/generate_corpus.py:779— tools/llm_verifier/process_steps/generate_corpus.py:779-804 | tools/llm_verifier/verdict_protocol/generate_corpus.py:807-831 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) scripts/font_kerning_cohort.py:521— scripts/font_kerning_cohort.py:521-554 | scripts/font_rank8_qualification.py:579-603 — 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 (22 corresponding lines) · ×12
Edited copy of a member (22 corresponding lines) src/parser/pdf/structured_lowering/body.rs:46— src/parser/pdf/structured_lowering/body.rs:46-67 | src/parser/pdf/structured_lowering/body.rs:118-145 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src/parser/hwpx/section.rs:3530— src/parser/hwpx/section.rs:3530-3551 | src/parser/hwpx/section.rs:3556-3582 — 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) src/renderer/layout/paragraph_layout.rs:1708— src/renderer/layout/paragraph_layout.rs:1708-1729 | src/renderer/typeset.rs:1784-1808 — 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) src/parser/control/shape.rs:1108— src/parser/control/shape.rs:1108-1129 | src/parser/control/shape.rs:1133-1163 — 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) src/renderer/layout.rs:2001— src/renderer/layout.rs:2001-2022 | src/renderer/typeset.rs:1981-2004 — 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) src/paint/json.rs:2929— src/paint/json.rs:2929-2961 | src/paint/json.rs:2963-2984 — 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) src/parser/body_text.rs:1432— src/parser/body_text.rs:1432-1454 | src/parser/ole_container.rs:261-282 — 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) src/document_core/helpers.rs:1614— src/document_core/helpers.rs:1614-1636 | src/parser/hwpx/header.rs:2517-2538 — 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) src/model/document.rs:690— src/model/document.rs:690-711 | src/model/document.rs:734-755 — 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) src/serializer/hwpx/header.rs:847— src/serializer/hwpx/header.rs:847-868 | src/serializer/hwpx/header.rs:1393-1416 — 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) src/renderer/skia/image_coverage.rs:11— src/renderer/skia/image_coverage.rs:11-32 | src/renderer/skia/rectangle_fill.rs:11-37 — 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) src/renderer/float_placement.rs:6337— src/renderer/float_placement.rs:6337-6359 | src/renderer/float_placement.rs:6457-6478 — 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.
Duplicated block (13–14 lines × 2) src/cli/queries/structured_objects.rs:203— src/cli/queries/structured_objects.rs:203-215 | src/cli/queries/structured_objects.rs:293-306 — both copies are in the same file, so extract the 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 `src/cli/queries/structured_objects.rs:203` 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 (13–14 lines × 2) src/document_core/commands/header_footer_ops.rs:402— src/document_core/commands/header_footer_ops.rs:402-415 | src/document_core/commands/header_footer_ops.rs:544-556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) src/document_core/commands/text_editing.rs:5678— src/document_core/commands/text_editing.rs:5678-5691 | src/document_core/commands/text_editing.rs:5771-5783 — both copies are in the same file, so extract the 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–14 lines × 2) src/renderer/composer/line_breaking.rs:590— src/renderer/composer/line_breaking.rs:590-603 | src/renderer/composer/line_breaking.rs:640-652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/composer/line_breaking.rs:590` 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) src/renderer/composer/stored_tac_display.inc.rs:105— src/renderer/composer/stored_tac_display.inc.rs:105-118 | src/renderer/layout/table_layout/stored_inline_row_frame.rs:70-82 — 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 `src/renderer/composer/stored_tac_display.inc.rs:105` 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–14 lines × 2) src/renderer/height_measurer.rs:4880— src/renderer/height_measurer.rs:4880-4893 | src/renderer/layout/table_layout.rs:5845-5857 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 300 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/height_measurer.rs:4880` 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) src/renderer/height_measurer.rs:4940— src/renderer/height_measurer.rs:4940-4953 | src/renderer/layout/table_layout.rs:5896-5908 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 300 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/height_measurer.rs:4940` 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 (13–14 lines × 2) src/renderer/layout.rs:2008— src/renderer/layout.rs:2008-2020 | src/renderer/typeset.rs:1989-2002 — before extracting anything, compare `src/renderer/layout.rs` and `src/renderer/typeset.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 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 `src/renderer/layout.rs:2008` 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 (13–14 lines × 2) src/renderer/layout/shape_layout.rs:1406— src/renderer/layout/shape_layout.rs:1406-1418 | src/renderer/layout/shape_layout.rs:2346-2359 — both copies are in the same file, so extract the 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 `src/renderer/layout/shape_layout.rs:1406` 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) src/renderer/layout/table_layout.rs:13153— src/renderer/layout/table_layout.rs:13153-13165 | src/renderer/layout/table_layout.rs:16294-16307 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:13153` 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–14 lines × 2) src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:346— src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:346-358 | src/renderer/typeset/notes/endnotes/paragraph/new_note_fit.rs:305-318 — before extracting anything, compare `src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs` and `src/renderer/typeset/notes/endnotes/paragraph/new_note_fit.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 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 `src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:346` 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–14 lines × 2) src/wasm_api.rs:1256— src/wasm_api.rs:1256-1268 | src/wasm_api.rs:1359-1372 — both copies are in the same file, so extract the 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 `src/wasm_api.rs:1256` 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 × 4) src/bin/rhwp-q/kit/char_index.rs:41— src/bin/rhwp-q/kit/char_index.rs:41-51 | src/bin/rhwp-q/kit/cur_field_state.rs:41-51 | src/bin/rhwp-q/kit/field_info_at.rs:41-51 | src/bin/rhwp-q/kit/word_end.rs:41-51 — before extracting anything, compare `src/bin/rhwp-q/kit/char_index.rs` and `src/bin/rhwp-q/kit/cur_field_state.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 69 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 `src/bin/rhwp-q/kit/char_index.rs:41` 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 (11 lines × 4) src/bin/rhwp-q/kit/cursor_in_cell.rs:90— src/bin/rhwp-q/kit/cursor_in_cell.rs:90-100 | src/bin/rhwp-q/kit/cursor_in_hf.rs:106-116 | src/bin/rhwp-q/kit/cursor_in_note.rs:85-95 | src/bin/rhwp-q/kit/note_edit_info.rs:72-82 — before extracting anything, compare `src/bin/rhwp-q/kit/cursor_in_cell.rs` and `src/bin/rhwp-q/kit/cursor_in_hf.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `src/bin/rhwp-q/kit/cursor_in_cell.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/bin/rhwp-q/kit/cursor_in_hf.rs:105` calls `Some`, `take_u32` and `src/bin/rhwp-q/kit/cursor_in_cell.rs:89` 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 lines × 4) src/bin/rhwp-q/pack/inventory.rs:85— src/bin/rhwp-q/pack/inventory.rs:85-95 | src/bin/rhwp-q/pack/inventory.rs:550-560 | src/bin/rhwp-q/pack/inventory.rs:991-1001 | src/bin/rhwp-q/pack/inventory.rs:1068-1078 — 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 `src/bin/rhwp-q/pack/inventory.rs:85` 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 (11 lines × 4) src/bin/rhwp-q/pack/inventory.rs:731— src/bin/rhwp-q/pack/inventory.rs:731-741 | src/bin/rhwp-q/pack/inventory.rs:758-768 | src/bin/rhwp-q/pack/inventory.rs:1120-1130 | src/bin/rhwp-q/pack/inventory.rs:1271-1281 — 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 `src/bin/rhwp-q/pack/inventory.rs:731` 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 (11 lines × 4) src/cli/protocol/exchange/bundle.rs:225— src/cli/protocol/exchange/bundle.rs:225-235 | src/cli/protocol/harness.rs:337-347 | src/cli/protocol/trust/gate.rs:41-51 | src/cli/protocol/trust/governance.rs:201-211 — before extracting anything, compare `src/cli/protocol/exchange/bundle.rs` and `src/cli/protocol/harness.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/exchange/bundle.rs:225` 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 × 4) src/diagnostics/ir_field_sweep.rs:734— src/diagnostics/ir_field_sweep.rs:734-744 | src/diagnostics/ir_field_sweep.rs:746-756 | src/diagnostics/ir_field_sweep.rs:758-768 | src/diagnostics/ir_field_sweep.rs:770-780 — 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. 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 (11 lines × 4) src/document_core/commands/clipboard.rs:1022— src/document_core/commands/clipboard.rs:1022-1033 | src/document_core/commands/foreign_paste.rs:241-251 | src/document_core/commands/html_import.rs:374-388 | src/document_core/commands/html_import.rs:428-439 — before extracting anything, compare `src/document_core/commands/clipboard.rs` and `src/document_core/commands/foreign_paste.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 134 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 `src/document_core/commands/clipboard.rs:1022` 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 (11 lines × 4) src/document_core/queries/rendering.rs:4569— src/document_core/queries/rendering.rs:4569-4579 | src/document_core/queries/rendering.rs:4592-4602 | src/document_core/queries/rendering.rs:4613-4623 | src/document_core/queries/rendering.rs:4633-4643 — 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 `src/document_core/queries/rendering.rs:4569` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/document_core/queries/rendering.rs:4644` calls `Some` and `src/document_core/queries/rendering.rs:4580` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 4) src/renderer/composer/line_breaking.rs:706— src/renderer/composer/line_breaking.rs:706-716 | src/renderer/composer/line_breaking.rs:735-746 | src/renderer/composer/line_breaking.rs:1004-1015 | src/renderer/composer/line_breaking.rs:1145-1156 — 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 `src/renderer/composer/line_breaking.rs:706` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 4) src/renderer/height_measurer.rs:4146— src/renderer/height_measurer.rs:4146-4156 | src/renderer/height_measurer.rs:5162-5172 | src/renderer/height_measurer.rs:5858-5868 | src/renderer/layout/table_layout.rs:6367-6377 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 300 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) src/renderer/layout/paragraph_layout.rs:9724— src/renderer/layout/paragraph_layout.rs:9724-9734 | src/renderer/layout/paragraph_layout.rs:9821-9831 | src/renderer/layout/paragraph_layout.rs:10010-10020 | src/renderer/layout/paragraph_layout.rs:10580-10590 — 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 `src/renderer/layout/paragraph_layout.rs:9724` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) tools/table_exchange/cases.py:910— tools/table_exchange/cases.py:910-920 | tools/table_exchange/cases.py:946-956 | tools/table_exchange/cases.py:1151-1161 | tools/table_exchange/cases.py:1191-1201 — 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.
rhwp_ooxml_chart::parser::handle_start (cyclomatic 182) crates/rhwp-ooxml-chart/src/parser.rs:239— rhwp_ooxml_chart::parser::handle_start has cyclomatic complexity 182 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp_ooxml_chart::data::scan_chart_values (cyclomatic 78) crates/rhwp-ooxml-chart/src/data.rs:575— rhwp_ooxml_chart::data::scan_chart_values has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp_ooxml_chart::parser::handle_end (cyclomatic 49) crates/rhwp-ooxml-chart/src/parser.rs:763— rhwp_ooxml_chart::parser::handle_end has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp_ooxml_chart::renderer::render_bars (cyclomatic 39) crates/rhwp-ooxml-chart/src/renderer.rs:646— rhwp_ooxml_chart::renderer::render_bars has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rhwp_ooxml_chart::drawing_style::resolve (cyclomatic 38) crates/rhwp-ooxml-chart/src/drawing_style.rs:71— rhwp_ooxml_chart::drawing_style::resolve 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.
rhwp_ooxml_chart::parser::parse_chart_xml (cyclomatic 32) crates/rhwp-ooxml-chart/src/parser.rs:123— rhwp_ooxml_chart::parser::parse_chart_xml 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.
rhwp_ooxml_chart::renderer::render_chart_svg_with_text_measure (cyclomatic 27) crates/rhwp-ooxml-chart/src/renderer.rs:313— rhwp_ooxml_chart::renderer::render_chart_svg_with_text_measure 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.
rhwp_ooxml_chart::renderer::render_value_grid (cyclomatic 25) crates/rhwp-ooxml-chart/src/renderer.rs:1897— rhwp_ooxml_chart::renderer::render_value_grid 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.
rhwp_ooxml_chart::renderer::chart_3d::render_bars_3d (cyclomatic 18) crates/rhwp-ooxml-chart/src/renderer/chart_3d.rs:398— rhwp_ooxml_chart::renderer::chart_3d::render_bars_3d 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.
rhwp_ooxml_chart::renderer::render_of_pie (cyclomatic 17) crates/rhwp-ooxml-chart/src/renderer.rs:1463— rhwp_ooxml_chart::renderer::render_of_pie 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.
rhwp_ooxml_chart::renderer::render_stock (cyclomatic 16) crates/rhwp-ooxml-chart/src/renderer.rs:1046— rhwp_ooxml_chart::renderer::render_stock 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.
EqParser::parse_command_inner (cyclomatic 48) src/renderer/equation/parser_commands.rs:33— EqParser::parse_command_inner has cyclomatic complexity 48 (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.
EqParser::parse_element_atom (cyclomatic 32) src/renderer/equation/parser_atoms.rs:7— EqParser::parse_element_atom 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.
EqParser::finish_named_scripts (cyclomatic 24) src/renderer/equation/parser_left_scripts.rs:20— EqParser::finish_named_scripts has cyclomatic complexity 24 (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.
EqParser::parse_script_span (cyclomatic 24) src/renderer/equation/parser_script_operand.rs:15— EqParser::parse_script_span 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.
EqParser::try_parse_scripts (cyclomatic 22) src/renderer/equation/parser_attached_scripts.rs:9— EqParser::try_parse_scripts 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.
EqParser::parse_fraction (cyclomatic 22) src/renderer/equation/parser_fractions.rs:8— EqParser::parse_fraction 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.
EqParser::parse_eqalign (cyclomatic 19) src/renderer/equation/parser_alignment.rs:55— EqParser::parse_eqalign 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.
EqParser::parse_matrix (cyclomatic 19) src/renderer/equation/parser_structures.rs:25— EqParser::parse_matrix 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.
EqParser::parse_command_fallback (cyclomatic 18) src/renderer/equation/parser_commands.rs:227— EqParser::parse_command_fallback has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EqParser::parse_named_script_operand (cyclomatic 16) src/renderer/equation/parser_left_scripts.rs:111— EqParser::parse_named_script_operand 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.
EqParser::parse_sqrt (cyclomatic 16) src/renderer/equation/parser_root.rs:7— EqParser::parse_sqrt 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.
SvgRenderer::render_node (cognitive 248) src/renderer/svg.rs:764— SvgRenderer::render_node has cognitive complexity 248 (threshold 15). Drivers by points: if/else 80 (201 pts), loops 11 (30 pts), boolean chains 9, match/switch 4 (8 pts) (nesting depth added 144). 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.
SvgRenderer::draw_text_positioned (cognitive 160) src/renderer/svg.rs:3421— SvgRenderer::draw_text_positioned has cognitive complexity 160 (threshold 15). Drivers by points: if/else 58 (119 pts), loops 10 (24 pts), match/switch 4 (10 pts), boolean chains 7 (nesting depth added 81). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SvgRenderer::render_image_node_with_sampling (cognitive 75) src/renderer/svg.rs:2101— SvgRenderer::render_image_node_with_sampling has cognitive complexity 75 (threshold 15). Drivers by points: if/else 38 (47 pts), match/switch 11 (20 pts), boolean chains 8 (nesting depth added 18). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
SvgRenderer::prepare_pua_glyphs (cognitive 48) src/renderer/svg/pua_glyph.rs:7— SvgRenderer::prepare_pua_glyphs has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SvgRenderer::render_page_background_image (cognitive 36) src/renderer/svg.rs:1878— SvgRenderer::render_page_background_image has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (21 pts), match/switch 6 (11 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SvgRenderer::draw_char_overlap (cognitive 35) src/renderer/svg.rs:2617— SvgRenderer::draw_char_overlap has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23 (27 pts), boolean chains 5, loops 2 (3 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.
SvgRenderer::draw_char_overlap_combined (cognitive 19) src/renderer/svg.rs:2773— SvgRenderer::draw_char_overlap_combined has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, 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.
SvgRenderer::draw_line_shape (cognitive 19) src/renderer/svg.rs:2897— SvgRenderer::draw_line_shape has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (7 pts), match/switch 2 (3 pts) (nesting depth added 10). 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.
SvgRenderer::draw_image (cognitive 19) src/renderer/svg.rs:4233— SvgRenderer::draw_image has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 6 (12 pts), if/else 7 (nesting depth added 6). 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.
SvgRenderer::place_debug_label (cognitive 18) src/renderer/svg.rs:3048— SvgRenderer::place_debug_label has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SvgRenderer::ensure_arrow_marker (cognitive 16) src/renderer/svg.rs:1641— SvgRenderer::ensure_arrow_marker has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 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.
D30 · Dependency Vulnerabilities· Medium CVE · ×11
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×11
Edited copy of a member (21 corresponding lines) src/parser/control.rs:577— src/parser/control.rs:577-600 | src/parser/control.rs:603-625 — 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) src/document_core/commands/clipboard.rs:106— src/document_core/commands/clipboard.rs:106-127 | src/model/paragraph.rs:830-850 — 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) src/render_backend/png_adapter.rs:146— src/render_backend/png_adapter.rs:146-168 | src/render_backend/skia_adapter.rs:170-190 — 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) src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:133— src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:133-155 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:135-155 — 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) src/wmf/parser/records/drawing/fill_region.rs:34— src/wmf/parser/records/drawing/fill_region.rs:34-54 | src/wmf/parser/records/state/set_text_justification.rs:38-58 — 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) src/parser/hwpx/header.rs:1298— src/parser/hwpx/header.rs:1298-1318 | src/parser/hwpx/utils.rs:177-198 — 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) src/parser/pdf/recognition.rs:552— src/parser/pdf/recognition.rs:552-577 | tools/pdf-ir-poc/src/recognition.rs:332-352 — 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) src/wasm_api.rs:8703— src/wasm_api.rs:8703-8723 | src/wasm_api.rs:8734-8755 — 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) src/document_core/commands/paragraph_block/import.rs:54— src/document_core/commands/paragraph_block/import.rs:54-74 | src/document_core/commands/paragraph_block.rs:60-88 — 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) tools/oracle_public/coverage_report.py:616— tools/oracle_public/coverage_report.py:616-642 | tools/oracle_public/oracle_resolver.py:427-447 — 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) tools/llm_verifier/process_steps/generate_corpus.py:844— tools/llm_verifier/process_steps/generate_corpus.py:844-865 | tools/llm_verifier/verdict_protocol/generate_corpus.py:858-878 — 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 (18 corresponding lines) · ×11
Edited copy of a member (18 corresponding lines) src/renderer/skia/hft_outline.rs:49— src/renderer/skia/hft_outline.rs:49-93 | src/renderer/skia/renderer.rs:2636-2678 — 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) src/document_core/queries/extract_data.rs:437— src/document_core/queries/extract_data.rs:437-454 | src/document_core/queries/extract_data.rs:457-480 — 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) gym/core/checks.py:155— gym/core/checks.py:155-173 | gym/core/checks.py:276-293 — 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) src/document_core/queries/injection_scan.rs:700— src/document_core/queries/injection_scan.rs:700-720 | src/document_core/queries/injection_scan.rs:903-920 — 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) src/serializer/control.rs:1233— src/serializer/control.rs:1233-1254 | src/serializer/control.rs:1256-1273 — 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) src/bin/rhwp-agent/explaincmd.rs:10— src/bin/rhwp-agent/explaincmd.rs:10-27 | src/bin/rhwp-agent/inspect.rs:9-26 — 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) mydocs/tech/investigations/issue-2264/probes/task2264_profile.rs:14— mydocs/tech/investigations/issue-2264/probes/task2264_profile.rs:14-34 | mydocs/tech/investigations/issue-2264/probes/task2264_profile.rs:36-53 — 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) src/document_core/queries/rendering.rs:6310— src/document_core/queries/rendering.rs:6310-6332 | src/document_core/queries/rendering.rs:6335-6352 — 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) src/renderer/shaping_vertical.rs:94— src/renderer/shaping_vertical.rs:94-111 | src/renderer/shaping_vertical.rs:116-136 — 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) src/renderer/typeset/table/scan/row.rs:226— src/renderer/typeset/table/scan/row.rs:226-243 | src/renderer/typeset/table/scan/row_entry.rs:78-103 — 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) samples/issue7687/gen_empty_host.py:80— samples/issue7687/gen_empty_host.py:80-97 | samples/issue7687/gen_titled_host_after_band.py:42-59 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×11
Members sharing a duplicated core (6 members, 50+ identical tokens) src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:220— src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:220-249 | src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:222-252 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:167-196 | src/bin/rhwp-q/commands/rhwp-q-page-items.rs:244-277 | src/bin/rhwp-q/commands/rhwp-q-scan-items.rs:196-226 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:143-172 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) src/cli/batch/query.rs:15— src/cli/batch/query.rs:15-50 | src/cli/batch/query.rs:64-97 | src/cli/batch/query.rs:104-115 | src/cli/batch/query.rs:119-131 | src/cli/batch/query.rs:134-145 | src/cli/batch/query.rs:151-167 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) src/cli/queries/document_inventory.rs:16— src/cli/queries/document_inventory.rs:16-78 | src/cli/queries/document_inventory.rs:81-150 | src/cli/queries/document_inventory.rs:153-222 | src/cli/queries/explain.rs:147-241 | src/cli/queries/explore.rs:19-159 | src/cli/queries/structured_objects.rs:259-331 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:263— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:263-285 | src/diagnostics/hwp5_cell_header_probe.rs:352-408 | src/diagnostics/hwp5_contract_probe.rs:294-371 | src/diagnostics/hwp5_first_para_control_probe.rs:377-400 | src/diagnostics/hwp5_mel_personnel_probe.rs:295-357 | src/diagnostics/hwp5_table_probe.rs:289-346 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:440— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:440-451 | src/diagnostics/hwp5_cell_header_probe.rs:704-715 | src/diagnostics/hwp5_contract_probe.rs:612-623 | src/diagnostics/hwp5_first_para_control_probe.rs:1304-1315 | src/diagnostics/hwp5_mel_personnel_probe.rs:618-629 | src/diagnostics/hwp5_table_probe.rs:363-374 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:463— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:463-474 | src/diagnostics/hwp5_cell_header_probe.rs:735-746 | src/diagnostics/hwp5_contract_probe.rs:653-664 | src/diagnostics/hwp5_first_para_control_probe.rs:1335-1346 | src/diagnostics/hwp5_mel_personnel_probe.rs:649-660 | src/diagnostics/hwp5_table_probe.rs:394-405 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:531— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:531-640 | src/diagnostics/hwp5_cell_header_probe.rs:878-952 | src/diagnostics/hwp5_contract_probe.rs:796-871 | src/diagnostics/hwp5_first_para_control_probe.rs:821-951 | src/diagnostics/hwp5_mel_personnel_probe.rs:792-858 | src/diagnostics/hwp5_table_probe.rs:647-709 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) src/document_core/commands/document/grown_table_heights.rs:58— src/document_core/commands/document/grown_table_heights.rs:58-106 | src/document_core/commands/header_footer_ops.rs:942-979 | src/document_core/queries/hwpctrl_sets.rs:1569-1618 | src/document_core/queries/rendering.rs:4960-4984 | src/document_core/queries/rendering.rs:6366-6770 | src/renderer/render_normalization.rs:124-224 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) src/renderer/layout/paragraph_layout.rs:8906— src/renderer/layout/paragraph_layout.rs:8906-10661 | src/renderer/layout/table_layout.rs:7358-10488 | src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:76-710 | src/renderer/typeset/notes/endnotes/paragraph/new_note_fit.rs:80-544 | src/renderer/typeset/notes/endnotes/paragraph/rewind_tail.rs:66-348 | src/renderer/typeset/notes/endnotes/paragraph/tail_fit.rs:110-1090 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) scripts/font_kerning_cohort.py:112— scripts/font_kerning_cohort.py:112-119 | scripts/font_rank1_metric_hypothesis.py:54-64 | scripts/font_rank8_metric_hypothesis.py:68-78 | scripts/font_rank8_qualification.py:102-109 | scripts/oracle_stage3_profile.py:51-58 | scripts/oracle_stage4_profile.py:166-173 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) tools/llm_verifier/abstain/generate_corpus.py:506— tools/llm_verifier/abstain/generate_corpus.py:506-523 | tools/llm_verifier/lineage_chain/generate_corpus.py:601-618 | tools/llm_verifier/oracle_vs_self/generate_corpus.py:334-342 | tools/llm_verifier/shadow_agree/generate_corpus.py:306-314 | tools/llm_verifier/third_party_replay/generate_corpus.py:480-497 | tools/llm_verifier/untrusted_sandbox/generate_corpus.py:453-472 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×11
Edited copy of a member (3 corresponding lines) src/parser/pdf/table_hierarchy.rs:41— src/parser/pdf/table_hierarchy.rs:41-43 | tools/pdf-ir-poc/src/table_hierarchy.rs:40-42 — 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) src/parser/pdf/recognition.rs:130— src/parser/pdf/recognition.rs:130-132 | tools/pdf-ir-poc/src/recognition.rs:96-98 — 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) gym/score.py:103— gym/score.py:103-106 | gym/tools/build_baseline.py:929-931 — 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) gym/tools/fuzz_corpus.py:908— gym/tools/fuzz_corpus.py:908-910 | gym/tools/robustness.py:750-752 — 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) bindings/Flutter/lib/src/native_document.dart:120— bindings/Flutter/lib/src/native_document.dart:120-122 | bindings/Flutter/lib/src/native_ffi.dart:100-102 — 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) tools/loadsave_sweep/classify_mismatch.py:23— tools/loadsave_sweep/classify_mismatch.py:23-25 | tools/loadsave_sweep/judge.py:44-47 — 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) tools/llm_verifier/best_of_n/generate_corpus.py:586— tools/llm_verifier/best_of_n/generate_corpus.py:586-588 | tools/llm_verifier/repeat_eval/generate_corpus.py:899-901 — 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) tools/forms/build_간이기안문_서식.py:58— tools/forms/build_간이기안문_서식.py:58-60 | tools/forms/build_일반기안문_서식.py:71-73 — 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) tools/fidelity_compare/fatten_text_layer.py:144— tools/fidelity_compare/fatten_text_layer.py:144-146 | tools/form_fill/fatten_form_fill.py:150-152 — 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) scripts/font_kerning_cohort.py:70— scripts/font_kerning_cohort.py:70-72 | scripts/font_rank8_qualification.py:91-93 — 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) scripts/generate_font_native_hwpx_fixture.py:19— scripts/generate_font_native_hwpx_fixture.py:19-21 | scripts/generate_outline_navigation_fixture.py:132-134 — 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 (24 lines × 2) src/cli/commands/conversion.rs:390— src/cli/commands/conversion.rs:390-413 | src/cli/commands/conversion.rs:609-632 — both copies are in the same file, so extract the 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 `src/cli/commands/conversion.rs:390` 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 (24 lines × 2) src/diagnostics/hwp5_inventory.rs:142— src/diagnostics/hwp5_inventory.rs:142-165 | src/diagnostics/hwp5_inventory_diff.rs:259-282 — before extracting anything, compare `src/diagnostics/hwp5_inventory.rs` and `src/diagnostics/hwp5_inventory_diff.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 112 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 `src/diagnostics/hwp5_inventory.rs:142` 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 (24 lines × 2) src/document_core/commands/text_editing.rs:6031— src/document_core/commands/text_editing.rs:6031-6054 | src/document_core/queries/search_query.rs:777-800 — 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 `src/document_core/commands/text_editing.rs:6031` 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 (24 lines × 2) src/document_core/queries/doc_tree_nav.rs:552— src/document_core/queries/doc_tree_nav.rs:552-575 | src/document_core/queries/doc_tree_nav.rs:604-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/queries/doc_tree_nav.rs:552` 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 (24 lines × 2) src/document_core/queries/rendering.rs:1430— src/document_core/queries/rendering.rs:1430-1453 | src/document_core/queries/rendering.rs:1651-1674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/queries/rendering.rs:1430` 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 (24 lines × 2) src/renderer/layout/table_partial.rs:804— src/renderer/layout/table_partial.rs:804-827 | src/renderer/layout/table_partial.rs:891-914 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_partial.rs:804` 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 (24 lines × 2) src/serializer/hwpx/section.rs:1346— src/serializer/hwpx/section.rs:1346-1369 | src/serializer/hwpx/section.rs:1424-1447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) src/wmf/converter/bitmap.rs:74— src/wmf/converter/bitmap.rs:74-97 | src/wmf/converter/bitmap.rs:130-153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/wmf/converter/bitmap.rs:74` 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) src/paint/text_v2.rs:390— src/paint/text_v2.rs:390-413 | src/paint/text_v2.rs:420-443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) src/parser/hwp3/mod.rs:1367— src/parser/hwp3/mod.rs:1367-1390 | src/parser/hwp3/mod.rs:1869-1892 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) scripts/font_rank7_qualification.py:169— scripts/font_rank7_qualification.py:169-192 | scripts/font_rank8_qualification.py:181-204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 3) src/cli/commands/edit/cells.rs:353— src/cli/commands/edit/cells.rs:353-365 | src/cli/commands/tabular_import.rs:325-337 | src/cli/protocol/plan/execution.rs:375-387 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/tabular_import.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/cells.rs:353` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) src/cli/commands/edit/media.rs:161— src/cli/commands/edit/media.rs:161-173 | src/cli/commands/edit/text.rs:339-351 | src/cli/commands/tabular_import.rs:79-91 — before extracting anything, compare `src/cli/commands/edit/media.rs` and `src/cli/commands/edit/text.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 57 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 `src/cli/commands/edit/media.rs:161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) src/document_core/queries/field_query.rs:945— src/document_core/queries/field_query.rs:945-957 | src/document_core/queries/field_query.rs:1016-1028 | src/document_core/queries/field_query.rs:1129-1141 — 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 `src/document_core/queries/field_query.rs:945` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) src/render_backend/util.rs:29— src/render_backend/util.rs:29-41 | src/renderer/canvaskit_policy.rs:2180-2192 | src/renderer/pdf.rs:868-880 — 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 `src/render_backend/util.rs:29` 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 × 3) src/renderer/composer/line_breaking.rs:736— src/renderer/composer/line_breaking.rs:736-748 | src/renderer/composer/line_breaking.rs:1005-1017 | src/renderer/composer/line_breaking.rs:1146-1158 — 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 `src/renderer/composer/line_breaking.rs:736` 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 (13 lines × 3) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:256— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:256-268 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:237-249 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:238-250 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 188 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 `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:256` 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 (13 lines × 3) scripts/font_rank1_qualification.py:371— scripts/font_rank1_qualification.py:371-386 | scripts/font_rank7_qualification.py:488-503 | scripts/font_rank8_qualification.py:579-591 — before extracting anything, compare `scripts/font_rank1_qualification.py` and `scripts/font_rank7_qualification.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 128 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 (13 lines × 3) tools/hwp5_inventory/cases.py:95— tools/hwp5_inventory/cases.py:95-107 | tools/hwp5_inventory/cases.py:112-124 | tools/hwp5_inventory/cases.py:373-385 — 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 `tools/hwp5_inventory/cases.py:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) tools/inspect_msec/gen_msec_fixtures.py:1051— tools/inspect_msec/gen_msec_fixtures.py:1051-1063 | tools/inspect_msec/gen_msec_fixtures.py:1083-1095 | tools/inspect_msec/gen_msec_fixtures.py:1843-1855 — 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 (13 lines × 3) tools/task2070/make_hy_ladder3.py:84— tools/task2070/make_hy_ladder3.py:84-96 | tools/task2070/make_hy_ladder4.py:110-122 | tools/task2169/make_linebreak_ladder.py:107-119 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `ptag` to `str = "A"` in one and `str` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13 lines × 3) tools/llm_verifier/repeat_eval/generate_corpus.py:981— tools/llm_verifier/repeat_eval/generate_corpus.py:981-993 | tools/llm_verifier/repeat_eval/generate_corpus.py:1044-1056 | tools/llm_verifier/repeat_eval/generate_corpus.py:1072-1084 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `tools/llm_verifier/repeat_eval/generate_corpus.py:979` calls `sorted` and `tools/llm_verifier/repeat_eval/generate_corpus.py:1043` 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.
Paragraph::insert_text_at_caret (cognitive 72) src/model/paragraph.rs:1600— Paragraph::insert_text_at_caret has cognitive complexity 72 (threshold 15). Drivers by points: if/else 28 (42 pts), boolean chains 21, loops 9 (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.
Paragraph::split_at (cognitive 56) src/model/paragraph.rs:2069— Paragraph::split_at has cognitive complexity 56 (threshold 15). Drivers by points: if/else 21 (37 pts), boolean chains 10, loops 8, match/switch 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.
Paragraph::delete_text_at (cognitive 54) src/model/paragraph.rs:1878— Paragraph::delete_text_at has cognitive complexity 54 (threshold 15). Drivers by points: if/else 26 (43 pts), loops 8, boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Paragraph::replace_text_keeping_slots (cognitive 45) src/model/paragraph.rs:2876— Paragraph::replace_text_keeping_slots has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 11, loops 5 (7 pts), match/switch 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Paragraph::try_control_text_positions (cognitive 37) src/model/paragraph.rs:3259— Paragraph::try_control_text_positions has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 6 (9 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Paragraph::try_map_char_shape_range (cognitive 35) src/model/paragraph.rs:3714— Paragraph::try_map_char_shape_range has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 4, loops 2 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Paragraph::merge_from_with_storage (cognitive 25) src/model/paragraph.rs:2515— Paragraph::merge_from_with_storage has cognitive complexity 25 (threshold 15). Drivers by points: loops 8 (11 pts), if/else 7 (8 pts), boolean chains 5, 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.
Paragraph::shift_position_metadata_for_stream_insertion (cognitive 22) src/model/paragraph.rs:1507— Paragraph::shift_position_metadata_for_stream_insertion has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, loops 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Paragraph::control_source_positions_with_storage (cognitive 19) src/model/paragraph/control_source.rs:18— Paragraph::control_source_positions_with_storage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Paragraph::rebuild_char_offsets (cognitive 18) src/model/paragraph.rs:2763— Paragraph::rebuild_char_offsets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 7, 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.
HwpDocument::update_style_shapes (cognitive 67) src/wasm_api.rs:8113— HwpDocument::update_style_shapes has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (42 pts), loops 8 (20 pts), boolean chains 4, match/switch 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HwpDocument::get_click_here_props (cognitive 46) src/wasm_api.rs:6549— HwpDocument::get_click_here_props has cognitive complexity 46 (threshold 15). Drivers by points: if/else 4 (22 pts), loops 6 (18 pts), match/switch 1 (4 pts), boolean chains 2 (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.
HwpDocument::create_numbering (cognitive 40) src/wasm_api.rs:8573— HwpDocument::create_numbering has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (32 pts), loops 2 (8 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
HwpDocument::inject_external_image (cognitive 32) src/wasm_api.rs:4561— HwpDocument::inject_external_image has cognitive complexity 32 (threshold 15). Drivers by points: if/else 4 (15 pts), match/switch 2 (9 pts), loops 4 (7 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.
HwpDocument::update_click_here_props (cognitive 25) src/wasm_api.rs:6612— HwpDocument::update_click_here_props has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 4 (7 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (HwpDocument::update_click_here_props::update_field_in_para) 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.
HwpDocument::remap_style_ids (cognitive 20) src/wasm_api.rs:8391— HwpDocument::remap_style_ids has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 5 (7 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HwpDocument::prepare_native_otf_fonts_wasm (cognitive 19) src/wasm_api.rs:923— HwpDocument::prepare_native_otf_fonts_wasm has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HwpDocument::find_effective_para_shape_for_style (cognitive 18) src/wasm_api.rs:8043— HwpDocument::find_effective_para_shape_for_style has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HwpDocument::update_click_here_props::update_field_in_para (cognitive 17) src/wasm_api.rs:6625— HwpDocument::update_click_here_props::update_field_in_para has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (HwpDocument::update_click_here_props) 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.
HwpDocument::group_shapes (cognitive 16) src/wasm_api.rs:5295— HwpDocument::group_shapes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 1 (4 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Duplicated block (26 lines × 2) src/cli/commands/edit/cell_paragraphs.rs:176— src/cli/commands/edit/cell_paragraphs.rs:176-201 | src/cli/commands/edit/formatting.rs:867-892 — before extracting anything, compare `src/cli/commands/edit/cell_paragraphs.rs` and `src/cli/commands/edit/formatting.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 240 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 `src/cli/commands/edit/cell_paragraphs.rs: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 (26 lines × 2) src/cli/outputs/tabular.rs:137— src/cli/outputs/tabular.rs:137-162 | src/cli/outputs/tabular.rs:347-372 — both copies are in the same file, so extract the 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 `src/cli/outputs/tabular.rs:137` 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 (26 lines × 2) src/cli/queries/security_inspection.rs:733— src/cli/queries/security_inspection.rs:733-758 | src/cli/queries/security_inspection.rs:1005-1030 — both copies are in the same file, so extract the 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 `src/cli/queries/security_inspection.rs:733` 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 (26 lines × 2) src/diagnostics/hwp5_roundtrip_batch.rs:613— src/diagnostics/hwp5_roundtrip_batch.rs:613-638 | src/diagnostics/hwpx_roundtrip_batch.rs:449-474 — before extracting anything, compare `src/diagnostics/hwp5_roundtrip_batch.rs` and `src/diagnostics/hwpx_roundtrip_batch.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 152 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 `src/diagnostics/hwp5_roundtrip_batch.rs:613` 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 (26 lines × 2) src/paint/json.rs:1474— src/paint/json.rs:1474-1499 | src/paint/layer_tree.rs:281-306 — 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 (26 lines × 2) src/renderer/svg.rs:2627— src/renderer/svg.rs:2627-2652 | src/renderer/web_canvas.rs:3911-3936 — before extracting anything, compare `src/renderer/svg.rs` and `src/renderer/web_canvas.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 321 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/renderer/web_canvas.rs:3939` calls `save` and `src/renderer/svg.rs:2658` 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 (26 lines × 2) src/serializer/hwpx/section.rs:4040— src/serializer/hwpx/section.rs:4040-4065 | src/serializer/hwpx/section.rs:4950-4975 — both copies are in the same file, so extract the 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 `src/serializer/hwpx/section.rs:4040` 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 (26 lines × 2) gym/tools/build_baseline.py:346— gym/tools/build_baseline.py:346-371 | gym/tools/discriminate.py:271-296 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26 lines × 2) tools/fidelity_compare/fidelity_compare.py:1272— tools/fidelity_compare/fidelity_compare.py:1272-1297 | tools/fidelity_compare/fidelity_compare.py:1387-1412 — both copies are in the same file, so extract the 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 `tools/fidelity_compare/fidelity_compare.py:1272` 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 (26 lines × 2) tools/form_fill/fatten_form_fill.py:853— tools/form_fill/fatten_form_fill.py:853-878 | tools/form_fill/fatten_form_fill.py:883-908 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:80— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:80-102 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:77-99 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-para-shape.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 221 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 `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:80` 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 (23 lines × 2) src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:79— src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:79-101 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:83-105 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs` and `src/bin/rhwp-q/commands/rhwp-q-form-info.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 218 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 `src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:79` 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 (23 lines × 2) src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:118— src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:118-140 | src/bin/rhwp-q/commands/rhwp-q-objects.rs:134-156 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs` and `src/bin/rhwp-q/commands/rhwp-q-objects.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 114 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. 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 (23 lines × 2) src/cli/queries/security_inspection.rs:624— src/cli/queries/security_inspection.rs:624-646 | src/cli/queries/security_inspection.rs:896-918 — both copies are in the same file, so extract the 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 `src/cli/queries/security_inspection.rs:624` 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) src/document_core/commands/table_ops.rs:879— src/document_core/commands/table_ops.rs:879-901 | src/document_core/commands/table_ops.rs:918-940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/table_ops.rs:879` 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) src/document_core/commands/text_editing.rs:5252— src/document_core/commands/text_editing.rs:5252-5274 | src/document_core/commands/text_editing.rs:5392-5414 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:5252` 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 (23 lines × 2) src/document_core/queries/memo_query.rs:1447— src/document_core/queries/memo_query.rs:1447-1469 | src/document_core/queries/memo_query.rs:1514-1536 — both copies are in the same file, so extract the 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 `src/document_core/queries/memo_query.rs:1447` 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) src/renderer/svg.rs:1215— src/renderer/svg.rs:1215-1237 | src/renderer/web_canvas.rs:635-657 — before extracting anything, compare `src/renderer/svg.rs` and `src/renderer/web_canvas.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 321 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 (23 lines × 2) src/parser/pdf/table_detection.rs:415— src/parser/pdf/table_detection.rs:415-437 | tools/pdf-ir-poc/src/table_detection.rs:198-220 — before extracting anything, compare `src/parser/pdf/table_detection.rs` and `tools/pdf-ir-poc/src/table_detection.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) src/document_core/commands/object_ops/chart.rs:975— src/document_core/commands/object_ops/chart.rs:975-997 | src/document_core/commands/object_ops/chart.rs:1125-1147 — both copies are in the same file, so extract the 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 `src/document_core/commands/object_ops/chart.rs:975` 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) src/cli/commands/tabular_import.rs:35— src/cli/commands/tabular_import.rs:35-48 | src/cli/commands/tabular_import.rs:483-497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/tabular_import.rs:35` 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–15 lines × 2) src/cli/queries/control_dump/mod.rs:25— src/cli/queries/control_dump/mod.rs:25-38 | src/cli/queries/info.rs:23-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/cli/queries/info.rs:39` calls `detect_format` and `src/cli/queries/control_dump/mod.rs:39` 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 (14–15 lines × 2) src/document_core/pdf_import_session.rs:297— src/document_core/pdf_import_session.rs:297-310 | src/document_core/pdf_import_session.rs:335-349 — both copies are in the same file, so extract the 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 `src/document_core/pdf_import_session.rs:297` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/document_core/pdf_import_session.rs:296` calls `map_err`, `RenderError`, `to_string` and `src/document_core/pdf_import_session.rs:335` 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 (14–15 lines × 2) src/document_core/queries/cursor_nav.rs:881— src/document_core/queries/cursor_nav.rs:881-895 | src/document_core/queries/cursor_nav.rs:989-1002 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_nav.rs:881` 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) src/parser/hwp3/mod.rs:2264— src/parser/hwp3/mod.rs:2264-2277 | src/parser/hwp3/mod.rs:3059-3073 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) src/parser/pdf/structured_lowering.rs:1989— src/parser/pdf/structured_lowering.rs:1989-2003 | tools/pdf-ir-poc/src/structured_lowering.rs:657-670 — before extracting anything, compare `src/parser/pdf/structured_lowering.rs` and `tools/pdf-ir-poc/src/structured_lowering.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 309 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 2) src/renderer/float_placement.rs:3019— src/renderer/float_placement.rs:3019-3033 | src/renderer/float_placement.rs:5779-5792 — both copies are in the same file, so extract the 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 `src/renderer/float_placement.rs:3019` 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 (14–15 lines × 2) src/renderer/float_placement.rs:4942— src/renderer/float_placement.rs:4942-4956 | src/renderer/float_placement.rs:5143-5156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) src/renderer/svg.rs:3914— src/renderer/svg.rs:3914-3927 | src/renderer/web_canvas.rs:3036-3050 — before extracting anything, compare `src/renderer/svg.rs` and `src/renderer/web_canvas.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 321 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 `src/renderer/svg.rs:3914` 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) bindings/Flutter/lib/src/native_ffi.dart:273— bindings/Flutter/lib/src/native_ffi.dart:273-287 | bindings/Flutter/lib/src/native_presentation.dart:159-172 — 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 `bindings/Flutter/lib/src/native_ffi.dart:273` 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 (6 lines × 5) src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:124— src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:124-129 | src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:24-29 | src/bin/rhwp-q/commands/rhwp-q-objects.rs:24-29 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:241-246 | src/cli/outputs/preview.rs:93-98 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs` and `src/bin/rhwp-q/commands/rhwp-q-objects.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 114 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 `src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/bin/rhwp-q/commands/rhwp-q-page-def.rs:239` calls `document` and `src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:123` 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 × 5) src/cli/commands/edit/cells.rs:455— src/cli/commands/edit/cells.rs:455-460 | src/cli/commands/edit/document_text.rs:196-201 | src/cli/commands/edit/media.rs:460-465 | src/cli/commands/tabular_import.rs:428-433 | src/cli/commands/tabular_import.rs:713-718 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 218 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 `src/cli/commands/edit/cells.rs:455` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/cli/commands/edit/cells.rs:454` calls `clone`, `unwrap_or_default` and `src/cli/commands/edit/document_text.rs:195` 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 × 5) src/document_core/queries/cursor_rect.rs:1532— src/document_core/queries/cursor_rect.rs:1532-1537 | src/document_core/queries/cursor_rect.rs:1539-1544 | src/document_core/queries/cursor_rect.rs:1546-1551 | src/document_core/queries/cursor_rect.rs:1553-1558 | src/document_core/queries/cursor_rect.rs:1560-1565 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 5) src/parser/hwpx/section.rs:2457— src/parser/hwpx/section.rs:2457-2462 | src/parser/hwpx/section.rs:3148-3153 | src/parser/hwpx/section.rs:3802-3807 | src/parser/hwpx/section.rs:7534-7539 | src/parser/hwpx/section.rs:7667-7672 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/hwpx/section.rs:2457` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/parser/hwpx/section.rs:3154` calls `parse_u32` and `src/parser/hwpx/section.rs:7540` 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 × 5) src/parser/hwpx/section.rs:2467— src/parser/hwpx/section.rs:2467-2472 | src/parser/hwpx/section.rs:3185-3190 | src/parser/hwpx/section.rs:3814-3819 | src/parser/hwpx/section.rs:7514-7519 | src/parser/hwpx/section.rs:7637-7642 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/hwpx/section.rs:2467` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/parser/hwpx/section.rs:2475` calls `attr_str` and `src/parser/hwpx/section.rs:3191` 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) src/renderer/float_placement.rs:2979— src/renderer/float_placement.rs:2979-2984 | src/renderer/float_placement.rs:3807-3814 | src/renderer/float_placement/stored_cut_outer_frame.rs:34-43 | src/renderer/float_placement/stored_header_frame.rs:26-34 | src/renderer/float_placement/stored_header_frame.rs:81-88 — before extracting anything, compare `src/renderer/float_placement.rs` and `src/renderer/float_placement/stored_header_frame.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/float_placement.rs:2979` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/renderer/float_placement/stored_header_frame.rs:35` calls `Footnote`, `Endnote` and `src/renderer/float_placement/stored_cut_outer_frame.rs:44` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 5) src/renderer/pagination/engine.rs:1018— src/renderer/pagination/engine.rs:1018-1024 | src/renderer/pagination/engine.rs:1131-1136 | src/renderer/pagination/engine.rs:1172-1177 | src/renderer/typeset/controls/wrap_match.rs:29-35 | src/renderer/typeset/section/post_flow.rs:425-430 — before extracting anything, compare `src/renderer/pagination/engine.rs` and `src/renderer/typeset/controls/wrap_match.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 5) src/document_core/converters/common_obj_attr_writer.rs:31— src/document_core/converters/common_obj_attr_writer.rs:31-36 | src/renderer/composer/inline_control_projection.inc.rs:70-75 | src/renderer/composer/stored_lines_runs.inc.rs:598-603 | src/serializer/body_text.rs:912-917 | src/serializer/record_writer.rs:70-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (6 lines × 5) gym/tools/audit.py:786— gym/tools/audit.py:786-791 | gym/tools/differential.py:882-887 | gym/tools/release_diff.py:811-816 | gym/tools/release_gate.py:796-801 | gym/tools/trajectory.py:577-582 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
Duplicated block (6 lines × 5) tools/dar/conformance.py:222— tools/dar/conformance.py:222-227 | tools/fde/triage.py:166-171 | tools/handoff/orchestrator.py:701-706 | tools/regression_loop/gate.py:68-73 | tools/regression_loop/promote.py:217-222 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `tools/regression_loop/promote.py:224` calls `add_argument` and `tools/handoff/orchestrator.py:708` 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.
Paragraph::insert_text_at_caret (cyclomatic 54) src/model/paragraph.rs:1600— Paragraph::insert_text_at_caret has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Paragraph::split_at (cyclomatic 38) src/model/paragraph.rs:2069— Paragraph::split_at 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.
Paragraph::delete_text_at (cyclomatic 35) src/model/paragraph.rs:1878— Paragraph::delete_text_at 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.
Paragraph::replace_text_keeping_slots (cyclomatic 35) src/model/paragraph.rs:2876— Paragraph::replace_text_keeping_slots 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.
Paragraph::try_control_text_positions (cyclomatic 22) src/model/paragraph.rs:3259— Paragraph::try_control_text_positions 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.
Paragraph::merge_from_with_storage (cyclomatic 21) src/model/paragraph.rs:2515— Paragraph::merge_from_with_storage has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Paragraph::shift_position_metadata_for_stream_insertion (cyclomatic 16) src/model/paragraph.rs:1507— Paragraph::shift_position_metadata_for_stream_insertion 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.
Paragraph::rebuild_char_offsets (cyclomatic 16) src/model/paragraph.rs:2763— Paragraph::rebuild_char_offsets 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.
Paragraph::try_map_char_shape_range (cyclomatic 16) src/model/paragraph.rs:3714— Paragraph::try_map_char_shape_range 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.
Paginator::paginate_with_measured_context_with_storage (cognitive 340) src/renderer/pagination/engine.rs:375— Paginator::paginate_with_measured_context_with_storage has cognitive complexity 340 (threshold 15). Drivers by points: if/else 88 (258 pts), boolean chains 64, match/switch 3 (10 pts), loops 4 (8 pts) (nesting depth added 181). 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.
Paginator::split_table_rows_with_storage (cognitive 168) src/renderer/pagination/engine.rs:2677— Paginator::split_table_rows_with_storage has cognitive complexity 168 (threshold 15). Drivers by points: if/else 80 (136 pts), boolean chains 31, loops 1 (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.
Paginator::paginate_text_lines_with_storage (cognitive 125) src/renderer/pagination/engine.rs:1406— Paginator::paginate_text_lines_with_storage has cognitive complexity 125 (threshold 15). Drivers by points: if/else 42 (110 pts), boolean chains 8, loops 2 (7 pts) (nesting depth added 73). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Paginator::paginate_table_control_with_storage (cognitive 82) src/renderer/pagination/engine.rs:2161— Paginator::paginate_table_control_with_storage has cognitive complexity 82 (threshold 15). Drivers by points: if/else 50 (72 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Paginator::process_controls_with_storage (cognitive 73) src/renderer/pagination/engine.rs:1928— Paginator::process_controls_with_storage has cognitive complexity 73 (threshold 15). Drivers by points: if/else 17 (55 pts), loops 3 (10 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Paginator::paginate_with_forced_breaks_with_storage (cognitive 67) src/renderer/pagination/engine.rs:1697— Paginator::paginate_with_forced_breaks_with_storage has cognitive complexity 67 (threshold 15). Drivers by points: if/else 24 (55 pts), boolean chains 6, loops 3 (6 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.
Paginator::place_table_fits_with_storage (cognitive 35) src/renderer/pagination/engine.rs:2500— Paginator::place_table_fits_with_storage has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 10 (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.
Paginator::process_multicolumn_break_with_storage (cognitive 17) src/renderer/pagination/engine.rs:1332— Paginator::process_multicolumn_break_with_storage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Paginator::paginate_multicolumn_paragraph_with_storage (cognitive 17) src/renderer/pagination/engine.rs:1865— Paginator::paginate_multicolumn_paragraph_with_storage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change coupling: canvas_render.rs ↔ svg_render.rs src/renderer/equation/canvas_render.rs:1— `src/renderer/equation/canvas_render.rs` and `src/renderer/equation/svg_render.rs` change together 96% of the time (27 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 27 shared commits counted here, the most recent 3 are `4dbb274b` fix: HancomEQN 글리프와 첨자 메트릭을 실제 출력에 연결; `eae23ccd` fix: 독립 Print에 따라 정렬 행과 조합·긴 나눗셈·색 범위를 보정; `be1aac16` fix: 공개 MATH 화살촉과 장식 프레임을 각 출력에 공유 — run `git show` on any of them.
Change coupling: svg_render.rs ↔ equation_conv.rs src/renderer/equation/svg_render.rs:1— `src/renderer/equation/svg_render.rs` and `src/renderer/skia/equation_conv.rs` change together 89% of the time (25 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 25 shared commits counted here, the most recent 3 are `4dbb274b` fix: HancomEQN 글리프와 첨자 메트릭을 실제 출력에 연결; `be1aac16` fix: 공개 MATH 화살촉과 장식 프레임을 각 출력에 공유; `b6947263` fix: 수식 명시적 간격과 구분자 윤곽·논리 프레임을 공유 — run `git show` on any of them.
Change coupling: canvas_render.rs ↔ equation_conv.rs src/renderer/equation/canvas_render.rs:1— `src/renderer/equation/canvas_render.rs` and `src/renderer/skia/equation_conv.rs` change together 89% of the time (25 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 25 shared commits counted here, the most recent 3 are `4dbb274b` fix: HancomEQN 글리프와 첨자 메트릭을 실제 출력에 연결; `be1aac16` fix: 공개 MATH 화살촉과 장식 프레임을 각 출력에 공유; `b6947263` fix: 수식 명시적 간격과 구분자 윤곽·논리 프레임을 공유 — run `git show` on any of them.
Change coupling: json.rs ↔ schema.rs src/paint/json.rs:1— `src/paint/json.rs` and `src/paint/schema.rs` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `ecb8e0af` fix: 자소의 실제 전진과 강조점 소유·본문 기울임을 공통화; `47b3ab93` fix: 원본 글꼴의 가시 옛한글 글리프와 성조 앵커 보정; `38ad228e` fix: 강조점의 실제 글리프와 자소별 공통 배치 연결 — run `git show` on any of them.
Change coupling: mutation-method-registry.ts ↔ wasm-bridge.ts rhwp-studio/src/core/mutation-method-registry.ts:1— `rhwp-studio/src/core/mutation-method-registry.ts` and `rhwp-studio/src/core/wasm-bridge.ts` change together 68% of the time (13 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `f8f3625d` feat(picture): 다른 쪽으로 끌어 놓은 그림은 놓은 쪽 문단으로 옮겨 붙인다 (#8557); `6638b6c6` feat(picture): 표 칸 문단 안에 그림을 넣는 insertPictureInCell (#8556); `b96229c1` fix(studio): support paragraph formatting in nested table cells — run `git show` on any of them.
Change coupling: canvas.rs ↔ table_cell_content.rs src/renderer/canvas.rs:1— `src/renderer/canvas.rs` and `src/renderer/layout/table_cell_content.rs` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `b1b639f8` wip: 완료 셀 외곽과 원본 예약 높이 분리 및 회귀 진단 보존; `a86e1f96` fix: 캡션 원문 주소와 문맥 문자 폭·회전 그림 출력 크기 보정; `215c6720` feat(render): expose source paragraph ranges for split table cells — run `git show` on any of them.
Change coupling: cursor.ts ↔ input-handler-keyboard.ts rhwp-studio/src/engine/cursor.ts:1— `rhwp-studio/src/engine/cursor.ts` and `rhwp-studio/src/engine/input-handler-keyboard.ts` change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `942cb8db` 수정: 모두 선택의 셀 범위와 표 강조 및 포커스 처리 정합; `e0561df6` Task #6741: 셀 블록 Delete·되돌리기를 한컴에 맞춘다; `cfa4ccac` 머리말/꼬리말 편집 API와 이벤트 계약 정리 (#6461) — run `git show` on any of them.
Change coupling: main.rs ↔ gen_agent_codex.py src/main.rs:1— `src/main.rs` and `tools/gen_agent_codex.py` 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, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `15d65b00` feat(cli): charts — 차트 목록 (#5051); `ad0a336f` feat: threat-scan — 무기화 문서 구조 위협 탐지(읽기 전용 안전 에어락); `b24cea3b` feat(armor): 프롬프트 주입 방패 — nonce 격벽 + 주입 신호 표지 + 출처 표지 (#4850) — run `git show` on any of them.
Change coupling: canvas.rs ↔ table_layout.rs src/renderer/canvas.rs:1— `src/renderer/canvas.rs` and `src/renderer/layout/table_layout.rs` 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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `b1b639f8` wip: 완료 셀 외곽과 원본 예약 높이 분리 및 회귀 진단 보존; `215c6720` feat(render): expose source paragraph ranges for split table cells; `e386f9b7` Expose logical clipboard editing and native paragraph refresh contracts — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×9
Edited copy of a member (36 corresponding lines) src/renderer/pagination/state.rs:92— src/renderer/pagination/state.rs:92-130 | src/renderer/pagination/state.rs:136-171 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) src/renderer/typeset/controls/stored_tac/owned_row.rs:74— src/renderer/typeset/controls/stored_tac/owned_row.rs:74-112 | src/renderer/typeset/controls/stored_tac/owned_row.rs:126-161 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) src/bin/rhwp-agent/lookups.rs:254— src/bin/rhwp-agent/lookups.rs:254-295 | src/bin/rhwp-agent/lookups.rs:448-483 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) src/native_host/gpu_d3d.rs:363— src/native_host/gpu_d3d.rs:363-398 | src/native_host/gpu_metal.rs:249-284 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) src/document_core/converters/common_obj_attr_writer.rs:46— src/document_core/converters/common_obj_attr_writer.rs:46-81 | src/serializer/control.rs:2563-2598 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) src/document_core/commands/foreign_paste.rs:838— src/document_core/commands/foreign_paste.rs:838-873 | src/document_core/queries/content_fonts.rs:57-92 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) tools/gate_3798_page_end_spill.py:42— tools/gate_3798_page_end_spill.py:42-77 | tools/verify_pi_page_vs_hangul.py:69-112 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) tools/skill_router/audit_skill_commands.py:201— tools/skill_router/audit_skill_commands.py:201-236 | tools/skill_router/gate_new_skill.py:409-444 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) scripts/font_rank1_qualification.py:371— scripts/font_rank1_qualification.py:371-406 | scripts/font_rank7_qualification.py:488-523 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (30 lines × 2) src/document_core/helpers.rs:1367— src/document_core/helpers.rs:1367-1396 | src/document_core/helpers.rs:1457-1486 — both copies are in the same file, so extract the 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 `src/document_core/helpers.rs:1367` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/document_core/helpers.rs:1397` calls `ends_with` and `src/document_core/helpers.rs:1487` 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 (30 lines × 2) src/parser/doc_info.rs:685— src/parser/doc_info.rs:685-714 | src/parser/hwp3/records.rs:113-142 — 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 `src/parser/doc_info.rs:685` 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 (30 lines × 2) src/renderer/layout/shape_layout.rs:4800— src/renderer/layout/shape_layout.rs:4800-4829 | src/renderer/layout/table_cell_content.rs:181-210 — before extracting anything, compare `src/renderer/layout/shape_layout.rs` and `src/renderer/layout/table_cell_content.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 185 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 `src/renderer/layout/shape_layout.rs:4800` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (30 lines × 2) src/renderer/typeset.rs:3556— src/renderer/typeset.rs:3556-3585 | src/renderer/typeset/notes/endnotes/measure.rs:647-676 — before extracting anything, compare `src/renderer/typeset.rs` and `src/renderer/typeset/notes/endnotes/measure.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/typeset.rs:3556` 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 (30 lines × 2) src/serializer/hwpx/section.rs:2717— src/serializer/hwpx/section.rs:2717-2746 | src/serializer/hwpx/section.rs:2796-2825 — both copies are in the same file, so extract the 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 `src/serializer/hwpx/section.rs:2717` 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 (30 lines × 2) src/parser/mod.rs:457— src/parser/mod.rs:457-486 | src/parser/mod.rs:942-971 — both copies are in the same file, so extract the 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 `src/parser/mod.rs: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.
Duplicated block (30 lines × 2) src/bin/rhwp-q/kit/footnote_hit.rs:56— src/bin/rhwp-q/kit/footnote_hit.rs:56-85 | src/bin/rhwp-q/kit/hit_header.rs:56-85 — before extracting anything, compare `src/bin/rhwp-q/kit/footnote_hit.rs` and `src/bin/rhwp-q/kit/hit_header.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 125 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. 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 (30 lines × 2) .claude/skills/rhwp-explore/references/_gen_pack.py:322— .claude/skills/rhwp-explore/references/_gen_pack.py:322-351 | .claude/skills/rhwp-explore/references/_gen_pack.py:372-401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (30 lines × 2) tools/oracle_public/page_smoke.py:233— tools/oracle_public/page_smoke.py:233-262 | tools/oracle_public/sweep_runner.py:656-685 — before extracting anything, compare `tools/oracle_public/page_smoke.py` and `tools/oracle_public/sweep_runner.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 138 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 (16–17 lines × 2) src/cli/commands/batch_convert.rs:147— src/cli/commands/batch_convert.rs:147-162 | src/cli/commands/conversion.rs:371-387 — 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 `src/cli/commands/batch_convert.rs:147` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) src/cli/commands/edit/privacy.rs:256— src/cli/commands/edit/privacy.rs:256-271 | src/cli/commands/edit/privacy.rs:757-773 — both copies are in the same file, so extract the 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 `src/cli/commands/edit/privacy.rs:256` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) src/parser/mod.rs:514— src/parser/mod.rs:514-529 | src/parser/mod.rs:1052-1068 — both copies are in the same file, so extract the 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 `src/parser/mod.rs:514` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16–17 lines × 2) src/renderer/composer/line_breaking.rs:981— src/renderer/composer/line_breaking.rs:981-997 | src/renderer/composer/line_breaking.rs:1017-1032 — both copies are in the same file, so extract the 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–17 lines × 2) src/renderer/float_placement.rs:4861— src/renderer/float_placement.rs:4861-4877 | src/renderer/float_placement.rs:5157-5172 — both copies are in the same file, so extract the 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 `src/renderer/float_placement.rs:4861` 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–17 lines × 2) src/renderer/layout.rs:17737— src/renderer/layout.rs:17737-17753 | src/renderer/layout.rs:17766-17781 — both copies are in the same file, so extract the 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 (16–17 lines × 2) src/renderer/layout/paragraph_layout.rs:9717— src/renderer/layout/paragraph_layout.rs:9717-9732 | src/renderer/layout/paragraph_layout.rs:9813-9829 — both copies are in the same file, so extract the 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 `src/renderer/layout/paragraph_layout.rs:9717` 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–17 lines × 2) src/serializer/control.rs:3047— src/serializer/control.rs:3047-3063 | src/serializer/doc_info.rs:775-790 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16–17 lines × 2) src/serializer/hwpx/section.rs:2543— src/serializer/hwpx/section.rs:2543-2558 | src/serializer/hwpx/section.rs:2677-2693 — both copies are in the same file, so extract the 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 `src/serializer/hwpx/section.rs:2543` 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 (11–12 lines × 2) src/document_core/commands/text_editing.rs:6648— src/document_core/commands/text_editing.rs:6648-6659 | src/document_core/commands/text_editing.rs:6764-6774 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) src/document_core/queries/memo_query.rs:1254— src/document_core/queries/memo_query.rs:1254-1265 | src/document_core/queries/memo_query.rs:1338-1348 — both copies are in the same file, so extract the 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, `src/document_core/queries/memo_query.rs:1335` calls `is_empty`, `Err`, `invalid_range` and `src/document_core/queries/memo_query.rs:1253` 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–12 lines × 2) src/parser/hwp3/mod.rs:1350— src/parser/hwp3/mod.rs:1350-1361 | src/parser/hwp3/mod.rs:1825-1835 — both copies are in the same file, so extract the 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 `src/parser/hwp3/mod.rs:1350` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) src/parser/mod.rs:889— src/parser/mod.rs:889-900 | src/parser/mod.rs:1028-1038 — both copies are in the same file, so extract the 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 `src/parser/mod.rs:889` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) src/parser/pdf/structured_lowering.rs:1913— src/parser/pdf/structured_lowering.rs:1913-1924 | tools/pdf-ir-poc/src/structured_lowering.rs:602-612 — before extracting anything, compare `src/parser/pdf/structured_lowering.rs` and `tools/pdf-ir-poc/src/structured_lowering.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 309 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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–12 lines × 2) src/parser/pdf/structured_lowering.rs:2063— src/parser/pdf/structured_lowering.rs:2063-2074 | tools/pdf-ir-poc/src/structured_lowering.rs:731-741 — before extracting anything, compare `src/parser/pdf/structured_lowering.rs` and `tools/pdf-ir-poc/src/structured_lowering.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 309 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/structured_lowering.rs:2063` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–12 lines × 2) src/renderer/layout.rs:12023— src/renderer/layout.rs:12023-12033 | src/renderer/layout.rs:12422-12433 — both copies are in the same file, so extract the 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 (11–12 lines × 2) src/renderer/layout/table_layout.rs:27361— src/renderer/layout/table_layout.rs:27361-27371 | src/renderer/layout/table_layout.rs:27380-27391 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:27361` 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–12 lines × 2) src/renderer/web_canvas.rs:157— src/renderer/web_canvas.rs:157-168 | src/renderer/web_canvas/cubic_reduction.rs:134-144 — 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 `src/renderer/web_canvas.rs:157` 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–10 lines × 2) src/cli/queries/digest.rs:116— src/cli/queries/digest.rs:116-124 | src/cli/queries/info.rs:34-43 — 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 `src/cli/queries/digest.rs:116` 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–10 lines × 2) src/document_core/commands/document.rs:3174— src/document_core/commands/document.rs:3174-3182 | src/document_core/commands/document.rs:3203-3212 — both copies are in the same file, so extract the 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 `src/document_core/commands/document.rs:3174` 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–10 lines × 2) src/document_core/commands/text_editing.rs:51— src/document_core/commands/text_editing.rs:51-60 | src/document_core/commands/text_editing.rs:146-154 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:51` 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–10 lines × 2) src/document_core/queries/grep.rs:340— src/document_core/queries/grep.rs:340-348 | src/document_core/queries/grep.rs:431-440 — both copies are in the same file, so extract the 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 `src/document_core/queries/grep.rs:340` 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–10 lines × 2) src/parser/body_text.rs:1193— src/parser/body_text.rs:1193-1201 | src/parser/control.rs:466-475 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9–10 lines × 2) src/parser/pdf/structured_lowering.rs:2044— src/parser/pdf/structured_lowering.rs:2044-2053 | tools/pdf-ir-poc/src/structured_lowering.rs:705-713 — before extracting anything, compare `src/parser/pdf/structured_lowering.rs` and `tools/pdf-ir-poc/src/structured_lowering.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 309 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/structured_lowering.rs:2044` 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–10 lines × 2) src/renderer/composer/inline_control_projection.inc.rs:38— src/renderer/composer/inline_control_projection.inc.rs:38-47 | src/renderer/layout/textless_shape_host.rs:15-23 — 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 (9–10 lines × 2) src/renderer/layout/table_layout.rs:2489— src/renderer/layout/table_layout.rs:2489-2498 | src/renderer/layout/table_layout.rs:2537-2545 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:2489` 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–10 lines × 2) src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:467— src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:467-475 | src/renderer/typeset/notes/endnotes/paragraph/tail_fit.rs:792-801 — 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 `src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:467` 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 (8 lines × 4) src/bin/rhwp-q/kit/chart_list.rs:13— src/bin/rhwp-q/kit/chart_list.rs:13-20 | src/bin/rhwp-q/kit/empty_doc.rs:9-16 | src/bin/rhwp-q/kit/overflow_cells.rs:11-18 | src/bin/rhwp-q/kit/table_overlaps.rs:11-18 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (8 lines × 4) src/bin/rhwp-q/kit/form_at.rs:90— src/bin/rhwp-q/kit/form_at.rs:90-97 | src/bin/rhwp-q/kit/hit_fn_marker.rs:91-98 | src/bin/rhwp-q/kit/hit_in_footnote.rs:91-98 | src/bin/rhwp-q/kit/hit_in_hf.rs:109-120 — before extracting anything, compare `src/bin/rhwp-q/kit/form_at.rs` and `src/bin/rhwp-q/kit/hit_fn_marker.rs` as WHOLE FILES: this scan already matched 11 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 `src/bin/rhwp-q/kit/form_at.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 (8 lines × 4) src/parser/hwpx/section.rs:4799— src/parser/hwpx/section.rs:4799-4806 | src/parser/hwpx/section.rs:4808-4815 | src/parser/hwpx/section.rs:4817-4824 | src/parser/hwpx/section.rs:4826-4833 — 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. 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 (8 lines × 4) src/renderer/float_placement/stored_nested_before_host.rs:17— src/renderer/float_placement/stored_nested_before_host.rs:17-24 | src/renderer/layout/table_layout/stored_deferred_picture_frame.rs:9-16 | src/renderer/layout/table_layout/stored_mixed_opening_frame.rs:287-294 | src/renderer/render_normalization/stored_nested_text_frames.rs:45-52 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/float_placement/stored_nested_before_host.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.
Duplicated block (8 lines × 4) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:157— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:157-164 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:156-163 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:160-167 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:140-147 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 188 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) src/wmf/parser/objects/structure/point_l.rs:20— src/wmf/parser/objects/structure/point_l.rs:20-27 | src/wmf/parser/objects/structure/point_s.rs:20-27 | src/wmf/parser/objects/structure/scan.rs:104-111 | src/wmf/parser/objects/structure/size_l.rs:20-27 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/wmf/parser/objects/structure/point_l.rs:20` 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 × 4) src/cli/outputs/text.rs:46— src/cli/outputs/text.rs:46-53 | src/cli/queries/data_extraction.rs:39-46 | src/cli/queries/search.rs:40-47 | src/cli/queries/search.rs:53-60 — before extracting anything, compare `src/cli/outputs/text.rs` and `src/cli/queries/search.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/outputs/text.rs:46` 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 lines × 4) src/bin/rhwp-q/kit/caret_stops.rs:64— src/bin/rhwp-q/kit/caret_stops.rs:64-71 | src/bin/rhwp-q/kit/line_starts.rs:65-72 | src/bin/rhwp-q/kit/para_bounds.rs:65-72 | src/bin/rhwp-q/kit/word_starts.rs:64-71 — before extracting anything, compare `src/bin/rhwp-q/kit/caret_stops.rs` and `src/bin/rhwp-q/kit/line_starts.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/kit/caret_stops.rs:64` 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 (8 lines × 4) tools/llm_verifier/abstain/generate_corpus.py:451— tools/llm_verifier/abstain/generate_corpus.py:451-458 | tools/llm_verifier/oracle_vs_self/generate_corpus.py:281-288 | tools/llm_verifier/shadow_agree/generate_corpus.py:250-257 | tools/llm_verifier/untrusted_sandbox/generate_corpus.py:393-400 — `tools/llm_verifier/oracle_vs_self/generate_corpus.py` and `tools/llm_verifier/shadow_agree/generate_corpus.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 70 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `tools/llm_verifier/abstain/generate_corpus.py:448` calls `any`, `RuntimeError` and `tools/llm_verifier/oracle_vs_self/generate_corpus.py:279` 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.
EqLayout::row_children (cyclomatic 27) src/renderer/equation/layout/symbol_spacing.rs:168— EqLayout::row_children 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.
EqLayout::layout_symbol (cyclomatic 20) src/renderer/equation/layout.rs:595— EqLayout::layout_symbol 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. This is NOT this file's highest cyclomatic complexity: EqLayout::layout_node (cyclomatic 35) 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 function is counted neither in this dimension's figures nor in its score.
EqLayout::layout_math_symbol (cyclomatic 19) src/renderer/equation/layout.rs:660— EqLayout::layout_math_symbol has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: EqLayout::layout_node (cyclomatic 35) 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 function is counted neither in this dimension's figures nor in its score.
EqLayout::layout_ladder (cyclomatic 18) src/renderer/equation/layout/ladder_geometry.rs:11— EqLayout::layout_ladder 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.
EqLayout::layout_paren (cyclomatic 17) src/renderer/equation/layout/paren_geometry.rs:7— EqLayout::layout_paren 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.
EqLayout::layout_matrix (cyclomatic 16) src/renderer/equation/layout/matrix_geometry.rs:20— EqLayout::layout_matrix 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.
EqLayout::layout_aligned_rows (cyclomatic 16) src/renderer/equation/layout/matrix_geometry.rs:276— EqLayout::layout_aligned_rows 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.
EqLayout::layout_plain_matrix (cyclomatic 16) src/renderer/equation/layout/plain_matrix_geometry.rs:9— EqLayout::layout_plain_matrix 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 (30 corresponding lines) · ×8
Edited copy of a member (30 corresponding lines) mydocs/pr/assets/issue_536_seo_rii_20261021/consumer_probe.rs:12— mydocs/pr/assets/issue_536_seo_rii_20261021/consumer_probe.rs:12-41 | mydocs/pr/assets/seo_rii_20261030/consumer_probe.rs:12-48 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) src/renderer/mod.rs:3155— src/renderer/mod.rs:3155-3184 | src/renderer/mod.rs:3195-3225 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) src/serializer/control.rs:1166— src/serializer/control.rs:1166-1196 | src/serializer/control.rs:1198-1227 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) src/renderer/float_placement.rs:185— src/renderer/float_placement.rs:185-215 | src/renderer/render_normalization/stored_word_tail.rs:508-537 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) src/parser/pdf/lowering.rs:154— src/parser/pdf/lowering.rs:154-186 | tools/pdf-ir-poc/src/lowering.rs:63-92 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) src/parser/hwp3/drawing.rs:49— src/parser/hwp3/drawing.rs:49-78 | src/parser/hwp3/records.rs:204-233 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) tools/llm_verifier/lineage_chain/cli.py:22— tools/llm_verifier/lineage_chain/cli.py:22-55 | tools/llm_verifier/third_party_replay/cli.py:22-51 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) scripts/font_kerning_cohort.py:135— scripts/font_kerning_cohort.py:135-164 | scripts/font_rank8_qualification.py:211-240 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×8
Edited copy of a member (24 corresponding lines) src/parser/cfb_reader.rs:1156— src/parser/cfb_reader.rs:1156-1181 | src/parser/cfb_reader.rs:1210-1233 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src/cli/integrity.rs:48— src/cli/integrity.rs:48-73 | src/cli/integrity.rs:83-106 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src/parser/hwpx/section.rs:5747— src/parser/hwpx/section.rs:5747-5770 | src/parser/hwpx/section.rs:5776-5799 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src/document_core/queries/field_query.rs:1453— src/document_core/queries/field_query.rs:1453-1479 | src/document_core/queries/field_query.rs:2315-2338 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src/document_core/queries/field_query.rs:1385— src/document_core/queries/field_query.rs:1385-1411 | src/document_core/queries/field_query.rs:1502-1525 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) samples/issue1937/gen_cell_notes_multipage.py:68— samples/issue1937/gen_cell_notes_multipage.py:68-91 | samples/issue8081/gen_fn_table.py:64-87 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) bindings/Native/examples/native_worker_file_store.py:259— bindings/Native/examples/native_worker_file_store.py:259-282 | bindings/Native/examples/native_worker_file_store.py:343-373 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) tools/adoption_spine.py:141— tools/adoption_spine.py:141-166 | tools/frame_guard.py:82-105 — 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 copies of one member (3 members, 8+ corresponding lines) · ×8
Edited copies of one member (3 members, 8+ corresponding lines) gym/core/checks.py:144— gym/core/checks.py:144-151 | gym/core/checks.py:216-223 | gym/core/checks.py:458-465 — 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.
Edited copies of one member (3 members, 8+ corresponding lines) .claude/skills/rhwp-visual-regression/references/_gen_pack.py:1790— .claude/skills/rhwp-visual-regression/references/_gen_pack.py:1790-1797 | .claude/skills/rhwp-visual-regression/references/_gen_pack.py:1820-1829 | .claude/skills/rhwp-visual-regression/references/_gen_pack.py:1875-1890 — 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.
Edited copies of one member (3 members, 8+ corresponding lines) src/serializer/hwpx/utils.rs:82— src/serializer/hwpx/utils.rs:82-89 | src/serializer/hwpx/utils.rs:105-112 | src/serializer/hwpx/utils.rs:123-130 — 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.
Edited copies of one member (3 members, 8+ corresponding lines) src/renderer/composer/line_breaking.rs:3663— src/renderer/composer/line_breaking.rs:3663-3675 | src/renderer/composer/line_breaking.rs:3678-3685 | src/renderer/pagination.rs:1517-1532 — 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.
Edited copies of one member (3 members, 8+ corresponding lines) src/renderer/height_measurer.rs:861— src/renderer/height_measurer.rs:861-868 | src/renderer/typeset/table/continuation/fragment/physical_rows.rs:21-28 | src/renderer/typeset/table/scan/row.rs:278-285 — 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.
Edited copies of one member (3 members, 8+ corresponding lines) src/render_backend/png_adapter.rs:104— src/render_backend/png_adapter.rs:104-111 | src/render_backend/skia_adapter.rs:116-123 | src/render_backend/svg_adapter.rs:89-96 — 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.
Edited copies of one member (3 members, 8+ corresponding lines) samples/issue8149/gen_headerrow.py:78— samples/issue8149/gen_headerrow.py:78-85 | samples/issue8149/gen_reservefit.py:24-31 | samples/issue8149/gen_rowfit.py:73-80 — 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.
Edited copies of one member (3 members, 8+ corresponding lines) scripts/font_kerning_boundary.py:319— scripts/font_kerning_boundary.py:319-326 | scripts/generate_kerning_pair_fixture.py:275-286 | scripts/generate_kerning_runtime_fixture.py:121-134 — 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.
Duplicated block (28 lines × 2) src/bin/rhwp-q/kit/cur_field_state.rs:39— src/bin/rhwp-q/kit/cur_field_state.rs:39-66 | src/bin/rhwp-q/kit/field_info_at.rs:39-66 — before extracting anything, compare `src/bin/rhwp-q/kit/cur_field_state.rs` and `src/bin/rhwp-q/kit/field_info_at.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 133 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 `src/bin/rhwp-q/kit/cur_field_state.rs:39` 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 (28 lines × 2) src/cli/commands/edit/cell_paragraphs.rs:19— src/cli/commands/edit/cell_paragraphs.rs:19-46 | src/cli/commands/edit/cells.rs:496-523 — before extracting anything, compare `src/cli/commands/edit/cell_paragraphs.rs` and `src/cli/commands/edit/cells.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 262 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 `src/cli/commands/edit/cell_paragraphs.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.
Duplicated block (28 lines × 2) src/cli/commands/edit/document_objects.rs:296— src/cli/commands/edit/document_objects.rs:296-323 | src/cli/commands/edit/document_objects.rs:437-464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/document_objects.rs:296` 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 (28 lines × 2) src/cli/outputs/pdf.rs:84— src/cli/outputs/pdf.rs:84-111 | src/cli/outputs/vector.rs:82-109 — before extracting anything, compare `src/cli/outputs/pdf.rs` and `src/cli/outputs/vector.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 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 `src/cli/outputs/pdf.rs:84` 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 (28 lines × 2) src/document_core/commands/clipboard.rs:2074— src/document_core/commands/clipboard.rs:2074-2101 | src/document_core/commands/clipboard.rs:2118-2145 — both copies are in the same file, so extract the 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 `src/document_core/commands/clipboard.rs:2074` 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 (28 lines × 2) src/paint/json.rs:1861— src/paint/json.rs:1861-1888 | src/paint/json.rs:1919-1946 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `style` to `&TextStyle` in one and `&PaintTextStyle` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/paint/json.rs:1890` calls `push_str` and `src/paint/json.rs:1947` 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 (28 lines × 2) gym/tools/fuzz_corpus.py:824— gym/tools/fuzz_corpus.py:824-851 | gym/tools/robustness.py:657-684 — before extracting anything, compare `gym/tools/fuzz_corpus.py` and `gym/tools/robustness.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 421 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 `gym/tools/fuzz_corpus.py:824` 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 (28 lines × 2) samples/issue8474/gen_section_top_spacing.py:87— samples/issue8474/gen_section_top_spacing.py:87-114 | samples/issue8474/gen_top_tac_cases.py:86-113 — before extracting anything, compare `samples/issue8474/gen_section_top_spacing.py` and `samples/issue8474/gen_top_tac_cases.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (9 lines × 4) src/bin/rhwp-agent/locate.rs:214— src/bin/rhwp-agent/locate.rs:214-222 | src/bin/rhwp-q/kit/covering_pages.rs:12-20 | src/bin/rhwp-q/kit/form_value.rs:18-26 | src/bin/rhwp-q/kit/page_border_fill.rs:14-22 — before extracting anything, compare `src/bin/rhwp-q/kit/covering_pages.rs` and `src/bin/rhwp-q/kit/form_value.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 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 `src/bin/rhwp-agent/locate.rs:214` 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 × 4) src/cli/protocol/harness.rs:327— src/cli/protocol/harness.rs:327-335 | src/cli/protocol/trust/gate.rs:19-27 | src/cli/protocol/trust/governance.rs:175-183 | src/cli/protocol/trust/governance.rs:570-578 — before extracting anything, compare `src/cli/protocol/harness.rs` and `src/cli/protocol/trust/governance.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/harness.rs:327` 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 × 4) src/diagnostics/hwp5_cell_header_probe.rs:857— src/diagnostics/hwp5_cell_header_probe.rs:857-865 | src/diagnostics/hwp5_contract_probe.rs:775-783 | src/diagnostics/hwp5_mel_personnel_probe.rs:771-779 | src/diagnostics/hwp5_table_probe.rs:626-634 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_contract_probe.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 370 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. 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 × 4) src/document_core/commands/formatting.rs:1191— src/document_core/commands/formatting.rs:1191-1199 | src/document_core/commands/formatting.rs:1268-1276 | src/document_core/commands/formatting.rs:1744-1752 | src/document_core/commands/formatting.rs:1827-1835 — 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.
Duplicated block (9 lines × 4) src/renderer/layout/shape_layout.rs:2101— src/renderer/layout/shape_layout.rs:2101-2109 | src/renderer/layout/shape_layout.rs:2129-2137 | src/renderer/layout/shape_layout.rs:2149-2157 | src/renderer/layout/shape_layout.rs:2447-2455 — 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 `src/renderer/layout/shape_layout.rs:2101` 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 × 4) src/renderer/typeset.rs:3564— src/renderer/typeset.rs:3564-3572 | src/renderer/typeset/notes/endnotes/measure.rs:247-255 | src/renderer/typeset/notes/endnotes/measure.rs:655-663 | src/renderer/typeset/notes/endnotes/stored_ink_fit.inc.rs:299-307 — before extracting anything, compare `src/renderer/typeset.rs` and `src/renderer/typeset/notes/endnotes/measure.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 × 4) src/bin/rhwp-agent/lookups.rs:22— src/bin/rhwp-agent/lookups.rs:22-30 | src/bin/rhwp-agent/lookups.rs:335-343 | src/cli/queries/document_inventory.rs:115-123 | src/cli/queries/document_inventory.rs:187-195 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-agent/lookups.rs:22` 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 × 4) src/diagnostics/hwp5_cell_header_probe.rs:285— src/diagnostics/hwp5_cell_header_probe.rs:285-293 | src/diagnostics/hwp5_contract_probe.rs:237-245 | src/diagnostics/hwp5_mel_personnel_probe.rs:229-237 | src/diagnostics/hwp5_table_probe.rs:232-240 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_contract_probe.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 370 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 5) bindings/Native/src/lib.rs:498— bindings/Native/src/lib.rs:498-504 | src/document_core/queries/bookmark_query.rs:461-467 | src/document_core/queries/field_query.rs:2754-2760 | src/render_backend/fixture.rs:90-96 | src/renderer/render_tree.rs:448-454 — before extracting anything, compare `src/document_core/queries/bookmark_query.rs` and `src/document_core/queries/field_query.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 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 `bindings/Native/src/lib.rs:498` 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 × 5) src/bin/rhwp-q/more/inventory.rs:54— src/bin/rhwp-q/more/inventory.rs:54-60 | src/bin/rhwp-q/more/inventory.rs:72-78 | src/bin/rhwp-q/more/inventory.rs:108-114 | src/bin/rhwp-q/more/inventory.rs:123-129 | src/bin/rhwp-q/more/inventory.rs:1068-1074 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 5) src/cli/commands/edit/bookmarks.rs:13— src/cli/commands/edit/bookmarks.rs:13-19 | src/cli/commands/edit/document_text.rs:1028-1034 | src/cli/commands/edit/notes.rs:12-18 | src/cli/commands/edit/notes.rs:107-113 | src/cli/commands/edit/tables/insert.rs:14-20 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 5) src/renderer/height_measurer.rs:3999— src/renderer/height_measurer.rs:3999-4005 | src/renderer/height_measurer.rs:5034-5040 | src/renderer/height_measurer.rs:5824-5830 | src/renderer/layout/table_layout.rs:6334-6344 | src/renderer/layout/table_layout.rs:28606-28616 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 300 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/height_measurer.rs:3999` 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 (7 lines × 5) src/renderer/layout/table_layout.rs:25061— src/renderer/layout/table_layout.rs:25061-25067 | src/renderer/layout/table_layout.rs:26796-26802 | src/renderer/layout/table_layout.rs:28000-28006 | src/renderer/layout/table_layout.rs:28516-28522 | src/renderer/layout/table_layout/reflow_external_cut.rs:65-71 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 5) src/document_core/queries/hwpctrl_sets.rs:607— src/document_core/queries/hwpctrl_sets.rs:607-613 | src/document_core/queries/hwpctrl_sets.rs:651-657 | src/document_core/queries/hwpctrl_sets.rs:997-1003 | src/document_core/queries/hwpctrl_sets.rs:2106-2112 | src/document_core/queries/hwpctrl_sets.rs:2426-2432 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 5) src/cli/protocol/plan/mod.rs:12— src/cli/protocol/plan/mod.rs:12-19 | src/main.rs:1064-1070 | src/main.rs:1144-1150 | src/main.rs:1218-1224 | src/main.rs:1300-1306 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/plan/mod.rs:12` 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 × 5) src/cli/commands/edit/bookmarks.rs:101— src/cli/commands/edit/bookmarks.rs:101-107 | src/cli/commands/edit/bookmarks.rs:215-221 | src/cli/commands/edit/bookmarks.rs:338-344 | src/cli/commands/edit/document_objects.rs:372-378 | src/cli/commands/edit/document_objects.rs:525-531 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/document_objects.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 213 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 `src/cli/commands/edit/bookmarks.rs:101` 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 × 4) src/bin/rhwp-q/kit/char_index.rs:72— src/bin/rhwp-q/kit/char_index.rs:72-78 | src/bin/rhwp-q/kit/cur_field_state.rs:72-78 | src/bin/rhwp-q/kit/field_info_at.rs:72-78 | src/bin/rhwp-q/kit/word_end.rs:72-78 — before extracting anything, compare `src/bin/rhwp-q/kit/char_index.rs` and `src/bin/rhwp-q/kit/cur_field_state.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 69 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 `src/bin/rhwp-q/kit/char_index.rs:72` 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 (7 lines × 4) src/document_core/commands/text_editing.rs:4551— src/document_core/commands/text_editing.rs:4551-4557 | src/document_core/commands/text_editing.rs:4607-4613 | src/document_core/queries/cursor_rect.rs:6355-6361 | src/document_core/queries/cursor_rect.rs:6403-6409 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 4) src/renderer/layout/table_layout.rs:12192— src/renderer/layout/table_layout.rs:12192-12198 | src/renderer/layout/table_layout.rs:13109-13115 | src/renderer/layout/table_layout.rs:17781-17787 | src/renderer/layout/table_layout.rs:28632-28638 — 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 `src/renderer/layout/table_layout.rs:12192` 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 (7 lines × 4) src/renderer/html.rs:73— src/renderer/html.rs:73-79 | src/renderer/html.rs:84-90 | src/renderer/html.rs:95-101 | src/renderer/html.rs:183-189 — 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.
Duplicated block (7 lines × 4) samples/issue7687/gen_empty_host.py:91— samples/issue7687/gen_empty_host.py:91-97 | samples/issue7687/gen_titled_host_after_band.py:53-59 | samples/issue8149/gen_headerrow.py:97-103 | samples/issue8149/gen_rowfit.py:92-98 — before extracting anything, compare `samples/issue8149/gen_headerrow.py` and `samples/issue8149/gen_rowfit.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 4) samples/issue1937/gen_cell_notes_multipage.py:49— samples/issue1937/gen_cell_notes_multipage.py:49-55 | samples/issue1937/gen_row_trim.py:51-57 | samples/issue8081/gen_fn_table.py:45-51 | samples/issue8464/gen_row_content_fit.py:61-67 — before extracting anything, compare `samples/issue1937/gen_row_trim.py` and `samples/issue8464/gen_row_content_fit.py` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) scripts/oracle_stage4_profile.py:182— scripts/oracle_stage4_profile.py:182-188 | scripts/oracle_stage5_queue_projection.py:62-68 | scripts/oracle_stage5_rank16_disposition.py:47-53 | scripts/oracle_stage5_rank8_profile.py:96-102 — before extracting anything, compare `scripts/oracle_stage4_profile.py` and `scripts/oracle_stage5_rank8_profile.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7 lines × 4) tools/layout_anomaly_batch_report.py:784— tools/layout_anomaly_batch_report.py:784-790 | tools/oracle_public/page_smoke.py:680-686 | tools/oracle_public/sweep_runner.py:1231-1237 | tools/page_roundtrip/harness.py:717-723 — 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.
Paginator::paginate_with_measured_context_with_storage (cyclomatic 144) src/renderer/pagination/engine.rs:375— Paginator::paginate_with_measured_context_with_storage has cyclomatic complexity 144 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Paginator::split_table_rows_with_storage (cyclomatic 81) src/renderer/pagination/engine.rs:2677— Paginator::split_table_rows_with_storage has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Paginator::paginate_text_lines_with_storage (cyclomatic 41) src/renderer/pagination/engine.rs:1406— Paginator::paginate_text_lines_with_storage 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.
Paginator::paginate_table_control_with_storage (cyclomatic 39) src/renderer/pagination/engine.rs:2161— Paginator::paginate_table_control_with_storage has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Paginator::paginate_with_forced_breaks_with_storage (cyclomatic 27) src/renderer/pagination/engine.rs:1697— Paginator::paginate_with_forced_breaks_with_storage 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.
Paginator::process_controls_with_storage (cyclomatic 26) src/renderer/pagination/engine.rs:1928— Paginator::process_controls_with_storage 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.
Paginator::place_table_fits_with_storage (cyclomatic 22) src/renderer/pagination/engine.rs:2500— Paginator::place_table_fits_with_storage 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.
SvgRenderer::render_node (cyclomatic 112) src/renderer/svg.rs:764— SvgRenderer::render_node has cyclomatic complexity 112 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SvgRenderer::draw_text_positioned (cyclomatic 79) src/renderer/svg.rs:3421— SvgRenderer::draw_text_positioned has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SvgRenderer::render_image_node_with_sampling (cyclomatic 52) src/renderer/svg.rs:2101— SvgRenderer::render_image_node_with_sampling has cyclomatic complexity 52 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SvgRenderer::render_page_background_image (cyclomatic 30) src/renderer/svg.rs:1878— SvgRenderer::render_page_background_image 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. This is NOT this file's highest cyclomatic complexity: rhwp::renderer::svg::known_font_filenames (cyclomatic 39) 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 function is counted neither in this dimension's figures nor in its score.
SvgRenderer::draw_char_overlap (cyclomatic 26) src/renderer/svg.rs:2617— SvgRenderer::draw_char_overlap has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: rhwp::renderer::svg::known_font_filenames (cyclomatic 39) 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 function is counted neither in this dimension's figures nor in its score.
SvgRenderer::prepare_pua_glyphs (cyclomatic 22) src/renderer/svg/pua_glyph.rs:7— SvgRenderer::prepare_pua_glyphs 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.
SvgRenderer::draw_line_shape (cyclomatic 18) src/renderer/svg.rs:2897— SvgRenderer::draw_line_shape 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. This is NOT this file's highest cyclomatic complexity: rhwp::renderer::svg::known_font_filenames (cyclomatic 39) 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 function is counted neither in this dimension's figures nor in its score.
TodoComment src/wmf/parser/objects/structure/device_independent_bitmap.rs:43— // TODO: Not written in [MS-WMF] how to parse this field. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment src/renderer/pagination/state.rs:9— /// TODO: current_height 누적이 정확해지면 방어 로직과 함께 제거 가능. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment src/renderer/pagination/state.rs:40— // --- 방어 로직 (TODO: current_height 누적이 정확해지면 제거 가능) --- — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment src/parser/hwp3/mod.rs:2395— // TODO: TagID 3에서 추출 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment src/doclang/adapter/paragraph.rs:39— //! TODO(v2): use `field_ranges` / `control_text_positions()` to split the text — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×7
Edited copy of a member (28 corresponding lines) src/renderer/web_canvas.rs:2338— src/renderer/web_canvas.rs:2338-2377 | src/renderer/web_canvas.rs:2385-2508 — 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) src/paint/device_clip.rs:7— src/paint/device_clip.rs:7-34 | src/paint/device_fill.rs:41-73 — 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) src/parser/control.rs:513— src/parser/control.rs:513-540 | src/parser/control.rs:543-570 — 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) src/cli/queries/control_dump/story.rs:126— src/cli/queries/control_dump/story.rs:126-158 | src/cli/queries/control_dump/story.rs:258-285 — 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) src/document_core/pdf_import_session.rs:283— src/document_core/pdf_import_session.rs:283-310 | src/document_core/pdf_import_session.rs:318-349 — 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) src/document_core/commands/table_ops.rs:999— src/document_core/commands/table_ops.rs:999-1026 | src/document_core/commands/table_ops.rs:1035-1068 — 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) src/serializer/hwpx/picture.rs:706— src/serializer/hwpx/picture.rs:706-733 | src/serializer/hwpx/table.rs:233-267 — 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 (27 corresponding lines) · ×7
Edited copy of a member (27 corresponding lines) src/document_core/commands/object_ops/picture.rs:113— src/document_core/commands/object_ops/picture.rs:113-157 | src/document_core/commands/object_ops/picture.rs:514-692 — 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) src/parser/pdf/table_detection.rs:378— src/parser/pdf/table_detection.rs:378-411 | tools/pdf-ir-poc/src/table_detection.rs:168-194 — 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) src/parser/pdf/table_detection.rs:413— src/parser/pdf/table_detection.rs:413-439 | tools/pdf-ir-poc/src/table_detection.rs:196-222 — 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) src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:72— src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:72-98 | src/bin/rhwp-q/commands/rhwp-q-objects.rs:72-100 — 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) src/document_core/table_calc/parser.rs:86— src/document_core/table_calc/parser.rs:86-112 | src/document_core/table_calc/parser.rs:115-141 — 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) mydocs/tech/investigations/issue-705/probes/inspect_705.rs:26— mydocs/tech/investigations/issue-705/probes/inspect_705.rs:26-52 | mydocs/tech/investigations/issue-705/probes/scan_cell_pagehide.rs:19-51 — 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) src/document_core/commands/text_editing.rs:5861— src/document_core/commands/text_editing.rs:5861-5887 | src/document_core/commands/text_editing.rs:5980-6006 — 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 (16 corresponding lines) · ×7
Edited copy of a member (16 corresponding lines) src/paint/dot_leader.rs:73— src/paint/dot_leader.rs:73-168 | src/renderer/arrow.rs:89-112 — 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) src/renderer/height_measurer.rs:359— src/renderer/height_measurer.rs:359-374 | src/renderer/layout/table_layout.rs:22204-22227 — 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) src/agent/dsel/parse.rs:526— src/agent/dsel/parse.rs:526-541 | src/agent/dsel/parse.rs:543-560 — 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) src/renderer/composer/line_breaking.rs:3846— src/renderer/composer/line_breaking.rs:3846-3861 | src/renderer/composer/line_breaking.rs:3863-3886 — 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) src/renderer/layout/paragraph_layout/leading_justification.rs:175— src/renderer/layout/paragraph_layout/leading_justification.rs:175-192 | src/renderer/layout/paragraph_layout/leading_justification.rs:194-209 — 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) src/renderer/height_measurer.rs:7017— src/renderer/height_measurer.rs:7017-7032 | src/renderer/pagination.rs:75-91 — 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) src/serializer/hwpx/picture.rs:264— src/serializer/hwpx/picture.rs:264-280 | src/serializer/hwpx/shape.rs:952-967 — 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 (31 corresponding lines) · ×7
Edited copy of a member (31 corresponding lines) src/bin/rhwp-q/kit/cursor_in_footnote.rs:63— src/bin/rhwp-q/kit/cursor_in_footnote.rs:63-96 | src/bin/rhwp-q/kit/note_edit_info.rs:56-86 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) src/native_host/gpu_d3d.rs:404— src/native_host/gpu_d3d.rs:404-434 | src/native_host/gpu_metal.rs:290-320 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) src/renderer/layout/border_rendering.rs:1455— src/renderer/layout/border_rendering.rs:1455-1485 | src/renderer/layout/border_rendering.rs:1497-1533 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) tools/llm_verifier/lineage_chain/verify_corpus.py:21— tools/llm_verifier/lineage_chain/verify_corpus.py:21-51 | tools/llm_verifier/third_party_replay/verify_corpus.py:21-51 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) tools/oracle_public/fatten_catalog.py:303— tools/oracle_public/fatten_catalog.py:303-339 | tools/oracle_public/fatten_catalog.py:349-379 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) scripts/font_rank1_qualification.py:186— scripts/font_rank1_qualification.py:186-216 | scripts/font_rank7_qualification.py:255-286 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) tools/scale_ladder.py:214— tools/scale_ladder.py:214-244 | tools/scale_ladder_real.py:210-241 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×7
Edited copy of a member (5 corresponding lines) src/diagnostics/hwp5_cell_header_probe.rs:642— src/diagnostics/hwp5_cell_header_probe.rs:642-646 | src/diagnostics/hwp5_mel_personnel_probe.rs:551-555 — 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) src/parser/hml/reader.rs:1030— src/parser/hml/reader.rs:1030-1034 | src/parser/hml/reader.rs:1041-1045 — 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) bindings/Native/src/session.rs:708— bindings/Native/src/session.rs:708-712 | src/native_host/presentation.rs:36-41 — 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) src/renderer/composer/frame_geometry.rs:58— src/renderer/composer/frame_geometry.rs:58-64 | src/renderer/layout/table_layout/declared_first_frame.rs:13-17 — 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) crates/rhwp-ooxml-chart/src/patch.rs:302— crates/rhwp-ooxml-chart/src/patch.rs:302-306 | src/cli/commands/edit/cells.rs:199-203 — 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) tools/layout_anomaly/gen_m02f_fixtures.py:106— tools/layout_anomaly/gen_m02f_fixtures.py:106-110 | tools/layout_anomaly/gen_m02f_fixtures.py:114-118 — 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) tools/llm_verifier/repeat_eval/src/loader.rs:19— tools/llm_verifier/repeat_eval/src/loader.rs:19-23 | tools/llm_verifier/tool_version_gate/src/loader.rs:32-38 — 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 (19 lines × 3) src/bin/rhwp-q/kit/canvaskit_preflight.rs:55— src/bin/rhwp-q/kit/canvaskit_preflight.rs:55-73 | src/bin/rhwp-q/kit/layer_tree.rs:31-49 | src/bin/rhwp-q/kit/search_all.rs:33-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/kit/canvaskit_preflight.rs:55` 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 × 3) src/bin/rhwp-q/kit/cur_field_state.rs:21— src/bin/rhwp-q/kit/cur_field_state.rs:21-39 | src/bin/rhwp-q/kit/line_starts.rs:20-38 | src/bin/rhwp-q/kit/para_bounds.rs:20-38 — before extracting anything, compare `src/bin/rhwp-q/kit/cur_field_state.rs` and `src/bin/rhwp-q/kit/line_starts.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 98 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 `src/bin/rhwp-q/kit/cur_field_state.rs:21` 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 × 3) src/document_core/commands/formatting.rs:1700— src/document_core/commands/formatting.rs:1700-1718 | src/document_core/commands/formatting.rs:1904-1922 | src/document_core/commands/header_footer_ops.rs:1197-1215 — 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 `src/document_core/commands/formatting.rs:1700` 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 × 3) src/native_host/gpu_d3d.rs:183— src/native_host/gpu_d3d.rs:183-201 | src/native_host/gpu_metal.rs:123-141 | src/native_host/presentation.rs:106-124 — before extracting anything, compare `src/native_host/gpu_d3d.rs` and `src/native_host/gpu_metal.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 170 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 `src/native_host/gpu_d3d.rs:183` 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 × 3) src/parser/hwp3/mod.rs:3257— src/parser/hwp3/mod.rs:3257-3275 | src/parser/hwp3/mod.rs:3281-3299 | src/parser/hwp3/mod.rs:3314-3332 — 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 `src/parser/hwp3/mod.rs:3257` 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 (19 lines × 3) src/renderer/layout/table_partial.rs:8243— src/renderer/layout/table_partial.rs:8243-8261 | src/renderer/layout/table_partial.rs:8270-8288 | src/renderer/layout/table_partial.rs:8308-8326 — 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 `src/renderer/layout/table_partial.rs:8243` 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 (19 lines × 3) tools/oracle_public/coverage_report.py:118— tools/oracle_public/coverage_report.py:118-136 | tools/oracle_public/oracle_resolver.py:110-128 | tools/oracle_public/sweep_runner.py:296-314 — before extracting anything, compare `tools/oracle_public/coverage_report.py` and `tools/oracle_public/oracle_resolver.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 187 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 (17–18 lines × 2) src/document_core/commands/clipboard.rs:584— src/document_core/commands/clipboard.rs:584-601 | src/document_core/commands/clipboard.rs:673-689 — both copies are in the same file, so extract the 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, `src/document_core/commands/clipboard.rs:579` calls `Ok`, `store_clipboard` and `src/document_core/commands/clipboard.rs:671` 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–18 lines × 2) src/document_core/commands/text_editing.rs:6486— src/document_core/commands/text_editing.rs:6486-6502 | src/document_core/commands/text_editing.rs:6548-6565 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:6548` 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 × 2) src/parser/hwpx/section.rs:6752— src/parser/hwpx/section.rs:6752-6768 | src/parser/hwpx/section.rs:6856-6873 — both copies are in the same file, so extract the 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 `src/parser/hwpx/section.rs:6752` 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–18 lines × 2) src/renderer/layout/table_layout.rs:8198— src/renderer/layout/table_layout.rs:8198-8215 | src/renderer/layout/table_layout.rs:9073-9089 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:8198` 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 × 2) src/renderer/layout/table_layout.rs:22291— src/renderer/layout/table_layout.rs:22291-22308 | src/renderer/layout/table_layout.rs:22352-22368 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:22291` 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 × 2) src/wmf/parser/objects/graphics/brush.rs:75— src/wmf/parser/objects/graphics/brush.rs:75-92 | src/wmf/parser/objects/structure/log_brush.rs:67-83 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/wmf/parser/objects/graphics/brush.rs:75` 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 (17–18 lines × 2) src/renderer/layout/paragraph_layout.rs:9015— src/renderer/layout/paragraph_layout.rs:9015-9032 | src/renderer/layout/paragraph_layout.rs:11181-11197 — both copies are in the same file, so extract the 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 `src/renderer/layout/paragraph_layout.rs:9015` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) src/cli/commands/edit/tables/grid.rs:14— src/cli/commands/edit/tables/grid.rs:14-28 | src/cli/commands/edit/tables/grid.rs:229-243 | src/cli/commands/edit/tables/structure.rs:14-28 — before extracting anything, compare `src/cli/commands/edit/tables/grid.rs` and `src/cli/commands/edit/tables/structure.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 187 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 `src/cli/commands/edit/tables/grid.rs:14` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) src/cli/commands/tabular_import.rs:520— src/cli/commands/tabular_import.rs:520-534 | src/cli/outputs/tabular.rs:22-36 | src/cli/outputs/text.rs:273-287 — before extracting anything, compare `src/cli/commands/tabular_import.rs` and `src/cli/outputs/tabular.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/tabular_import.rs:520` 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 (15 lines × 3) src/cli/outputs/raster.rs:214— src/cli/outputs/raster.rs:214-228 | src/cli/outputs/text.rs:460-474 | src/cli/outputs/vector.rs:237-251 — before extracting anything, compare `src/cli/outputs/raster.rs` and `src/cli/outputs/text.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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 `src/cli/outputs/raster.rs:214` 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 × 3) src/renderer/shaping_paragraph.rs:1217— src/renderer/shaping_paragraph.rs:1217-1231 | src/renderer/shaping_paragraph.rs:1270-1284 | src/renderer/shaping_paragraph.rs:1302-1316 — 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 `src/renderer/shaping_paragraph.rs:1217` 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 (15 lines × 3) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:141— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:141-155 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:140-154 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:144-158 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 188 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 `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:141` 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 × 3) scripts/font_rank1_qualification.py:42— scripts/font_rank1_qualification.py:42-56 | scripts/font_rank7_qualification.py:55-69 | scripts/font_rank8_qualification.py:130-144 — before extracting anything, compare `scripts/font_rank1_qualification.py` and `scripts/font_rank7_qualification.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 128 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `scripts/font_rank1_qualification.py:57` calls `require_equal`, `get` and `scripts/font_rank8_qualification.py:145` 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 (15 lines × 3) tools/hwp5_inventory/cases.py:96— tools/hwp5_inventory/cases.py:96-110 | tools/hwp5_inventory/cases.py:113-127 | tools/hwp5_inventory/cases.py:130-144 — 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 (12–13 lines × 2) src/document_core/commands/object_ops/equation.rs:498— src/document_core/commands/object_ops/equation.rs:498-509 | src/document_core/commands/object_ops/picture.rs:1468-1480 — before extracting anything, compare `src/document_core/commands/object_ops/equation.rs` and `src/document_core/commands/object_ops/picture.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 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 `src/document_core/commands/object_ops/equation.rs:498` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) src/document_core/commands/text_editing.rs:5534— src/document_core/commands/text_editing.rs:5534-5545 | src/document_core/commands/text_editing.rs:5553-5565 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:5534` 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–13 lines × 2) src/model/page.rs:209— src/model/page.rs:209-221 | src/renderer/page_layout.rs:110-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12–13 lines × 2) src/renderer/layout/shape_layout.rs:5123— src/renderer/layout/shape_layout.rs:5123-5134 | src/renderer/layout/shape_layout.rs:5302-5314 — both copies are in the same file, so extract the 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 `src/renderer/layout/shape_layout.rs:5123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 2) src/renderer/pagination/engine.rs:1614— src/renderer/pagination/engine.rs:1614-1625 | src/renderer/typeset/paragraph/placement.rs:60-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/pagination/engine.rs:1614` 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 (12–13 lines × 2) src/wasm_api.rs:8712— src/wasm_api.rs:8712-8723 | src/wasm_api.rs:8743-8755 — both copies are in the same file, so extract the 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 `src/wasm_api.rs:8712` 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–13 lines × 2) scripts/visual_sweep_handbook.py:63— scripts/visual_sweep_handbook.py:63-75 | scripts/visual_sweep_native_webfonts.py:98-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 4) src/bin/rhwp-agent/searchcmd.rs:18— src/bin/rhwp-agent/searchcmd.rs:18-29 | src/bin/rhwp-agent/searchcmd.rs:63-74 | src/bin/rhwp-agent/searchcmd.rs:98-109 | src/bin/rhwp-agent/searchcmd.rs:126-137 — 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.
Duplicated block (12 lines × 4) src/bin/rhwp-q/kit/cur_field_state.rs:19— src/bin/rhwp-q/kit/cur_field_state.rs:19-30 | src/bin/rhwp-q/kit/field_info_at.rs:19-30 | src/bin/rhwp-q/kit/line_starts.rs:18-29 | src/bin/rhwp-q/kit/para_bounds.rs:18-29 — before extracting anything, compare `src/bin/rhwp-q/kit/cur_field_state.rs` and `src/bin/rhwp-q/kit/field_info_at.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 133 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 `src/bin/rhwp-q/kit/cur_field_state.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.
Duplicated block (12 lines × 4) src/cli/commands/edit/formatting.rs:38— src/cli/commands/edit/formatting.rs:38-49 | src/cli/commands/edit/formatting.rs:176-187 | src/cli/commands/edit/header_footer_properties.rs:37-48 | src/cli/commands/edit/note_content.rs:597-608 — before extracting anything, compare `src/cli/commands/edit/formatting.rs` and `src/cli/commands/edit/header_footer_properties.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 185 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 `src/cli/commands/edit/formatting.rs:38` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 4) src/wmf/converter/bitmap.rs:34— src/wmf/converter/bitmap.rs:34-45 | src/wmf/converter/bitmap.rs:54-65 | src/wmf/converter/bitmap.rs:89-100 | src/wmf/converter/bitmap.rs:145-156 — 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 `src/wmf/converter/bitmap.rs:34` 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 lines × 4) src/renderer/composer/equation_line_metrics.rs:29— src/renderer/composer/equation_line_metrics.rs:29-40 | src/serializer/body_text.rs:369-380 | src/serializer/control.rs:449-460 | src/serializer/control.rs:1487-1498 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/composer/equation_line_metrics.rs:29` 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 × 4) src/main.rs:1104— src/main.rs:1104-1116 | src/main.rs:1183-1195 | src/main.rs:1258-1269 | src/main.rs:1341-1353 — 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 `src/main.rs:1104` 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 lines × 4) src/parser/hwpx/header.rs:962— src/parser/hwpx/header.rs:962-973 | src/parser/hwpx/header.rs:1122-1133 | src/parser/hwpx/header.rs:1165-1176 | src/parser/hwpx/header.rs:1179-1190 — 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 `src/parser/hwpx/header.rs:962` 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 × 6) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:116— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:116-125 | src/diagnostics/hwp5_cell_header_probe.rs:175-184 | src/diagnostics/hwp5_contract_analyze.rs:100-109 | src/diagnostics/hwp5_contract_probe.rs:123-132 | src/diagnostics/hwp5_mel_personnel_probe.rs:121-130 | src/diagnostics/hwp5_table_probe.rs:127-136 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 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 `src/diagnostics/hwp5_borderfill_diagonal_probe.rs:116` 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 × 6) src/document_core/commands/html_import.rs:369— src/document_core/commands/html_import.rs:369-378 | src/document_core/commands/text_editing.rs:4257-4266 | src/document_core/commands/text_editing.rs:4281-4290 | src/document_core/commands/text_editing.rs:4359-4368 | src/document_core/commands/text_editing.rs:5133-5142 | src/document_core/commands/text_editing.rs:5157-5166 — before extracting anything, compare `src/document_core/commands/html_import.rs` and `src/document_core/commands/text_editing.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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 (10 lines × 6) src/document_core/commands/table_ops.rs:1000— src/document_core/commands/table_ops.rs:1000-1009 | src/document_core/commands/table_ops.rs:1036-1045 | src/document_core/commands/table_ops.rs:1210-1219 | src/document_core/commands/table_ops.rs:2949-2958 | src/document_core/commands/text_editing.rs:5897-5906 | src/document_core/queries/cursor_nav.rs:1436-1445 — before extracting anything, compare `src/document_core/commands/table_ops.rs` and `src/document_core/commands/text_editing.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 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 (10 lines × 6) src/document_core/queries/hwpctrl_sets.rs:1024— src/document_core/queries/hwpctrl_sets.rs:1024-1033 | src/document_core/queries/hwpctrl_sets.rs:1098-1107 | src/document_core/queries/hwpctrl_sets.rs:1302-1311 | src/document_core/queries/hwpctrl_sets.rs:1652-1661 | src/document_core/queries/hwpctrl_sets.rs:1708-1717 | src/document_core/queries/hwpctrl_sets.rs:1754-1763 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 6) src/renderer/pagination/engine.rs:1154— src/renderer/pagination/engine.rs:1154-1163 | src/renderer/typeset.rs:1190-1199 | src/renderer/typeset/controls/host_wrap.rs:17-26 | src/renderer/typeset/controls/host_wrap.rs:92-101 | src/renderer/typeset/controls/wrap_match.rs:56-65 | src/renderer/typeset/controls/wrap_match.rs:163-172 — before extracting anything, compare `src/renderer/pagination/engine.rs` and `src/renderer/typeset.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/pagination/engine.rs:1154` 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 × 6) src/wmf/parser/objects/graphics/font.rs:118— src/wmf/parser/objects/graphics/font.rs:118-127 | src/wmf/parser/objects/structure/bitmap_info_header/info.rs:99-108 | src/wmf/parser/objects/structure/log_color_space.rs:63-72 | src/wmf/parser/objects/structure/log_color_space_w.rs:63-72 | src/wmf/parser/records/bitmap/set_dib_to_dev.rs:71-80 | src/wmf/parser/records/bitmap/stretch_dib.rs:83-92 — before extracting anything, compare `src/wmf/parser/objects/structure/log_color_space.rs` and `src/wmf/parser/objects/structure/log_color_space_w.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 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 `src/wmf/parser/objects/graphics/font.rs:118` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/wmf/parser/records/bitmap/stretch_dib.rs:93` calls `parse` and `src/wmf/parser/objects/graphics/font.rs:128` 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 (10 lines × 6) src/bin/rhwp-q/kit/form_at.rs:88— src/bin/rhwp-q/kit/form_at.rs:88-97 | src/bin/rhwp-q/kit/form_value.rs:89-100 | src/bin/rhwp-q/kit/hf_edit_target.rs:81-92 | src/bin/rhwp-q/kit/hit_fn_marker.rs:89-98 | src/bin/rhwp-q/kit/hit_in_footnote.rs:89-98 | src/bin/rhwp-q/kit/hit_in_hf.rs:107-118 — before extracting anything, compare `src/bin/rhwp-q/kit/form_at.rs` and `src/bin/rhwp-q/kit/form_value.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `src/bin/rhwp-q/kit/form_at.rs:88` 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 (5 lines × 4) src/cli/protocol/exchange/bundle.rs:6— src/cli/protocol/exchange/bundle.rs:6-10 | src/cli/protocol/trust/gate.rs:17-21 | src/cli/protocol/trust/governance.rs:173-177 | src/cli/protocol/trust/governance.rs:568-572 — before extracting anything, compare `src/cli/protocol/exchange/bundle.rs` and `src/cli/protocol/trust/governance.rs` as WHOLE FILES: this scan already matched 7 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) src/document_core/queries/rendering.rs:6234— src/document_core/queries/rendering.rs:6234-6238 | src/renderer/layout.rs:8525-8529 | src/renderer/pagination.rs:1546-1550 | src/renderer/pagination/engine.rs:3229-3233 — 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.
Duplicated block (5 lines × 4) src/emf/emfplus/stream.rs:63— src/emf/emfplus/stream.rs:63-67 | src/emf/emfplus/stream.rs:69-73 | src/emf/emfplus/stream.rs:75-79 | src/paint/text_shadow.rs:130-134 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 4) src/cli/commands/edit/cell_paragraphs.rs:12— src/cli/commands/edit/cell_paragraphs.rs:12-16 | src/cli/commands/edit/cell_paragraphs.rs:170-174 | src/cli/commands/edit/formatting.rs:708-712 | src/cli/commands/edit/formatting.rs:860-864 — before extracting anything, compare `src/cli/commands/edit/cell_paragraphs.rs` and `src/cli/commands/edit/formatting.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 240 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) tools/llm_verifier/claim_bind/src/loader.rs:17— tools/llm_verifier/claim_bind/src/loader.rs:17-21 | tools/llm_verifier/criteria_decomp/src/loader.rs:17-21 | tools/llm_verifier/process_steps/src/loader.rs:17-21 | tools/llm_verifier/verdict_protocol/src/loader.rs:17-21 — before extracting anything, compare `tools/llm_verifier/claim_bind/src/loader.rs` and `tools/llm_verifier/criteria_decomp/src/loader.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) tools/task2279/pi78_split_ladder.py:77— tools/task2279/pi78_split_ladder.py:77-81 | tools/task2279/spacing_ladder.py:73-77 | tools/task2279/subpixel_align_harness.py:42-46 | tools/task2430/hy_ascii_ladder.py:183-187 — 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. The matched lines also transfer control out of the body holding them, 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 × 4) tools/dar/transaction.py:86— tools/dar/transaction.py:86-90 | tools/hancom_chart_judgment_verify.py:84-88 | tools/handoff/orchestrator.py:127-131 | tools/page_roundtrip/spec_probe.py:383-387 — 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.
TypesetState::prepare_saved_empty_run (cognitive 30) src/renderer/typeset/state/empty_run.rs:27— TypesetState::prepare_saved_empty_run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 7, 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.
TypesetState::spill_page_tail_floats (cognitive 24) src/renderer/typeset/state/transition.rs:707— TypesetState::spill_page_tail_floats has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, match/switch 2 (4 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypesetState::apply_visible_float_exclusions_absorbing (cognitive 20) src/renderer/typeset/state/transition.rs:1055— TypesetState::apply_visible_float_exclusions_absorbing has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypesetState::attach_pending_behind_absorptions (cognitive 18) src/renderer/typeset/state/commands.rs:987— TypesetState::attach_pending_behind_absorptions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypesetState::place_mixed_host_line (cognitive 17) src/renderer/typeset/state/mixed_host_line.rs:8— TypesetState::place_mixed_host_line has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, 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.
TypesetState::resolve_computed_float_first_line (cognitive 16) src/renderer/typeset/state/computed_float_line.rs:18— TypesetState::resolve_computed_float_first_line has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, 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.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×6
Edited copy of a member (35 corresponding lines) src/diagnostics/render_geom_diff.rs:289— src/diagnostics/render_geom_diff.rs:289-327 | src/docdiff/compare.rs:498-532 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) src/document_core/helpers.rs:1365— src/document_core/helpers.rs:1365-1406 | src/document_core/helpers.rs:1456-1490 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) src/wmf/parser/records/drawing/pat_blt.rs:48— src/wmf/parser/records/drawing/pat_blt.rs:48-82 | src/wmf/parser/records/drawing/round_rect.rs:52-94 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) bindings/swift/Sources/Rhwp/Rhwp.swift:123— bindings/swift/Sources/Rhwp/Rhwp.swift:123-160 | bindings/swift/Sources/Rhwp/Rhwp.swift:162-196 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) src/document_core/queries/field_query.rs:1907— src/document_core/queries/field_query.rs:1907-1941 | src/document_core/queries/field_query.rs:2022-2057 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) tools/llm_verifier/claim_bind/src/loader.rs:83— tools/llm_verifier/claim_bind/src/loader.rs:83-117 | tools/llm_verifier/criteria_decomp/src/loader.rs:84-130 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×6
Edited copy of a member (29 corresponding lines) bindings/Native/src/gpu_d3d.rs:181— bindings/Native/src/gpu_d3d.rs:181-210 | bindings/Native/src/gpu_metal.rs:191-219 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) src/diagnostics/hwp5_inventory_diff.rs:1399— src/diagnostics/hwp5_inventory_diff.rs:1399-1427 | src/diagnostics/hwp5_inventory_diff.rs:1943-1979 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) src/document_core/queries/rendering.rs:1983— src/document_core/queries/rendering.rs:1983-2011 | src/document_core/queries/rendering.rs:2070-2098 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) src/diagnostics/hwp5_cell_header_probe.rs:583— src/diagnostics/hwp5_cell_header_probe.rs:583-612 | src/diagnostics/hwp5_mel_personnel_probe.rs:521-549 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) src/serializer/hwpx/roundtrip.rs:1083— src/serializer/hwpx/roundtrip.rs:1083-1118 | src/serializer/hwpx/roundtrip.rs:1128-1156 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) tools/oracle_public/page_smoke.py:309— tools/oracle_public/page_smoke.py:309-347 | tools/oracle_public/sweep_runner.py:730-758 — 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 (26 corresponding lines) · ×6
Edited copy of a member (26 corresponding lines) src/renderer/html.rs:536— src/renderer/html.rs:536-571 | src/renderer/svg.rs:5527-5552 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) src/model/paragraph.rs:873— src/model/paragraph.rs:873-900 | src/model/paragraph.rs:3446-3471 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) src/renderer/layout.rs:1955— src/renderer/layout.rs:1955-1983 | src/renderer/typeset.rs:1886-1911 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) src/bin/rhwp-agent/harvest.rs:249— src/bin/rhwp-agent/harvest.rs:249-277 | src/bin/rhwp-agent/lookups.rs:297-322 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) src/parser/hml/reader.rs:609— src/parser/hml/reader.rs:609-634 | src/parser/hml/reader.rs:658-687 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) tools/llm_verifier/process_steps/src/score.rs:9— tools/llm_verifier/process_steps/src/score.rs:9-34 | tools/llm_verifier/verdict_protocol/src/classify.rs:60-88 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×6
Edited copy of a member (32 corresponding lines) src/renderer/equation/layout/script_geometry.rs:98— src/renderer/equation/layout/script_geometry.rs:98-129 | src/renderer/equation/layout/script_geometry.rs:130-163 — 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) src/cli/protocol/exchange/bundle.rs:216— src/cli/protocol/exchange/bundle.rs:216-247 | src/cli/protocol/harness.rs:326-358 — 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) src/document_core/queries/injection_scan.rs:563— src/document_core/queries/injection_scan.rs:563-598 | src/document_core/queries/injection_scan.rs:611-642 — 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) src/document_core/commands/table_ops.rs:864— src/document_core/commands/table_ops.rs:864-901 | src/document_core/commands/table_ops.rs:909-940 — 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) src/paint/font_glyph.rs:1116— src/paint/font_glyph.rs:1116-1147 | src/renderer/canvaskit_policy.rs:2260-2299 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) scripts/font_rank8_metric_hypothesis.py:246— scripts/font_rank8_metric_hypothesis.py:246-280 | scripts/font_rank8_private_qualification.py:196-227 — 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.
Duplicated block (27 lines × 2) src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:44— src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:44-70 | src/bin/rhwp-q/commands/rhwp-q-objects.rs:44-70 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs` and `src/bin/rhwp-q/commands/rhwp-q-objects.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 114 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. 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 (27 lines × 2) src/bin/rhwp-q/pack/inventory.rs:32— src/bin/rhwp-q/pack/inventory.rs:32-58 | src/docdiff/compare.rs:396-422 — 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 (27 lines × 2) src/diagnostics/layout_anomaly.rs:341— src/diagnostics/layout_anomaly.rs:341-367 | src/diagnostics/render_geom_diff.rs:119-145 — before extracting anything, compare `src/diagnostics/layout_anomaly.rs` and `src/diagnostics/render_geom_diff.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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. 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 (27 lines × 2) src/document_core/commands/text_editing.rs:4476— src/document_core/commands/text_editing.rs:4476-4502 | src/document_core/commands/text_editing.rs:4662-4688 — both copies are in the same file, so extract the 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 (27 lines × 2) src/renderer/layout/table_layout.rs:13062— src/renderer/layout/table_layout.rs:13062-13088 | src/renderer/layout/table_layout.rs:13244-13270 — both copies are in the same file, so extract the 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 (27 lines × 2) src/renderer/layout/table_layout.rs:17454— src/renderer/layout/table_layout.rs:17454-17480 | src/renderer/layout/table_layout.rs:18020-18046 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:17454` 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 (26–27 lines × 2) src/document_core/commands/object_ops/picture.rs:114— src/document_core/commands/object_ops/picture.rs:114-140 | src/document_core/commands/object_ops/picture.rs:563-588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26–27 lines × 2) src/parser/hwpx/header.rs:1868— src/parser/hwpx/header.rs:1868-1893 | src/parser/hwpx/section.rs:4505-4531 — before extracting anything, compare `src/parser/hwpx/header.rs` and `src/parser/hwpx/section.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 162 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 `src/parser/hwpx/header.rs:1868` 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 (26–27 lines × 2) src/renderer/layout/shape_layout.rs:2830— src/renderer/layout/shape_layout.rs:2830-2856 | src/renderer/layout/shape_layout.rs:2973-2998 — both copies are in the same file, so extract the 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 `src/renderer/layout/shape_layout.rs:2830` 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 (26–27 lines × 2) src/renderer/layout/table_layout.rs:8684— src/renderer/layout/table_layout.rs:8684-8710 | src/renderer/layout/table_partial.rs:3987-4012 — before extracting anything, compare `src/renderer/layout/table_layout.rs` and `src/renderer/layout/table_partial.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 327 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 `src/renderer/layout/table_layout.rs:8684` 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 (26–27 lines × 2) src/renderer/layout/table_layout.rs:23728— src/renderer/layout/table_layout.rs:23728-23754 | src/renderer/layout/table_layout.rs:23986-24011 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:23728` 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 (26–27 lines × 2) scripts/oracle_stage4_contract.py:75— scripts/oracle_stage4_contract.py:75-100 | scripts/oracle_stage4_contract.py:261-287 — both copies are in the same file, so extract the 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 (20 lines × 3) src/cli/commands/edit/document_text.rs:846— src/cli/commands/edit/document_text.rs:846-865 | src/cli/commands/edit/document_text.rs:942-961 | src/cli/commands/edit/page.rs:361-380 — before extracting anything, compare `src/cli/commands/edit/document_text.rs` and `src/cli/commands/edit/page.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 188 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. 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 (20 lines × 3) src/document_core/helpers.rs:1617— src/document_core/helpers.rs:1617-1636 | src/parser/hwpx/header.rs:2519-2538 | src/serializer/doc_info.rs:660-679 — 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 `src/document_core/helpers.rs:1617` 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 (20 lines × 3) src/document_core/queries/hwpctrl_sets.rs:2134— src/document_core/queries/hwpctrl_sets.rs:2134-2153 | src/document_core/queries/hwpctrl_sets.rs:2244-2263 | src/document_core/queries/hwpctrl_sets.rs:2288-2307 — 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 `src/document_core/queries/hwpctrl_sets.rs:2134` 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 (20 lines × 3) src/renderer/svg.rs:5353— src/renderer/svg.rs:5353-5372 | src/renderer/svg.rs:5429-5448 | src/renderer/svg.rs:5496-5515 — 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 `src/renderer/svg.rs:5353` 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 (20 lines × 3) src/serializer/hwpx/picture.rs:673— src/serializer/hwpx/picture.rs:673-693 | src/serializer/hwpx/shape.rs:1560-1582 | src/serializer/hwpx/table.rs:177-196 — before extracting anything, compare `src/serializer/hwpx/picture.rs` and `src/serializer/hwpx/shape.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 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 (20 lines × 3) tools/inspect_msec/gen_msec_fixtures.py:1402— tools/inspect_msec/gen_msec_fixtures.py:1402-1421 | tools/inspect_msec/gen_msec_fixtures.py:1517-1536 | tools/inspect_msec/gen_msec_fixtures.py:2222-2241 — 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 `tools/inspect_msec/gen_msec_fixtures.py:1402` 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–19 lines × 2) src/cli/commands/edit/media.rs:378— src/cli/commands/edit/media.rs:378-396 | src/cli/commands/edit/media.rs:757-773 — both copies are in the same file, so extract the 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 `src/cli/commands/edit/media.rs:378` 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 (17–19 lines × 2) src/document_core/commands/clipboard.rs:2135— src/document_core/commands/clipboard.rs:2135-2153 | src/document_core/commands/clipboard.rs:2177-2193 — both copies are in the same file, so extract the 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 `src/document_core/commands/clipboard.rs:2135` 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 (17–19 lines × 2) src/main.rs:521— src/main.rs:521-539 | src/service/open.rs:313-329 — 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 `src/main.rs:521` 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–19 lines × 2) src/renderer/equation/canvas_render.rs:372— src/renderer/equation/canvas_render.rs:372-388 | src/renderer/equation/svg_render.rs:436-454 — before extracting anything, compare `src/renderer/equation/canvas_render.rs` and `src/renderer/equation/svg_render.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 198 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 `src/renderer/equation/canvas_render.rs:372` 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–19 lines × 2) src/renderer/layout/table_partial.rs:3697— src/renderer/layout/table_partial.rs:3697-3713 | src/renderer/layout/table_partial.rs:3796-3814 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_partial.rs:3697` 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 (17–19 lines × 2) src/renderer/svg.rs:5376— src/renderer/svg.rs:5376-5392 | src/renderer/svg.rs:5451-5469 — both copies are in the same file, so extract the 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 `src/renderer/svg.rs:5376` 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 (17 lines × 3) src/bin/rhwp-agent/envlint.rs:11— src/bin/rhwp-agent/envlint.rs:11-27 | src/bin/rhwp-agent/envlint.rs:67-83 | src/bin/rhwp-agent/planlint.rs:11-27 — 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 `src/bin/rhwp-agent/envlint.rs:11` 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 (17 lines × 3) src/cli/commands/edit/document_objects.rs:164— src/cli/commands/edit/document_objects.rs:164-180 | src/cli/commands/edit/document_text.rs:627-643 | src/cli/commands/edit/media.rs:552-568 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 213 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 `src/cli/commands/edit/document_objects.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 (17 lines × 3) src/cli/outputs/pdf.rs:55— src/cli/outputs/pdf.rs:55-71 | src/cli/outputs/raster.rs:89-105 | src/cli/outputs/vector.rs:144-160 — before extracting anything, compare `src/cli/outputs/pdf.rs` and `src/cli/outputs/vector.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 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 (17 lines × 3) src/diagnostics/hwp5_anchor_trace.rs:31— src/diagnostics/hwp5_anchor_trace.rs:31-47 | src/diagnostics/hwp5_inventory.rs:91-107 | src/diagnostics/hwp5_inventory_diff.rs:193-209 — before extracting anything, compare `src/diagnostics/hwp5_anchor_trace.rs` and `src/diagnostics/hwp5_inventory.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 3) src/renderer/layout/shape_layout.rs:3573— src/renderer/layout/shape_layout.rs:3573-3589 | src/renderer/layout/shape_layout.rs:3640-3656 | src/renderer/layout/shape_layout.rs:4689-4705 — 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 (17 lines × 3) tools/oracle_public/coverage_report.py:143— tools/oracle_public/coverage_report.py:143-159 | tools/oracle_public/oracle_resolver.py:135-151 | tools/oracle_public/sweep_runner.py:320-336 — before extracting anything, compare `tools/oracle_public/coverage_report.py` and `tools/oracle_public/oracle_resolver.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 187 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 (15–16 lines × 2) src/cli/commands/edit/bookmarks.rs:79— src/cli/commands/edit/bookmarks.rs:79-93 | src/cli/commands/edit/bookmarks.rs:315-330 — both copies are in the same file, so extract the 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 `src/cli/commands/edit/bookmarks.rs:79` 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 (15–16 lines × 2) src/document_core/commands/formatting.rs:1949— src/document_core/commands/formatting.rs:1949-1964 | src/document_core/commands/formatting.rs:2055-2069 — both copies are in the same file, so extract the 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 `src/document_core/commands/formatting.rs:2055` 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 (15–16 lines × 2) src/document_core/queries/cursor_rect.rs:2004— src/document_core/queries/cursor_rect.rs:2004-2019 | src/document_core/queries/cursor_rect.rs:2930-2944 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:2004` 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–16 lines × 2) src/renderer/layout/table_layout.rs:16914— src/renderer/layout/table_layout.rs:16914-16929 | src/renderer/layout/table_layout.rs:17509-17523 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:16914` 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 (15–16 lines × 2) src/renderer/mod.rs:1627— src/renderer/mod.rs:1627-1641 | src/renderer/typeset/paragraph/format.rs:648-663 — 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 `src/renderer/typeset/paragraph/format.rs:648` 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–16 lines × 2) src/renderer/skia/prepared_page.rs:144— src/renderer/skia/prepared_page.rs:144-158 | src/renderer/skia/tiled_region.rs:224-239 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 5) src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:123— src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:123-136 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:124-137 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:123-136 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:124-137 | src/bin/rhwp-q/kit/footnote_footholds.rs:59-72 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs` and `src/bin/rhwp-q/commands/rhwp-q-markdown.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 158 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 `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:123` 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 before the matched lines, `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:122` calls `Some`, `to_string` and `src/bin/rhwp-q/kit/footnote_footholds.rs:58` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 5) src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:87— src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:87-100 | src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:153-166 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:87-100 | src/bin/rhwp-q/commands/rhwp-q-scan-items.rs:116-129 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:87-100 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs` and `src/bin/rhwp-q/commands/rhwp-q-font-trace.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (14 lines × 5) src/cli/commands/edit/media.rs:300— src/cli/commands/edit/media.rs:300-313 | src/cli/commands/edit/privacy.rs:190-203 | src/cli/commands/edit/privacy.rs:621-634 | src/cli/commands/tabular_import.rs:216-229 | src/cli/commands/tabular_import.rs:565-578 — before extracting anything, compare `src/cli/commands/edit/media.rs` and `src/cli/commands/edit/privacy.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 78 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 (14 lines × 5) src/renderer/height_measurer.rs:2279— src/renderer/height_measurer.rs:2279-2292 | src/renderer/height_measurer.rs:3750-3763 | src/renderer/height_measurer.rs:6296-6309 | src/renderer/pagination/engine.rs:235-248 | src/renderer/typeset.rs:3935-3948 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/typeset.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 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 `src/renderer/height_measurer.rs:2279` 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 × 5) src/serializer/hwpx/context.rs:583— src/serializer/hwpx/context.rs:583-596 | src/serializer/hwpx/context.rs:601-614 | src/serializer/hwpx/context.rs:619-632 | src/serializer/hwpx/context.rs:637-650 | src/serializer/hwpx/context.rs:655-668 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/serializer/hwpx/context.rs:583` 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 × 5) src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:224— src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:224-237 | src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:226-239 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:171-184 | src/bin/rhwp-q/commands/rhwp-q-scan-items.rs:200-213 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:147-160 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs` and `src/bin/rhwp-q/commands/rhwp-q-font-trace.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `src/bin/rhwp-q/commands/rhwp-q-cursor-model.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. The matched lines also transfer control out of the body holding them, 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–13 lines × 2) src/document_core/commands/formatting.rs:189— src/document_core/commands/formatting.rs:189-199 | src/document_core/commands/text_editing.rs:2011-2023 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `&mut` in one and `crate) fn reflow_paragraph(&mut` 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–13 lines × 2) src/parser/body_text.rs:318— src/parser/body_text.rs:318-328 | src/parser/hwpx/section.rs:173-185 — 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 `src/parser/body_text.rs:318` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 2) src/parser/hwpx/section.rs:7593— src/parser/hwpx/section.rs:7593-7605 | src/parser/hwpx/section.rs:7730-7740 — both copies are in the same file, so extract the 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 `src/parser/hwpx/section.rs:7593` 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–13 lines × 2) src/renderer/layout/shape_layout.rs:2879— src/renderer/layout/shape_layout.rs:2879-2889 | src/renderer/layout/shape_layout.rs:3062-3074 — both copies are in the same file, so extract the 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 `src/renderer/layout/shape_layout.rs:2879` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–13 lines × 2) src/renderer/layout/table_layout.rs:18994— src/renderer/layout/table_layout.rs:18994-19006 | src/renderer/layout/table_layout.rs:21556-21566 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:18994` 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 (11–13 lines × 2) src/wmf/converter/svg/ternary_raster_operator.rs:450— src/wmf/converter/svg/ternary_raster_operator.rs:450-460 | src/wmf/converter/svg/ternary_raster_operator.rs:471-483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 × 6) src/bin/rhwp-q/kit/cursor_in_footnote.rs:81— src/bin/rhwp-q/kit/cursor_in_footnote.rs:81-91 | src/bin/rhwp-q/kit/flow_images.rs:60-70 | src/bin/rhwp-q/kit/footnote_hit.rs:71-81 | src/bin/rhwp-q/kit/footnote_info.rs:67-77 | src/bin/rhwp-q/kit/hit_header.rs:71-81 | src/bin/rhwp-q/kit/overlay_images.rs:64-74 — before extracting anything, compare `src/bin/rhwp-q/kit/cursor_in_footnote.rs` and `src/bin/rhwp-q/kit/flow_images.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 63 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 `src/bin/rhwp-q/kit/cursor_in_footnote.rs:81` 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, `src/bin/rhwp-q/kit/cursor_in_footnote.rs:94` calls `require` and `src/bin/rhwp-q/kit/footnote_hit.rs:84` 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 lines × 6) src/cli/commands/edit/document_text.rs:344— src/cli/commands/edit/document_text.rs:344-354 | src/cli/commands/edit/document_text.rs:480-490 | src/cli/commands/edit/document_text.rs:1031-1041 | src/cli/commands/edit/notes.rs:15-25 | src/cli/commands/edit/notes.rs:110-120 | src/cli/commands/edit/shapes.rs:21-31 — before extracting anything, compare `src/cli/commands/edit/document_text.rs` and `src/cli/commands/edit/notes.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 250 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 `src/cli/commands/edit/document_text.rs:344` 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, `src/cli/commands/edit/shapes.rs:18` calls `to_string` and `src/cli/commands/edit/document_text.rs:343` 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 lines × 6) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:441— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:441-451 | src/diagnostics/hwp5_cell_header_probe.rs:705-715 | src/diagnostics/hwp5_contract_probe.rs:613-623 | src/diagnostics/hwp5_first_para_control_probe.rs:1305-1315 | src/diagnostics/hwp5_mel_personnel_probe.rs:619-629 | src/diagnostics/hwp5_table_probe.rs:364-374 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 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. 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 (11 lines × 6) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:464— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:464-474 | src/diagnostics/hwp5_cell_header_probe.rs:736-746 | src/diagnostics/hwp5_contract_probe.rs:654-664 | src/diagnostics/hwp5_first_para_control_probe.rs:1336-1346 | src/diagnostics/hwp5_mel_personnel_probe.rs:650-660 | src/diagnostics/hwp5_table_probe.rs:395-405 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 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. 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 (11 lines × 6) src/diagnostics/hwp5_cell_header_probe.rs:178— src/diagnostics/hwp5_cell_header_probe.rs:178-188 | src/diagnostics/hwp5_contract_analyze.rs:103-113 | src/diagnostics/hwp5_contract_probe.rs:126-136 | src/diagnostics/hwp5_first_para_control_probe.rs:136-146 | src/diagnostics/hwp5_mel_personnel_probe.rs:124-134 | src/diagnostics/hwp5_table_probe.rs:130-140 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_contract_analyze.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/diagnostics/hwp5_cell_header_probe.rs:178` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 6) src/wmf/parser/objects/graphics/font.rs:121— src/wmf/parser/objects/graphics/font.rs:121-131 | src/wmf/parser/objects/structure/bitmap16.rs:77-87 | src/wmf/parser/records/drawing/arc.rs:69-79 | src/wmf/parser/records/drawing/chord.rs:72-82 | src/wmf/parser/records/drawing/pie.rs:71-81 | src/wmf/parser/records/drawing/round_rect.rs:59-69 — before extracting anything, compare `src/wmf/parser/records/drawing/arc.rs` and `src/wmf/parser/records/drawing/chord.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 112 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 `src/wmf/parser/objects/graphics/font.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 (10 lines × 5) src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:231— src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:231-240 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:176-185 | src/bin/rhwp-q/commands/rhwp-q-page-items.rs:257-266 | src/bin/rhwp-q/commands/rhwp-q-scan-items.rs:205-214 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:152-161 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-font-trace.rs` and `src/bin/rhwp-q/commands/rhwp-q-page-caret.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 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 `src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:231` 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 × 5) src/bin/rhwp-q/kit/caret_stops.rs:39— src/bin/rhwp-q/kit/caret_stops.rs:39-48 | src/bin/rhwp-q/kit/covering_pages.rs:36-45 | src/bin/rhwp-q/kit/line_starts.rs:40-49 | src/bin/rhwp-q/kit/para_bounds.rs:40-49 | src/bin/rhwp-q/kit/word_starts.rs:39-48 — before extracting anything, compare `src/bin/rhwp-q/kit/caret_stops.rs` and `src/bin/rhwp-q/kit/covering_pages.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `src/bin/rhwp-q/kit/caret_stops.rs:39` 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 × 5) src/bin/rhwp-q/kit/cell_shape.rs:46— src/bin/rhwp-q/kit/cell_shape.rs:46-55 | src/bin/rhwp-q/kit/field_by_id.rs:13-22 | src/bin/rhwp-q/kit/flow_images.rs:49-58 | src/bin/rhwp-q/kit/footnote_footholds.rs:37-46 | src/bin/rhwp-q/kit/overlay_images.rs:53-62 — before extracting anything, compare `src/bin/rhwp-q/kit/cell_shape.rs` and `src/bin/rhwp-q/kit/flow_images.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 47 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 `src/bin/rhwp-q/kit/cell_shape.rs:46` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 5) src/bin/rhwp-q/kit/fn_selection_rects.rs:21— src/bin/rhwp-q/kit/fn_selection_rects.rs:21-30 | src/bin/rhwp-q/kit/form_at.rs:18-27 | src/bin/rhwp-q/kit/hit_fn_marker.rs:19-28 | src/bin/rhwp-q/kit/hit_in_footnote.rs:19-28 | src/bin/rhwp-q/kit/page_text.rs:15-24 — before extracting anything, compare `src/bin/rhwp-q/kit/fn_selection_rects.rs` and `src/bin/rhwp-q/kit/form_at.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/kit/fn_selection_rects.rs:21` 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 × 5) src/renderer/layout/table_layout.rs:12212— src/renderer/layout/table_layout.rs:12212-12221 | src/renderer/layout/table_layout.rs:12267-12276 | src/renderer/layout/table_layout.rs:28652-28661 | src/renderer/layout/table_layout.rs:28703-28712 | src/renderer/layout/table_layout.rs:28748-28757 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 5) src/document_core/queries/table_extract.rs:224— src/document_core/queries/table_extract.rs:224-233 | src/document_core/queries/table_extract.rs:237-246 | src/document_core/queries/table_extract.rs:249-258 | src/document_core/queries/table_extract.rs:261-270 | src/document_core/queries/table_extract.rs:273-282 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/queries/table_extract.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 (7–9 lines × 2) src/document_core/commands/clipboard.rs:505— src/document_core/commands/clipboard.rs:505-513 | src/document_core/commands/text_editing.rs:3785-3791 — before extracting anything, compare `src/document_core/commands/clipboard.rs` and `src/document_core/commands/text_editing.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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, `src/document_core/commands/clipboard.rs:503` calls `Ok`, `store_clipboard` and `src/document_core/commands/text_editing.rs:3783` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–9 lines × 2) src/document_core/commands/object_ops/table.rs:641— src/document_core/commands/object_ops/table.rs:641-647 | src/scaffold/builder.rs:425-433 — before extracting anything, compare `src/document_core/commands/object_ops/table.rs` and `src/scaffold/builder.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/object_ops/table.rs:641` 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, `src/document_core/commands/object_ops/table.rs:640` calls `copy_from_slice`, `to_le_bytes` and `src/scaffold/builder.rs:424` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–9 lines × 2) src/document_core/commands/object_ops/table.rs:1346— src/document_core/commands/object_ops/table.rs:1346-1352 | src/document_core/html_table_import.rs:675-683 — 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 `src/document_core/commands/object_ops/table.rs:1346` 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–9 lines × 2) src/document_core/commands/text_editing.rs:436— src/document_core/commands/text_editing.rs:436-444 | src/renderer/typeset.rs:596-602 — 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–9 lines × 2) src/renderer/layout/table_layout.rs:8989— src/renderer/layout/table_layout.rs:8989-8995 | src/renderer/layout/table_partial.rs:4193-4201 — before extracting anything, compare `src/renderer/layout/table_layout.rs` and `src/renderer/layout/table_partial.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 327 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 `src/renderer/layout/table_layout.rs:8989` 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 (7–9 lines × 2) scripts/oracle_stage5_queue_projection.py:73— scripts/oracle_stage5_queue_projection.py:73-81 | scripts/oracle_stage5_rank16_disposition.py:69-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/oracle_stage5_queue_projection.py:73` 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.
Low contrast colour pair in CSS (3.1:1) mydocs/pr/assets/pr7152_negative_report.html:30— `.badge.pass` sets color: white on background-color: #28a745 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.1:1) mydocs/pr/assets/pr7152_responsive_report.html:10— `.header` sets color: white on background-color: #28a745 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.1:1) mydocs/pr/assets/pr7152_responsive_report.html:30— `.badge.pass` sets color: white on background-color: #28a745 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.1:1) mydocs/pr/assets/task2809/issue-2809-split-alignment-report.html:10— `.header` sets color: white on background-color: #28a745 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.1:1) mydocs/pr/assets/task2809/issue-2809-split-alignment-report.html:30— `.badge.pass` sets color: white on background-color: #28a745 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
HeightMeasurer::measure_table_impl_with_storage (cognitive 731) src/renderer/height_measurer.rs:3765— HeightMeasurer::measure_table_impl_with_storage has cognitive complexity 731 (threshold 15). Drivers by points: if/else 223 (537 pts), boolean chains 117, loops 26 (52 pts), match/switch 9 (25 pts) (nesting depth added 356). 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.
HeightMeasurer::measure_paragraph_with_storage (cognitive 71) src/renderer/height_measurer.rs:2294— HeightMeasurer::measure_paragraph_with_storage has cognitive complexity 71 (threshold 15). Drivers by points: if/else 33 (60 pts), boolean chains 7, match/switch 2 (4 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HeightMeasurer::cell_nested_controls_bottom_with_storage (cognitive 36) src/renderer/height_measurer.rs:3488— HeightMeasurer::cell_nested_controls_bottom_with_storage has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 5, match/switch 1 (2 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.
HeightMeasurer::measure_section_selective_with_storage (cognitive 36) src/renderer/height_measurer.rs:6311— HeightMeasurer::measure_section_selective_with_storage has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (28 pts), loops 3 (7 pts), match/switch 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
HeightMeasurer::estimate_footnote_area_height (cognitive 16) src/renderer/height_measurer.rs:6965— HeightMeasurer::estimate_footnote_area_height has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkiaLayerRenderer::render_node (cognitive 410) src/renderer/skia/renderer.rs:1171— SkiaLayerRenderer::render_node has cognitive complexity 410 (threshold 15). Drivers by points: if/else 103 (307 pts), match/switch 13 (46 pts), loops 13 (38 pts), boolean chains 19 (nesting depth added 262). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkiaLayerRenderer::draw_form_control (cognitive 24) src/renderer/skia/renderer.rs:2503— SkiaLayerRenderer::draw_form_control has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkiaLayerRenderer::prepare_text_shadow_fonts (cognitive 24) src/renderer/skia/text_shadow_fonts.rs:8— SkiaLayerRenderer::prepare_text_shadow_fonts has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 2 (3 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.
SkiaLayerRenderer::render_tiled_region_with_provider_cancellable (cognitive 19) src/renderer/skia/tiled_region.rs:181— SkiaLayerRenderer::render_tiled_region_with_provider_cancellable has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (7 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkiaLayerRenderer::render_pixels_in_window (cognitive 18) src/renderer/skia/renderer.rs:847— SkiaLayerRenderer::render_pixels_in_window has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, loops 1 (2 pts), match/switch 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.
Ledger::reconcile (cognitive 72) src/parser/pdf/table_inference.rs:477— Ledger::reconcile has cognitive complexity 72 (threshold 15). Drivers by points: if/else 16 (43 pts), loops 11 (22 pts), boolean chains 7 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Ledger::shared_edges (cognitive 54) src/parser/pdf/table_inference.rs:656— Ledger::shared_edges has cognitive complexity 54 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 8 (22 pts), boolean chains 1 (nesting depth added 34). Of this number, 52 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.
Ledger::observe (cognitive 40) src/parser/pdf/table_inference.rs:144— Ledger::observe has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 8 (12 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.
Ledger::candidate (cognitive 35) src/parser/pdf/table_inference.rs:336— Ledger::candidate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 9, loops 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Ledger::compositions (cognitive 17) src/parser/pdf/table_inference.rs:786— Ledger::compositions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change-coupling hub: state.rs → float_placement.rs, tests.rs, tests.rs src/renderer/pagination/state.rs— `src/renderer/pagination/state.rs` changes together with 3 other files — `src/renderer/float_placement.rs`, `src/renderer/layout/tests.rs`, `src/renderer/pagination/tests.rs` — 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.
Change-coupling hub: page_number.rs → tests.rs, state.rs, tests.rs, typeset.rs src/renderer/page_number.rs— `src/renderer/page_number.rs` changes together with 4 other files — `src/renderer/layout/tests.rs`, `src/renderer/pagination/state.rs`, `src/renderer/pagination/tests.rs`, `src/renderer/typeset.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 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 4.
Change-coupling hub: layout.rs → page_number.rs, engine.rs, state.rs, controls.rs, vpos.rs src/renderer/layout.rs— `src/renderer/layout.rs` changes together with 5 other files — `src/renderer/page_number.rs`, `src/renderer/pagination/engine.rs`, `src/renderer/pagination/state.rs`, `src/renderer/typeset/section/controls.rs`, `src/renderer/typeset/section/vpos.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 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 5.
Change-coupling hub: canvaskit-renderer.ts → canvaskit_policy.rs, box_types.rs, canvas_render.rs, svg_render.rs, equation_conv.rs rhwp-studio/src/view/canvaskit-renderer.ts— `rhwp-studio/src/view/canvaskit-renderer.ts` changes together with 5 other files — `src/renderer/canvaskit_policy.rs`, `src/renderer/equation/box_types.rs`, `src/renderer/equation/canvas_render.rs`, `src/renderer/equation/svg_render.rs`, `src/renderer/skia/equation_conv.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 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 5.
Change-coupling hub: types.ts → box_types.rs, canvas_render.rs, svg_render.rs rhwp-studio/src/core/types.ts— `rhwp-studio/src/core/types.ts` changes together with 3 other files — `src/renderer/equation/box_types.rs`, `src/renderer/equation/canvas_render.rs`, `src/renderer/equation/svg_render.rs` — 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.
D4 · Code Duplication· Edited copy of a member (45 corresponding lines) · ×5
Edited copy of a member (45 corresponding lines) src/model/border_paint.rs:645— src/model/border_paint.rs:645-702 | src/model/border_paint.rs:708-752 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (45 corresponding lines) src/document_core/commands/formatting.rs:1051— src/document_core/commands/formatting.rs:1051-1095 | src/document_core/commands/formatting.rs:1098-1157 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (45 corresponding lines) src/cli/commands/caption_validation.rs:85— src/cli/commands/caption_validation.rs:85-133 | src/document_core/commands/object_ops/picture.rs:63-107 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (45 corresponding lines) src/document_core/queries/doc_tree_nav.rs:798— src/document_core/queries/doc_tree_nav.rs:798-842 | src/document_core/queries/doc_tree_nav.rs:852-898 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (45 corresponding lines) tools/inspect_msec/gen_msec_fixtures.py:1377— tools/inspect_msec/gen_msec_fixtures.py:1377-1421 | tools/inspect_msec/gen_msec_fixtures.py:1492-1536 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (47 corresponding lines) · ×5
Edited copy of a member (47 corresponding lines) src/document_core/commands/object_ops/equation.rs:153— src/document_core/commands/object_ops/equation.rs:153-200 | src/document_core/commands/object_ops/equation.rs:209-255 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (47 corresponding lines) src/renderer/native_pua_fonts.rs:358— src/renderer/native_pua_fonts.rs:358-404 | src/renderer/native_pua_fonts.rs:445-502 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (47 corresponding lines) src/document_core/commands/document.rs:2038— src/document_core/commands/document.rs:2038-2084 | src/document_core/commands/document.rs:3411-3457 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (47 corresponding lines) tools/fidelity_compare/fidelity_compare.py:3026— tools/fidelity_compare/fidelity_compare.py:3026-3072 | tools/fidelity_compare/fidelity_compare.py:3081-3130 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (47 corresponding lines) tools/llm_verifier/process_steps/generate_corpus.py:296— tools/llm_verifier/process_steps/generate_corpus.py:296-343 | tools/llm_verifier/verdict_protocol/generate_corpus.py:219-265 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×5
Edited copies of one member (3 members, 13+ corresponding lines) src/wasm_api/print_image_sampling.rs:91— src/wasm_api/print_image_sampling.rs:91-103 | src/wasm_api/print_image_sampling.rs:106-121 | src/wasm_api/print_image_sampling.rs:125-137 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) src/wasm_api.rs:5894— src/wasm_api.rs:5894-5906 | src/wasm_api.rs:6001-6016 | src/wasm_api.rs:8826-8839 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) src/renderer/canvas.rs:332— src/renderer/canvas.rs:332-344 | src/renderer/svg.rs:1486-1498 | src/renderer/web_canvas.rs:1809-1822 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) src/renderer/equation/font_frame_metrics.rs:101— src/renderer/equation/font_frame_metrics.rs:101-116 | src/renderer/equation/font_frame_metrics.rs:119-133 | src/renderer/equation/font_frame_metrics.rs:136-148 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) bindings/Native/src/gpu_gl.rs:85— bindings/Native/src/gpu_gl.rs:85-115 | bindings/Native/src/gpu_gl.rs:130-142 | bindings/Native/src/gpu_gl.rs:161-193 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (31 lines × 2) src/bin/rhwp-q/kit/hf_edit_target.rs:17— src/bin/rhwp-q/kit/hf_edit_target.rs:17-47 | src/bin/rhwp-q/kit/hit_in_hf.rs:19-49 — before extracting anything, compare `src/bin/rhwp-q/kit/hf_edit_target.rs` and `src/bin/rhwp-q/kit/hit_in_hf.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 102 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 `src/bin/rhwp-q/kit/hf_edit_target.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.
Duplicated block (31 lines × 2) src/document_core/commands/text_editing.rs:2317— src/document_core/commands/text_editing.rs:2317-2347 | src/document_core/commands/text_editing.rs:2686-2716 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:2317` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31 lines × 2) src/parser/pdf/lowering.rs:365— src/parser/pdf/lowering.rs:365-395 | tools/pdf-ir-poc/src/lowering.rs:193-223 — before extracting anything, compare `src/parser/pdf/lowering.rs` and `tools/pdf-ir-poc/src/lowering.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/lowering.rs:365` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (31 lines × 2) src/renderer/layout/paragraph_layout.rs:4577— src/renderer/layout/paragraph_layout.rs:4577-4607 | src/renderer/layout/paragraph_layout.rs:4640-4670 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31 lines × 2) src/renderer/layout/table_partial.rs:2599— src/renderer/layout/table_partial.rs:2599-2629 | src/renderer/layout/table_partial.rs:5740-5770 — both copies are in the same file, so extract the 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 (29 lines × 2) src/cli/outputs/kitty.rs:94— src/cli/outputs/kitty.rs:94-122 | src/cli/outputs/sixel.rs:94-122 — before extracting anything, compare `src/cli/outputs/kitty.rs` and `src/cli/outputs/sixel.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 128 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 `src/cli/outputs/kitty.rs:94` 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 (29 lines × 2) src/document_core/commands/document.rs:459— src/document_core/commands/document.rs:459-487 | src/document_core/mod.rs:614-642 — 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 (29 lines × 2) src/renderer/layout/table_partial.rs:2089— src/renderer/layout/table_partial.rs:2089-2117 | src/renderer/layout/table_partial.rs:2440-2468 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_partial.rs:2089` 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 (29 lines × 2) src/renderer/skia/equation_conv.rs:497— src/renderer/skia/equation_conv.rs:497-525 | src/renderer/skia/equation_conv.rs:529-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 `src/renderer/skia/equation_conv.rs:497` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 2) tools/llm_verifier/repeat_eval/src/row.rs:93— tools/llm_verifier/repeat_eval/src/row.rs:93-121 | tools/llm_verifier/tool_version_gate/src/row.rs:109-137 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 lines × 3) src/main.rs:1099— src/main.rs:1099-1119 | src/main.rs:1178-1198 | src/main.rs:1252-1272 — 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 `src/main.rs:1099` 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 × 3) src/renderer/web_canvas/cubic_reduction.rs:52— src/renderer/web_canvas/cubic_reduction.rs:52-72 | src/renderer/web_canvas/metafile_print.rs:57-77 | src/renderer/web_canvas/print_image_sampling.rs:105-125 — before extracting anything, compare `src/renderer/web_canvas/cubic_reduction.rs` and `src/renderer/web_canvas/metafile_print.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 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 `src/renderer/web_canvas/cubic_reduction.rs:52` 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 × 3) src/wmf/parser/objects/structure/bitmap_info_header/info.rs:140— src/wmf/parser/objects/structure/bitmap_info_header/info.rs:140-160 | src/wmf/parser/objects/structure/log_color_space.rs:105-125 | src/wmf/parser/objects/structure/log_color_space_w.rs:106-126 — before extracting anything, compare `src/wmf/parser/objects/structure/log_color_space.rs` and `src/wmf/parser/objects/structure/log_color_space_w.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 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 `src/wmf/parser/objects/structure/bitmap_info_header/info.rs:140` 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 × 3) src/bin/rhwp-agent/envelope.rs:198— src/bin/rhwp-agent/envelope.rs:198-218 | src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:44-64 | src/bin/rhwp-q/commands/rhwp-q-objects.rs:44-64 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs` and `src/bin/rhwp-q/commands/rhwp-q-objects.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 114 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 `src/bin/rhwp-agent/envelope.rs:198` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 3) tools/oracle_public/coverage_report.py:164— tools/oracle_public/coverage_report.py:164-184 | tools/oracle_public/oracle_resolver.py:156-176 | tools/oracle_public/sweep_runner.py:340-360 — before extracting anything, compare `tools/oracle_public/coverage_report.py` and `tools/oracle_public/oracle_resolver.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 187 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 3) src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:49— src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:49-66 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:49-66 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:49-66 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs` and `src/bin/rhwp-q/commands/rhwp-q-page-caret.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 101 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 `src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:49` 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 (18 lines × 3) src/cli/commands/edit/cells.rs:428— src/cli/commands/edit/cells.rs:428-445 | src/cli/commands/edit/media.rs:432-449 | src/cli/commands/tabular_import.rs:401-418 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/media.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 266 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 `src/cli/commands/edit/cells.rs:428` 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 × 3) src/cli/outputs/pdf.rs:78— src/cli/outputs/pdf.rs:78-95 | src/cli/outputs/text.rs:442-459 | src/cli/outputs/vector.rs:76-93 — before extracting anything, compare `src/cli/outputs/pdf.rs` and `src/cli/outputs/vector.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 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 `src/cli/outputs/pdf.rs:78` 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 × 3) src/wmf/converter/svg/mod.rs:186— src/wmf/converter/svg/mod.rs:186-203 | src/wmf/converter/svg/mod.rs:264-281 | src/wmf/converter/svg/mod.rs:473-490 — 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 `src/wmf/converter/svg/mod.rs:186` 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 × 3) src/wmf/parser/records/bitmap/dib_stretch_blt.rs:139— src/wmf/parser/records/bitmap/dib_stretch_blt.rs:139-156 | src/wmf/parser/records/bitmap/stretch_blt.rs:136-153 | src/wmf/parser/records/drawing/pat_blt.rs:52-69 — before extracting anything, compare `src/wmf/parser/records/bitmap/dib_stretch_blt.rs` and `src/wmf/parser/records/bitmap/stretch_blt.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 89 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 `src/wmf/parser/records/bitmap/dib_stretch_blt.rs:139` 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–16 lines × 2) src/document_core/queries/grep.rs:382— src/document_core/queries/grep.rs:382-397 | src/document_core/queries/grep.rs:561-574 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/queries/grep.rs:382` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/document_core/queries/grep.rs:398` calls `Some`, `clone` and `src/document_core/queries/grep.rs:575` 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 (14–16 lines × 2) src/model/control.rs:566— src/model/control.rs:566-579 | src/parser/hwpx/section.rs:6194-6209 — before extracting anything, compare `src/model/control.rs` and `src/parser/hwpx/section.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/model/control.rs:566` 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–16 lines × 2) src/renderer/layout/table_layout.rs:9192— src/renderer/layout/table_layout.rs:9192-9207 | src/renderer/layout/table_layout.rs:10333-10346 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:9192` 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–16 lines × 2) gym/tools/differential.py:211— gym/tools/differential.py:211-224 | gym/tools/trajectory.py:352-367 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `gym/tools/differential.py:210` calls `isinstance` and `gym/tools/trajectory.py:351` 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 (14–16 lines × 2) tools/llm_verifier/lineage_chain/cli.py:22— tools/llm_verifier/lineage_chain/cli.py:22-37 | tools/llm_verifier/third_party_replay/cli.py:22-35 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9–11 lines × 2) src/document_core/commands/formatting.rs:1497— src/document_core/commands/formatting.rs:1497-1507 | src/document_core/commands/formatting.rs:1579-1587 — both copies are in the same file, so extract the 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–11 lines × 2) src/renderer/float_placement/stored_column_spacing.rs:70— src/renderer/float_placement/stored_column_spacing.rs:70-78 | src/renderer/layout/table_layout.rs:2734-2744 — 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–11 lines × 2) src/renderer/layout.rs:756— src/renderer/layout.rs:756-764 | src/renderer/layout/paragraph_layout.rs:3686-3696 — 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 `src/renderer/layout.rs:756` 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–11 lines × 2) src/renderer/skia/image_conv.rs:999— src/renderer/skia/image_conv.rs:999-1009 | src/renderer/skia/image_conv.rs:1133-1141 — both copies are in the same file, so extract the 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 `src/renderer/skia/image_conv.rs:999` 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–11 lines × 2) src/wasm_api.rs:238— src/wasm_api.rs:238-246 | src/wasm_api.rs:1210-1220 — both copies are in the same file, so extract the 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 `src/wasm_api.rs:238` 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–10 lines × 3) src/cli/commands/edit/document_text.rs:15— src/cli/commands/edit/document_text.rs:15-24 | src/cli/commands/edit/document_text.rs:340-348 | src/cli/commands/edit/document_text.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.
Duplicated block (9–10 lines × 3) src/diagnostics/hwp5_cell_header_probe.rs:894— src/diagnostics/hwp5_cell_header_probe.rs:894-903 | src/diagnostics/hwp5_mel_personnel_probe.rs:808-817 | src/diagnostics/hwp5_table_probe.rs:657-665 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_mel_personnel_probe.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 503 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 `src/diagnostics/hwp5_cell_header_probe.rs:894` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 3) src/document_core/commands/document.rs:957— src/document_core/commands/document.rs:957-965 | src/document_core/commands/document.rs:2133-2141 | src/renderer/composer/reflow_helpers.inc.rs:83-92 — 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 `src/document_core/commands/document.rs:957` 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–10 lines × 3) src/paint/paper_viewport.rs:107— src/paint/paper_viewport.rs:107-116 | src/paint/paper_viewport.rs:173-181 | src/paint/paper_viewport.rs:445-453 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 3) src/parser/pdf/table_detection.rs:1033— src/parser/pdf/table_detection.rs:1033-1041 | src/parser/pdf/table_hierarchy.rs:152-161 | tools/pdf-ir-poc/src/table_hierarchy.rs:134-142 — before extracting anything, compare `src/parser/pdf/table_hierarchy.rs` and `tools/pdf-ir-poc/src/table_hierarchy.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/table_detection.rs:1033` 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 (8–10 lines × 2) src/parser/pdf/structured_lowering.rs:817— src/parser/pdf/structured_lowering.rs:817-824 | src/parser/pdf/structured_lowering.rs:859-868 — both copies are in the same file, so extract the 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 `src/parser/pdf/structured_lowering.rs:817` 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–10 lines × 2) src/renderer/float_placement.rs:5140— src/renderer/float_placement.rs:5140-5149 | src/renderer/float_placement.rs:5786-5793 — both copies are in the same file, so extract the 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 `src/renderer/float_placement.rs:5140` 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 (8–10 lines × 2) src/renderer/height_cursor.rs:714— src/renderer/height_cursor.rs:714-723 | src/renderer/layout/paragraph_layout.rs:4854-4861 — 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 `src/renderer/layout/paragraph_layout.rs:4854` 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–10 lines × 2) src/renderer/layout/table_layout.rs:5777— src/renderer/layout/table_layout.rs:5777-5784 | src/renderer/layout/table_layout.rs:5912-5921 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:5777` 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 (8–10 lines × 2) tools/test-data-gen/hwp_test_data_generator.py:341— tools/test-data-gen/hwp_test_data_generator.py:341-350 | tools/test-data-gen/hwp_test_data_generator.py:356-363 — both copies are in the same file, so extract the 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 `tools/test-data-gen/hwp_test_data_generator.py:341` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `tools/test-data-gen/hwp_test_data_generator.py:364` calls `GenerationError`, `get` and `tools/test-data-gen/hwp_test_data_generator.py:350` 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.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×4
Animation without a prefers-reduced-motion guard mydocs/pr/assets/pr7152_negative_report.html:38— `.screenshot img` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard mydocs/pr/assets/pr7152_responsive_report.html:38— `.screenshot img` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard mydocs/pr/assets/task2809/issue-2809-split-alignment-report.html:38— `.screenshot img` moves (`transition: transform 0.2s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard rhwp-safari/src/options.html:108— `.toggle .slider::before` moves (`transition: transform 0.25s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Ledger::reconcile (cyclomatic 34) src/parser/pdf/table_inference.rs:477— Ledger::reconcile has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Ledger::observe (cyclomatic 23) src/parser/pdf/table_inference.rs:144— Ledger::observe 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.
Ledger::candidate (cyclomatic 23) src/parser/pdf/table_inference.rs:336— Ledger::candidate 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.
Ledger::shared_edges (cyclomatic 19) src/parser/pdf/table_inference.rs:656— Ledger::shared_edges has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
isPrivateIPv4 (cyclomatic 17) rhwp-safari/src/background.js:20— isPrivateIPv4 has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
isPrivateIPv4 (cyclomatic 17) rhwp-shared/security/url-validator.js:44— isPrivateIPv4 has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
isPrivateIPv4 (cyclomatic 17) rhwp-chrome/sw/fetch-security.js:143— isPrivateIPv4 has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
isPrivateIPv4 (cyclomatic 17) rhwp-firefox/sw/fetch-security.js:143— isPrivateIPv4 has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RenderNormalizationOverlay::register_rendered_text_partitions_with_storage (cognitive 46) src/renderer/render_normalization.rs:431— RenderNormalizationOverlay::register_rendered_text_partitions_with_storage has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (33 pts), boolean chains 7, loops 3 (6 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenderNormalizationOverlay::collect_nested_tables_with_storage (cognitive 28) src/renderer/render_normalization.rs:257— RenderNormalizationOverlay::collect_nested_tables_with_storage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenderNormalizationOverlay::from_document_reusing_with_storage (cognitive 21) src/renderer/render_normalization.rs:120— RenderNormalizationOverlay::from_document_reusing_with_storage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenderNormalizationOverlay::register_rebased_source_frames_with_storage (cognitive 16) src/renderer/render_normalization.rs:572— RenderNormalizationOverlay::register_rebased_source_frames_with_storage has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 3 (6 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.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×4
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (10 members, 50+ identical tokens) mydocs/tech/investigations/issue-1061/probes/dump_eqedit_raw.rs:4— mydocs/tech/investigations/issue-1061/probes/dump_eqedit_raw.rs:4-61 | mydocs/tech/investigations/issue-1061/probes/dump_equation_records.rs:82-165 | mydocs/tech/investigations/issue-1064/probes/dump_table_ctrl_data.rs:111-169 | mydocs/tech/investigations/issue-1064/probes/repro_1064_save.rs:6-63 | src/diagnostics/hwp5_borderfill_diagonal_probe.rs:476-507 | src/diagnostics/hwp5_cell_header_probe.rs:748-779 | src/diagnostics/hwp5_contract_probe.rs:666-697 | src/diagnostics/hwp5_first_para_control_probe.rs:1348-1379 | src/diagnostics/hwp5_mel_personnel_probe.rs:662-693 | src/diagnostics/hwp5_table_probe.rs:513-544 — These 10 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 10 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 10 times.
Members sharing a duplicated core (10 members, 50+ identical tokens) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:36— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:36-50 | src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:33-47 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:36-50 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:36-50 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:34-48 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:33-47 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:33-47 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:35-49 | src/bin/rhwp-q/commands/rhwp-q-text-file.rs:36-50 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:34-48 — These 10 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 10 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 10 times.
Members sharing a duplicated core (10 members, 50+ identical tokens) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:207— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:207-228 | src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:140-161 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:181-203 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:185-206 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:141-163 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:147-180 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:140-178 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:190-211 | src/bin/rhwp-q/commands/rhwp-q-text-file.rs:122-154 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:141-162 — These 10 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 10 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 10 times.
Members sharing a duplicated core (10 members, 50+ identical tokens) src/wmf/parser/records/drawing/line_to.rs:36— src/wmf/parser/records/drawing/line_to.rs:36-56 | src/wmf/parser/records/drawing/text_out.rs:55-107 | src/wmf/parser/records/state/move_to.rs:35-55 | src/wmf/parser/records/state/offset_clip_rgn.rs:35-55 | src/wmf/parser/records/state/offset_viewport_org.rs:35-55 | src/wmf/parser/records/state/offset_window_org.rs:35-55 | src/wmf/parser/records/state/set_viewport_ext.rs:35-55 | src/wmf/parser/records/state/set_viewport_org.rs:35-55 | src/wmf/parser/records/state/set_window_ext.rs:35-55 | src/wmf/parser/records/state/set_window_org.rs:35-55 — These 10 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 10 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 10 times.
D4 · Code Duplication· Edited copy of a member (64 corresponding lines) · ×4
Edited copy of a member (64 corresponding lines) src/document_core/commands/text_editing.rs:4475— src/document_core/commands/text_editing.rs:4475-4540 | src/document_core/commands/text_editing.rs:4661-4724 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (64 corresponding lines) src/parser/hwp3/mod.rs:317— src/parser/hwp3/mod.rs:317-380 | src/parser/hwpx/section.rs:2729-2800 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (64 corresponding lines) src/document_core/commands/formatting.rs:1361— src/document_core/commands/formatting.rs:1361-1441 | src/document_core/commands/formatting.rs:1457-1520 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (64 corresponding lines) scripts/font_kerning_cohort.py:228— scripts/font_kerning_cohort.py:228-304 | scripts/font_rank8_qualification.py:316-379 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×4
Edited copies of one member (3 members, 15+ corresponding lines) src/agent/dsel/suggest.rs:31— src/agent/dsel/suggest.rs:31-53 | src/bin/rhwp-agent/envelope.rs:297-311 | src/cli/metadata/capabilities/mod.rs:433-447 — 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) src/wasm_api.rs:2716— src/wasm_api.rs:2716-2730 | src/wasm_api.rs:2769-2784 | src/wasm_api.rs:5948-5964 — 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) src/parser/pdf/value_allocation.rs:265— src/parser/pdf/value_allocation.rs:265-281 | src/parser/pdf/value_allocation.rs:325-339 | src/parser/pdf/value_allocation.rs:389-404 — 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) samples/issue8149/gen_captioned_host.py:113— samples/issue8149/gen_captioned_host.py:113-133 | samples/issue8149/gen_headerrow.py:89-103 | samples/issue8149/gen_rowfit.py:84-98 — 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 copies of one member (3 members, 19+ corresponding lines) · ×4
Edited copies of one member (3 members, 19+ corresponding lines) src/bin/rhwp-agent/fields.rs:40— src/bin/rhwp-agent/fields.rs:40-58 | src/bin/rhwp-agent/inspect.rs:302-325 | src/bin/rhwp-agent/tables.rs:43-61 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) src/parser/hwp3/drawing.rs:349— src/parser/hwp3/drawing.rs:349-367 | src/parser/hwp3/drawing.rs:402-420 | src/parser/hwp3/drawing.rs:455-478 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) samples/issue8149/gen_captioned_host.py:44— samples/issue8149/gen_captioned_host.py:44-62 | samples/issue8149/gen_headerrow.py:38-61 | samples/issue8149/gen_rowfit.py:33-56 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) scripts/font_rank1_qualification.py:42— scripts/font_rank1_qualification.py:42-61 | scripts/font_rank7_qualification.py:55-74 | scripts/font_rank8_qualification.py:130-148 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (1 corresponding lines) · ×4
Edited copy of a member (1 corresponding lines) src/renderer/layout_frame.rs:396— src/renderer/layout_frame.rs:396-396 | src/renderer/pagination.rs:442-442 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) mydocs/pr/assets/issue_536_seo_rii_20261021/consumer_probe.rs:11— mydocs/pr/assets/issue_536_seo_rii_20261021/consumer_probe.rs:11-11 | mydocs/pr/assets/seo_rii_20261030/consumer_probe.rs:11-11 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) pdf/issue7998/generate_native_border_sources.py:5— pdf/issue7998/generate_native_border_sources.py:5-5 | pdf/issue7998/generate_periodic_border_sources.py:5-5 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (1 corresponding lines) tools/provenance_map/fatten_provenance_map.py:638— tools/provenance_map/fatten_provenance_map.py:638-638 | tools/work_receipt/fatten_work_receipt.py:817-817 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×4
Edited copies of one member (3 members, 4+ corresponding lines) src/emf/parser/mod.rs:479— src/emf/parser/mod.rs:479-482 | src/ole_chart/grid.rs:513-516 | src/paint/color_glyph.rs:437-440 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) gym/tools/build_baseline.py:711— gym/tools/build_baseline.py:711-714 | gym/tools/competitive_bench.py:532-535 | gym/tools/discriminate.py:178-182 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) tools/oracle_public/page_smoke.py:137— tools/oracle_public/page_smoke.py:137-140 | tools/oracle_public/sweep_runner.py:266-269 | tools/page_roundtrip/harness.py:193-196 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) tools/task2070/make_hy_ladder3.py:77— tools/task2070/make_hy_ladder3.py:77-80 | tools/task2070/make_hy_ladder4.py:103-106 | tools/task2169/make_linebreak_ladder.py:100-103 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (25–26 lines × 2) src/parser/hwpx/section.rs:757— src/parser/hwpx/section.rs:757-781 | src/parser/hwpx/section.rs:974-999 — both copies are in the same file, so extract the 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 `src/parser/hwpx/section.rs:757` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/parser/hwpx/section.rs:783` calls `Some` and `src/parser/hwpx/section.rs:1000` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (25–26 lines × 2) src/renderer/layout.rs:13447— src/renderer/layout.rs:13447-13471 | src/renderer/layout.rs:15477-15502 — both copies are in the same file, so extract the 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 `src/renderer/layout.rs:13447` 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 (25–26 lines × 2) src/renderer/layout/shape_layout.rs:2091— src/renderer/layout/shape_layout.rs:2091-2115 | src/renderer/layout/shape_layout.rs:2119-2144 — both copies are in the same file, so extract the 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 `src/renderer/layout/shape_layout.rs:2091` 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 (25–26 lines × 2) tools/inspect_msec/gen_msec_fixtures.py:1037— tools/inspect_msec/gen_msec_fixtures.py:1037-1061 | tools/inspect_msec/gen_msec_fixtures.py:1342-1367 — both copies are in the same file, so extract the 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 `tools/inspect_msec/gen_msec_fixtures.py:1037` 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 (25 lines × 2) src/cli/commands/tabular_import.rs:199— src/cli/commands/tabular_import.rs:199-223 | src/cli/commands/tabular_import.rs:548-572 — both copies are in the same file, so extract the 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 `src/cli/commands/tabular_import.rs:199` 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 (25 lines × 2) src/renderer/height_measurer.rs:2058— src/renderer/height_measurer.rs:2058-2082 | src/renderer/layout/table_layout.rs:3438-3462 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 300 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (25 lines × 2) gym/tools/differential.py:416— gym/tools/differential.py:416-440 | gym/tools/release_diff.py:467-491 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `gym/tools/release_diff.py:494` calls `observations_equal`, `_values_equal` and `gym/tools/differential.py:443` 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 (25 lines × 2) tools/layout_anomaly_batch_report.py:254— tools/layout_anomaly_batch_report.py:254-278 | tools/oracle_public/sweep_runner.py:557-581 — 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 (22–23 lines × 2) src/diagnostics/hwp5_roundtrip_batch.rs:309— src/diagnostics/hwp5_roundtrip_batch.rs:309-330 | src/diagnostics/hwpx_roundtrip_batch.rs:183-205 — before extracting anything, compare `src/diagnostics/hwp5_roundtrip_batch.rs` and `src/diagnostics/hwpx_roundtrip_batch.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 152 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 `src/diagnostics/hwp5_roundtrip_batch.rs:309` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22–23 lines × 2) src/document_core/commands/text_editing.rs:4518— src/document_core/commands/text_editing.rs:4518-4540 | src/document_core/commands/text_editing.rs:4703-4724 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:4518` 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 (22–23 lines × 2) src/renderer/shaping_paragraph.rs:1268— src/renderer/shaping_paragraph.rs:1268-1289 | src/renderer/shaping_paragraph.rs:1299-1321 — both copies are in the same file, so extract the 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 `src/renderer/shaping_paragraph.rs:1299` 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 (22–23 lines × 2) tools/fidelity_compare/fidelity_compare.py:930— tools/fidelity_compare/fidelity_compare.py:930-952 | tools/fidelity_compare/fidelity_compare.py:962-983 — both copies are in the same file, so extract the 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 `tools/fidelity_compare/fidelity_compare.py:930` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 5) src/bin/rhwp-agent/safety.rs:157— src/bin/rhwp-agent/safety.rs:157-177 | src/bin/rhwp-agent/safety.rs:254-274 | src/bin/rhwp-agent/safety.rs:400-420 | src/bin/rhwp-agent/safety.rs:559-579 | src/bin/rhwp-agent/structurecmd.rs:40-60 — before extracting anything, compare `src/bin/rhwp-agent/safety.rs` and `src/bin/rhwp-agent/structurecmd.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 83 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 `src/bin/rhwp-agent/safety.rs:157` 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 (21 lines × 5) src/cli/commands/edit/document_objects.rs:569— src/cli/commands/edit/document_objects.rs:569-589 | src/cli/commands/edit/note_content.rs:131-151 | src/cli/commands/edit/page.rs:13-33 | src/cli/commands/edit/page.rs:116-136 | src/cli/commands/edit/shapes.rs:282-302 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/note_content.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 278 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 `src/cli/commands/edit/document_objects.rs:569` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 5) src/wmf/converter/svg/mod.rs:230— src/wmf/converter/svg/mod.rs:230-250 | src/wmf/converter/svg/mod.rs:308-328 | src/wmf/converter/svg/mod.rs:425-445 | src/wmf/converter/svg/mod.rs:517-537 | src/wmf/converter/svg/mod.rs:589-609 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/wmf/converter/svg/mod.rs:230` 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 (21 lines × 5) src/diagnostics/hwp5_cell_header_probe.rs:821— src/diagnostics/hwp5_cell_header_probe.rs:821-841 | src/diagnostics/hwp5_contract_probe.rs:739-759 | src/diagnostics/hwp5_inventory_diff.rs:551-571 | src/diagnostics/hwp5_mel_personnel_probe.rs:735-755 | src/diagnostics/hwp5_table_probe.rs:590-610 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_contract_probe.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 370 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 `src/diagnostics/hwp5_cell_header_probe.rs:821` 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–20 lines × 2) src/cli/commands/generation.rs:70— src/cli/commands/generation.rs:70-89 | src/cli/commands/generation.rs:233-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/generation.rs:70` 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 (19–20 lines × 2) src/document_core/commands/text_editing.rs:2515— src/document_core/commands/text_editing.rs:2515-2534 | src/document_core/commands/text_editing.rs:2884-2902 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:2515` 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 (19–20 lines × 2) src/renderer/typeset/notes/endnotes/paragraph/new_note_fit.rs:154— src/renderer/typeset/notes/endnotes/paragraph/new_note_fit.rs:154-173 | src/renderer/typeset/notes/endnotes/paragraph/new_note_fit.rs:189-207 — both copies are in the same file, so extract the 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 `src/renderer/typeset/notes/endnotes/paragraph/new_note_fit.rs:154` 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) tools/oracle_public/page_smoke.py:323— tools/oracle_public/page_smoke.py:323-342 | tools/oracle_public/sweep_runner.py:736-754 — before extracting anything, compare `tools/oracle_public/page_smoke.py` and `tools/oracle_public/sweep_runner.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–19 lines × 2) src/cli/commands/edit/cells.rs:914— src/cli/commands/edit/cells.rs:914-932 | src/cli/commands/edit/tables/layout.rs:538-555 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/tables/layout.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 209 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/cells.rs:914` 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–19 lines × 2) src/document_core/commands/formatting.rs:1064— src/document_core/commands/formatting.rs:1064-1082 | src/document_core/commands/formatting.rs:1115-1132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) src/parser/pdf/lowering.rs:308— src/parser/pdf/lowering.rs:308-325 | tools/pdf-ir-poc/src/lowering.rs:135-153 — before extracting anything, compare `src/parser/pdf/lowering.rs` and `tools/pdf-ir-poc/src/lowering.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18–19 lines × 2) src/renderer/composer/line_breaking.rs:4626— src/renderer/composer/line_breaking.rs:4626-4643 | src/renderer/composer/line_breaking.rs:6225-6243 — both copies are in the same file, so extract the 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 `src/renderer/composer/line_breaking.rs:4626` 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–17 lines × 2) src/cli/commands/edit/fields.rs:251— src/cli/commands/edit/fields.rs:251-267 | src/mcp_serve.rs:2266-2280 — before extracting anything, compare `src/cli/commands/edit/fields.rs` and `src/mcp_serve.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15–17 lines × 2) src/cli/outputs/raster.rs:366— src/cli/outputs/raster.rs:366-380 | src/cli/outputs/vector.rs:388-404 — before extracting anything, compare `src/cli/outputs/raster.rs` and `src/cli/outputs/vector.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 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 (15–17 lines × 2) src/document_core/commands/clipboard.rs:2091— src/document_core/commands/clipboard.rs:2091-2107 | src/document_core/commands/clipboard.rs:2158-2172 — both copies are in the same file, so extract the 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 `src/document_core/commands/clipboard.rs:2091` 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–17 lines × 2) src/renderer/svg.rs:3585— src/renderer/svg.rs:3585-3599 | src/renderer/web_canvas.rs:2714-2730 — before extracting anything, compare `src/renderer/svg.rs` and `src/renderer/web_canvas.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 321 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 3) src/renderer/layout/table_partial.rs:1600— src/renderer/layout/table_partial.rs:1600-1615 | src/renderer/layout/table_partial.rs:1689-1704 | src/renderer/layout/table_partial.rs:6671-6686 — 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 (16 lines × 3) src/serializer/hwpx/section.rs:2541— src/serializer/hwpx/section.rs:2541-2556 | src/serializer/hwpx/section.rs:2675-2690 | src/serializer/hwpx/section.rs:2977-2992 — 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 `src/serializer/hwpx/section.rs:2541` 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 × 3) src/renderer/composer/reflow_helpers.inc.rs:594— src/renderer/composer/reflow_helpers.inc.rs:594-609 | src/renderer/composer/stored_cell_reflow.inc.rs:356-371 | src/renderer/typeset/controls.rs:494-509 — 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 `src/renderer/composer/reflow_helpers.inc.rs:594` 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 × 3) tools/llm_verifier/abstain/generate_corpus.py:508— tools/llm_verifier/abstain/generate_corpus.py:508-523 | tools/llm_verifier/lineage_chain/generate_corpus.py:603-618 | tools/llm_verifier/third_party_replay/generate_corpus.py:482-497 — `tools/llm_verifier/lineage_chain/generate_corpus.py` and `tools/llm_verifier/third_party_replay/generate_corpus.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 81 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13–16 lines × 2) src/document_core/queries/cursor_nav.rs:1607— src/document_core/queries/cursor_nav.rs:1607-1619 | src/document_core/queries/cursor_rect.rs:4513-4528 — 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 `src/document_core/queries/cursor_nav.rs:1607` 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–16 lines × 2) src/parser/control.rs:658— src/parser/control.rs:658-673 | src/parser/control.rs:688-700 — both copies are in the same file, so extract the 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 `src/parser/control.rs:658` 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–16 lines × 2) src/renderer/pagination/engine.rs:3197— src/renderer/pagination/engine.rs:3197-3212 | src/renderer/typeset/state/finalize.rs:155-167 — before extracting anything, compare `src/renderer/pagination/engine.rs` and `src/renderer/typeset/state/finalize.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13–16 lines × 2) tools/table_exchange/cases.py:1136— tools/table_exchange/cases.py:1136-1151 | tools/table_exchange/cases.py:1216-1228 — both copies are in the same file, so extract the 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 `tools/table_exchange/cases.py:1136` 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–15 lines × 3) src/cli/commands/conversion.rs:248— src/cli/commands/conversion.rs:248-262 | src/cli/outputs/vector.rs:346-360 | src/cli/outputs/vector.rs:640-652 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (13–15 lines × 3) src/renderer/height_measurer.rs:2410— src/renderer/height_measurer.rs:2410-2422 | src/renderer/mod.rs:1627-1641 | src/renderer/typeset/paragraph/format.rs:648-662 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/typeset/paragraph/format.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–15 lines × 3) src/renderer/html.rs:517— src/renderer/html.rs:517-529 | src/renderer/svg.rs:4258-4270 | src/renderer/web_canvas.rs:3393-3407 — before extracting anything, compare `src/renderer/html.rs` and `src/renderer/svg.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 76 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 `src/renderer/html.rs:517` 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–15 lines × 3) src/renderer/typeset.rs:3589— src/renderer/typeset.rs:3589-3601 | src/renderer/typeset/notes/endnotes/measure.rs:446-458 | src/renderer/typeset/notes/endnotes/measure.rs:679-693 — before extracting anything, compare `src/renderer/typeset.rs` and `src/renderer/typeset/notes/endnotes/measure.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/typeset/notes/endnotes/measure.rs:679` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/renderer/typeset.rs:3588` calls `available_height` and `src/renderer/typeset/notes/endnotes/measure.rs:445` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–15 lines × 2) src/renderer/layout/border_rendering.rs:1190— src/renderer/layout/border_rendering.rs:1190-1204 | src/renderer/layout/border_rendering.rs:1644-1656 — both copies are in the same file, so extract the 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 `src/renderer/layout/border_rendering.rs:1190` 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 (13–15 lines × 2) src/renderer/layout/border_rendering.rs:1210— src/renderer/layout/border_rendering.rs:1210-1224 | src/renderer/layout/border_rendering.rs:1662-1674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/layout/border_rendering.rs:1210` 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 (13–15 lines × 2) src/renderer/layout/border_rendering.rs:1230— src/renderer/layout/border_rendering.rs:1230-1244 | src/renderer/layout/border_rendering.rs:1680-1692 — both copies are in the same file, so extract the 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 `src/renderer/layout/border_rendering.rs:1230` 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 (13–15 lines × 2) src/renderer/layout/table_partial.rs:4782— src/renderer/layout/table_partial.rs:4782-4796 | src/renderer/layout/table_partial.rs:4798-4810 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_partial.rs:4782` 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 × 4) src/renderer/web_canvas/cubic_reduction.rs:29— src/renderer/web_canvas/cubic_reduction.rs:29-41 | src/renderer/web_canvas/cubic_reduction.rs:100-112 | src/renderer/web_canvas/metafile_print.rs:30-42 | src/renderer/web_canvas/print_image_sampling.rs:73-85 — before extracting anything, compare `src/renderer/web_canvas/cubic_reduction.rs` and `src/renderer/web_canvas/metafile_print.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 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 (13 lines × 4) src/renderer/web_canvas/cubic_reduction.rs:47— src/renderer/web_canvas/cubic_reduction.rs:47-59 | src/renderer/web_canvas/metafile_print.rs:52-64 | src/renderer/web_canvas/print_image_sampling.rs:100-112 | src/renderer/web_canvas/print_jpeg.rs:40-52 — before extracting anything, compare `src/renderer/web_canvas/cubic_reduction.rs` and `src/renderer/web_canvas/metafile_print.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 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, `src/renderer/web_canvas/metafile_print.rs:50` calls `Some` and `src/renderer/web_canvas/print_jpeg.rs:39` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 4) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:140— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:140-152 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:139-151 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:143-155 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:124-136 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 188 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 `src/bin/rhwp-q/commands/rhwp-q-char-shape.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 (13 lines × 4) tools/layout_anomaly_batch_report.py:259— tools/layout_anomaly_batch_report.py:259-271 | tools/oracle_public/page_smoke.py:148-160 | tools/oracle_public/sweep_runner.py:562-574 | tools/page_roundtrip/harness.py:204-216 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `tools/layout_anomaly_batch_report.py:259` 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 after the matched lines, `tools/layout_anomaly_batch_report.py:272` calls `Path` and `tools/oracle_public/page_smoke.py:161` 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 (12 lines × 5) src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:120— src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:120-131 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:60-71 | src/bin/rhwp-q/commands/rhwp-q-page-items.rs:108-119 | src/bin/rhwp-q/commands/rhwp-q-scan-items.rs:88-99 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:60-71 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-font-trace.rs` and `src/bin/rhwp-q/commands/rhwp-q-page-caret.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 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 `src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:120` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 5) src/bin/rhwp-q/kit/footnote_hit.rs:56— src/bin/rhwp-q/kit/footnote_hit.rs:56-67 | src/bin/rhwp-q/kit/form_at.rs:13-24 | src/bin/rhwp-q/kit/hit_fn_marker.rs:14-25 | src/bin/rhwp-q/kit/hit_header.rs:56-67 | src/bin/rhwp-q/kit/hit_in_footnote.rs:14-25 — before extracting anything, compare `src/bin/rhwp-q/kit/footnote_hit.rs` and `src/bin/rhwp-q/kit/hit_header.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 125 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 `src/bin/rhwp-q/kit/footnote_hit.rs:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 5) src/diagnostics/hwp5_cell_header_probe.rs:722— src/diagnostics/hwp5_cell_header_probe.rs:722-733 | src/diagnostics/hwp5_contract_probe.rs:640-651 | src/diagnostics/hwp5_first_para_control_probe.rs:1322-1333 | src/diagnostics/hwp5_mel_personnel_probe.rs:636-647 | src/diagnostics/hwp5_table_probe.rs:381-392 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_contract_probe.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 370 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. 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 × 5) src/document_core/commands/object_ops/common.rs:577— src/document_core/commands/object_ops/common.rs:577-588 | src/document_core/commands/object_ops/equation.rs:528-539 | src/document_core/commands/object_ops/table.rs:1115-1126 | src/document_core/commands/text_editing.rs:4478-4489 | src/document_core/commands/text_editing.rs:4664-4675 — before extracting anything, compare `src/document_core/commands/object_ops/common.rs` and `src/document_core/commands/object_ops/equation.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, 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–12 lines × 2) src/cli/commands/edit/cells.rs:340— src/cli/commands/edit/cells.rs:340-349 | src/mcp_serve.rs:2144-2155 — 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 `src/cli/commands/edit/cells.rs:340` 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–12 lines × 2) src/parser/hwpx/header.rs:1760— src/parser/hwpx/header.rs:1760-1771 | src/parser/hwpx/section.rs:4413-4422 — before extracting anything, compare `src/parser/hwpx/header.rs` and `src/parser/hwpx/section.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 162 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 `src/parser/hwpx/header.rs:1760` 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–12 lines × 2) src/renderer/web_canvas.rs:2836— src/renderer/web_canvas.rs:2836-2847 | src/renderer/web_canvas.rs:3700-3709 — both copies are in the same file, so extract the 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 `src/renderer/web_canvas.rs:2836` 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 (10–12 lines × 2) scripts/workflow_promotion_preflight.py:754— scripts/workflow_promotion_preflight.py:754-763 | scripts/workflow_promotion_preflight.py:764-775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 5) src/bin/rhwp-q/kit/caret_stops.rs:12— src/bin/rhwp-q/kit/caret_stops.rs:12-22 | src/bin/rhwp-q/kit/footnote_info.rs:54-64 | src/bin/rhwp-q/kit/line_starts.rs:13-23 | src/bin/rhwp-q/kit/para_bounds.rs:13-23 | src/bin/rhwp-q/kit/word_starts.rs:12-22 — before extracting anything, compare `src/bin/rhwp-q/kit/caret_stops.rs` and `src/bin/rhwp-q/kit/line_starts.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/kit/caret_stops.rs:12` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 5) src/cli/commands/edit/document_text.rs:234— src/cli/commands/edit/document_text.rs:234-244 | src/cli/commands/edit/document_text.rs:838-848 | src/cli/commands/edit/document_text.rs:934-944 | src/cli/commands/edit/formatting.rs:158-168 | src/cli/commands/edit/page.rs:353-363 — before extracting anything, compare `src/cli/commands/edit/document_text.rs` and `src/cli/commands/edit/formatting.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 218 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 `src/cli/commands/edit/document_text.rs:234` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 5) src/renderer/pagination/engine.rs:1154— src/renderer/pagination/engine.rs:1154-1164 | src/renderer/typeset/controls/host_wrap.rs:17-27 | src/renderer/typeset/controls/host_wrap.rs:92-102 | src/renderer/typeset/controls/wrap_match.rs:56-66 | src/renderer/typeset/controls/wrap_match.rs:163-173 — before extracting anything, compare `src/renderer/pagination/engine.rs` and `src/renderer/typeset/controls/host_wrap.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 5) src/cli/protocol/capsule/signing.rs:17— src/cli/protocol/capsule/signing.rs:17-27 | src/cli/protocol/exchange/settlement.rs:31-41 | src/cli/protocol/harness.rs:117-127 | src/cli/protocol/trust/anchor.rs:94-104 | src/cli/protocol/trust/governance.rs:458-468 — before extracting anything, compare `src/cli/protocol/capsule/signing.rs` and `src/cli/protocol/harness.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/capsule/signing.rs:17` 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 × 11) src/bin/rhwp-agent/locate.rs:213— src/bin/rhwp-agent/locate.rs:213-221 | src/bin/rhwp-q/kit/char_index.rs:16-24 | src/bin/rhwp-q/kit/covering_pages.rs:11-19 | src/bin/rhwp-q/kit/cur_field_state.rs:16-24 | src/bin/rhwp-q/kit/cursor_in_cell.rs:75-83 | src/bin/rhwp-q/kit/cursor_in_footnote.rs:68-76 | src/bin/rhwp-q/kit/cursor_in_note.rs:71-79 | src/bin/rhwp-q/kit/field_info_at.rs:16-24 | src/bin/rhwp-q/kit/form_value.rs:17-25 | src/bin/rhwp-q/kit/note_edit_info.rs:60-68 | src/bin/rhwp-q/kit/word_end.rs:16-24 — before extracting anything, compare `src/bin/rhwp-q/kit/char_index.rs` and `src/bin/rhwp-q/kit/covering_pages.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 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 `src/bin/rhwp-agent/locate.rs:213` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/bin/rhwp-q/kit/cursor_in_footnote.rs:77` calls `Some`, `take_u32` and `src/bin/rhwp-q/kit/cursor_in_cell.rs:84` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 11) src/cli/commands/edit/bookmarks.rs:155— src/cli/commands/edit/bookmarks.rs:155-163 | src/cli/commands/edit/bookmarks.rs:273-281 | src/cli/commands/edit/controls.rs:27-35 | src/cli/commands/edit/document_objects.rs:290-298 | src/cli/commands/edit/equations.rs:272-280 | src/cli/commands/edit/media.rs:821-829 | src/cli/commands/edit/media.rs:919-927 | src/cli/commands/edit/notes.rs:217-225 | src/cli/commands/edit/shapes.rs:199-207 | src/cli/commands/edit/shapes.rs:473-481 | src/cli/queries/structured_objects.rs:30-38 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/controls.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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 `src/cli/commands/edit/bookmarks.rs: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.
Duplicated block (9 lines × 11) src/cli/commands/edit/document_text.rs:739— src/cli/commands/edit/document_text.rs:739-747 | src/cli/commands/edit/document_text.rs:1040-1048 | src/cli/commands/edit/formatting.rs:27-35 | src/cli/commands/edit/formatting.rs:606-614 | src/cli/commands/edit/note_content.rs:26-34 | src/cli/commands/edit/note_content.rs:255-263 | src/cli/commands/edit/note_content.rs:363-371 | src/cli/commands/edit/note_content.rs:473-481 | src/cli/commands/edit/notes.rs:24-32 | src/cli/commands/edit/notes.rs:119-127 | src/cli/commands/edit/shapes.rs:30-38 — before extracting anything, compare `src/cli/commands/edit/document_text.rs` and `src/cli/commands/edit/formatting.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 218 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 `src/cli/commands/edit/document_text.rs:739` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/cli/commands/edit/note_content.rs:264` calls `Some` and `src/cli/commands/edit/document_text.rs:1049` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 11) src/cli/commands/edit/header_footer_content.rs:14— src/cli/commands/edit/header_footer_content.rs:14-22 | src/cli/commands/edit/header_footer_content.rs:134-142 | src/cli/commands/edit/header_footer_content.rs:258-266 | src/cli/commands/edit/header_footer_content.rs:415-423 | src/cli/commands/edit/header_footer_content.rs:587-595 | src/cli/commands/edit/header_footer_content.rs:741-749 | src/cli/commands/edit/header_footer_content.rs:880-888 | src/cli/commands/edit/header_footer_content.rs:1013-1021 | src/cli/commands/edit/header_footer_properties.rs:146-154 | src/cli/commands/edit/header_footer_properties.rs:281-289 | src/cli/commands/edit/header_footer_properties.rs:399-407 — before extracting anything, compare `src/cli/commands/edit/header_footer_content.rs` and `src/cli/commands/edit/header_footer_properties.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 296 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 `src/cli/commands/edit/header_footer_content.rs:14` 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–9 lines × 3) src/native_host/gpu_d3d.rs:556— src/native_host/gpu_d3d.rs:556-563 | src/native_host/gpu_metal.rs:363-371 | src/native_host/presentation.rs:855-863 — before extracting anything, compare `src/native_host/gpu_d3d.rs` and `src/native_host/gpu_metal.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 170 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 `src/native_host/gpu_d3d.rs:556` 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 3) src/parser/hwpx/section.rs:4619— src/parser/hwpx/section.rs:4619-4627 | src/parser/hwpx/section.rs:6945-6952 | src/parser/hwpx/section.rs:7802-7810 — 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 `src/parser/hwpx/section.rs:4619` 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–9 lines × 3) src/render_backend/util.rs:20— src/render_backend/util.rs:20-27 | src/renderer/canvaskit_policy.rs:2160-2168 | src/renderer/pdf.rs:859-866 — 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 `src/render_backend/util.rs:20` 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 (8–9 lines × 3) gym/tools/audit.py:1132— gym/tools/audit.py:1132-1139 | gym/tools/audit.py:1144-1151 | gym/tools/audit.py:1160-1168 — 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 `gym/tools/audit.py:1160` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7 lines × 10) src/cli/commands/edit/cell_paragraphs.rs:18— src/cli/commands/edit/cell_paragraphs.rs:18-24 | src/cli/commands/edit/cell_paragraphs.rs:175-181 | src/cli/commands/edit/cells.rs:495-501 | src/cli/commands/edit/cells.rs:665-671 | src/cli/commands/edit/cells.rs:838-844 | src/cli/commands/edit/formatting.rs:298-304 | src/cli/commands/edit/formatting.rs:714-720 | src/cli/commands/edit/formatting.rs:866-872 | src/cli/commands/edit/tables/grid.rs:338-344 | src/cli/commands/edit/tables/grid.rs:585-591 — before extracting anything, compare `src/cli/commands/edit/cell_paragraphs.rs` and `src/cli/commands/edit/cells.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 262 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 `src/cli/commands/edit/cell_paragraphs.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 (7 lines × 10) src/cli/commands/edit/document_objects.rs:152— src/cli/commands/edit/document_objects.rs:152-158 | src/cli/commands/edit/document_text.rs:344-350 | src/cli/commands/edit/document_text.rs:480-486 | src/cli/commands/edit/document_text.rs:730-736 | src/cli/commands/edit/document_text.rs:1031-1037 | src/cli/commands/edit/equations.rs:128-134 | src/cli/commands/edit/formatting.rs:18-24 | src/cli/commands/edit/notes.rs:15-21 | src/cli/commands/edit/notes.rs:110-116 | src/cli/commands/edit/shapes.rs:21-27 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 213 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 `src/cli/commands/edit/document_objects.rs:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/cli/commands/edit/shapes.rs:18` calls `to_string` and `src/cli/commands/edit/document_objects.rs:151` 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 × 10) src/cli/protocol/capsule/signing.rs:6— src/cli/protocol/capsule/signing.rs:6-12 | src/cli/protocol/exchange/bundle.rs:8-14 | src/cli/protocol/exchange/bundle.rs:217-223 | src/cli/protocol/exchange/disclosure.rs:6-12 | src/cli/protocol/exchange/disclosure.rs:209-215 | src/cli/protocol/harness.rs:5-11 | src/cli/protocol/trust/anchor.rs:8-14 | src/cli/protocol/trust/anchor.rs:83-89 | src/cli/protocol/trust/anchor.rs:158-164 | src/cli/protocol/trust/governance.rs:443-449 — before extracting anything, compare `src/cli/protocol/capsule/signing.rs` and `src/cli/protocol/exchange/bundle.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/capsule/signing.rs:6` 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 × 10) src/doclang/writer/escape.rs:50— src/doclang/writer/escape.rs:50-56 | src/document_core/hwpjson/ctx.rs:203-209 | src/eps.rs:1930-1936 | src/model/control.rs:564-570 | src/ole_chart/svg_renderer.rs:409-415 | src/parser/hwpx/section.rs:6192-6198 | src/renderer/equation/svg_render.rs:770-776 | src/renderer/html.rs:584-590 | src/renderer/pdf.rs:1811-1817 | src/renderer/svg.rs:4411-4417 — before extracting anything, compare `src/doclang/writer/escape.rs` and `src/ole_chart/svg_renderer.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/doclang/writer/escape.rs:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/doclang/writer/escape.rs:57` calls `push_str` and `src/model/control.rs:571` 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–7 lines × 2) src/parser/pdf/table_hierarchy.rs:133— src/parser/pdf/table_hierarchy.rs:133-139 | tools/pdf-ir-poc/src/table_hierarchy.rs:119-124 — before extracting anything, compare `src/parser/pdf/table_hierarchy.rs` and `tools/pdf-ir-poc/src/table_hierarchy.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/table_hierarchy.rs:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–7 lines × 2) src/parser/pdf/table_topology.rs:108— src/parser/pdf/table_topology.rs:108-113 | tools/pdf-ir-poc/src/table_topology.rs:74-80 — before extracting anything, compare `src/parser/pdf/table_topology.rs` and `tools/pdf-ir-poc/src/table_topology.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/table_topology.rs:108` 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–7 lines × 2) src/renderer/layout/shape_layout.rs:4266— src/renderer/layout/shape_layout.rs:4266-4272 | src/renderer/layout/table_cell_content.rs:888-893 — before extracting anything, compare `src/renderer/layout/shape_layout.rs` and `src/renderer/layout/table_cell_content.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 185 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 `src/renderer/layout/shape_layout.rs:4266` 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 (6–7 lines × 2) src/diagnostics/hwp5_contract_probe.rs:803— src/diagnostics/hwp5_contract_probe.rs:803-809 | src/diagnostics/hwp5_table_probe.rs:654-659 — before extracting anything, compare `src/diagnostics/hwp5_contract_probe.rs` and `src/diagnostics/hwp5_table_probe.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 377 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 `src/diagnostics/hwp5_contract_probe.rs:803` 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 (5 lines × 5) src/document_core/queries/cursor_rect.rs:1989— src/document_core/queries/cursor_rect.rs:1989-1995 | src/document_core/queries/cursor_rect.rs:5419-5425 | src/document_core/queries/cursor_rect.rs:5957-5963 | src/document_core/queries/cursor_rect.rs:6246-6250 | src/document_core/queries/cursor_rect.rs:6573-6577 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/queries/cursor_rect.rs:6246` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `run` to `&RunInfo` in one and `&HfRunInfo` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 5) src/renderer/layout/table_layout.rs:24959— src/renderer/layout/table_layout.rs:24959-24967 | src/renderer/layout/table_layout.rs:25061-25065 | src/renderer/layout/table_layout.rs:26796-26800 | src/renderer/layout/table_layout.rs:28000-28004 | src/renderer/layout/table_layout.rs:28516-28520 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 5) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:532— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:532-536 | src/diagnostics/hwp5_cell_header_probe.rs:879-886 | src/diagnostics/hwp5_contract_probe.rs:797-801 | src/diagnostics/hwp5_mel_personnel_probe.rs:793-800 | src/diagnostics/hwp5_table_probe.rs:648-652 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 5) src/bin/rhwp-agent/locate.rs:120— src/bin/rhwp-agent/locate.rs:120-124 | src/bin/rhwp-agent/searchcmd.rs:18-22 | src/bin/rhwp-agent/searchcmd.rs:63-67 | src/bin/rhwp-agent/searchcmd.rs:98-102 | src/bin/rhwp-agent/searchcmd.rs:126-130 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-agent/locate.rs:120` 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.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×3
Focus outline removed in CSS without a :focus replacement rhwp-studio/hwpctl-test.html:15— `.code-area` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement rhwp-studio/src/styles/command-palette.css:48— `.cp-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement rhwp-studio/src/styles/form-overlay.css:42— `.form-edit-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
HeightMeasurer::measure_table_impl_with_storage (cyclomatic 310) src/renderer/height_measurer.rs:3765— HeightMeasurer::measure_table_impl_with_storage has cyclomatic complexity 310 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HeightMeasurer::measure_paragraph_with_storage (cyclomatic 36) src/renderer/height_measurer.rs:2294— HeightMeasurer::measure_paragraph_with_storage 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.
HeightMeasurer::cell_nested_controls_bottom_with_storage (cyclomatic 21) src/renderer/height_measurer.rs:3488— HeightMeasurer::cell_nested_controls_bottom_with_storage 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.
HwpDocument::update_style_shapes (cyclomatic 31) src/wasm_api.rs:8113— HwpDocument::update_style_shapes 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.
HwpDocument::update_click_here_props (cyclomatic 17) src/wasm_api.rs:6612— HwpDocument::update_click_here_props has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 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.
HwpDocument::remap_style_ids (cyclomatic 16) src/wasm_api.rs:8391— HwpDocument::remap_style_ids 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.
TypesetState::prepare_saved_empty_run (cyclomatic 20) src/renderer/typeset/state/empty_run.rs:27— TypesetState::prepare_saved_empty_run 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.
TypesetState::stored_tac_page (cyclomatic 18) src/renderer/typeset/state/stored_tac.rs:159— TypesetState::stored_tac_page 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.
TypesetState::spill_page_tail_floats (cyclomatic 17) src/renderer/typeset/state/transition.rs:707— TypesetState::spill_page_tail_floats 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.
download-interceptor-common.classifyDownload (cyclomatic 18) rhwp-chrome/sw/download-interceptor-common.js:96— download-interceptor-common.classifyDownload 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.
download-interceptor-common.classifyDownload (cyclomatic 18) rhwp-firefox/sw/download-interceptor-common.js:96— download-interceptor-common.classifyDownload 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.
download-interceptor-common.classifyDownload (cyclomatic 18) rhwp-shared/sw/download-interceptor-common.js:96— download-interceptor-common.classifyDownload 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.
Tokenizer::read_command (cognitive 66) src/renderer/equation/tokenizer.rs:160— Tokenizer::read_command has cognitive complexity 66 (threshold 15). Drivers by points: if/else 20 (41 pts), loops 8 (13 pts), boolean chains 9, match/switch 1 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tokenizer::next_token (cognitive 43) src/renderer/equation/tokenizer.rs:436— Tokenizer::next_token has cognitive complexity 43 (threshold 15). Drivers by points: if/else 21 (29 pts), match/switch 3 (7 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tokenizer::read_number (cognitive 20) src/renderer/equation/tokenizer.rs:314— Tokenizer::read_number has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (5 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
HtmlRenderer::render_node (cognitive 66) src/renderer/html.rs:51— HtmlRenderer::render_node has cognitive complexity 66 (threshold 15). Drivers by points: if/else 18 (41 pts), loops 9 (19 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
HtmlRenderer::draw_text_positioned (cognitive 25) src/renderer/html.rs:276— HtmlRenderer::draw_text_positioned has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (17 pts), match/switch 3 (6 pts), loops 1 (2 pts) (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.
HtmlRenderer::draw_image (cognitive 19) src/renderer/html.rs:492— HtmlRenderer::draw_image has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 6 (12 pts), if/else 7 (nesting depth added 6). 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.
LayoutFrame::try_carve (cognitive 56) src/renderer/layout_frame.rs:574— LayoutFrame::try_carve has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (41 pts), loops 4 (8 pts), boolean chains 7 (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.
LayoutFrame::admit_stored_rows (cognitive 24) src/renderer/layout_frame.rs:800— LayoutFrame::admit_stored_rows has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutFrame::try_absorb_whitespace_only_rows (cognitive 23) src/renderer/layout_frame.rs:999— LayoutFrame::try_absorb_whitespace_only_rows has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FontEnvironment::from_document_lookup (cognitive 51) src/renderer/font_environment.rs:309— FontEnvironment::from_document_lookup has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (34 pts), loops 6 (8 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FontEnvironment::document_requests_with_slots (cognitive 20) src/renderer/font_environment.rs:249— FontEnvironment::document_requests_with_slots has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FontEnvironment::from_native_document_substitutions (cognitive 17) src/renderer/font_environment.rs:601— FontEnvironment::from_native_document_substitutions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SVGPlayer::ext_text_out (cognitive 47) src/wmf/converter/svg/mod.rs:868— SVGPlayer::ext_text_out has cognitive complexity 47 (threshold 15). Drivers by points: if/else 30 (40 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SVGPlayer::device_independent_bitmap_stretch_blt (cognitive 18) src/wmf/converter/svg/mod.rs:335— SVGPlayer::device_independent_bitmap_stretch_blt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), 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.
SVGPlayer::generate (cognitive 16) src/wmf/converter/svg/mod.rs:88— SVGPlayer::generate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scan::drain (cognitive 40) src/document_core/commands/paragraph_block/validation/resources.rs:151— Scan::drain has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 3 (7 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scan::para (cognitive 16) src/document_core/commands/paragraph_block/validation/support.rs:130— Scan::para has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, loops 2, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scan::control (cognitive 16) src/document_core/commands/paragraph_block/validation/support.rs:203— Scan::control has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 6, loops 1 (2 pts), 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.
content-script.classifyDocumentHref (cognitive 21) rhwp-chrome/content-script.js:200— content-script.classifyDocumentHref has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (7 pts), boolean chains 2, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
content-script.classifyDocumentHref (cognitive 21) rhwp-firefox/content-script.js:202— content-script.classifyDocumentHref has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (7 pts), boolean chains 2, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
content-script.classifyDocumentHref (cognitive 21) rhwp-safari/src/content-script.js:75— content-script.classifyDocumentHref has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (7 pts), boolean chains 2, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeEditor::ime_context (cognitive 19) src/native_host/commands.rs:352— NativeEditor::ime_context has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeEditor::commit_ime_edit (cognitive 18) src/native_host/ime_edit.rs:253— NativeEditor::commit_ime_edit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3 (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.
NativeEditor::horizontal_target (cognitive 17) src/native_host/commands.rs:186— NativeEditor::horizontal_target has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
document-url-resolver.classifyGithubDocumentUrl (cognitive 16) rhwp-chrome/sw/document-url-resolver.js:75— document-url-resolver.classifyGithubDocumentUrl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, 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.
document-url-resolver.classifyGithubDocumentUrl (cognitive 16) rhwp-firefox/sw/document-url-resolver.js:75— document-url-resolver.classifyGithubDocumentUrl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, 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.
document-url-resolver.classifyGithubDocumentUrl (cognitive 16) rhwp-shared/sw/document-url-resolver.js:75— document-url-resolver.classifyGithubDocumentUrl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, 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.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×3
Near-duplicate member pair (80 shared lines) src/bin/rhwp-agent/safety.rs:210— src/bin/rhwp-agent/safety.rs:210-364 | src/bin/rhwp-agent/safety.rs:516-663 — These two members are variants of one another: 80 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.
Near-duplicate member pair (80 shared lines) src/parser/hwpx/header.rs:1661— src/parser/hwpx/header.rs:1661-1948 | src/parser/hwpx/section.rs:4394-4547 — These two members are variants of one another: 80 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.
Near-duplicate member pair (80 shared lines) src/cli/commands/conversion.rs:216— src/cli/commands/conversion.rs:216-425 | src/cli/commands/conversion.rs:432-644 — These two members are variants of one another: 80 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (9 members, 50+ identical tokens) src/bin/rhwp-q/kit/field_by_id.rs:92— src/bin/rhwp-q/kit/field_by_id.rs:92-100 | src/bin/rhwp-q/kit/field_info_at.rs:106-114 | src/bin/rhwp-q/kit/form_at.rs:106-114 | src/bin/rhwp-q/kit/form_value.rs:116-124 | src/bin/rhwp-q/kit/hf_edit_target.rs:103-111 | src/bin/rhwp-q/kit/hit_fn_marker.rs:107-115 | src/bin/rhwp-q/kit/hit_in_footnote.rs:107-115 | src/bin/rhwp-q/kit/hit_in_hf.rs:131-139 | src/bin/rhwp-q/kit/para_bounds.rs:87-95 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
Members sharing a duplicated core (9 members, 50+ identical tokens) src/diagnostics/hwp5_anchor_trace.rs:145— src/diagnostics/hwp5_anchor_trace.rs:145-237 | src/diagnostics/hwp5_borderfill_diagonal_probe.rs:430-438 | src/diagnostics/hwp5_cell_header_probe.rs:689-697 | src/diagnostics/hwp5_char_shape_audit.rs:355-377 | src/diagnostics/hwp5_char_shape_audit.rs:381-423 | src/diagnostics/hwp5_contract_probe.rs:597-605 | src/diagnostics/hwp5_first_para_control_probe.rs:1294-1302 | src/diagnostics/hwp5_mel_personnel_probe.rs:603-611 | src/diagnostics/hwp5_table_probe.rs:348-356 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
Members sharing a duplicated core (9 members, 50+ identical tokens) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:83— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:83-110 | src/diagnostics/hwp5_cell_header_probe.rs:141-168 | src/diagnostics/hwp5_char_shape_audit.rs:132-178 | src/diagnostics/hwp5_contract_analyze.rs:66-93 | src/diagnostics/hwp5_contract_probe.rs:88-115 | src/diagnostics/hwp5_ctrl_data_trace.rs:22-49 | src/diagnostics/hwp5_first_para_control_probe.rs:94-121 | src/diagnostics/hwp5_mel_personnel_probe.rs:87-114 | src/diagnostics/hwp5_table_probe.rs:93-120 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (8 members, 50+ identical tokens) src/bin/rhwp-q/kit/auto_numbers.rs:10— src/bin/rhwp-q/kit/auto_numbers.rs:10-46 | src/bin/rhwp-q/kit/equations.rs:10-43 | src/bin/rhwp-q/kit/hidden_comments.rs:10-37 | src/bin/rhwp-q/kit/hyperlinks.rs:10-36 | src/bin/rhwp-q/kit/index_marks.rs:10-36 | src/bin/rhwp-q/kit/page_hide.rs:10-34 | src/bin/rhwp-q/kit/pictures.rs:10-45 | src/bin/rhwp-q/kit/ruby.rs:10-41 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) src/cli/commands/edit/cells.rs:204— src/cli/commands/edit/cells.rs:204-484 | src/cli/commands/edit/document_text.rs:11-227 | src/cli/commands/edit/media.rs:212-515 | src/cli/commands/edit/privacy.rs:579-802 | src/cli/commands/edit/runtime.rs:218-287 | src/cli/commands/edit/text.rs:60-265 | src/cli/commands/tabular_import.rs:184-466 | src/cli/commands/tabular_import.rs:479-753 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) src/wmf/converter/svg/mod.rs:734— src/wmf/converter/svg/mod.rs:734-793 | src/wmf/converter/svg/mod.rs:800-847 | src/wmf/converter/svg/mod.rs:1214-1247 | src/wmf/converter/svg/mod.rs:1254-1324 | src/wmf/converter/svg/mod.rs:1377-1421 | src/wmf/converter/svg/mod.rs:1432-1520 | src/wmf/converter/svg/mod.rs:1531-1573 | src/wmf/converter/svg/mod.rs:1584-1633 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Edited copy of a member (54 corresponding lines) · ×3
Edited copy of a member (54 corresponding lines) src/renderer/anisotropic_sampling.rs:57— src/renderer/anisotropic_sampling.rs:57-110 | src/renderer/cubic_sampling.rs:68-123 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (54 corresponding lines) src/document_core/queries/field_query.rs:2501— src/document_core/queries/field_query.rs:2501-2554 | src/document_core/queries/memo_query.rs:1761-1822 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (54 corresponding lines) tools/fidelity_compare/fidelity_compare.py:2525— tools/fidelity_compare/fidelity_compare.py:2525-2579 | tools/fidelity_compare/fidelity_compare.py:2585-2638 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (51 corresponding lines) · ×3
Edited copy of a member (51 corresponding lines) src/cli/protocol/trust/gate.rs:15— src/cli/protocol/trust/gate.rs:15-65 | src/cli/protocol/trust/governance.rs:170-226 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (51 corresponding lines) src/diagnostics/hwp5_inventory.rs:87— src/diagnostics/hwp5_inventory.rs:87-137 | src/diagnostics/hwp5_inventory_diff.rs:190-250 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (51 corresponding lines) src/document_core/commands/document.rs:1986— src/document_core/commands/document.rs:1986-2036 | src/document_core/commands/document.rs:3357-3409 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×3
Edited copy of a member (41 corresponding lines) src/renderer/equation/operator_outline.rs:63— src/renderer/equation/operator_outline.rs:63-103 | src/renderer/equation/relation_outline.rs:111-166 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) src/renderer/layout.rs:2658— src/renderer/layout.rs:2658-2705 | src/renderer/typeset/controls/decoration_host.rs:94-134 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) src/bin/rhwp-agent/stats.rs:23— src/bin/rhwp-agent/stats.rs:23-66 | src/bin/rhwp-agent/stats.rs:68-108 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (49 corresponding lines) · ×3
Edited copy of a member (49 corresponding lines) src/renderer/float_placement.rs:3628— src/renderer/float_placement.rs:3628-3676 | src/renderer/float_placement.rs:3685-3740 — 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.
Edited copy of a member (49 corresponding lines) src/parser/hwpx/section.rs:260— src/parser/hwpx/section.rs:260-308 | src/parser/hwpx/section.rs:6591-6641 — 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.
Edited copy of a member (49 corresponding lines) samples/issue8474/gen_section_top_spacing.py:65— samples/issue8474/gen_section_top_spacing.py:65-114 | samples/issue8474/gen_top_tac_cases.py:65-113 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (60 corresponding lines) · ×3
Edited copy of a member (60 corresponding lines) src/wmf/parser/records/bitmap/set_dib_to_dev.rs:64— src/wmf/parser/records/bitmap/set_dib_to_dev.rs:64-123 | src/wmf/parser/records/bitmap/stretch_dib.rs:75-138 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (60 corresponding lines) src/wmf/parser/objects/graphics/region.rs:70— src/wmf/parser/objects/graphics/region.rs:70-129 | src/wmf/parser/objects/structure/bitmap_info_header/info.rs:96-165 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (60 corresponding lines) tools/llm_verifier/lineage_chain/generate_corpus.py:537— tools/llm_verifier/lineage_chain/generate_corpus.py:537-597 | tools/llm_verifier/third_party_replay/generate_corpus.py:417-476 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×3
Edited copy of a member (39 corresponding lines) src/document_core/commands/object_ops/equation.rs:471— src/document_core/commands/object_ops/equation.rs:471-509 | src/document_core/commands/object_ops/picture.rs:1424-1480 — 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) src/document_core/commands/header_footer_ops.rs:293— src/document_core/commands/header_footer_ops.rs:293-331 | src/document_core/commands/header_footer_ops.rs:342-390 — 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) src/diagnostics/hwp5_inventory_diff.rs:1856— src/diagnostics/hwp5_inventory_diff.rs:1856-1894 | src/diagnostics/hwp5_inventory_diff.rs:1902-1941 — 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 (34 corresponding lines) · ×3
Edited copy of a member (34 corresponding lines) src/document_core/queries/field_query.rs:488— src/document_core/queries/field_query.rs:488-521 | src/document_core/queries/field_query.rs:539-581 — 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) src/renderer/layout/table_layout/row_physical_band.rs:134— src/renderer/layout/table_layout/row_physical_band.rs:134-167 | src/renderer/layout/table_layout/row_physical_band.rs:263-303 — 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) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:112— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:112-145 | src/diagnostics/hwp5_char_shape_audit.rs:180-220 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×3
Edited copy of a member (38 corresponding lines) src/diagnostics/hwp5_roundtrip_batch.rs:148— src/diagnostics/hwp5_roundtrip_batch.rs:148-185 | src/diagnostics/hwpx_roundtrip_batch.rs:35-75 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) src/wmf/parser/records/drawing/poly_line.rs:37— src/wmf/parser/records/drawing/poly_line.rs:37-75 | src/wmf/parser/records/drawing/polygon.rs:40-77 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) tools/oracle_public/coverage_report.py:570— tools/oracle_public/coverage_report.py:570-612 | tools/oracle_public/oracle_resolver.py:386-423 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 1+ corresponding lines) · ×3
Edited copies of one member (3 members, 1+ corresponding lines) src/model/paragraph.rs:400— src/model/paragraph.rs:400-400 | src/renderer/composer.rs:276-276 | src/renderer/layout_frame.rs:480-480 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 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, 1+ corresponding lines) src/model/footnote.rs:65— src/model/footnote.rs:65-65 | src/renderer/composer.rs:222-222 | src/renderer/style_resolver/resolved.rs:705-705 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 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, 1+ corresponding lines) src/renderer/char_overlap.rs:24— src/renderer/char_overlap.rs:24-24 | src/renderer/height_measurer.rs:681-681 | src/renderer/pagination.rs:1158-1158 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×3
Edited copies of one member (3 members, 14+ corresponding lines) src/wasm_api.rs:5077— src/wasm_api.rs:5077-5090 | src/wasm_api.rs:6174-6188 | src/wasm_api.rs:9041-9055 — 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) src/serializer/hwpx/roundtrip.rs:858— src/serializer/hwpx/roundtrip.rs:858-871 | src/serializer/hwpx/roundtrip.rs:875-889 | src/serializer/hwpx/roundtrip.rs:1791-1804 — 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) src/renderer/pdf_raster_fidelity/pdf_page.rs:220— src/renderer/pdf_raster_fidelity/pdf_page.rs:220-233 | src/serializer/hwpx/char_shapes.rs:52-68 | src/serializer/hwpx/package_check.rs:393-406 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 18+ corresponding lines) · ×3
Edited copies of one member (3 members, 18+ corresponding lines) src/paint/json.rs:2319— src/paint/json.rs:2319-2336 | src/paint/shaping_glyph.rs:375-393 | src/paint/text_shape.rs:447-465 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) tools/llm_verifier/criteria_decomp/src/decomp.rs:202— tools/llm_verifier/criteria_decomp/src/decomp.rs:202-220 | tools/llm_verifier/criteria_decomp/src/envelope.rs:45-62 | tools/llm_verifier/repeat_eval/src/envelope.rs:61-80 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) tools/fidelity_compare/fidelity_compare.py:928— tools/fidelity_compare/fidelity_compare.py:928-957 | tools/fidelity_compare/fidelity_compare.py:961-989 | tools/fidelity_compare/fidelity_compare.py:993-1010 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×3
Edited copies of one member (3 members, 11+ corresponding lines) src/diagnostics/ir_field_sweep.rs:1182— src/diagnostics/ir_field_sweep.rs:1182-1192 | src/diagnostics/ir_field_sweep.rs:1205-1223 | src/diagnostics/ir_field_sweep.rs:1226-1236 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) src/wasm_api.rs:1786— src/wasm_api.rs:1786-1796 | src/wasm_api.rs:1805-1817 | src/wasm_api.rs:1826-1837 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) src/parser/pdf/value_allocation.rs:282— src/parser/pdf/value_allocation.rs:282-292 | src/parser/pdf/value_allocation.rs:293-303 | src/parser/pdf/value_allocation.rs:308-318 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×3
Edited copies of one member (3 members, 12+ corresponding lines) src/document_core/helpers.rs:823— src/document_core/helpers.rs:823-834 | src/document_core/helpers.rs:891-902 | src/document_core/helpers.rs:915-927 — 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) src/document_core/commands/text_editing.rs:1211— src/document_core/commands/text_editing.rs:1211-1222 | src/renderer/layout.rs:1886-1902 | src/renderer/typeset.rs:1052-1067 — 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) bindings/Native/src/gpu_d3d.rs:162— bindings/Native/src/gpu_d3d.rs:162-173 | bindings/Native/src/gpu_gl.rs:240-251 | bindings/Native/src/gpu_metal.rs:173-184 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 3+ corresponding lines) · ×3
Edited copies of one member (3 members, 3+ corresponding lines) gym/tools/differential.py:927— gym/tools/differential.py:927-929 | gym/tools/release_diff.py:856-859 | gym/tools/release_gate.py:857-860 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) tools/task2668/discriminator.py:37— tools/task2668/discriminator.py:37-39 | tools/task2668/fn_geom_drive.py:32-34 | tools/task2668/margins.py:40-42 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) scripts/font_kerning_cohort.py:45— scripts/font_kerning_cohort.py:45-48 | scripts/font_rank8_qualification.py:42-45 | scripts/oracle_stage2_common.py:38-40 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (32 lines × 2) src/renderer/layout.rs:8563— src/renderer/layout.rs:8563-8594 | src/renderer/layout.rs:10466-10497 — both copies are in the same file, so extract the 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 `src/renderer/layout.rs:8563` 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 (32 lines × 2) src/renderer/layout/shape_layout.rs:4893— src/renderer/layout/shape_layout.rs:4893-4924 | src/renderer/layout/table_cell_content.rs:530-561 — before extracting anything, compare `src/renderer/layout/shape_layout.rs` and `src/renderer/layout/table_cell_content.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 185 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 `src/renderer/layout/shape_layout.rs:4893` 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 (32 lines × 2) src/wmf/parser/objects/structure/log_color_space.rs:98— src/wmf/parser/objects/structure/log_color_space.rs:98-129 | src/wmf/parser/objects/structure/log_color_space_w.rs:99-130 — before extracting anything, compare `src/wmf/parser/objects/structure/log_color_space.rs` and `src/wmf/parser/objects/structure/log_color_space_w.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 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 `src/wmf/parser/objects/structure/log_color_space.rs:98` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29–30 lines × 2) src/wmf/parser/records/bitmap/set_dib_to_dev.rs:92— src/wmf/parser/records/bitmap/set_dib_to_dev.rs:92-121 | src/wmf/parser/records/bitmap/stretch_dib.rs:107-135 — before extracting anything, compare `src/wmf/parser/records/bitmap/set_dib_to_dev.rs` and `src/wmf/parser/records/bitmap/stretch_dib.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 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 `src/wmf/parser/records/bitmap/set_dib_to_dev.rs:92` 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 (29–30 lines × 2) src/document_core/commands/text_editing.rs:6662— src/document_core/commands/text_editing.rs:6662-6691 | src/document_core/commands/text_editing.rs:6779-6807 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:6662` 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 (29–30 lines × 2) tools/oracle_public/coverage_report.py:385— tools/oracle_public/coverage_report.py:385-414 | tools/oracle_public/oracle_resolver.py:324-352 — before extracting anything, compare `tools/oracle_public/coverage_report.py` and `tools/oracle_public/oracle_resolver.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 187 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 `tools/oracle_public/coverage_report.py: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (27–28 lines × 2) src/parser/hwp3/mod.rs:329— src/parser/hwp3/mod.rs:329-355 | src/parser/hwpx/section.rs:2746-2773 — 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 `src/parser/hwp3/mod.rs:329` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `common` to `&crate::model::shape::CommonObjAttr` in one and `&CommonObjAttr` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/parser/hwpx/section.rs:2744` calls `hwp5_attr_bits` and `src/parser/hwp3/mod.rs:327` 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 (27–28 lines × 2) src/renderer/layout/shape_layout.rs:2787— src/renderer/layout/shape_layout.rs:2787-2813 | src/renderer/layout/shape_layout.rs:3002-3029 — both copies are in the same file, so extract the 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 `src/renderer/layout/shape_layout.rs:2787` 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 (27–28 lines × 2) mydocs/tech/investigations/issue-4969/probes/scratch_r6_hwp5_slice.rs:20— mydocs/tech/investigations/issue-4969/probes/scratch_r6_hwp5_slice.rs:20-46 | mydocs/tech/investigations/issue-4969/probes/scratch_r6_hwpx_slice.rs:21-48 — before extracting anything, compare `mydocs/tech/investigations/issue-4969/probes/scratch_r6_hwp5_slice.rs` and `mydocs/tech/investigations/issue-4969/probes/scratch_r6_hwpx_slice.rs` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mydocs/tech/investigations/issue-4969/probes/scratch_r6_hwp5_slice.rs:20` 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 (23–24 lines × 2) src/cli/commands/edit/document_objects.rs:342— src/cli/commands/edit/document_objects.rs:342-364 | src/cli/commands/edit/document_objects.rs:492-515 — both copies are in the same file, so extract the 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 `src/cli/commands/edit/document_objects.rs:342` 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–24 lines × 2) src/renderer/layout/text_measurement.rs:464— src/renderer/layout/text_measurement.rs:464-486 | src/renderer/layout/text_measurement.rs:683-706 — both copies are in the same file, so extract the 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 `src/renderer/layout/text_measurement.rs:464` 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, `src/renderer/layout/text_measurement.rs:487` calls `push` and `src/renderer/layout/text_measurement.rs:707` 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 (23–24 lines × 2) src/renderer/pagination/engine.rs:1153— src/renderer/pagination/engine.rs:1153-1176 | src/renderer/typeset/controls/host_wrap.rs:16-38 — before extracting anything, compare `src/renderer/pagination/engine.rs` and `src/renderer/typeset/controls/host_wrap.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/pagination/engine.rs:1153` 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 (18–24 lines × 2) src/cli/commands/edit/privacy.rs:273— src/cli/commands/edit/privacy.rs:273-296 | src/cli/commands/edit/text.rs:203-220 — before extracting anything, compare `src/cli/commands/edit/privacy.rs` and `src/cli/commands/edit/text.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 98 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 `src/cli/commands/edit/privacy.rs:273` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18–24 lines × 2) src/document_core/commands/text_editing.rs:5603— src/document_core/commands/text_editing.rs:5603-5626 | src/document_core/commands/text_editing.rs:5642-5659 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:5603` 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–24 lines × 2) src/parser/mod.rs:432— src/parser/mod.rs:432-455 | src/parser/mod.rs:923-940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/mod.rs:432` 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 (22–24 lines × 2) src/document_core/commands/object_ops/picture.rs:1870— src/document_core/commands/object_ops/picture.rs:1870-1891 | src/document_core/commands/object_ops/picture.rs:1945-1968 — both copies are in the same file, so extract the 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 `src/document_core/commands/object_ops/picture.rs:1870` 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 (22–24 lines × 2) src/parser/hwpx/header.rs:1826— src/parser/hwpx/header.rs:1826-1847 | src/parser/hwpx/section.rs:4469-4492 — before extracting anything, compare `src/parser/hwpx/header.rs` and `src/parser/hwpx/section.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 162 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 `src/parser/hwpx/header.rs:1826` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/parser/hwpx/header.rs:1853` calls `parse_i8` and `src/parser/hwpx/section.rs:4493` 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 (22–24 lines × 2) src/wmf/parser/records/bitmap/dib_bit_blt.rs:151— src/wmf/parser/records/bitmap/dib_bit_blt.rs:151-172 | src/wmf/parser/records/bitmap/dib_stretch_blt.rs:174-197 — before extracting anything, compare `src/wmf/parser/records/bitmap/dib_bit_blt.rs` and `src/wmf/parser/records/bitmap/dib_stretch_blt.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 84 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 `src/wmf/parser/records/bitmap/dib_bit_blt.rs:151` 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–21 lines × 2) src/diagnostics/ir_field_sweep.rs:290— src/diagnostics/ir_field_sweep.rs:290-310 | src/diagnostics/ir_field_sweep.rs:334-353 — both copies are in the same file, so extract the 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 `src/diagnostics/ir_field_sweep.rs:290` 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 (20–21 lines × 2) src/document_core/commands/formatting.rs:2058— src/document_core/commands/formatting.rs:2058-2077 | src/document_core/commands/formatting.rs:2494-2514 — both copies are in the same file, so extract the 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 `src/document_core/commands/formatting.rs:2058` 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 (20–21 lines × 2) src/diagnostics/hwp5_char_shape_audit.rs:356— src/diagnostics/hwp5_char_shape_audit.rs:356-375 | src/diagnostics/hwp5_char_shape_audit.rs:382-402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–20 lines × 2) src/document_core/commands/formatting.rs:808— src/document_core/commands/formatting.rs:808-825 | src/document_core/commands/formatting.rs:885-904 — both copies are in the same file, so extract the 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 (18–20 lines × 2) src/renderer/layout/shape_layout.rs:2691— src/renderer/layout/shape_layout.rs:2691-2708 | src/renderer/layout/shape_layout.rs:2724-2743 — both copies are in the same file, so extract the 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 `src/renderer/layout/shape_layout.rs:2691` 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–20 lines × 2) src/renderer/layout/text_measurement.rs:527— src/renderer/layout/text_measurement.rs:527-546 | src/renderer/layout/text_measurement.rs:2812-2829 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–19 lines × 2) src/document_core/commands/text_editing.rs:4579— src/document_core/commands/text_editing.rs:4579-4597 | src/document_core/commands/text_editing.rs:4636-4651 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:4579` 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 (16–19 lines × 2) src/renderer/layout.rs:1956— src/renderer/layout.rs:1956-1974 | src/renderer/typeset.rs:1887-1902 — before extracting anything, compare `src/renderer/layout.rs` and `src/renderer/typeset.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 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 `src/renderer/layout.rs:1956` 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–19 lines × 2) src/cli/commands/edit/fields.rs:224— src/cli/commands/edit/fields.rs:224-242 | src/mcp_serve.rs:2239-2254 — before extracting anything, compare `src/cli/commands/edit/fields.rs` and `src/mcp_serve.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/fields.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 (17–18 lines × 3) src/cli/commands/edit/document_objects.rs:171— src/cli/commands/edit/document_objects.rs:171-187 | src/cli/commands/edit/header_footer_content.rs:626-643 | src/cli/commands/edit/media.rs:559-575 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/header_footer_content.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 163 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 `src/cli/commands/edit/document_objects.rs:171` 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 (17–18 lines × 3) src/cli/queries/data_extraction.rs:47— src/cli/queries/data_extraction.rs:47-64 | src/cli/queries/security_inspection.rs:604-620 | src/cli/queries/security_inspection.rs:876-892 — 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 `src/cli/queries/data_extraction.rs:47` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/cli/queries/security_inspection.rs:620` calls `Some` and `src/cli/queries/data_extraction.rs:64` 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–18 lines × 3) src/renderer/svg.rs:2707— src/renderer/svg.rs:2707-2723 | src/renderer/svg.rs:2743-2760 | src/renderer/svg.rs:2833-2850 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/renderer/svg.rs:2725` calls `iter`, `char_overlap_display_text` and `src/renderer/svg.rs:2762` 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 (16–18 lines × 2) src/renderer/layout/shape_layout.rs:5138— src/renderer/layout/shape_layout.rs:5138-5155 | src/renderer/layout/shape_layout.rs:5323-5338 — both copies are in the same file, so extract the 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 `src/renderer/layout/shape_layout.rs:5138` 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 (16–18 lines × 2) src/renderer/layout/table_layout.rs:9025— src/renderer/layout/table_layout.rs:9025-9040 | src/renderer/layout/table_partial.rs:4242-4259 — before extracting anything, compare `src/renderer/layout/table_layout.rs` and `src/renderer/layout/table_partial.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 327 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 `src/renderer/layout/table_layout.rs:9025` 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–18 lines × 2) src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:239— src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:239-254 | src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:258-275 — both copies are in the same file, so extract the 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 `src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:239` 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 (34 lines × 2) src/wmf/parser/objects/structure/log_color_space.rs:62— src/wmf/parser/objects/structure/log_color_space.rs:62-95 | src/wmf/parser/objects/structure/log_color_space_w.rs:62-95 — before extracting anything, compare `src/wmf/parser/objects/structure/log_color_space.rs` and `src/wmf/parser/objects/structure/log_color_space_w.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 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 `src/wmf/parser/objects/structure/log_color_space.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 (34 lines × 2) scripts/generate_kerning_pair_fixture.py:165— scripts/generate_kerning_pair_fixture.py:165-202 | scripts/generate_oracle_typesetting_fixture.py:299-332 — 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 (34 lines × 2) tools/skill_router/audit_skill_commands.py:86— tools/skill_router/audit_skill_commands.py:86-119 | tools/skill_router/gate_new_skill.py:237-270 — before extracting anything, compare `tools/skill_router/audit_skill_commands.py` and `tools/skill_router/gate_new_skill.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 124 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 (17 lines × 5) src/bin/rhwp-q/kit/caret_stops.rs:30— src/bin/rhwp-q/kit/caret_stops.rs:30-46 | src/bin/rhwp-q/kit/char_index.rs:32-48 | src/bin/rhwp-q/kit/covering_pages.rs:27-43 | src/bin/rhwp-q/kit/word_end.rs:32-48 | src/bin/rhwp-q/kit/word_starts.rs:30-46 — before extracting anything, compare `src/bin/rhwp-q/kit/caret_stops.rs` and `src/bin/rhwp-q/kit/char_index.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 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 `src/bin/rhwp-q/kit/caret_stops.rs:30` 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 (17 lines × 5) src/bin/rhwp-q/kit/cur_field_state.rs:32— src/bin/rhwp-q/kit/cur_field_state.rs:32-48 | src/bin/rhwp-q/kit/field_info_at.rs:32-48 | src/bin/rhwp-q/kit/form_value.rs:33-49 | src/bin/rhwp-q/kit/line_starts.rs:31-47 | src/bin/rhwp-q/kit/para_bounds.rs:31-47 — before extracting anything, compare `src/bin/rhwp-q/kit/cur_field_state.rs` and `src/bin/rhwp-q/kit/field_info_at.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 133 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 `src/bin/rhwp-q/kit/cur_field_state.rs:32` 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 (17 lines × 5) src/cli/commands/edit/header_footer_content.rs:16— src/cli/commands/edit/header_footer_content.rs:16-32 | src/cli/commands/edit/header_footer_content.rs:1015-1031 | src/cli/commands/edit/header_footer_properties.rs:148-164 | src/cli/commands/edit/header_footer_properties.rs:283-299 | src/cli/commands/edit/header_footer_properties.rs:401-417 — before extracting anything, compare `src/cli/commands/edit/header_footer_content.rs` and `src/cli/commands/edit/header_footer_properties.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 296 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 `src/cli/commands/edit/header_footer_content.rs:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 6) src/cli/queries/document_inventory.rs:19— src/cli/queries/document_inventory.rs:19-34 | src/cli/queries/document_inventory.rs:84-99 | src/cli/queries/document_inventory.rs:156-171 | src/cli/queries/explain.rs:150-165 | src/cli/queries/explore.rs:29-44 | src/cli/queries/structured_objects.rs:262-277 — before extracting anything, compare `src/cli/queries/document_inventory.rs` and `src/cli/queries/structured_objects.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 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 `src/cli/queries/document_inventory.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.
Duplicated block (16 lines × 6) src/bin/rhwp-q/more/inventory.rs:147— src/bin/rhwp-q/more/inventory.rs:147-162 | src/bin/rhwp-q/more/inventory.rs:174-189 | src/bin/rhwp-q/more/inventory.rs:201-216 | src/bin/rhwp-q/more/inventory.rs:914-929 | src/bin/rhwp-q/more/inventory.rs:941-956 | src/bin/rhwp-q/more/inventory.rs:1111-1126 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:147` 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 × 6) src/bin/rhwp-q/more/inventory.rs:390— src/bin/rhwp-q/more/inventory.rs:390-405 | src/bin/rhwp-q/more/inventory.rs:417-432 | src/bin/rhwp-q/more/inventory.rs:444-459 | src/bin/rhwp-q/more/inventory.rs:995-1010 | src/bin/rhwp-q/more/inventory.rs:1138-1153 | src/bin/rhwp-q/more/inventory.rs:1273-1288 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:390` 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 × 5) src/cli/commands/edit/cell_paragraphs.rs:106— src/cli/commands/edit/cell_paragraphs.rs:106-121 | src/cli/commands/edit/cells.rs:593-608 | src/cli/commands/edit/cells.rs:762-777 | src/cli/commands/edit/formatting.rs:809-824 | src/cli/commands/edit/formatting.rs:973-988 — before extracting anything, compare `src/cli/commands/edit/cell_paragraphs.rs` and `src/cli/commands/edit/cells.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 262 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 `src/cli/commands/edit/cell_paragraphs.rs:106` 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 × 5) src/bin/rhwp-q/more/inventory.rs:228— src/bin/rhwp-q/more/inventory.rs:228-243 | src/bin/rhwp-q/more/inventory.rs:255-270 | src/bin/rhwp-q/more/inventory.rs:282-297 | src/bin/rhwp-q/more/inventory.rs:1219-1234 | src/bin/rhwp-q/more/inventory.rs:1246-1261 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:228` 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 × 5) tools/inspect_msec/gen_msec_fixtures.py:1401— tools/inspect_msec/gen_msec_fixtures.py:1401-1416 | tools/inspect_msec/gen_msec_fixtures.py:1469-1484 | tools/inspect_msec/gen_msec_fixtures.py:1516-1531 | tools/inspect_msec/gen_msec_fixtures.py:2221-2236 | tools/inspect_msec/gen_msec_fixtures.py:2295-2310 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `tools/inspect_msec/gen_msec_fixtures.py:1401` 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 × 4) src/bin/rhwp-q/commands/rhwp-q-font-layout-evidence.rs:41— src/bin/rhwp-q/commands/rhwp-q-font-layout-evidence.rs:41-56 | src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:84-99 | src/bin/rhwp-q/commands/rhwp-q-page-items.rs:68-83 | src/bin/rhwp-q/commands/rhwp-q-scan-items.rs:56-71 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-font-trace.rs` and `src/bin/rhwp-q/commands/rhwp-q-page-items.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 101 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 `src/bin/rhwp-q/commands/rhwp-q-font-layout-evidence.rs:41` 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 × 4) src/diagnostics/hwp5_cell_header_probe.rs:483— src/diagnostics/hwp5_cell_header_probe.rs:483-498 | src/diagnostics/hwp5_first_para_control_probe.rs:766-781 | src/diagnostics/hwp5_mel_personnel_probe.rs:466-481 | src/diagnostics/hwp5_table_probe.rs:482-497 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_first_para_control_probe.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 283 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 (16 lines × 4) src/diagnostics/ir_field_sweep.rs:677— src/diagnostics/ir_field_sweep.rs:677-692 | src/diagnostics/ir_field_sweep.rs:885-900 | src/diagnostics/ir_field_sweep.rs:959-974 | src/diagnostics/ir_field_sweep.rs:1034-1049 — 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 `src/diagnostics/ir_field_sweep.rs:677` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `a` to `&Paragraph` in one and `&Table` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/diagnostics/ir_field_sweep.rs:695` calls `is_some` and `src/diagnostics/ir_field_sweep.rs:901` 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 × 5) src/document_core/commands/text_editing.rs:1399— src/document_core/commands/text_editing.rs:1399-1413 | src/document_core/commands/text_editing.rs:1643-1657 | src/document_core/commands/text_editing.rs:1796-1810 | src/document_core/commands/text_editing.rs:1892-1906 | src/document_core/commands/text_editing.rs:4217-4231 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, 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, `src/document_core/commands/text_editing.rs:1640` calls `normalize_text_newlines`, `as_ref` and `src/document_core/commands/text_editing.rs:1398` 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 (15 lines × 5) src/renderer/inline_flow/floating_shapes.rs:70— src/renderer/inline_flow/floating_shapes.rs:70-84 | src/renderer/render_normalization/stored_word_tail.rs:141-155 | src/renderer/render_normalization/stored_word_tail.rs:192-206 | src/renderer/typeset/paragraph.rs:1147-1161 | src/renderer/typeset/paragraph.rs:1353-1367 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/inline_flow/floating_shapes.rs:70` 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 × 5) src/cli/commands/edit/header_footer_content.rs:554— src/cli/commands/edit/header_footer_content.rs:554-568 | src/cli/commands/edit/header_footer_content.rs:706-720 | src/cli/commands/edit/header_footer_content.rs:849-863 | src/cli/commands/edit/header_footer_content.rs:1136-1150 | src/cli/commands/edit/header_footer_properties.rs:520-534 — before extracting anything, compare `src/cli/commands/edit/header_footer_content.rs` and `src/cli/commands/edit/header_footer_properties.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 296 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 `src/cli/commands/edit/header_footer_content.rs:554` 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–15 lines × 3) src/document_core/queries/cursor_rect.rs:962— src/document_core/queries/cursor_rect.rs:962-973 | src/document_core/queries/cursor_rect.rs:1006-1020 | src/document_core/queries/cursor_rect.rs:4791-4802 — 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 `src/document_core/queries/cursor_rect.rs:962` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–15 lines × 3) src/renderer/height_measurer.rs:628— src/renderer/height_measurer.rs:628-640 | src/renderer/layout/paragraph_layout.rs:949-960 | src/renderer/typeset.rs:153-167 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/layout/paragraph_layout.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/height_measurer.rs:628` 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 first that the copies are not typed on the same thing: the declarations holding them bind `para` to `&Paragraph` in one and `Option<&Paragraph>` 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 (12–15 lines × 3) src/wmf/parser/objects/graphics/font.rs:113— src/wmf/parser/objects/graphics/font.rs:113-127 | src/wmf/parser/objects/structure/bitmap_info_header/info.rs:97-108 | src/wmf/parser/records/bitmap/stretch_dib.rs:81-92 — 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 `src/wmf/parser/objects/graphics/font.rs:113` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/wmf/parser/records/bitmap/stretch_dib.rs:93` calls `parse` and `src/wmf/parser/objects/graphics/font.rs:128` 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 (12–14 lines × 2) src/parser/cfb_reader.rs:98— src/parser/cfb_reader.rs:98-111 | src/parser/cfb_reader.rs:248-259 — both copies are in the same file, so extract the 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 `src/parser/cfb_reader.rs:98` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–14 lines × 2) src/renderer/equation/canvas_render.rs:293— src/renderer/equation/canvas_render.rs:293-304 | src/renderer/equation/svg_render.rs:344-357 — before extracting anything, compare `src/renderer/equation/canvas_render.rs` and `src/renderer/equation/svg_render.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 198 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 `src/renderer/equation/canvas_render.rs:293` 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–14 lines × 2) src/renderer/typeset/section/controls.rs:333— src/renderer/typeset/section/controls.rs:333-344 | src/renderer/typeset/section/controls.rs:394-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/typeset/section/controls.rs:333` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–13 lines × 2) src/bin/rhwp-q/kit/flow_images.rs:26— src/bin/rhwp-q/kit/flow_images.rs:26-35 | src/bin/rhwp-q/kit/overlay_images.rs:26-38 — before extracting anything, compare `src/bin/rhwp-q/kit/flow_images.rs` and `src/bin/rhwp-q/kit/overlay_images.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 128 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 `src/bin/rhwp-q/kit/flow_images.rs:26` 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 (10–13 lines × 2) src/document_core/commands/clipboard.rs:984— src/document_core/commands/clipboard.rs:984-996 | src/document_core/commands/foreign_paste.rs:209-218 — before extracting anything, compare `src/document_core/commands/clipboard.rs` and `src/document_core/commands/foreign_paste.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 134 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 `src/document_core/commands/clipboard.rs:984` 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–13 lines × 2) src/renderer/layout/paragraph_layout.rs:9092— src/renderer/layout/paragraph_layout.rs:9092-9104 | src/renderer/layout/paragraph_layout.rs:11219-11228 — both copies are in the same file, so extract the 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 `src/renderer/layout/paragraph_layout.rs:9092` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–12 lines × 3) src/cli/outputs/text.rs:100— src/cli/outputs/text.rs:100-111 | src/cli/queries/security_inspection.rs:628-638 | src/cli/queries/security_inspection.rs:900-910 — before extracting anything, compare `src/cli/outputs/text.rs` and `src/cli/queries/security_inspection.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 3) src/cli/protocol/capsule/signing.rs:18— src/cli/protocol/capsule/signing.rs:18-28 | src/cli/protocol/harness.rs:118-129 | src/cli/protocol/trust/governance.rs:459-469 — before extracting anything, compare `src/cli/protocol/capsule/signing.rs` and `src/cli/protocol/harness.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/capsule/signing.rs:18` 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 (11–12 lines × 3) src/renderer/svg.rs:3123— src/renderer/svg.rs:3123-3133 | src/renderer/svg.rs:3197-3208 | src/renderer/svg.rs:3233-3244 — 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 `src/renderer/svg.rs:3123` 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–11 lines × 2) src/paint/builder.rs:768— src/paint/builder.rs:768-778 | src/paint/text_shadow.rs:80-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8–11 lines × 2) src/parser/control.rs:198— src/parser/control.rs:198-208 | src/parser/control/shape.rs:135-142 — 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 `src/parser/control.rs:198` 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–11 lines × 2) src/renderer/equation/logical_font_frame.rs:188— src/renderer/equation/logical_font_frame.rs:188-198 | src/renderer/equation/logical_font_frame.rs:219-226 — both copies are in the same file, so extract the 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 `src/renderer/equation/logical_font_frame.rs: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. 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–10 lines × 3) src/document_core/queries/hwpctrl_sets.rs:1028— src/document_core/queries/hwpctrl_sets.rs:1028-1035 | src/document_core/queries/hwpctrl_sets.rs:1102-1109 | src/document_core/queries/hwpctrl_sets.rs:1974-1983 — 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 `src/document_core/queries/hwpctrl_sets.rs:1028` 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–10 lines × 3) src/parser/hwpx/header.rs:1868— src/parser/hwpx/header.rs:1868-1877 | src/parser/hwpx/section.rs:3417-3425 | src/parser/hwpx/section.rs:4505-4512 — before extracting anything, compare `src/parser/hwpx/header.rs` and `src/parser/hwpx/section.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 162 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 `src/parser/hwpx/header.rs:1868` 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, `src/parser/hwpx/header.rs:1867` calls `Some` and `src/parser/hwpx/section.rs:3416` 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–10 lines × 3) src/renderer/float_placement.rs:3808— src/renderer/float_placement.rs:3808-3815 | src/renderer/float_placement/stored_header_frame.rs:27-36 | src/renderer/float_placement/stored_header_frame.rs:82-89 — before extracting anything, compare `src/renderer/float_placement.rs` and `src/renderer/float_placement/stored_header_frame.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/float_placement.rs:3808` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–10 lines × 2) src/parser/hwpx/header.rs:1353— src/parser/hwpx/header.rs:1353-1359 | src/parser/hwpx/header.rs:2020-2029 — both copies are in the same file, so extract the 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 `src/parser/hwpx/header.rs:1353` 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–10 lines × 2) src/renderer/float_placement.rs:2978— src/renderer/float_placement.rs:2978-2984 | src/renderer/float_placement/stored_header_frame.rs:25-34 — before extracting anything, compare `src/renderer/float_placement.rs` and `src/renderer/float_placement/stored_header_frame.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/float_placement.rs:2978` 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–10 lines × 2) src/serializer/control.rs:1236— src/serializer/control.rs:1236-1245 | src/serializer/control.rs:1258-1264 — both copies are in the same file, so extract the 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–9 lines × 3) src/document_core/commands/clipboard.rs:590— src/document_core/commands/clipboard.rs:590-598 | src/document_core/commands/clipboard.rs:678-686 | src/document_core/commands/clipboard.rs:739-745 — 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 `src/document_core/commands/clipboard.rs:590` 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–9 lines × 3) src/model/control.rs:565— src/model/control.rs:565-571 | src/parser/hwpx/section.rs:6193-6201 | src/renderer/html.rs:585-592 — before extracting anything, compare `src/model/control.rs` and `src/parser/hwpx/section.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/model/control.rs:565` 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–9 lines × 3) src/renderer/layout/paragraph_layout.rs:9303— src/renderer/layout/paragraph_layout.rs:9303-9309 | src/renderer/layout/paragraph_layout.rs:9444-9452 | src/renderer/layout/paragraph_layout.rs:11200-11206 — 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 `src/renderer/layout/paragraph_layout.rs:9303` 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 (8 lines × 11) src/cli/commands/edit/bookmarks.rs:146— src/cli/commands/edit/bookmarks.rs:146-153 | src/cli/commands/edit/controls.rs:18-25 | src/cli/commands/edit/document_objects.rs:281-288 | src/cli/commands/edit/equations.rs:17-24 | src/cli/commands/edit/equations.rs:263-270 | src/cli/commands/edit/media.rs:812-819 | src/cli/commands/edit/media.rs:910-917 | src/cli/commands/edit/notes.rs:208-215 | src/cli/commands/edit/shapes.rs:190-197 | src/cli/commands/edit/shapes.rs:464-471 | src/cli/queries/structured_objects.rs:21-28 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/controls.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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 `src/cli/commands/edit/bookmarks.rs:146` 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 × 11) src/bin/rhwp-q/kit/cell_shape.rs:104— src/bin/rhwp-q/kit/cell_shape.rs:104-111 | src/bin/rhwp-q/kit/cursor_in_cell.rs:142-149 | src/bin/rhwp-q/kit/cursor_in_footnote.rs:137-144 | src/bin/rhwp-q/kit/cursor_in_hf.rs:175-182 | src/bin/rhwp-q/kit/cursor_in_note.rs:136-143 | src/bin/rhwp-q/kit/flow_images.rs:107-114 | src/bin/rhwp-q/kit/footnote_hit.rs:126-133 | src/bin/rhwp-q/kit/footnote_info.rs:121-128 | src/bin/rhwp-q/kit/hit_header.rs:126-133 | src/bin/rhwp-q/kit/note_edit_info.rs:121-128 | src/bin/rhwp-q/kit/overlay_images.rs:111-118 — before extracting anything, compare `src/bin/rhwp-q/kit/cell_shape.rs` and `src/bin/rhwp-q/kit/flow_images.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 11) src/cli/protocol/capsule/signing.rs:7— src/cli/protocol/capsule/signing.rs:7-14 | src/cli/protocol/capsule/signing.rs:74-81 | src/cli/protocol/exchange/bundle.rs:9-16 | src/cli/protocol/exchange/bundle.rs:218-225 | src/cli/protocol/exchange/disclosure.rs:7-14 | src/cli/protocol/exchange/disclosure.rs:210-217 | src/cli/protocol/harness.rs:6-13 | src/cli/protocol/trust/anchor.rs:9-16 | src/cli/protocol/trust/anchor.rs:84-91 | src/cli/protocol/trust/anchor.rs:159-166 | src/cli/protocol/trust/governance.rs:444-451 — before extracting anything, compare `src/cli/protocol/capsule/signing.rs` and `src/cli/protocol/exchange/bundle.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/capsule/signing.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.
Duplicated block (8 lines × 7) src/bin/rhwp-q/kit/cursor_in_footnote.rs:70— src/bin/rhwp-q/kit/cursor_in_footnote.rs:70-77 | src/bin/rhwp-q/kit/flow_images.rs:52-59 | src/bin/rhwp-q/kit/footnote_footholds.rs:40-47 | src/bin/rhwp-q/kit/footnote_hit.rs:61-68 | src/bin/rhwp-q/kit/footnote_info.rs:58-65 | src/bin/rhwp-q/kit/hit_header.rs:61-68 | src/bin/rhwp-q/kit/overlay_images.rs:56-63 — before extracting anything, compare `src/bin/rhwp-q/kit/cursor_in_footnote.rs` and `src/bin/rhwp-q/kit/flow_images.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 63 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 `src/bin/rhwp-q/kit/cursor_in_footnote.rs:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/bin/rhwp-q/kit/cursor_in_footnote.rs:78` calls `Some`, `take_usize` and `src/bin/rhwp-q/kit/flow_images.rs:60` 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 × 7) src/cli/commands/edit/page.rs:352— src/cli/commands/edit/page.rs:352-359 | src/cli/commands/edit/shapes.rs:20-27 | src/cli/commands/edit/tables/grid.rs:13-20 | src/cli/commands/edit/tables/grid.rs:121-128 | src/cli/commands/edit/tables/grid.rs:704-711 | src/cli/commands/edit/tables/layout.rs:111-118 | src/cli/commands/edit/tables/layout.rs:356-363 — before extracting anything, compare `src/cli/commands/edit/page.rs` and `src/cli/commands/edit/shapes.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 176 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 `src/cli/commands/edit/page.rs:352` 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 × 7) tools/skill_router/audit_skill_commands.py:51— tools/skill_router/audit_skill_commands.py:51-58 | tools/skill_router/check_catalog_sync.py:45-52 | tools/skill_router/gate_new_skill.py:210-217 | tools/skill_router/install_git_hook.py:30-37 | tools/skill_router/precommit_skill_gate.py:37-44 | tools/skill_router/route.py:64-71 | tools/skill_router/run_ci_skill_gate.py:34-41 — before extracting anything, compare `tools/skill_router/audit_skill_commands.py` and `tools/skill_router/gate_new_skill.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `tools/skill_router/precommit_skill_gate.py:33` calls `tuple`, `rstrip` and `tools/skill_router/route.py:60` 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 × 5) src/bin/rhwp-agent/inspect.rs:108— src/bin/rhwp-agent/inspect.rs:108-115 | src/bin/rhwp-agent/inspect.rs:240-247 | src/bin/rhwp-agent/inspect.rs:277-284 | src/bin/rhwp-agent/inspect.rs:304-311 | src/bin/rhwp-agent/inspect.rs:367-374 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 5) src/cli/commands/edit/tables/grid.rs:228— src/cli/commands/edit/tables/grid.rs:228-235 | src/cli/commands/edit/tables/grid.rs:337-344 | src/cli/commands/edit/tables/grid.rs:477-484 | src/cli/commands/edit/tables/grid.rs:584-591 | src/cli/commands/edit/tables/structure.rs:13-20 — before extracting anything, compare `src/cli/commands/edit/tables/grid.rs` and `src/cli/commands/edit/tables/structure.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 187 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 `src/cli/commands/edit/tables/grid.rs:228` 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 × 5) src/bin/rhwp-agent/inspect.rs:147— src/bin/rhwp-agent/inspect.rs:147-154 | src/bin/rhwp-agent/locate.rs:215-222 | src/bin/rhwp-agent/lookups.rs:79-88 | src/bin/rhwp-agent/safety.rs:374-383 | src/bin/rhwp-agent/tables.rs:73-80 — before extracting anything, compare `src/bin/rhwp-agent/inspect.rs` and `src/bin/rhwp-agent/locate.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-agent/inspect.rs:147` 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 × 3) src/document_core/commands/clipboard.rs:925— src/document_core/commands/clipboard.rs:925-931 | src/document_core/commands/foreign_paste.rs:164-170 | src/document_core/commands/html_import.rs:226-233 — before extracting anything, compare `src/document_core/commands/clipboard.rs` and `src/document_core/commands/foreign_paste.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 134 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 `src/document_core/commands/clipboard.rs:925` 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–8 lines × 3) src/renderer/equation/canvas_render.rs:431— src/renderer/equation/canvas_render.rs:431-437 | src/renderer/equation/svg_render.rs:501-507 | src/renderer/skia/equation_conv.rs:586-593 — before extracting anything, compare `src/renderer/equation/canvas_render.rs` and `src/renderer/equation/svg_render.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 198 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 `src/renderer/equation/canvas_render.rs:431` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 3) src/renderer/layout/table_layout.rs:2492— src/renderer/layout/table_layout.rs:2492-2498 | src/renderer/layout/table_layout.rs:2539-2545 | src/renderer/layout/table_layout/empty_line_flow.rs:266-273 — 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 `src/renderer/layout/table_layout.rs:2492` 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–8 lines × 2) src/document_core/inline_control.rs:235— src/document_core/inline_control.rs:235-240 | src/document_core/inline_control.rs:783-790 — both copies are in the same file, so extract the 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 `src/document_core/inline_control.rs:235` 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–8 lines × 2) src/parser/pdf/recognition.rs:812— src/parser/pdf/recognition.rs:812-819 | tools/pdf-ir-poc/src/recognition.rs:554-559 — before extracting anything, compare `src/parser/pdf/recognition.rs` and `tools/pdf-ir-poc/src/recognition.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/recognition.rs:812` 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 (6–8 lines × 2) src/renderer/float_placement.rs:8413— src/renderer/float_placement.rs:8413-8418 | src/renderer/float_placement.rs:8430-8437 — both copies are in the same file, so extract the 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 (6–7 lines × 3) src/bin/rhwp-q/more/inventory.rs:704— src/bin/rhwp-q/more/inventory.rs:704-710 | src/bin/rhwp-q/more/inventory.rs:1157-1163 | src/bin/rhwp-q/pack/inventory.rs:576-581 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:704` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–7 lines × 3) src/bin/rhwp-q/more/inventory.rs:1041— src/bin/rhwp-q/more/inventory.rs:1041-1047 | src/bin/rhwp-q/pack/inventory.rs:680-685 | src/bin/rhwp-q/pack/inventory.rs:1324-1329 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:1041` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–7 lines × 3) src/renderer/layout/table_layout.rs:21001— src/renderer/layout/table_layout.rs:21001-21006 | src/renderer/layout/table_layout.rs:21060-21066 | src/renderer/layout/table_layout.rs:21950-21956 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5–7 lines × 2) src/renderer/float_placement.rs:6854— src/renderer/float_placement.rs:6854-6860 | src/renderer/layout/paragraph_layout.rs:1026-1030 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5–7 lines × 2) src/renderer/height_measurer.rs:1458— src/renderer/height_measurer.rs:1458-1464 | src/renderer/height_measurer.rs:1631-1635 — both copies are in the same file, so extract the 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 (5–7 lines × 2) src/renderer/layout/paragraph_layout.rs:3962— src/renderer/layout/paragraph_layout.rs:3962-3966 | src/renderer/layout/tac_picture_item.inc.rs:181-187 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5–6 lines × 2) src/document_core/queries/rendering.rs:6235— src/document_core/queries/rendering.rs:6235-6239 | src/renderer/pagination.rs:1547-1552 — 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 `src/renderer/pagination.rs:1547` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5–6 lines × 2) src/renderer/pagination/engine.rs:3184— src/renderer/pagination/engine.rs:3184-3189 | src/renderer/typeset/state/finalize.rs:144-148 — before extracting anything, compare `src/renderer/pagination/engine.rs` and `src/renderer/typeset/state/finalize.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/pagination/engine.rs:3184` 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 (5–6 lines × 2) src/renderer/svg/font_file_lookup.rs:200— src/renderer/svg/font_file_lookup.rs:200-204 | src/renderer/svg/system_fonts.rs:124-129 — 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 `src/renderer/svg/font_file_lookup.rs:200` 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 × 6) src/parser/hwp3/mod.rs:2001— src/parser/hwp3/mod.rs:2001-2005 | src/parser/hwp3/mod.rs:2007-2011 | src/parser/hwp3/mod.rs:2013-2017 | src/parser/hwp3/mod.rs:2019-2023 | src/parser/hwp3/mod.rs:2025-2029 | src/parser/hwp3/mod.rs:2031-2035 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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 (5 lines × 6) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:533— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:533-537 | src/diagnostics/hwp5_cell_header_probe.rs:880-887 | src/diagnostics/hwp5_contract_probe.rs:798-802 | src/diagnostics/hwp5_first_para_control_probe.rs:827-831 | src/diagnostics/hwp5_mel_personnel_probe.rs:794-801 | src/diagnostics/hwp5_table_probe.rs:649-653 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 6) tools/llm_verifier/abstain/generate_corpus.py:506— tools/llm_verifier/abstain/generate_corpus.py:506-510 | tools/llm_verifier/lineage_chain/generate_corpus.py:601-605 | tools/llm_verifier/oracle_vs_self/generate_corpus.py:334-338 | tools/llm_verifier/shadow_agree/generate_corpus.py:306-310 | tools/llm_verifier/third_party_replay/generate_corpus.py:480-484 | tools/llm_verifier/untrusted_sandbox/generate_corpus.py:453-457 — `tools/llm_verifier/lineage_chain/generate_corpus.py` and `tools/llm_verifier/third_party_replay/generate_corpus.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 81 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 6) src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:41— src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:41-46 | src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:47-52 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:41-46 | src/bin/rhwp-q/commands/rhwp-q-page-items.rs:43-48 | src/bin/rhwp-q/commands/rhwp-q-scan-items.rs:42-47 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:41-46 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs` and `src/bin/rhwp-q/commands/rhwp-q-font-trace.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 6) src/document_core/helpers.rs:314— src/document_core/helpers.rs:314-319 | src/renderer/canvas.rs:476-481 | src/renderer/html.rs:575-580 | src/renderer/layout/paragraph_layout.rs:13112-13117 | src/renderer/svg.rs:4321-4326 | src/renderer/web_canvas.rs:4568-4573 — before extracting anything, compare `src/renderer/html.rs` and `src/renderer/svg.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 76 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, `src/renderer/web_canvas.rs:4561` calls `restore` and `src/renderer/canvas.rs:472` 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 × 6) scripts/font_kerning_cohort.py:112— scripts/font_kerning_cohort.py:112-117 | scripts/font_rank1_metric_hypothesis.py:54-59 | scripts/font_rank8_metric_hypothesis.py:68-73 | scripts/font_rank8_qualification.py:102-107 | scripts/oracle_stage3_profile.py:51-56 | scripts/oracle_stage4_profile.py:166-171 — before extracting anything, compare `scripts/font_kerning_cohort.py` and `scripts/font_rank8_qualification.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 77 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 `label` to `str = "public"` in one and `str = "evidence"` 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.
AC3 · Page structure· Heading level jumps from h1 to h3 · ×2
Heading level jumps from h1 to h3 mydocs/pr/assets/pr7152_negative_report.html:58— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Heading level jumps from h1 to h3 mydocs/pr/assets/pr7152_responsive_report.html:58— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Low contrast colour pair in CSS (4.0:1) rhwp-safari/src/options.html:137— `.add-domain button` sets color: #fff on background-color: #007aff — 4.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (4.0:1) rhwp-safari/src/options.html:156— `.log-btn-primary` sets color: #fff on background-color: #007aff — 4.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.3:1) rhwp-safari/src/options.html:158— `.log-btn-danger` sets color: #ff3b30 on background-color: #f5f5f7 — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.3:1) rhwp-safari/src/options.html:167— `.log-table th` sets color: #86868b on background-color: #f5f5f7 — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.5:1) rhwp-desk/ui/css/app.css:130— `.palette-hint` sets color: #6b7484 on background-color: #1b2029 — 3.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.5:1) rhwp-desk/ui/css/app.css:543— `.palette-foot` sets color: #6b7484 on background-color: #1b2029 — 3.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
PaintOp::write_json (cyclomatic 96) src/paint/json.rs:645— PaintOp::write_json has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PaintOp::paint_bounds (cyclomatic 22) src/paint/paint_bounds.rs:23— PaintOp::paint_bounds 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.
Tokenizer::next_token (cyclomatic 42) src/renderer/equation/tokenizer.rs:436— Tokenizer::next_token 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.
Tokenizer::read_command (cyclomatic 38) src/renderer/equation/tokenizer.rs:160— Tokenizer::read_command 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.
HtmlRenderer::render_node (cyclomatic 40) src/renderer/html.rs:51— HtmlRenderer::render_node 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.
HtmlRenderer::draw_text_positioned (cyclomatic 26) src/renderer/html.rs:276— HtmlRenderer::draw_text_positioned has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
page-scroll-probe.installPageScrollProbe::observe (cyclomatic 37) rhwp-studio/src/dev/page-scroll-probe.ts:240— page-scroll-probe.installPageScrollProbe::observe has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (page-scroll-probe.installPageScrollProbe::inspectMilestones) 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.
page-scroll-probe.installPageScrollProbe::inspectMilestones (cyclomatic 18) rhwp-studio/src/dev/page-scroll-probe.ts:189— page-scroll-probe.installPageScrollProbe::inspectMilestones 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. This shape REPEATS in the file: one other method here (page-scroll-probe.installPageScrollProbe::observe) 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.
Scan::control (cyclomatic 34) src/document_core/commands/paragraph_block/validation/support.rs:203— Scan::control has cyclomatic complexity 34 (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.
Scan::drain (cyclomatic 24) src/document_core/commands/paragraph_block/validation/resources.rs:151— Scan::drain 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.
rhwp_native_ffi::session::rhwp_native_host_request (cyclomatic 31) bindings/Native/src/session.rs:425— rhwp_native_ffi::session::rhwp_native_host_request has cyclomatic complexity 31 (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. This is NOT this file's highest cyclomatic complexity: rhwp_native_ffi::session::rhwp_session_request (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
rhwp_native_ffi::session::worker_output (cyclomatic 27) bindings/Native/src/session.rs:579— rhwp_native_ffi::session::worker_output has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: rhwp_native_ffi::session::rhwp_session_request (cyclomatic 42) 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 function is counted neither in this dimension's figures nor in its score.
Proof::add (cyclomatic 28) src/document_core/commands/border_paint_structure.rs:180— Proof::add 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.
Proof::complete (cyclomatic 18) src/document_core/commands/border_paint_structure.rs:409— Proof::complete 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.
thumbnail-extractor.extractPrvImageFromZipAsync (cyclomatic 27) rhwp-chrome/sw/thumbnail-extractor.js:294— thumbnail-extractor.extractPrvImageFromZipAsync 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.
thumbnail-extractor.extractPrvImageFromZipAsync (cyclomatic 27) rhwp-firefox/sw/thumbnail-extractor.js:294— thumbnail-extractor.extractPrvImageFromZipAsync 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.
Collector::paragraphs (cyclomatic 25) src/document_core/canvas_metric_requests.rs:61— Collector::paragraphs 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.
Collector::paragraphs (cyclomatic 16) src/document_core/queries/rendering_metafile_resources.rs:117— Collector::paragraphs has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Lexer::next (cyclomatic 24) src/eps.rs:363— Lexer::next 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.
Lexer::read_string (cyclomatic 16) src/eps.rs:453— Lexer::read_string 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.
EmbeddedTextMeasurer::estimate_text_width_exact_with_storage (cyclomatic 24) src/renderer/layout/text_measurement.rs:514— EmbeddedTextMeasurer::estimate_text_width_exact_with_storage 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.
EmbeddedTextMeasurer::compute_char_positions_with_hft_tracking (cyclomatic 24) src/renderer/layout/text_measurement.rs:730— EmbeddedTextMeasurer::compute_char_positions_with_hft_tracking 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.
inspect (cyclomatic 21) rhwp-firefox/dev-tools-inject.js:11— inspect 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.
inspect (cyclomatic 21) rhwp-chrome/dev-tools-inject.js:10— inspect 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.
PageLayerTree::typed_text_v2_slots (cyclomatic 19) src/paint/text_v2_slots.rs:142— PageLayerTree::typed_text_v2_slots has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
PageLayerTree::write_text_v2_export (cyclomatic 18) src/paint/text_v2_export.rs:38— PageLayerTree::write_text_v2_export 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.
thumbnail-extractor.extractPrvImage (cyclomatic 18) rhwp-chrome/sw/thumbnail-extractor.js:65— thumbnail-extractor.extractPrvImage 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.
thumbnail-extractor.extractPrvImage (cyclomatic 18) rhwp-firefox/sw/thumbnail-extractor.js:65— thumbnail-extractor.extractPrvImage 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.
thumbnail-extractor.parseImageData (cyclomatic 17) rhwp-chrome/sw/thumbnail-extractor.js:250— thumbnail-extractor.parseImageData 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.
thumbnail-extractor.parseImageData (cyclomatic 17) rhwp-firefox/sw/thumbnail-extractor.js:250— thumbnail-extractor.parseImageData 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.
LayerBuilder::build_node (cognitive 108) src/paint/builder.rs:310— LayerBuilder::build_node has cognitive complexity 108 (threshold 15). Drivers by points: if/else 41 (91 pts), boolean chains 15, match/switch 2 (nesting depth added 50). 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.
LayerBuilder::build_with_embedded_fonts (cognitive 18) src/paint/builder.rs:150— LayerBuilder::build_with_embedded_fonts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 3 (7 pts), boolean chains 3, match/switch 1 (nesting depth added 6). Of this number, 16 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.
Proof::add (cognitive 76) src/document_core/commands/border_paint_structure.rs:180— Proof::add has cognitive complexity 76 (threshold 15). Drivers by points: if/else 27 (66 pts), loops 4 (7 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.
Proof::complete (cognitive 40) src/document_core/commands/border_paint_structure.rs:409— Proof::complete has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 5 (9 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Interp::op (cognitive 65) src/eps.rs:994— Interp::op has cognitive complexity 65 (threshold 15). Drivers by points: if/else 33 (58 pts), loops 1 (3 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Interp::emit_path (cognitive 34) src/eps.rs:1448— Interp::emit_path has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (33 pts), boolean chains 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EmbeddedTextMeasurer::estimate_text_width_exact_with_storage (cognitive 52) src/renderer/layout/text_measurement.rs:514— EmbeddedTextMeasurer::estimate_text_width_exact_with_storage has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (36 pts), match/switch 2 (9 pts), boolean chains 6, loops 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EmbeddedTextMeasurer::compute_char_positions_with_hft_tracking (cognitive 37) src/renderer/layout/text_measurement.rs:730— EmbeddedTextMeasurer::compute_char_positions_with_hft_tracking has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 4 (12 pts), boolean chains 8, match/switch 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.
TypefaceCatalog::load (cognitive 48) src/renderer/skia/font_catalog.rs:155— TypefaceCatalog::load has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (35 pts), loops 5 (10 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.
TypefaceCatalog::try_from_data (cognitive 17) src/renderer/skia/font_catalog.rs:103— TypefaceCatalog::try_from_data 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.
CanvasKitLayerRenderer.renderTextDecoration::draw (cognitive 47) rhwp-studio/src/view/canvaskit-renderer.ts:4224— CanvasKitLayerRenderer.renderTextDecoration::draw has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 11, loops 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (CanvasKitLayerRenderer.renderTextDecoration::drawLineShape) 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.
CanvasKitLayerRenderer.renderTextDecoration::drawLineShape (cognitive 28) rhwp-studio/src/view/canvaskit-renderer.ts:4175— CanvasKitLayerRenderer.renderTextDecoration::drawLineShape has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 6 (27 pts), match/switch 1 (nesting depth added 21). 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. This shape REPEATS in the file: one other method here (CanvasKitLayerRenderer.renderTextDecoration::draw) 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.
Document::populate_external_images_from_dir (cognitive 46) src/model/document.rs:784— Document::populate_external_images_from_dir has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (27 pts), match/switch 2 (9 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Document::update_external_image_display_path (cognitive 20) src/model/document.rs:625— Document::update_external_image_display_path has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 2 (9 pts), loops 3 (6 pts), if/else 1 (4 pts), boolean chains 1 (nesting depth added 13). 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.
CanvasKitReplayPlanBuilder::item_for_op (cognitive 44) src/renderer/canvaskit_policy.rs:1516— CanvasKitReplayPlanBuilder::item_for_op has cognitive complexity 44 (threshold 15). Drivers by points: if/else 27 (36 pts), boolean chains 5, match/switch 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.
CanvasKitReplayPlanBuilder::collect_leaf_required_font_families (cognitive 19) src/renderer/canvaskit_policy.rs:1435— CanvasKitReplayPlanBuilder::collect_leaf_required_font_families has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 2 (6 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
thumbnail-extractor.extractPrvImageFromZipAsync (cognitive 42) rhwp-chrome/sw/thumbnail-extractor.js:294— thumbnail-extractor.extractPrvImageFromZipAsync has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 8, error handling 1 (4 pts), loops 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
thumbnail-extractor.extractPrvImageFromZipAsync (cognitive 42) rhwp-firefox/sw/thumbnail-extractor.js:294— thumbnail-extractor.extractPrvImageFromZipAsync has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 8, error handling 1 (4 pts), loops 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KerningParagraphBreakSession::boundary_width (cognitive 40) src/renderer/kerning.rs:1823— KerningParagraphBreakSession::boundary_width has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 5 (14 pts), boolean chains 6 (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.
KerningParagraphBreakSession::find_fitting_end (cognitive 16) src/renderer/kerning.rs:1922— KerningParagraphBreakSession::find_fitting_end has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FontGlyphLowerer::lower_portable_glyph_run (cognitive 38) src/paint/font_glyph.rs:569— FontGlyphLowerer::lower_portable_glyph_run has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (31 pts), boolean chains 6, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FontGlyphLowerer::try_svg (cognitive 18) src/paint/font_glyph.rs:1025— FontGlyphLowerer::try_svg has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PageLayerTree::typed_text_v2_slots (cognitive 38) src/paint/text_v2_slots.rs:142— PageLayerTree::typed_text_v2_slots has cognitive complexity 38 (threshold 15). Drivers by points: loops 6 (17 pts), match/switch 4 (13 pts), if/else 2 (8 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PageLayerTree::write_text_v2_export (cognitive 27) src/paint/text_v2_export.rs:38— PageLayerTree::write_text_v2_export has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 5 (9 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SnapshotWalk::paragraph (cognitive 36) src/native_host/accessibility.rs:278— SnapshotWalk::paragraph has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 4 (9 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SnapshotWalk::selection_geometry (cognitive 22) src/native_host/accessibility.rs:420— SnapshotWalk::selection_geometry has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 1, loops 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.
Lexer::next (cognitive 32) src/eps.rs:363— Lexer::next has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 5 (9 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer::read_string (cognitive 17) src/eps.rs:453— Lexer::read_string has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (6 pts), loops 2 (5 pts), match/switch 2 (5 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.
rhwp_desk::planner::substitute_cli_args (cognitive 31) rhwp-desk/src/planner.rs:231— rhwp_desk::planner::substitute_cli_args has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 3 (7 pts), match/switch 2 (5 pts) (nesting depth added 18). Of this number, 27 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.
rhwp_desk::engine::candidate_paths (cognitive 18) rhwp-desk/src/engine.rs:30— rhwp_desk::engine::candidate_paths has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (8 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extractPrvImage (cognitive 30) rhwp-chrome/sw/thumbnail-extractor.js:65— extractPrvImage has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 4, loops 2 (3 pts), ternaries 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.
extractPrvImage (cognitive 30) rhwp-firefox/sw/thumbnail-extractor.js:65— extractPrvImage has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 4, loops 2 (3 pts), ternaries 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.
inspect (cognitive 30) rhwp-firefox/dev-tools-inject.js:11— inspect has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 6, loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
inspect (cognitive 30) rhwp-chrome/dev-tools-inject.js:10— inspect has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 6, loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pool::import (cognitive 29) src/document_core/commands/paragraph_block/import/resources/binary.rs:109— Pool::import has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pool::compact_page::paragraphs (cognitive 19) src/parser/pdf/char_pool.rs:66— Pool::compact_page::paragraphs has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 2 (7 pts), match/switch 1 (3 pts) (nesting depth added 12). 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.
PagePaintContext::publish_glyph_geometry::collect (cognitive 28) src/paint/paper_viewport.rs:195— PagePaintContext::publish_glyph_geometry::collect has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (22 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 18). 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.
PagePaintContext::image_frame (cognitive 18) src/paint/paper_viewport.rs:733— PagePaintContext::image_frame has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TextShapeLowerer::lower_node (cognitive 23) src/paint/text_shape.rs:170— TextShapeLowerer::lower_node has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TextShapeLowerer::evaluate_text_run (cognitive 17) src/paint/text_shape.rs:262— TextShapeLowerer::evaluate_text_run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 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.
Hwp5BinResolver::resolved_len (cognitive 22) src/parser/mod.rs:1998— Hwp5BinResolver::resolved_len has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 4 (7 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.
Hwp5BinResolver::resolve_limited (cognitive 16) src/parser/mod.rs:1917— Hwp5BinResolver::resolve_limited has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), match/switch 4 (7 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Record::read (cognitive 21) src/model/border_paint.rs:826— Record::read has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 5, match/switch 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.
Record::write (cognitive 18) src/model/border_paint.rs:787— Record::write has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 3, match/switch 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TextFontCoverage::select (cognitive 20) src/renderer/text_font_coverage.rs:140— TextFontCoverage::select has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 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.
TextFontCoverage::register (cognitive 16) src/renderer/text_font_coverage.rs:75— TextFontCoverage::register has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ReadState::warn_invalid_references (cognitive 19) src/parser/hml/reader.rs:1404— ReadState::warn_invalid_references has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadState::warn_if_unsupported (cognitive 16) src/parser/hml/reader.rs:1318— ReadState::warn_if_unsupported has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, loops 1 (3 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.
MetafileFonts::coverage_fingerprint (cognitive 18) src/paint/metafile_fonts.rs:386— MetafileFonts::coverage_fingerprint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MetafileFonts::register (cognitive 16) src/paint/metafile_fonts.rs:292— MetafileFonts::register has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, 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.
rhwp_password_crypto::decrypt_hwpx_package (cognitive 17) crates/rhwp-password-crypto/src/lib.rs:752— rhwp_password_crypto::decrypt_hwpx_package has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 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.
rhwp_password_crypto::encrypt_hwpx_package (cognitive 17) crates/rhwp-password-crypto/src/lib.rs:965— rhwp_password_crypto::encrypt_hwpx_package has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RowBlockQuery::candidate (cognitive 16) src/renderer/typeset/table/scan.rs:46— RowBlockQuery::candidate has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 4. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RowBlockQuery::row_offsets_for_cut (cognitive 16) src/renderer/typeset/table/scan.rs:145— RowBlockQuery::row_offsets_for_cut has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
download-interceptor-common.classifyDownload (cognitive 16) rhwp-chrome/sw/download-interceptor-common.js:96— download-interceptor-common.classifyDownload has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
download-interceptor-common.classifyDownload (cognitive 16) rhwp-firefox/sw/download-interceptor-common.js:96— download-interceptor-common.classifyDownload has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D4 · Code Duplication· Near-duplicate member family (8 members, 45 shared lines) · ×2
Near-duplicate member family (8 members, 45 shared lines) src/cli/commands/edit/bookmarks.rs:244— src/cli/commands/edit/bookmarks.rs:244-372 | src/cli/commands/edit/cells.rs:831-968 | src/cli/commands/edit/document_objects.rs:11-143 | src/cli/commands/edit/document_objects.rs:271-404 | src/cli/commands/edit/document_objects.rs:406-562 | src/cli/commands/edit/media.rs:900-1010 | src/cli/commands/edit/note_content.rs:126-223 | src/cli/commands/edit/tables/layout.rs:475-586 — These 8 members are variants of one another: a block of 45 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Near-duplicate member family (8 members, 45 shared lines) src/cli/commands/edit/document_objects.rs:564— src/cli/commands/edit/document_objects.rs:564-668 | src/cli/commands/edit/formatting.rs:10-149 | src/cli/commands/edit/formatting.rs:152-276 | src/cli/commands/edit/formatting.rs:858-1019 | src/cli/commands/edit/header_footer_properties.rs:7-137 | src/cli/commands/edit/note_content.rs:569-695 | src/cli/commands/edit/page.rs:8-109 | src/cli/commands/edit/page.rs:111-215 — These 8 members are variants of one another: a block of 45 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Near-duplicate member family (7 members, 45 shared lines) · ×2
Near-duplicate member family (7 members, 45 shared lines) src/cli/commands/edit/document_text.rs:11— src/cli/commands/edit/document_text.rs:11-227 | src/cli/commands/edit/document_text.rs:229-336 | src/cli/commands/edit/document_text.rs:338-472 | src/cli/commands/edit/document_text.rs:474-606 | src/cli/commands/edit/document_text.rs:608-721 | src/cli/commands/edit/equations.rs:119-252 | src/cli/commands/edit/header_footer_properties.rs:276-389 — These 7 members are variants of one another: a block of 45 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Near-duplicate member family (7 members, 45 shared lines) src/cli/commands/edit/page.rs:342— src/cli/commands/edit/page.rs:342-466 | src/cli/commands/edit/shapes.rs:8-179 | src/cli/commands/edit/tables/grid.rs:8-114 | src/cli/commands/edit/tables/grid.rs:116-222 | src/cli/commands/edit/tables/grid.rs:695-853 | src/cli/commands/edit/tables/layout.rs:103-225 | src/cli/commands/edit/tables/layout.rs:349-473 — These 7 members are variants of one another: a block of 45 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Near-duplicate member pair (56 shared lines) src/parser/pdf/table_hierarchy.rs:58— src/parser/pdf/table_hierarchy.rs:58-175 | tools/pdf-ir-poc/src/table_hierarchy.rs:54-153 — These two members are variants of one another: 56 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.
Near-duplicate member pair (56 shared lines) src/diagnostics/hwp5_roundtrip_batch.rs:287— src/diagnostics/hwp5_roundtrip_batch.rs:287-421 | src/diagnostics/hwpx_roundtrip_batch.rs:164-289 — These two members are variants of one another: 56 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.
Near-duplicate member pair (51 shared lines) src/cli/commands/edit/privacy.rs:177— src/cli/commands/edit/privacy.rs:177-376 | src/cli/commands/edit/text.rs:60-265 — These two members are variants of one another: 51 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.
Near-duplicate member pair (51 shared lines) src/diagnostics/hwp5_roundtrip_batch.rs:602— src/diagnostics/hwp5_roundtrip_batch.rs:602-705 | src/diagnostics/hwpx_roundtrip_batch.rs:438-542 — These two members are variants of one another: 51 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.
Near-duplicate member pair (39 shared lines) src/renderer/layout/table_layout.rs:21044— src/renderer/layout/table_layout.rs:21044-21099 | src/renderer/layout/table_layout.rs:21933-21991 — These two members are variants of one another: 39 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.
Near-duplicate member pair (39 shared lines) src/renderer/layout/border_rendering.rs:1174— src/renderer/layout/border_rendering.rs:1174-1291 | src/renderer/layout/border_rendering.rs:1631-1721 — These two members are variants of one another: 39 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 (11 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (11 members, 50+ identical tokens) src/bin/rhwp-agent/envlint.rs:8— src/bin/rhwp-agent/envlint.rs:8-62 | src/bin/rhwp-agent/envlint.rs:64-102 | src/bin/rhwp-agent/explorecmd.rs:14-118 | src/bin/rhwp-agent/files.rs:8-29 | src/bin/rhwp-agent/files.rs:53-85 | src/bin/rhwp-agent/inspect.rs:83-104 | src/bin/rhwp-agent/planlint.rs:8-80 | src/bin/rhwp-agent/safety.rs:11-48 | src/bin/rhwp-agent/safety.rs:50-113 | src/bin/rhwp-agent/safety.rs:665-738 | src/bin/rhwp-agent/stats.rs:155-186 — These 11 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 11 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 11 times.
Members sharing a duplicated core (11 members, 50+ identical tokens) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:230— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:230-242 | src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:163-175 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:205-217 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:208-220 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:165-177 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:182-194 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:180-192 | src/bin/rhwp-q/commands/rhwp-q-page-items.rs:135-147 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:213-225 | src/bin/rhwp-q/commands/rhwp-q-text-file.rs:156-168 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:164-176 — These 11 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 11 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 11 times.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (7 members, 50+ identical tokens) src/diagnostics/layout_anomaly.rs:602— src/diagnostics/layout_anomaly.rs:602-612 | src/document_core/queries/rendering.rs:2730-2970 | src/native_host/view.rs:288-336 | src/paint/paint_bounds.rs:330-339 | src/parser/pdf/table_detection.rs:26-48 | src/parser/pdf/table_detection/cell_regions.rs:144-165 | src/renderer/hyperlinks.rs:27-55 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) src/document_core/commands/clipboard.rs:901— src/document_core/commands/clipboard.rs:901-1043 | src/document_core/commands/clipboard.rs:1314-1508 | src/document_core/commands/foreign_paste.rs:41-261 | src/document_core/commands/formatting.rs:1167-1233 | src/document_core/commands/formatting.rs:1247-1309 | src/document_core/commands/formatting.rs:1802-1874 | src/document_core/commands/html_import.rs:188-449 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Edited copy of a member (108 corresponding lines) · ×2
Edited copy of a member (108 corresponding lines) src/parser/pdf/recognition.rs:690— src/parser/pdf/recognition.rs:690-799 | tools/pdf-ir-poc/src/recognition.rs:435-542 — These two members are one piece of code written twice and then edited apart: 108 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (108 corresponding lines) tools/inspect_msec/gen_msec_fixtures.py:2244— tools/inspect_msec/gen_msec_fixtures.py:2244-2363 | tools/inspect_msec/gen_msec_fixtures.py:2415-2522 — These two members are one piece of code written twice and then edited apart: 108 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (92 corresponding lines) · ×2
Edited copy of a member (92 corresponding lines) src/renderer/height_measurer.rs:2088— src/renderer/height_measurer.rs:2088-2196 | src/renderer/layout/table_layout.rs:3468-3559 — These two members are one piece of code written twice and then edited apart: 92 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (92 corresponding lines) src/wmf/parser/objects/structure/bitmap_info_header/v4.rs:148— src/wmf/parser/objects/structure/bitmap_info_header/v4.rs:148-244 | src/wmf/parser/objects/structure/bitmap_info_header/v5.rs:174-265 — These two members are one piece of code written twice and then edited apart: 92 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×2
Edited copy of a member (43 corresponding lines) src/renderer/html.rs:492— src/renderer/html.rs:492-534 | src/renderer/svg.rs:4233-4275 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (43 corresponding lines) src/renderer/pagination/engine.rs:143— src/renderer/pagination/engine.rs:143-185 | src/renderer/typeset.rs:2230-2277 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (69 corresponding lines) · ×2
Edited copy of a member (69 corresponding lines) src/wmf/parser/objects/structure/log_color_space.rs:61— src/wmf/parser/objects/structure/log_color_space.rs:61-129 | src/wmf/parser/objects/structure/log_color_space_w.rs:61-130 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (69 corresponding lines) src/bin/rhwp-q/kit/layer_tree.rs:12— src/bin/rhwp-q/kit/layer_tree.rs:12-80 | src/bin/rhwp-q/kit/search_all.rs:12-86 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (57 corresponding lines) · ×2
Edited copy of a member (57 corresponding lines) src/wmf/parser/objects/graphics/brush.rs:31— src/wmf/parser/objects/graphics/brush.rs:31-92 | src/wmf/parser/objects/structure/log_brush.rs:27-83 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (57 corresponding lines) src/document_core/queries/font_metric_coverage.rs:677— src/document_core/queries/font_metric_coverage.rs:677-733 | src/document_core/queries/rendering.rs:598-657 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 37+ corresponding lines) · ×2
Edited copies of one member (3 members, 37+ corresponding lines) src/bin/rhwp-q/kit/cursor_in_cell.rs:68— src/bin/rhwp-q/kit/cursor_in_cell.rs:68-107 | src/bin/rhwp-q/kit/cursor_in_hf.rs:69-123 | src/bin/rhwp-q/kit/cursor_in_note.rs:65-101 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 37 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, 37+ corresponding lines) src/bin/rhwp-agent/lookups.rs:11— src/bin/rhwp-agent/lookups.rs:11-47 | src/bin/rhwp-agent/lookups.rs:324-368 | src/bin/rhwp-agent/lookups.rs:485-529 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 37 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 (50 corresponding lines) · ×2
Edited copy of a member (50 corresponding lines) src/paint/json.rs:1860— src/paint/json.rs:1860-1916 | src/paint/json.rs:1918-1967 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (50 corresponding lines) src/paint/shaped_measurement.rs:310— src/paint/shaped_measurement.rs:310-360 | src/paint/shaped_measurement.rs:372-421 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×2
Edited copy of a member (40 corresponding lines) src/renderer/height_measurer.rs:2229— src/renderer/height_measurer.rs:2229-2268 | src/renderer/height_measurer.rs:6235-6283 — 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.
Edited copy of a member (40 corresponding lines) src/model/hyperlink_format.rs:207— src/model/hyperlink_format.rs:207-254 | src/model/hyperlink_format.rs:286-325 — 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 (42 corresponding lines) · ×2
Edited copy of a member (42 corresponding lines) src/renderer/mod.rs:4162— src/renderer/mod.rs:4162-4203 | src/renderer/mod.rs:4206-4247 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (42 corresponding lines) src/parser/body_text.rs:301— src/parser/body_text.rs:301-345 | src/parser/hwpx/section.rs:154-195 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×2
Edited copy of a member (33 corresponding lines) src/document_core/queries/rendering.rs:4789— src/document_core/queries/rendering.rs:4789-4826 | src/document_core/queries/rendering.rs:4829-4861 — 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) src/bin/rhwp-agent/compare.rs:17— src/bin/rhwp-agent/compare.rs:17-49 | src/bin/rhwp-agent/compare.rs:51-84 — 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 copies of one member (3 members, 23+ corresponding lines) · ×2
Edited copies of one member (3 members, 23+ corresponding lines) src/render_backend/util.rs:19— src/render_backend/util.rs:19-41 | src/renderer/canvaskit_policy.rs:2159-2192 | src/renderer/pdf.rs:858-880 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 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, 23+ corresponding lines) src/parser/cfb_reader.rs:713— src/parser/cfb_reader.rs:713-735 | src/parser/cfb_reader.rs:737-759 | src/parser/cfb_reader.rs:762-786 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 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, 27+ corresponding lines) · ×2
Edited copies of one member (3 members, 27+ corresponding lines) src/bin/rhwp-agent/searchcmd.rs:61— src/bin/rhwp-agent/searchcmd.rs:61-94 | src/bin/rhwp-agent/searchcmd.rs:96-122 | src/bin/rhwp-agent/searchcmd.rs:124-159 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 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, 27+ corresponding lines) tools/skill_router/audit_skill_commands.py:466— tools/skill_router/audit_skill_commands.py:466-492 | tools/skill_router/check_catalog_sync.py:314-345 | tools/skill_router/gate_new_skill.py:844-870 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 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, 22+ corresponding lines) · ×2
Edited copies of one member (3 members, 22+ corresponding lines) src/paint/resources.rs:62— src/paint/resources.rs:62-83 | src/paint/resources.rs:112-133 | src/paint/resources.rs:162-185 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 22+ corresponding lines) src/wasm_api.rs:1201— src/wasm_api.rs:1201-1228 | src/wasm_api.rs:1244-1268 | src/wasm_api.rs:1351-1372 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 20+ corresponding lines) · ×2
Edited copies of one member (4 members, 20+ corresponding lines) src/diagnostics/hwp5_roundtrip_batch.rs:503— src/diagnostics/hwp5_roundtrip_batch.rs:503-524 | src/diagnostics/hwpx_roundtrip_batch.rs:292-313 | src/diagnostics/layout_anomaly.rs:1799-1824 | src/diagnostics/render_geom_diff.rs:753-772 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 20+ corresponding lines) src/renderer/typeset.rs:3821— src/renderer/typeset.rs:3821-3843 | src/renderer/typeset/controls.rs:105-124 | src/renderer/typeset/paragraph.rs:157-179 | src/renderer/typeset/paragraph.rs:964-989 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 24+ corresponding lines) · ×2
Edited copies of one member (3 members, 24+ corresponding lines) src/document_core/commands/table_ops.rs:658— src/document_core/commands/table_ops.rs:658-681 | src/document_core/commands/table_ops.rs:695-720 | src/document_core/commands/table_ops.rs:794-827 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 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, 24+ corresponding lines) src/native_host/gpu_d3d.rs:182— src/native_host/gpu_d3d.rs:182-205 | src/native_host/gpu_metal.rs:122-145 | src/native_host/presentation.rs:105-128 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 22+ corresponding lines) · ×2
Edited copies of one member (4 members, 22+ corresponding lines) src/bin/rhwp-agent/safety.rs:748— src/bin/rhwp-agent/safety.rs:748-769 | src/bin/rhwp-agent/safety.rs:779-803 | src/cli/queries/security_inspection.rs:532-559 | src/cli/queries/security_inspection.rs:809-833 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 22+ corresponding lines) src/document_core/commands/table_ops.rs:80— src/document_core/commands/table_ops.rs:80-101 | src/document_core/commands/table_ops.rs:111-132 | src/document_core/commands/table_ops.rs:141-162 | src/document_core/commands/table_ops.rs:171-192 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 1+ corresponding lines) · ×2
Edited copies of one member (8 members, 1+ corresponding lines) src/model/control.rs:219— src/model/control.rs:219-219 | src/model/control.rs:404-404 | src/renderer/inline_flow.rs:81-81 | src/renderer/inline_flow.rs:112-112 | src/renderer/mod.rs:5322-5322 | src/renderer/pagination.rs:347-347 | src/renderer/pagination.rs:693-693 | src/renderer/pagination.rs:1098-1098 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 1 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.
Edited copies of one member (8 members, 1+ corresponding lines) src/model/style.rs:1335— src/model/style.rs:1335-1335 | src/renderer/composer.rs:246-246 | src/renderer/inline_flow/floating_shapes.rs:26-26 | src/renderer/layout_frame.rs:453-453 | src/renderer/mod.rs:186-186 | src/renderer/mod.rs:198-198 | src/renderer/pagination.rs:457-457 | src/renderer/space_compression.rs:9-9 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 1 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, 12+ corresponding lines) · ×2
Edited copies of one member (4 members, 12+ corresponding lines) src/document_core/native_pua_fonts.rs:209— src/document_core/native_pua_fonts.rs:209-220 | src/document_core/native_pua_fonts.rs:231-242 | src/document_core/native_pua_fonts.rs:252-263 | src/document_core/native_pua_fonts.rs:274-285 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) src/renderer/composer/line_breaking.rs:519— src/renderer/composer/line_breaking.rs:519-536 | src/renderer/composer/punctuation_slots.rs:42-53 | src/renderer/composer/supplemental_clusters.rs:54-65 | src/renderer/layout/text_measurement.rs:940-951 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×2
Edited copies of one member (4 members, 9+ corresponding lines) src/renderer/png_sampling.rs:60— src/renderer/png_sampling.rs:60-84 | src/renderer/png_sampling.rs:91-99 | src/renderer/png_sampling.rs:101-109 | src/renderer/png_sampling.rs:111-120 — 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.
Edited copies of one member (4 members, 9+ corresponding lines) src/wmf/parser/objects/graphics/pen.rs:24— src/wmf/parser/objects/graphics/pen.rs:24-39 | src/wmf/parser/objects/structure/ciexyz.rs:23-31 | src/wmf/parser/objects/structure/ciexyz_triple.rs:24-33 | src/wmf/parser/objects/structure/rgb_triple.rs:24-35 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×2
Edited copies of one member (3 members, 7+ corresponding lines) gym/core/checks.py:396— gym/core/checks.py:396-402 | gym/core/checks.py:406-413 | gym/core/checks.py:417-424 — 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.
Edited copies of one member (3 members, 7+ corresponding lines) src/document_core/queries/hwpctrl_sets.rs:2372— src/document_core/queries/hwpctrl_sets.rs:2372-2382 | src/document_core/queries/hwpctrl_sets.rs:2393-2399 | src/document_core/queries/hwpctrl_sets.rs:2402-2408 — 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 (3 members, 30+ corresponding lines) · ×2
Edited copies of one member (3 members, 30+ corresponding lines) crates/rhwp-contracts/src/ir_schema.rs:803— crates/rhwp-contracts/src/ir_schema.rs:803-863 | src/capabilities_schema.rs:526-557 | src/capabilities_schema.rs:563-592 — 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.
Edited copies of one member (3 members, 30+ corresponding lines) tools/inspect_msec/gen_msec_fixtures.py:1071— tools/inspect_msec/gen_msec_fixtures.py:1071-1100 | tools/inspect_msec/gen_msec_fixtures.py:1752-1783 | tools/inspect_msec/gen_msec_fixtures.py:1825-1860 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 11+ corresponding lines) · ×2
Edited copies of one member (4 members, 11+ corresponding lines) bindings/Native/src/gpu_d3d.rs:38— bindings/Native/src/gpu_d3d.rs:38-50 | bindings/Native/src/gpu_d3d.rs:64-74 | bindings/Native/src/gpu_d3d.rs:84-94 | bindings/Native/src/gpu_d3d.rs:101-111 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 11+ corresponding lines) src/renderer/layout/paragraph_layout.rs:1226— src/renderer/layout/paragraph_layout.rs:1226-1236 | src/renderer/layout/paragraph_layout.rs:1243-1256 | src/renderer/typeset.rs:1465-1475 | src/renderer/typeset/paragraph/line_queries.rs:32-43 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 13+ corresponding lines) · ×2
Edited copies of one member (4 members, 13+ corresponding lines) bindings/Native/src/gpu_metal.rs:67— bindings/Native/src/gpu_metal.rs:67-79 | bindings/Native/src/gpu_metal.rs:94-106 | bindings/Native/src/gpu_metal.rs:116-128 | bindings/Native/src/gpu_metal.rs:140-152 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:188— src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:188-200 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:121-133 | src/bin/rhwp-q/commands/rhwp-q-scan-items.rs:162-177 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:115-127 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×2
Edited copies of one member (3 members, 6+ corresponding lines) gym/tools/competitive_bench.py:919— gym/tools/competitive_bench.py:919-924 | gym/tools/competitive_bench.py:928-933 | gym/tools/competitive_bench.py:973-981 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) crates/rhwp-password-crypto/src/lib.rs:912— crates/rhwp-password-crypto/src/lib.rs:912-919 | src/document_core/helpers.rs:322-327 | src/serializer/hwpx/field.rs:65-73 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 3+ corresponding lines) · ×2
Edited copies of one member (4 members, 3+ corresponding lines) src/parser/pdf/table_detection.rs:569— src/parser/pdf/table_detection.rs:569-571 | src/parser/pdf/table_hierarchy.rs:50-52 | tools/pdf-ir-poc/src/table_detection.rs:309-311 | tools/pdf-ir-poc/src/table_hierarchy.rs:49-51 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 3+ corresponding lines) src/agent/dsel/ast.rs:229— src/agent/dsel/ast.rs:229-231 | src/docdiff/model.rs:299-305 | src/parser/tags.rs:366-371 | src/serializer/doc_info.rs:589-594 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 10+ corresponding lines) · ×2
Edited copies of one member (4 members, 10+ corresponding lines) src/model/border_paint.rs:1195— src/model/border_paint.rs:1195-1204 | src/model/table_row_grid.rs:470-479 | src/model/text_clip.rs:275-284 | src/model/text_paint.rs:150-159 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 10+ corresponding lines) scripts/font_kerning_cohort.py:558— scripts/font_kerning_cohort.py:558-569 | scripts/font_rank1_qualification.py:410-422 | scripts/font_rank7_qualification.py:527-539 | scripts/font_rank8_qualification.py:607-616 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 4+ corresponding lines) · ×2
Edited copies of one member (4 members, 4+ corresponding lines) src/diagnostics/hwp5_cell_header_probe.rs:699— src/diagnostics/hwp5_cell_header_probe.rs:699-702 | src/diagnostics/hwp5_contract_probe.rs:607-610 | src/diagnostics/hwp5_mel_personnel_probe.rs:613-616 | src/diagnostics/hwp5_table_probe.rs:358-361 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) scripts/oracle_stage4_profile.py:659— scripts/oracle_stage4_profile.py:659-662 | scripts/oracle_stage5_queue_projection.py:574-578 | scripts/oracle_stage5_rank16_disposition.py:287-290 | scripts/oracle_stage5_rank8_profile.py:494-497 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (52–53 lines × 2) src/wmf/parser/objects/structure/bitmap_info_header/v4.rs:188— src/wmf/parser/objects/structure/bitmap_info_header/v4.rs:188-240 | src/wmf/parser/objects/structure/bitmap_info_header/v5.rs:206-257 — before extracting anything, compare `src/wmf/parser/objects/structure/bitmap_info_header/v4.rs` and `src/wmf/parser/objects/structure/bitmap_info_header/v5.rs` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/wmf/parser/objects/structure/bitmap_info_header/v4.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.
Duplicated block (52–53 lines × 2) tools/llm_verifier/lineage_chain/generate_corpus.py:545— tools/llm_verifier/lineage_chain/generate_corpus.py:545-597 | tools/llm_verifier/third_party_replay/generate_corpus.py:425-476 — `tools/llm_verifier/lineage_chain/generate_corpus.py` and `tools/llm_verifier/third_party_replay/generate_corpus.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 81 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (49 lines × 2) src/bin/rhwp-q/more/envelope.rs:91— src/bin/rhwp-q/more/envelope.rs:91-139 | src/bin/rhwp-q/pack/envelope.rs:91-139 — `src/bin/rhwp-q/more/envelope.rs` and `src/bin/rhwp-q/pack/envelope.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 125 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (49 lines × 2) src/parser/pdf/recognition.rs:716— src/parser/pdf/recognition.rs:716-764 | tools/pdf-ir-poc/src/recognition.rs:463-511 — before extracting anything, compare `src/parser/pdf/recognition.rs` and `tools/pdf-ir-poc/src/recognition.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/recognition.rs:716` 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 (46–47 lines × 2) src/renderer/composer/cell_line_breaking.inc.rs:235— src/renderer/composer/cell_line_breaking.inc.rs:235-281 | src/renderer/composer/cell_line_breaking.inc.rs:293-338 — both copies are in the same file, so extract the 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 `src/renderer/composer/cell_line_breaking.inc.rs:235` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/renderer/composer/cell_line_breaking.inc.rs:283` calls `text_width`, `matches`, `count` and `src/renderer/composer/cell_line_breaking.inc.rs:340` 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 (46–47 lines × 2) tools/llm_verifier/oracle_vs_self/generate_corpus.py:260— tools/llm_verifier/oracle_vs_self/generate_corpus.py:260-306 | tools/llm_verifier/shadow_agree/generate_corpus.py:230-275 — `tools/llm_verifier/oracle_vs_self/generate_corpus.py` and `tools/llm_verifier/shadow_agree/generate_corpus.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 70 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (44 lines × 2) src/document_core/commands/text_editing.rs:4250— src/document_core/commands/text_editing.rs:4250-4293 | src/document_core/commands/text_editing.rs:5126-5169 — both copies are in the same file, so extract the 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 (44 lines × 2) src/parser/pdf/structured_lowering.rs:1335— src/parser/pdf/structured_lowering.rs:1335-1378 | tools/pdf-ir-poc/src/structured_lowering.rs:276-319 — before extracting anything, compare `src/parser/pdf/structured_lowering.rs` and `tools/pdf-ir-poc/src/structured_lowering.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 309 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (35 lines × 2) src/renderer/pagination/state.rs:96— src/renderer/pagination/state.rs:96-130 | src/renderer/pagination/state.rs:137-171 — both copies are in the same file, so extract the 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 `src/renderer/pagination/state.rs:96` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/renderer/pagination/state.rs:93` calls `is_empty`, `Ok` and `src/renderer/pagination/state.rs:136` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (35 lines × 2) src/renderer/shaping_paragraph.rs:428— src/renderer/shaping_paragraph.rs:428-462 | src/renderer/shaping_paragraph.rs:637-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/shaping_paragraph.rs:428` 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 (33 lines × 3) src/cli/commands/edit/header_footer_content.rs:304— src/cli/commands/edit/header_footer_content.rs:304-336 | src/cli/commands/edit/header_footer_content.rs:777-809 | src/cli/commands/edit/header_footer_content.rs:1063-1095 — 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 `src/cli/commands/edit/header_footer_content.rs:304` 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 (33 lines × 3) src/cli/commands/edit/header_footer_content.rs:454— src/cli/commands/edit/header_footer_content.rs:454-486 | src/cli/commands/edit/header_footer_content.rs:909-941 | src/cli/commands/edit/header_footer_properties.rs:438-470 — before extracting anything, compare `src/cli/commands/edit/header_footer_content.rs` and `src/cli/commands/edit/header_footer_properties.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 296 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 `src/cli/commands/edit/header_footer_content.rs:454` 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 (33 lines × 2) src/bin/rhwp-q/more/probe.rs:153— src/bin/rhwp-q/more/probe.rs:153-185 | src/bin/rhwp-q/pack/probe.rs:143-175 — `src/bin/rhwp-q/more/probe.rs` and `src/bin/rhwp-q/pack/probe.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 113 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/probe.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.
Duplicated block (33 lines × 2) src/document_core/commands/object_ops/common.rs:302— src/document_core/commands/object_ops/common.rs:302-334 | src/document_core/commands/object_ops/picture.rs:387-419 — before extracting anything, compare `src/document_core/commands/object_ops/common.rs` and `src/document_core/commands/object_ops/picture.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (28 lines × 3) src/cli/commands/edit/document_text.rs:37— src/cli/commands/edit/document_text.rs:37-64 | src/cli/commands/edit/document_text.rs:351-378 | src/cli/commands/edit/document_text.rs:487-514 — 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 (28 lines × 3) src/diagnostics/hwp5_cell_header_probe.rs:353— src/diagnostics/hwp5_cell_header_probe.rs:353-380 | src/diagnostics/hwp5_mel_personnel_probe.rs:296-323 | src/diagnostics/hwp5_table_probe.rs:290-317 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_mel_personnel_probe.rs` as WHOLE FILES: this scan already matched 35 separate duplicated blocks between them, totalling at least 503 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 `src/diagnostics/hwp5_cell_header_probe.rs:353` 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 (25–28 lines × 2) src/parser/pdf/structured_lowering.rs:468— src/parser/pdf/structured_lowering.rs:468-495 | src/parser/pdf/structured_lowering.rs:569-593 — both copies are in the same file, so extract the 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 (25–28 lines × 2) src/renderer/layout/table_partial.rs:3660— src/renderer/layout/table_partial.rs:3660-3687 | src/renderer/layout/table_partial.rs:3757-3781 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_partial.rs:3660` 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 (25–27 lines × 2) src/document_core/commands/object_ops/picture.rs:1893— src/document_core/commands/object_ops/picture.rs:1893-1919 | src/document_core/commands/object_ops/picture.rs:1970-1994 — both copies are in the same file, so extract the 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 `src/document_core/commands/object_ops/picture.rs:1893` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (25–27 lines × 2) src/renderer/height_measurer.rs:633— src/renderer/height_measurer.rs:633-657 | src/renderer/typeset.rs:158-184 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/typeset.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 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 `src/renderer/height_measurer.rs:633` 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 (21–24 lines × 2) src/parser/mod.rs:1167— src/parser/mod.rs:1167-1187 | src/parser/mod.rs:2115-2138 — both copies are in the same file, so extract the 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 `src/parser/mod.rs:1167` 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–24 lines × 2) src/renderer/layout/table_layout.rs:14493— src/renderer/layout/table_layout.rs:14493-14516 | src/renderer/layout/table_layout.rs:14568-14588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 3) src/bin/rhwp-agent/chunkplan.rs:37— src/bin/rhwp-agent/chunkplan.rs:37-59 | src/bin/rhwp-agent/fingerprint.rs:180-202 | src/bin/rhwp-agent/piiscan.rs:75-97 — 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 `src/bin/rhwp-agent/chunkplan.rs:37` 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 (23 lines × 3) src/wmf/converter/bitmap.rs:48— src/wmf/converter/bitmap.rs:48-70 | src/wmf/converter/bitmap.rs:83-105 | src/wmf/converter/bitmap.rs:139-161 — 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 `src/wmf/converter/bitmap.rs:48` 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 (21–23 lines × 2) src/renderer/pagination/engine.rs:1574— src/renderer/pagination/engine.rs:1574-1594 | src/renderer/pagination/engine.rs:1761-1783 — both copies are in the same file, so extract the 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 `src/renderer/pagination/engine.rs:1574` 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 (21–23 lines × 2) scripts/generate_exact_face_collection_fixture.py:35— scripts/generate_exact_face_collection_fixture.py:35-55 | scripts/generate_font_glyph_payload_fixture.py:96-118 — 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 `scripts/generate_font_glyph_payload_fixture.py:96` 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 (22 lines × 4) src/bin/rhwp-q/kit/caret_stops.rs:17— src/bin/rhwp-q/kit/caret_stops.rs:17-38 | src/bin/rhwp-q/kit/char_index.rs:19-40 | src/bin/rhwp-q/kit/word_end.rs:19-40 | src/bin/rhwp-q/kit/word_starts.rs:17-38 — before extracting anything, compare `src/bin/rhwp-q/kit/caret_stops.rs` and `src/bin/rhwp-q/kit/char_index.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 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 `src/bin/rhwp-q/kit/caret_stops.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.
Duplicated block (22 lines × 4) src/wmf/parser/records/bitmap/bit_blt.rs:131— src/wmf/parser/records/bitmap/bit_blt.rs:131-152 | src/wmf/parser/records/bitmap/dib_bit_blt.rs:135-156 | src/wmf/parser/records/bitmap/dib_stretch_blt.rs:158-179 | src/wmf/parser/records/bitmap/stretch_blt.rs:155-176 — before extracting anything, compare `src/wmf/parser/records/bitmap/bit_blt.rs` and `src/wmf/parser/records/bitmap/dib_bit_blt.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 `src/wmf/parser/records/bitmap/bit_blt.rs:131` 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 (20–22 lines × 2) src/renderer/layout.rs:1934— src/renderer/layout.rs:1934-1953 | src/renderer/typeset.rs:1926-1947 — before extracting anything, compare `src/renderer/layout.rs` and `src/renderer/typeset.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 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 `src/renderer/layout.rs:1934` 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 (20–22 lines × 2) src/renderer/svg.rs:922— src/renderer/svg.rs:922-943 | src/renderer/web_canvas.rs:1096-1115 — before extracting anything, compare `src/renderer/svg.rs` and `src/renderer/web_canvas.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 321 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 `src/renderer/svg.rs:922` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/renderer/web_canvas.rs:1116` calls `set_fill_style_str`, `set_font` and `src/renderer/svg.rs:944` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (21–22 lines × 2) src/renderer/layout/table_layout.rs:9095— src/renderer/layout/table_layout.rs:9095-9115 | src/renderer/layout/table_layout.rs:9685-9706 — both copies are in the same file, so extract the 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 (21–22 lines × 2) src/renderer/layout/table_layout.rs:27630— src/renderer/layout/table_layout.rs:27630-27651 | src/renderer/layout/table_partial.rs:6847-6867 — before extracting anything, compare `src/renderer/layout/table_layout.rs` and `src/renderer/layout/table_partial.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 327 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 `src/renderer/layout/table_layout.rs:27630` 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 (21 lines × 4) src/cli/commands/edit/document_text.rs:1036— src/cli/commands/edit/document_text.rs:1036-1056 | src/cli/commands/edit/notes.rs:20-40 | src/cli/commands/edit/notes.rs:115-135 | src/cli/commands/edit/shapes.rs:26-46 — before extracting anything, compare `src/cli/commands/edit/document_text.rs` and `src/cli/commands/edit/notes.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 250 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 `src/cli/commands/edit/document_text.rs:1036` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 4) src/cli/commands/edit/header_footer_content.rs:297— src/cli/commands/edit/header_footer_content.rs:297-317 | src/cli/commands/edit/header_footer_content.rs:616-636 | src/cli/commands/edit/header_footer_content.rs:770-790 | src/cli/commands/edit/header_footer_content.rs:1056-1076 — 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 `src/cli/commands/edit/header_footer_content.rs:297` 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–20 lines × 3) src/cli/outputs/tabular.rs:27— src/cli/outputs/tabular.rs:27-45 | src/cli/outputs/text.rs:278-297 | src/cli/queries/security_inspection.rs:37-56 — before extracting anything, compare `src/cli/outputs/tabular.rs` and `src/cli/outputs/text.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 116 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 `src/cli/outputs/tabular.rs:27` 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–20 lines × 3) src/document_core/commands/table_ops.rs:663— src/document_core/commands/table_ops.rs:663-681 | src/document_core/commands/table_ops.rs:702-720 | src/document_core/commands/table_ops.rs:808-827 — 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 `src/document_core/commands/table_ops.rs:663` 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–20 lines × 2) src/renderer/layout/table_layout.rs:23767— src/renderer/layout/table_layout.rs:23767-23786 | src/renderer/layout/table_layout.rs:24011-24026 — both copies are in the same file, so extract the 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–20 lines × 2) src/parser/control/shape.rs:182— src/parser/control/shape.rs:182-201 | src/parser/control/shape.rs:792-807 — both copies are in the same file, so extract the 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 `src/parser/control/shape.rs:182` 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 × 4) src/diagnostics/hwp5_cell_header_probe.rs:186— src/diagnostics/hwp5_cell_header_probe.rs:186-204 | src/diagnostics/hwp5_contract_analyze.rs:111-129 | src/diagnostics/hwp5_mel_personnel_probe.rs:132-150 | src/diagnostics/hwp5_table_probe.rs:138-156 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_contract_analyze.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/diagnostics/hwp5_cell_header_probe.rs:186` 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 (19 lines × 4) src/bin/rhwp-q/pack/inventory.rs:500— src/bin/rhwp-q/pack/inventory.rs:500-518 | src/bin/rhwp-q/pack/inventory.rs:914-932 | src/bin/rhwp-q/pack/inventory.rs:941-959 | src/bin/rhwp-q/pack/inventory.rs:1302-1320 — 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 `src/bin/rhwp-q/pack/inventory.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 (17 lines × 9) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:87— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:87-103 | src/diagnostics/hwp5_cell_header_probe.rs:145-161 | src/diagnostics/hwp5_char_shape_audit.rs:133-149 | src/diagnostics/hwp5_contract_analyze.rs:70-86 | src/diagnostics/hwp5_contract_probe.rs:92-108 | src/diagnostics/hwp5_ctrl_data_trace.rs:26-42 | src/diagnostics/hwp5_first_para_control_probe.rs:98-114 | src/diagnostics/hwp5_mel_personnel_probe.rs:91-107 | src/diagnostics/hwp5_table_probe.rs:97-113 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 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 (17 lines × 9) src/wmf/parser/records/drawing/line_to.rs:40— src/wmf/parser/records/drawing/line_to.rs:40-56 | src/wmf/parser/records/state/move_to.rs:39-55 | src/wmf/parser/records/state/offset_clip_rgn.rs:39-55 | src/wmf/parser/records/state/offset_viewport_org.rs:39-55 | src/wmf/parser/records/state/offset_window_org.rs:39-55 | src/wmf/parser/records/state/set_viewport_ext.rs:39-55 | src/wmf/parser/records/state/set_viewport_org.rs:39-55 | src/wmf/parser/records/state/set_window_ext.rs:39-55 | src/wmf/parser/records/state/set_window_org.rs:39-55 — before extracting anything, compare `src/wmf/parser/records/state/move_to.rs` and `src/wmf/parser/records/state/set_window_org.rs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/wmf/parser/records/drawing/line_to.rs:40` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 7) src/cli/commands/tabular_import.rs:525— src/cli/commands/tabular_import.rs:525-541 | src/cli/outputs/tabular.rs:147-163 | src/cli/outputs/tabular.rs:357-373 | src/cli/outputs/text.rs:66-82 | src/cli/queries/digest.rs:84-100 | src/cli/queries/security_inspection.rs:158-175 | src/cli/queries/structure.rs:58-74 — before extracting anything, compare `src/cli/commands/tabular_import.rs` and `src/cli/outputs/tabular.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/tabular_import.rs:525` 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 (17 lines × 7) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:126— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:126-142 | src/diagnostics/hwp5_cell_header_probe.rs:196-212 | src/diagnostics/hwp5_contract_probe.rs:148-164 | src/diagnostics/hwp5_ctrl_data_trace.rs:89-105 | src/diagnostics/hwp5_first_para_control_probe.rs:152-168 | src/diagnostics/hwp5_mel_personnel_probe.rs:142-158 | src/diagnostics/hwp5_table_probe.rs:148-164 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 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 `src/diagnostics/hwp5_borderfill_diagonal_probe.rs:126` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 4) src/parser/hwpx/section.rs:3134— src/parser/hwpx/section.rs:3134-3150 | src/parser/hwpx/section.rs:3788-3804 | src/parser/hwpx/section.rs:7520-7536 | src/parser/hwpx/section.rs:7653-7669 — 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 `src/parser/hwpx/section.rs:3134` 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 × 4) scripts/font_kerning_cohort.py:573— scripts/font_kerning_cohort.py:573-590 | scripts/font_rank1_qualification.py:426-443 | scripts/font_rank7_qualification.py:543-560 | scripts/font_rank8_qualification.py:620-636 — before extracting anything, compare `scripts/font_kerning_cohort.py` and `scripts/font_rank8_qualification.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12–17 lines × 2) src/cli/commands/edit/header_footer_properties.rs:90— src/cli/commands/edit/header_footer_properties.rs:90-101 | src/cli/commands/edit/tables/grid.rs:417-433 — before extracting anything, compare `src/cli/commands/edit/header_footer_properties.rs` and `src/cli/commands/edit/tables/grid.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/header_footer_properties.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 (12–17 lines × 2) src/renderer/float_placement.rs:9173— src/renderer/float_placement.rs:9173-9184 | src/renderer/float_placement.rs:9329-9345 — both copies are in the same file, so extract the 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 `src/renderer/float_placement.rs:9173` 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 after the matched lines, `src/renderer/float_placement.rs:9346` calls `is_some_and`, `has_non_whitespace_text`, `is_empty` and `src/renderer/float_placement.rs:9185` 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 (15–16 lines × 3) src/renderer/web_canvas.rs:2263— src/renderer/web_canvas.rs:2263-2277 | src/renderer/web_canvas.rs:2349-2364 | src/renderer/web_canvas.rs:2473-2488 — 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 `src/renderer/web_canvas.rs:2263` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–16 lines × 3) tools/fidelity_compare/fidelity_compare.py:2381— tools/fidelity_compare/fidelity_compare.py:2381-2396 | tools/fidelity_compare/fidelity_compare.py:2525-2540 | tools/fidelity_compare/fidelity_compare.py:2585-2599 — 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 `tools/fidelity_compare/fidelity_compare.py:2381` 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 (4–16 lines × 3) src/paint/json.rs:2320— src/paint/json.rs:2320-2323 | src/paint/shaping_glyph.rs:378-393 | src/paint/text_shape.rs:450-465 — 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 `src/paint/shaping_glyph.rs:378` 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 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 (4–16 lines × 3) src/serializer/hwpx/char_shapes.rs:84— src/serializer/hwpx/char_shapes.rs:84-98 | src/serializer/hwpx/header.rs:696-711 | src/serializer/hwpx/shape.rs:1687-1690 — 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 `src/serializer/hwpx/char_shapes.rs:84` 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 4) src/cli/commands/edit/cells.rs:426— src/cli/commands/edit/cells.rs:426-440 | src/cli/commands/edit/document_text.rs:169-182 | src/cli/commands/edit/media.rs:430-444 | src/cli/commands/tabular_import.rs:399-413 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 218 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 `src/cli/commands/edit/cells.rs:426` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/cli/commands/edit/document_text.rs:183` calls `chars`, `count` and `src/cli/commands/edit/cells.rs:442` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14–15 lines × 4) tools/llm_verifier/abstain/corpus_io.py:21— tools/llm_verifier/abstain/corpus_io.py:21-34 | tools/llm_verifier/oracle_vs_self/corpus_io.py:21-34 | tools/llm_verifier/shadow_agree/corpus_io.py:24-37 | tools/llm_verifier/untrusted_sandbox/corpus_io.py:21-35 — `tools/llm_verifier/abstain/corpus_io.py` and `tools/llm_verifier/oracle_vs_self/corpus_io.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 2 separate duplicated blocks between them, totalling at least 21 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `tools/llm_verifier/untrusted_sandbox/corpus_io.py:21` 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 (12–15 lines × 2) src/document_core/commands/text_editing.rs:6560— src/document_core/commands/text_editing.rs:6560-6574 | src/document_core/commands/text_editing.rs:6612-6623 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:6560` 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–15 lines × 2) tools/schema-validator/schema_validator.py:470— tools/schema-validator/schema_validator.py:470-484 | tools/test-data-gen/hwp_test_data_generator.py:414-425 — 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 `tools/schema-validator/schema_validator.py:470` 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 × 6) src/bin/rhwp-q/kit/fn_selection_rects.rs:26— src/bin/rhwp-q/kit/fn_selection_rects.rs:26-39 | src/bin/rhwp-q/kit/form_at.rs:23-36 | src/bin/rhwp-q/kit/hf_edit_target.rs:39-52 | src/bin/rhwp-q/kit/hit_fn_marker.rs:24-37 | src/bin/rhwp-q/kit/hit_in_footnote.rs:24-37 | src/bin/rhwp-q/kit/hit_in_hf.rs:41-54 — before extracting anything, compare `src/bin/rhwp-q/kit/fn_selection_rects.rs` and `src/bin/rhwp-q/kit/form_at.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/kit/fn_selection_rects.rs:26` 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 (14 lines × 6) src/diagnostics/hwp5_cell_header_probe.rs:182— src/diagnostics/hwp5_cell_header_probe.rs:182-195 | src/diagnostics/hwp5_contract_analyze.rs:107-120 | src/diagnostics/hwp5_contract_probe.rs:130-143 | src/diagnostics/hwp5_ctrl_data_trace.rs:64-77 | src/diagnostics/hwp5_mel_personnel_probe.rs:128-141 | src/diagnostics/hwp5_table_probe.rs:134-147 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_contract_analyze.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/diagnostics/hwp5_cell_header_probe.rs:182` 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 (14 lines × 4) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:215— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:215-228 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:190-203 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:193-206 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:198-211 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 188 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 `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:215` 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 × 4) src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:90— src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:90-103 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:91-104 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:90-103 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:91-104 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs` and `src/bin/rhwp-q/commands/rhwp-q-markdown.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 158 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 `src/bin/rhwp-q/commands/rhwp-q-control-layout.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.
Duplicated block (8–14 lines × 2) src/renderer/equation/canvas_render.rs:240— src/renderer/equation/canvas_render.rs:240-247 | src/renderer/equation/svg_render.rs:236-249 — before extracting anything, compare `src/renderer/equation/canvas_render.rs` and `src/renderer/equation/svg_render.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 198 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 `src/renderer/equation/canvas_render.rs:240` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–14 lines × 2) src/renderer/layout/table_layout.rs:20959— src/renderer/layout/table_layout.rs:20959-20972 | src/renderer/layout/table_layout.rs:21935-21942 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:20959` 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–14 lines × 2) src/renderer/layout/paragraph_layout.rs:4342— src/renderer/layout/paragraph_layout.rs:4342-4355 | src/renderer/layout/paragraph_layout.rs:4443-4453 — both copies are in the same file, so extract the 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 `src/renderer/layout/paragraph_layout.rs:4342` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/renderer/layout/paragraph_layout.rs:4442` calls `with_stored_tabs` and `src/renderer/layout/paragraph_layout.rs:4342` 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–14 lines × 2) tools/gate_3798_page_end_spill.py:59— tools/gate_3798_page_end_spill.py:59-69 | tools/verify_pi_page_vs_hangul.py:89-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 8) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:124— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:124-136 | src/diagnostics/hwp5_cell_header_probe.rs:194-206 | src/diagnostics/hwp5_contract_analyze.rs:119-131 | src/diagnostics/hwp5_contract_probe.rs:146-158 | src/diagnostics/hwp5_ctrl_data_trace.rs:87-99 | src/diagnostics/hwp5_first_para_control_probe.rs:150-162 | src/diagnostics/hwp5_mel_personnel_probe.rs:140-152 | src/diagnostics/hwp5_table_probe.rs:146-158 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 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 `src/diagnostics/hwp5_borderfill_diagonal_probe.rs:124` 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 (13 lines × 8) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:129— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:129-141 | src/diagnostics/hwp5_cell_header_probe.rs:199-211 | src/diagnostics/hwp5_contract_probe.rs:151-163 | src/diagnostics/hwp5_ctrl_data_trace.rs:92-104 | src/diagnostics/hwp5_first_para_control_probe.rs:155-167 | src/diagnostics/hwp5_inventory_diff.rs:323-335 | src/diagnostics/hwp5_mel_personnel_probe.rs:145-157 | src/diagnostics/hwp5_table_probe.rs:151-163 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 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 `src/diagnostics/hwp5_borderfill_diagonal_probe.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/diagnostics/hwp5_contract_probe.rs:165` calls `ok_or_else`, `to_string` and `src/diagnostics/hwp5_inventory_diff.rs:337` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 4) src/document_core/commands/clipboard.rs:2090— src/document_core/commands/clipboard.rs:2090-2102 | src/document_core/commands/clipboard.rs:2134-2146 | src/document_core/commands/clipboard.rs:2157-2168 | src/document_core/commands/clipboard.rs:2176-2187 — 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.
Duplicated block (12–13 lines × 4) src/wmf/parser/records/bitmap/stretch_dib.rs:100— src/wmf/parser/records/bitmap/stretch_dib.rs:100-112 | src/wmf/parser/records/drawing/arc.rs:81-92 | src/wmf/parser/records/drawing/chord.rs:84-95 | src/wmf/parser/records/drawing/pie.rs:83-94 — before extracting anything, compare `src/wmf/parser/records/bitmap/stretch_dib.rs` and `src/wmf/parser/records/drawing/arc.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/wmf/parser/records/bitmap/stretch_dib.rs:100` 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 × 3) src/cli/commands/edit/document_text.rs:87— src/cli/commands/edit/document_text.rs:87-99 | src/cli/commands/edit/header_footer_content.rs:357-368 | src/cli/commands/edit/header_footer_content.rs:507-518 — before extracting anything, compare `src/cli/commands/edit/document_text.rs` and `src/cli/commands/edit/header_footer_content.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 126 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 `src/cli/commands/edit/document_text.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/cli/commands/edit/document_text.rs:85` calls `normalize_text_newlines`, `as_ref` and `src/cli/commands/edit/header_footer_content.rs:356` 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 (12–13 lines × 3) src/renderer/typeset/controls/host_wrap.rs:94— src/renderer/typeset/controls/host_wrap.rs:94-105 | src/renderer/typeset/controls/wrap_match.rs:58-70 | src/renderer/typeset/controls/wrap_match.rs:165-177 — before extracting anything, compare `src/renderer/typeset/controls/host_wrap.rs` and `src/renderer/typeset/controls/wrap_match.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 `src/renderer/typeset/controls/host_wrap.rs:94` 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 lines × 10) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:213— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:213-224 | src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:146-157 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:188-199 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:191-202 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:147-158 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:153-164 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:146-157 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:196-207 | src/bin/rhwp-q/commands/rhwp-q-text-file.rs:128-139 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:147-158 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 105 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 `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:213` 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 after the matched lines, `src/bin/rhwp-q/commands/rhwp-q-page-images.rs:158` calls `as_bool`, `unwrap_or`, `as_u64` and `src/bin/rhwp-q/commands/rhwp-q-page-def.rs:165` 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 (12 lines × 10) src/renderer/height_measurer.rs:2209— src/renderer/height_measurer.rs:2209-2220 | src/renderer/height_measurer.rs:2956-2967 | src/renderer/height_measurer.rs:2999-3010 | src/renderer/height_measurer.rs:3119-3130 | src/renderer/height_measurer.rs:3402-3413 | src/renderer/height_measurer.rs:3475-3486 | src/renderer/layout/table_layout.rs:18544-18555 | src/renderer/render_normalization.rs:244-255 | src/renderer/typeset/section/heading.rs:35-46 | src/renderer/typeset/state.rs:545-556 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 300 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/height_measurer.rs:2209` 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–12 lines × 4) src/renderer/layout/table_layout.rs:10765— src/renderer/layout/table_layout.rs:10765-10776 | src/renderer/layout/table_layout.rs:13067-13077 | src/renderer/layout/table_layout.rs:13249-13259 | src/renderer/layout/table_layout.rs:14239-14249 — 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 `src/renderer/layout/table_layout.rs:10765` 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–12 lines × 4) src/wmf/converter/svg/mod.rs:939— src/wmf/converter/svg/mod.rs:939-950 | src/wmf/converter/svg/mod.rs:953-964 | src/wmf/converter/svg/mod.rs:967-978 | src/wmf/converter/svg/mod.rs:980-990 — 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 `src/wmf/converter/svg/mod.rs:939` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 10) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:77— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:77-87 | src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:66-76 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:76-86 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:80-90 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:67-77 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:66-76 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:66-76 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:74-84 | src/bin/rhwp-q/commands/rhwp-q-text-file.rs:78-88 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:67-77 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 105 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 `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 10) src/renderer/height_measurer.rs:3077— src/renderer/height_measurer.rs:3077-3087 | src/renderer/height_measurer.rs:3249-3259 | src/renderer/height_measurer.rs:3348-3358 | src/renderer/layout/table_layout.rs:18620-18630 | src/renderer/layout/table_layout.rs:18663-18673 | src/renderer/layout/table_layout.rs:18711-18721 | src/renderer/render_normalization.rs:420-430 | src/renderer/typeset/state.rs:420-430 | src/renderer/typeset/state.rs:1008-1018 | src/renderer/typeset/state.rs:1275-1285 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 300 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/height_measurer.rs:3077` 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–11 lines × 3) src/renderer/pagination/engine.rs:1131— src/renderer/pagination/engine.rs:1131-1141 | src/renderer/pagination/engine.rs:1172-1181 | src/renderer/typeset/section/post_flow.rs:425-435 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10–11 lines × 3) tools/llm_verifier/abstain/verify_corpus.py:30— tools/llm_verifier/abstain/verify_corpus.py:30-39 | tools/llm_verifier/oracle_vs_self/verify_corpus.py:30-40 | tools/llm_verifier/shadow_agree/verify_corpus.py:31-40 — `tools/llm_verifier/oracle_vs_self/verify_corpus.py` and `tools/llm_verifier/shadow_agree/verify_corpus.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 32 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `tools/llm_verifier/oracle_vs_self/verify_corpus.py:30` 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 (10 lines × 8) src/bin/rhwp-q/kit/auto_numbers.rs:11— src/bin/rhwp-q/kit/auto_numbers.rs:11-20 | src/bin/rhwp-q/kit/equations.rs:11-20 | src/bin/rhwp-q/kit/hidden_comments.rs:11-20 | src/bin/rhwp-q/kit/hyperlinks.rs:11-20 | src/bin/rhwp-q/kit/index_marks.rs:11-20 | src/bin/rhwp-q/kit/page_hide.rs:11-20 | src/bin/rhwp-q/kit/pictures.rs:11-20 | src/bin/rhwp-q/kit/ruby.rs:11-20 — 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 8 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/kit/auto_numbers.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 (10 lines × 8) src/parser/hwpx/header.rs:900— src/parser/hwpx/header.rs:900-909 | src/parser/hwpx/header.rs:1929-1938 | src/parser/hwpx/section.rs:1019-1028 | src/parser/hwpx/section.rs:1351-1360 | src/parser/hwpx/section.rs:3085-3094 | src/parser/hwpx/section.rs:3484-3493 | src/parser/hwpx/section.rs:5180-5189 | src/parser/hwpx/section.rs:5393-5402 — before extracting anything, compare `src/parser/hwpx/header.rs` and `src/parser/hwpx/section.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 162 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 `src/parser/hwpx/header.rs:900` 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 × 7) src/bin/rhwp-agent/inspect.rs:35— src/bin/rhwp-agent/inspect.rs:35-44 | src/bin/rhwp-agent/inspect.rs:113-122 | src/bin/rhwp-agent/inspect.rs:245-254 | src/bin/rhwp-agent/inspect.rs:282-291 | src/bin/rhwp-agent/inspect.rs:338-347 | src/bin/rhwp-agent/inspect.rs:372-381 | src/bin/rhwp-agent/lookups.rs:183-192 — before extracting anything, compare `src/bin/rhwp-agent/inspect.rs` and `src/bin/rhwp-agent/lookups.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 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 `src/bin/rhwp-agent/inspect.rs:35` 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 × 7) src/cli/commands/edit/document_objects.rs:590— src/cli/commands/edit/document_objects.rs:590-599 | src/cli/commands/edit/formatting.rs:45-54 | src/cli/commands/edit/formatting.rs:183-192 | src/cli/commands/edit/header_footer_properties.rs:44-53 | src/cli/commands/edit/note_content.rs:604-613 | src/cli/commands/edit/page.rs:34-43 | src/cli/commands/edit/page.rs:137-146 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/formatting.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 217 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 (9 lines × 10) src/cli/commands/edit/bookmarks.rs:144— src/cli/commands/edit/bookmarks.rs:144-152 | src/cli/commands/edit/controls.rs:16-24 | src/cli/commands/edit/document_objects.rs:279-287 | src/cli/commands/edit/equations.rs:15-23 | src/cli/commands/edit/equations.rs:261-269 | src/cli/commands/edit/media.rs:810-818 | src/cli/commands/edit/media.rs:908-916 | src/cli/commands/edit/notes.rs:206-214 | src/cli/commands/edit/shapes.rs:188-196 | src/cli/commands/edit/shapes.rs:462-470 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/controls.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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 `src/cli/commands/edit/bookmarks.rs:144` 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 × 10) src/bin/rhwp-q/kit/cursor_in_cell.rs:31— src/bin/rhwp-q/kit/cursor_in_cell.rs:31-41 | src/bin/rhwp-q/kit/cursor_in_footnote.rs:30-40 | src/bin/rhwp-q/kit/cursor_in_hf.rs:31-41 | src/bin/rhwp-q/kit/cursor_in_note.rs:30-40 | src/bin/rhwp-q/kit/flow_images.rs:24-32 | src/bin/rhwp-q/kit/footnote_hit.rs:24-34 | src/bin/rhwp-q/kit/footnote_info.rs:24-34 | src/bin/rhwp-q/kit/hit_header.rs:24-34 | src/bin/rhwp-q/kit/note_edit_info.rs:25-35 | src/bin/rhwp-q/kit/overlay_images.rs:24-32 — before extracting anything, compare `src/bin/rhwp-q/kit/cursor_in_cell.rs` and `src/bin/rhwp-q/kit/cursor_in_footnote.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 63 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 `src/bin/rhwp-q/kit/cursor_in_cell.rs:31` 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 (9 lines × 6) src/cli/commands/edit/document_text.rs:1045— src/cli/commands/edit/document_text.rs:1045-1055 | src/cli/commands/edit/equations.rs:161-169 | src/cli/commands/edit/notes.rs:29-39 | src/cli/commands/edit/notes.rs:124-134 | src/cli/commands/edit/shapes.rs:35-45 | src/cli/commands/edit/tables/insert.rs:56-64 — before extracting anything, compare `src/cli/commands/edit/document_text.rs` and `src/cli/commands/edit/equations.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 163 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 (9 lines × 6) src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:179— src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:179-187 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:227-235 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:230-238 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:198-206 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:196-204 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:180-188 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs` and `src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 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 `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:179` 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 (8 lines × 10) src/bin/rhwp-q/kit/cursor_in_cell.rs:14— src/bin/rhwp-q/kit/cursor_in_cell.rs:14-21 | src/bin/rhwp-q/kit/cursor_in_footnote.rs:15-22 | src/bin/rhwp-q/kit/cursor_in_hf.rs:14-21 | src/bin/rhwp-q/kit/cursor_in_note.rs:14-21 | src/bin/rhwp-q/kit/flow_images.rs:14-21 | src/bin/rhwp-q/kit/footnote_hit.rs:14-21 | src/bin/rhwp-q/kit/footnote_info.rs:14-21 | src/bin/rhwp-q/kit/hit_header.rs:14-21 | src/bin/rhwp-q/kit/note_edit_info.rs:15-22 | src/bin/rhwp-q/kit/overlay_images.rs:14-21 — before extracting anything, compare `src/bin/rhwp-q/kit/cursor_in_cell.rs` and `src/bin/rhwp-q/kit/cursor_in_footnote.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 10) src/cli/commands/edit/bookmarks.rs:311— src/cli/commands/edit/bookmarks.rs:311-318 | src/cli/commands/edit/cells.rs:571-578 | src/cli/commands/edit/cells.rs:740-747 | src/cli/commands/edit/cells.rs:910-917 | src/cli/commands/edit/document_objects.rs:338-345 | src/cli/commands/edit/equations.rs:71-78 | src/cli/commands/edit/formatting.rs:780-787 | src/cli/commands/edit/formatting.rs:941-948 | src/cli/commands/edit/media.rs:967-974 | src/cli/commands/edit/note_content.rs:638-645 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/cells.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 151 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 `src/cli/commands/edit/bookmarks.rs:311` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 9) src/cli/commands/edit/bookmarks.rs:250— src/cli/commands/edit/bookmarks.rs:250-257 | src/cli/commands/edit/cells.rs:837-844 | src/cli/commands/edit/document_objects.rs:15-22 | src/cli/commands/edit/document_objects.rs:277-284 | src/cli/commands/edit/document_objects.rs:415-422 | src/cli/commands/edit/formatting.rs:297-304 | src/cli/commands/edit/media.rs:906-913 | src/cli/commands/edit/note_content.rs:130-137 | src/cli/commands/edit/tables/layout.rs:479-486 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/cells.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 151 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 `src/cli/commands/edit/bookmarks.rs:250` 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 × 9) src/bin/rhwp-q/kit/field_by_id.rs:93— src/bin/rhwp-q/kit/field_by_id.rs:93-100 | src/bin/rhwp-q/kit/field_info_at.rs:107-114 | src/bin/rhwp-q/kit/form_at.rs:107-114 | src/bin/rhwp-q/kit/form_value.rs:117-124 | src/bin/rhwp-q/kit/hf_edit_target.rs:104-111 | src/bin/rhwp-q/kit/hit_fn_marker.rs:108-115 | src/bin/rhwp-q/kit/hit_in_footnote.rs:108-115 | src/bin/rhwp-q/kit/hit_in_hf.rs:132-139 | src/bin/rhwp-q/kit/para_bounds.rs:88-95 — before extracting anything, compare `src/bin/rhwp-q/kit/field_by_id.rs` and `src/bin/rhwp-q/kit/field_info_at.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (8 lines × 8) src/document_core/queries/cursor_rect.rs:514— src/document_core/queries/cursor_rect.rs:514-521 | src/document_core/queries/cursor_rect.rs:524-531 | src/document_core/queries/cursor_rect.rs:535-542 | src/document_core/queries/cursor_rect.rs:545-552 | src/document_core/queries/cursor_rect.rs:555-562 | src/document_core/queries/cursor_rect.rs:565-572 | src/document_core/queries/cursor_rect.rs:575-582 | src/document_core/queries/cursor_rect.rs:586-593 — all 8 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 `src/document_core/queries/cursor_rect.rs:514` 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 lines × 8) src/wmf/converter/svg/mod.rs:761— src/wmf/converter/svg/mod.rs:761-768 | src/wmf/converter/svg/mod.rs:817-824 | src/wmf/converter/svg/mod.rs:1226-1233 | src/wmf/converter/svg/mod.rs:1258-1265 | src/wmf/converter/svg/mod.rs:1385-1392 | src/wmf/converter/svg/mod.rs:1435-1442 | src/wmf/converter/svg/mod.rs:1534-1541 | src/wmf/converter/svg/mod.rs:1601-1608 — all 8 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 `src/wmf/converter/svg/mod.rs:761` 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, `src/wmf/converter/svg/mod.rs:815` calls `from`, `selected_pen`, `clone` and `src/wmf/converter/svg/mod.rs:1223` 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 × 6) src/cli/batch/query.rs:16— src/cli/batch/query.rs:16-23 | src/cli/batch/query.rs:67-74 | src/cli/batch/query.rs:105-112 | src/cli/batch/query.rs:121-128 | src/cli/batch/query.rs:135-142 | src/cli/batch/query.rs:153-160 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 6) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:431— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:431-438 | src/diagnostics/hwp5_cell_header_probe.rs:690-697 | src/diagnostics/hwp5_contract_probe.rs:598-605 | src/diagnostics/hwp5_first_para_control_probe.rs:1295-1302 | src/diagnostics/hwp5_mel_personnel_probe.rs:604-611 | src/diagnostics/hwp5_table_probe.rs:349-356 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 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. 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 × 9) src/bin/rhwp-q/more/inventory.rs:220— src/bin/rhwp-q/more/inventory.rs:220-226 | src/bin/rhwp-q/more/inventory.rs:247-253 | src/bin/rhwp-q/more/inventory.rs:274-280 | src/bin/rhwp-q/more/inventory.rs:1211-1217 | src/bin/rhwp-q/more/inventory.rs:1238-1244 | src/bin/rhwp-q/pack/inventory.rs:495-501 | src/bin/rhwp-q/pack/inventory.rs:909-915 | src/bin/rhwp-q/pack/inventory.rs:936-942 | src/bin/rhwp-q/pack/inventory.rs:1297-1303 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:220` 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 × 9) src/cli/commands/edit/cells.rs:838— src/cli/commands/edit/cells.rs:838-844 | src/cli/commands/edit/formatting.rs:298-304 | src/cli/commands/edit/formatting.rs:714-720 | src/cli/commands/edit/formatting.rs:866-872 | src/cli/commands/edit/tables/grid.rs:229-235 | src/cli/commands/edit/tables/grid.rs:338-344 | src/cli/commands/edit/tables/grid.rs:478-484 | src/cli/commands/edit/tables/grid.rs:585-591 | src/cli/commands/edit/tables/structure.rs:14-20 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/formatting.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 232 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 `src/cli/commands/edit/cells.rs:838` 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 (2–7 lines × 3) src/document_core/queries/cursor_rect.rs:5493— src/document_core/queries/cursor_rect.rs:5493-5499 | src/document_core/queries/cursor_rect.rs:5918-5919 | src/document_core/queries/cursor_rect.rs:6009-6015 — 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 `src/document_core/queries/cursor_rect.rs:5493` 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 (2–7 lines × 3) src/renderer/layout/table_layout/reflow_nested_band.rs:33— src/renderer/layout/table_layout/reflow_nested_band.rs:33-39 | src/renderer/layout/table_layout/reflow_nested_band.rs:78-84 | src/renderer/layout/table_layout/row_physical_band.rs:142-143 — 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 `src/renderer/layout/table_layout/reflow_nested_band.rs:33` 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 (4–7 lines × 3) src/renderer/equation/font_frame_metrics.rs:187— src/renderer/equation/font_frame_metrics.rs:187-193 | src/renderer/equation/font_frame_metrics.rs:220-226 | src/renderer/equation/script_fraction_frame.rs:31-34 — 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 `src/renderer/equation/font_frame_metrics.rs:187` 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 (4–7 lines × 3) src/wasm_api.rs:4190— src/wasm_api.rs:4190-4193 | src/wasm_api.rs:8583-8589 | src/wasm_api.rs:8604-8610 — 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 `src/wasm_api.rs:4190` 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 (6 lines × 11) src/bin/rhwp-q/more/inventory.rs:139— src/bin/rhwp-q/more/inventory.rs:139-144 | src/bin/rhwp-q/more/inventory.rs:166-171 | src/bin/rhwp-q/more/inventory.rs:193-198 | src/bin/rhwp-q/more/inventory.rs:906-911 | src/bin/rhwp-q/more/inventory.rs:933-938 | src/bin/rhwp-q/more/inventory.rs:1103-1108 | src/bin/rhwp-q/pack/inventory.rs:386-391 | src/bin/rhwp-q/pack/inventory.rs:730-735 | src/bin/rhwp-q/pack/inventory.rs:757-762 | src/bin/rhwp-q/pack/inventory.rs:1119-1124 | src/bin/rhwp-q/pack/inventory.rs:1270-1275 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.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 (6 lines × 11) src/renderer/layout/table_layout.rs:16615— src/renderer/layout/table_layout.rs:16615-16620 | src/renderer/layout/table_layout.rs:20958-20963 | src/renderer/layout/table_layout.rs:21045-21050 | src/renderer/layout/table_layout.rs:21934-21939 | src/renderer/layout/table_layout.rs:22240-22245 | src/renderer/layout/table_layout.rs:22277-22282 | src/renderer/layout/table_layout.rs:22337-22342 | src/renderer/layout/table_layout.rs:24951-24956 | src/renderer/layout/table_layout.rs:28174-28179 | src/renderer/layout/table_layout.rs:28327-28332 | src/renderer/layout/table_partial.rs:6650-6655 — before extracting anything, compare `src/renderer/layout/table_layout.rs` and `src/renderer/layout/table_partial.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 327 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 (9 lines × 5) src/bin/rhwp-q/more/inventory.rs:304— src/bin/rhwp-q/more/inventory.rs:304-312 | src/bin/rhwp-q/more/inventory.rs:331-339 | src/bin/rhwp-q/more/inventory.rs:358-366 | src/bin/rhwp-q/more/inventory.rs:1017-1025 | src/bin/rhwp-q/more/inventory.rs:1187-1195 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:304` 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 × 5) src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:33— src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:33-41 | src/bin/rhwp-q/commands/rhwp-q-objects.rs:33-41 | src/bin/rhwp-q/kit/envelope.rs:31-39 | src/bin/rhwp-q/more/envelope.rs:27-35 | src/bin/rhwp-q/pack/envelope.rs:27-35 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs` and `src/bin/rhwp-q/commands/rhwp-q-objects.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 114 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 (4–5 lines × 3) src/wmf/converter/bitmap.rs:107— src/wmf/converter/bitmap.rs:107-111 | src/wmf/converter/bitmap.rs:163-167 | src/wmf/converter/bitmap.rs:177-180 — 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 (4–5 lines × 3) gym/tools/fuzz_corpus.py:1216— gym/tools/fuzz_corpus.py:1216-1220 | gym/tools/fuzz_corpus.py:1316-1320 | gym/tools/fuzz_corpus.py:1347-1350 — 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 lines × 11) src/bin/rhwp-q/kit/cell_shape.rs:119— src/bin/rhwp-q/kit/cell_shape.rs:119-125 | src/bin/rhwp-q/kit/cursor_in_cell.rs:157-163 | src/bin/rhwp-q/kit/cursor_in_footnote.rs:152-158 | src/bin/rhwp-q/kit/cursor_in_hf.rs:190-196 | src/bin/rhwp-q/kit/cursor_in_note.rs:151-157 | src/bin/rhwp-q/kit/flow_images.rs:122-128 | src/bin/rhwp-q/kit/footnote_hit.rs:141-147 | src/bin/rhwp-q/kit/footnote_info.rs:136-142 | src/bin/rhwp-q/kit/hit_header.rs:141-147 | src/bin/rhwp-q/kit/note_edit_info.rs:136-142 | src/bin/rhwp-q/kit/overlay_images.rs:126-132 — before extracting anything, compare `src/bin/rhwp-q/kit/cell_shape.rs` and `src/bin/rhwp-q/kit/flow_images.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 11) src/parser/hwpx/header.rs:903— src/parser/hwpx/header.rs:903-909 | src/parser/hwpx/header.rs:1002-1008 | src/parser/hwpx/header.rs:1932-1938 | src/parser/hwpx/section.rs:1022-1028 | src/parser/hwpx/section.rs:1354-1360 | src/parser/hwpx/section.rs:3088-3094 | src/parser/hwpx/section.rs:3487-3493 | src/parser/hwpx/section.rs:5183-5189 | src/parser/hwpx/section.rs:5396-5402 | src/parser/hwpx/section.rs:6122-6128 | src/parser/hwpx/section.rs:6735-6741 — before extracting anything, compare `src/parser/hwpx/header.rs` and `src/parser/hwpx/section.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 15) src/cli/commands/edit/cell_paragraphs.rs:46— src/cli/commands/edit/cell_paragraphs.rs:46-53 | src/cli/commands/edit/cell_paragraphs.rs:202-209 | src/cli/commands/edit/cells.rs:523-530 | src/cli/commands/edit/cells.rs:702-709 | src/cli/commands/edit/cells.rs:862-869 | src/cli/commands/edit/formatting.rs:742-749 | src/cli/commands/edit/formatting.rs:893-900 | src/cli/commands/edit/tables/grid.rs:31-38 | src/cli/commands/edit/tables/grid.rs:139-146 | src/cli/commands/edit/tables/grid.rs:246-253 | src/cli/commands/edit/tables/grid.rs:376-383 | src/cli/commands/edit/tables/grid.rs:495-502 | src/cli/commands/edit/tables/grid.rs:609-616 | src/cli/commands/edit/tables/layout.rs:139-146 | src/cli/commands/edit/tables/layout.rs:383-390 — before extracting anything, compare `src/cli/commands/edit/cell_paragraphs.rs` and `src/cli/commands/edit/cells.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 262 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 `src/cli/commands/edit/cell_paragraphs.rs:46` 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 (8 lines × 15) src/cli/protocol/capsule/signing.rs:8— src/cli/protocol/capsule/signing.rs:8-15 | src/cli/protocol/exchange/bundle.rs:10-17 | src/cli/protocol/exchange/bundle.rs:219-226 | src/cli/protocol/exchange/disclosure.rs:8-15 | src/cli/protocol/exchange/disclosure.rs:112-119 | src/cli/protocol/exchange/disclosure.rs:211-218 | src/cli/protocol/exchange/settlement.rs:10-17 | src/cli/protocol/exchange/settlement.rs:146-153 | src/cli/protocol/exchange/settlement.rs:306-313 | src/cli/protocol/harness.rs:7-14 | src/cli/protocol/harness.rs:104-111 | src/cli/protocol/trust/anchor.rs:10-17 | src/cli/protocol/trust/anchor.rs:85-92 | src/cli/protocol/trust/anchor.rs:160-167 | src/cli/protocol/trust/governance.rs:445-452 — before extracting anything, compare `src/cli/protocol/capsule/signing.rs` and `src/cli/protocol/exchange/bundle.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/capsule/signing.rs:8` 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 (46 corresponding lines) · ×2
Edited copy of a member (46 corresponding lines) scripts/font_rank1_qualification.py:65— scripts/font_rank1_qualification.py:65-110 | scripts/font_rank7_qualification.py:78-128 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (46 corresponding lines) tools/inspect_msec/gen_msec_fixtures.py:853— tools/inspect_msec/gen_msec_fixtures.py:853-898 | tools/inspect_msec/gen_msec_fixtures.py:1103-1149 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (2 corresponding lines) · ×2
Edited copy of a member (2 corresponding lines) tools/task2279/hancom_metric_visual_check.py:30— tools/task2279/hancom_metric_visual_check.py:30-31 | tools/task2279/visual_evidence.py:39-40 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (2 corresponding lines) tools/llm_verifier/best_of_n/generate_corpus.py:290— tools/llm_verifier/best_of_n/generate_corpus.py:290-291 | tools/llm_verifier/repeat_eval/generate_corpus.py:232-233 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (46 lines × 2) scripts/renderer_baseline.py:493— scripts/renderer_baseline.py:493-538 | scripts/renderer_baseline.py:551-598 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/renderer_baseline.py:493` 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 lines × 2) tools/fidelity_compare/fidelity_compare.py:2534— tools/fidelity_compare/fidelity_compare.py:2534-2579 | tools/fidelity_compare/fidelity_compare.py:2593-2638 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Off the main sequence: rhwp-ooxml-chart — rhwp-ooxml-chart: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: rhwp-password-crypto — rhwp-password-crypto: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
R10 · Code Duplication· Duplicated block with local edits (131 matched lines × 2 locations) · ×2
Duplicated block with local edits (131 matched lines × 2 locations) rhwp-studio/src/ui/local-fonts-modal.ts:33— rhwp-studio/src/ui/local-fonts-modal.ts:33 · rhwp-studio/src/ui/validation-modal.ts:39 — the two spans are one implementation copied and then locally edited — 977 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 (131 matched lines × 2 locations) scripts/font_rank1_runtime_boundary.mjs:85— scripts/font_rank1_runtime_boundary.mjs:85 · scripts/font_rank7_runtime_boundary.mjs:49 — the two spans are one implementation copied and then locally edited — 1050 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 (61 matched lines × 2 locations) · ×2
Duplicated block with local edits (61 matched lines × 2 locations) rhwp-studio/src/history/idb-store.ts:118— rhwp-studio/src/history/idb-store.ts:118 · rhwp-studio/src/recovery/autosave-store.ts:98 — the two spans are one implementation copied and then locally edited — 527 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 (61 matched lines × 2 locations) rhwp-studio/src/ui/hwp-password-dialog.ts:9— rhwp-studio/src/ui/hwp-password-dialog.ts:9 · rhwp-studio/src/ui/hwp-password-dialog.ts:108 — the two spans are one implementation copied and then locally edited — 419 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 (52 matched lines × 2 locations) · ×2
Duplicated block with local edits (52 matched lines × 2 locations) scripts/font_metric_coverage_checkpoint_runner.mjs:544— scripts/font_metric_coverage_checkpoint_runner.mjs:544 · scripts/font_metric_coverage_full_manifest.mjs:406 — the two spans are one implementation copied and then locally edited — 357 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 (52 matched lines × 2 locations) scripts/run-adapter-diff.mjs:117— scripts/run-adapter-diff.mjs:117 · scripts/run-prop-roundtrip.mjs:62 — the two spans are one implementation copied and then locally edited — 304 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 (47 lines × 2 locations) rhwp-chrome/sw/message-router.js:18— rhwp-chrome/sw/message-router.js:18 · rhwp-firefox/sw/message-router.js:17 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (47 lines × 2 locations) rhwp-studio/src/engine/command.ts:2199— rhwp-studio/src/engine/command.ts:2199 · rhwp-studio/src/engine/command.ts:2252 — both copies are in the same file, so extract the 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 (40 lines × 2 locations) mydocs/pr/assets/pr8309-latestbase-20261102/reproduce.mjs:8— mydocs/pr/assets/pr8309-latestbase-20261102/reproduce.mjs:8 · mydocs/pr/assets/pr8309-maintainer-20261102/reproduce.mjs:8 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (40 lines × 2 locations) rhwp-studio/src/ui/table-cell-props-dialog.ts:388— rhwp-studio/src/ui/table-cell-props-dialog.ts:388 · rhwp-studio/src/ui/table-cell-props-dialog.ts:942 — both copies are in the same file, so extract the 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 (39 matched lines × 2 locations) · ×2
Duplicated block with local edits (39 matched lines × 2 locations) mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:25— mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:25 · scripts/export-wasm-for-sweep.mjs:27 — the two spans are one implementation copied and then locally edited — 480 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 (39 matched lines × 2 locations) scripts/font_metric_lineage.mjs:465— scripts/font_metric_lineage.mjs:465 · scripts/font_rule_ledger.mjs:628 — the two spans are one implementation copied and then locally edited — 292 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.
AC3 · Page structure· Data table has no header cells · ×1
Data table has no header cells data/font-metrics/adobe-core14/MustRead.html:11— A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
Low contrast colour pair in CSS (4.2:1) rhwp-studio/src/styles/table-selection.css:29— `.protected-cell-hover-guard` sets color: #fff on background-color: #d54f33 — 4.2:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
Low contrast colour pair in CSS (3.2:1) rhwp-desk/ui/css/app.css:155— `.btn.primary` sets color: #fff on background-color: #5b8def — 3.2:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
HeightCursor::vpos_adjust (cyclomatic 335) src/renderer/height_cursor.rs:497— HeightCursor::vpos_adjust has cyclomatic complexity 335 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
input-handler-keyboard.onKeyDown (cyclomatic 289) rhwp-studio/src/engine/input-handler-keyboard.ts:709— input-handler-keyboard.onKeyDown has cyclomatic complexity 289 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
input-handler-mouse.onClick (cyclomatic 240) rhwp-studio/src/engine/input-handler-mouse.ts:299— input-handler-mouse.onClick has cyclomatic complexity 240 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SkiaLayerRenderer::render_node (cyclomatic 157) src/renderer/skia/renderer.rs:1171— SkiaLayerRenderer::render_node has cyclomatic complexity 157 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SkiaTextReplay::draw_text (cyclomatic 123) src/renderer/skia/text_replay.rs:42— SkiaTextReplay::draw_text has cyclomatic complexity 123 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CanvasKitLayerRenderer.renderEquationBox (cyclomatic 123) rhwp-studio/src/view/canvaskit-renderer.ts:4891— CanvasKitLayerRenderer.renderEquationBox has cyclomatic complexity 123 (threshold 15). Of this number, 118 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
CanvasKitLayerRenderer.renderTextRun (cyclomatic 114) rhwp-studio/src/view/canvaskit-renderer.ts:3142— CanvasKitLayerRenderer.renderTextRun has cyclomatic complexity 114 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (CanvasKitLayerRenderer.renderTextRun::drawPass) 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.
PicturePropsDialog.populateFromProps (cyclomatic 111) rhwp-studio/src/ui/picture-props-dialog.ts:2151— PicturePropsDialog.populateFromProps has cyclomatic complexity 111 (threshold 15). Of this number, 107 points are the body's own statements and 4 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.
CanvasKitGlyphRunFontCache.replayStatus (cyclomatic 97) rhwp-studio/src/view/canvaskit/glyph-run-fonts.ts:159— CanvasKitGlyphRunFontCache.replayStatus has cyclomatic complexity 97 (threshold 15). Of this number, 92 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Interp::op (cyclomatic 95) src/eps.rs:994— Interp::op has cyclomatic complexity 95 (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.
input-handler-mouse.onMouseMove (cyclomatic 91) rhwp-studio/src/engine/input-handler-mouse.ts:1572— input-handler-mouse.onMouseMove has cyclomatic complexity 91 (threshold 15). Of this number, 77 points are the body's own statements and 14 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CharShapeDialog.collectMods (cyclomatic 82) rhwp-studio/src/ui/char-shape-dialog.ts:946— CharShapeDialog.collectMods has cyclomatic complexity 82 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity· Run (cyclomatic 80) · ×1
Run (cyclomatic 80) npm/hwpctrl-ocx/src/index.mjs:2344— Run has cyclomatic complexity 80 (threshold 15). Of this number, 76 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.
Reader::body (cyclomatic 77) src/ole_chart/legacy_presentation.rs:293— Reader::body 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.
WMFConverter::run (cyclomatic 74) src/wmf/converter/mod.rs:56— WMFConverter::run has cyclomatic complexity 74 (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.
glyph-outline-payload-status.hasSupportedColrv1GraphContract::visit (cyclomatic 72) rhwp-studio/src/view/glyph-outline-payload-status.ts:195— glyph-outline-payload-status.hasSupportedColrv1GraphContract::visit has cyclomatic complexity 72 (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.
ParaShapeDialog.collectMods (cyclomatic 68) rhwp-studio/src/ui/para-shape-dialog.ts:779— ParaShapeDialog.collectMods has cyclomatic complexity 68 (threshold 15). Of this number, 67 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
css-color.parseSupportedCssColor (cyclomatic 66) rhwp-studio/src/view/canvaskit/css-color.ts:173— css-color.parseSupportedCssColor has cyclomatic complexity 66 (threshold 15). Of this number, 64 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayerBuilder::build_node (cyclomatic 65) src/paint/builder.rs:310— LayerBuilder::build_node has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ColorPaintGraphPayload::has_colrv1_supported_graph_contract (cyclomatic 65) src/paint/paint_op.rs:1224— ColorPaintGraphPayload::has_colrv1_supported_graph_contract has cyclomatic complexity 65 (threshold 15). Of this number, 56 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.
diff-engine.fillSnapshotFromWasm (cyclomatic 63) rhwp-studio/src/compare/diff-engine.ts:929— diff-engine.fillSnapshotFromWasm has cyclomatic complexity 63 (threshold 15). Of this number, 62 points are the body's own statements and 1 belongs to one function literal 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.
sfnt-face.normalizeFontFaceData (cyclomatic 61) rhwp-studio/src/core/sfnt-face.ts:15— sfnt-face.normalizeFontFaceData has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
input-handler-picture.findPictureAtClick (cyclomatic 61) rhwp-studio/src/engine/input-handler-picture.ts:212— input-handler-picture.findPictureAtClick has cyclomatic complexity 61 (threshold 15). Of this number, 49 points are the body's own statements and 12 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
static-svg-path-layers.parseStaticSvgFragmentLayers (cyclomatic 59) rhwp-studio/src/view/static-svg-path-layers.ts:86— static-svg-path-layers.parseStaticSvgFragmentLayers 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.
main.initialize (cyclomatic 58) rhwp-studio/src/main.ts:570— main.initialize has cyclomatic complexity 58 (threshold 15). Of this number, 24 points are the body's own statements and 34 belong to 16 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Player::exec (cyclomatic 57) src/emf/converter/player.rs:105— Player::exec has cyclomatic complexity 57 (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.
CanvasKitLayerRenderer.imageForOp (cyclomatic 56) rhwp-studio/src/view/canvaskit-renderer.ts:5901— CanvasKitLayerRenderer.imageForOp has cyclomatic complexity 56 (threshold 15). Of this number, 45 points are the body's own statements and 11 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.
MovePos (cyclomatic 54) npm/hwpctrl-ocx/src/index.mjs:2088— MovePos has cyclomatic complexity 54 (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.
TableBuilder::build_inner (cyclomatic 53) src/parser/pdf/structured_lowering.rs:1506— TableBuilder::build_inner has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeTextureController._pump (cyclomatic 53) bindings/Flutter/lib/src/native_texture_view.dart:474— NativeTextureController._pump has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
static-svg-path-layers.isStaticSvgAttributeSupported (cyclomatic 53) rhwp-studio/src/view/static-svg-path-layers.ts:711— static-svg-path-layers.isStaticSvgAttributeSupported has cyclomatic complexity 53 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
text-variant-selection.selectLayerTextVariantsForLeaf (cyclomatic 52) rhwp-studio/src/view/canvaskit/text-variant-selection.ts:23— text-variant-selection.selectLayerTextVariantsForLeaf has cyclomatic complexity 52 (threshold 15). Of this number, 45 points are the body's own statements and 7 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.
rpc-router.routeEmbedRequest (cyclomatic 52) rhwp-studio/src/embed/rpc-router.ts:122— rpc-router.routeEmbedRequest has cyclomatic complexity 52 (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.
NativeDocument._complete (cyclomatic 51) bindings/Flutter/lib/src/native_document.dart:595— NativeDocument._complete 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.
CanvasKitLayerRenderer.drawImageOp::drawImage (cyclomatic 51) rhwp-studio/src/view/canvaskit-renderer.ts:2857— CanvasKitLayerRenderer.drawImageOp::drawImage has cyclomatic complexity 51 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (CanvasKitLayerRenderer.drawImageOp) 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.
release_gate.validate_verdict (cyclomatic 49) gym/tools/release_gate.py:790— release_gate.validate_verdict has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CanvasKitLayerRenderer.drawStaticControlText (cyclomatic 49) rhwp-studio/src/view/canvaskit-renderer.ts:5239— CanvasKitLayerRenderer.drawStaticControlText has cyclomatic complexity 49 (threshold 15). Of this number, 48 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.
input-handler-keyboard.handleCtrlKey (cyclomatic 49) rhwp-studio/src/engine/input-handler-keyboard.ts:1635— input-handler-keyboard.handleCtrlKey has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
audit.exception_kind (cyclomatic 48) gym/tools/audit.py:235— audit.exception_kind has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativePuaFontSession.prepare (cyclomatic 48) rhwp-studio/src/core/native-pua-font-session.ts:60— NativePuaFontSession.prepare has cyclomatic complexity 48 (threshold 15). Of this number, 45 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
main.setupEventListeners (cyclomatic 48) rhwp-studio/src/main.ts:1230— main.setupEventListeners has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 2 of the 48 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 1406, a function literal at line 1311, a function literal at line 1334, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
main.wire (cyclomatic 47) rhwp-desk/ui/js/main.js:821— main.wire has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 3 of the 47 points are its own statements and the rest belongs to 17 function literals inside it that branch (lines 885, 911, 958, …). 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.
text-v2-normalizer.normalizeTextV2Tree::expand (cyclomatic 47) rhwp-studio/src/core/text-v2-normalizer.ts:51— text-v2-normalizer.normalizeTextV2Tree::expand has cyclomatic complexity 47 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
static-svg-path-layers.isStaticSvgStyleSupported (cyclomatic 47) rhwp-studio/src/view/static-svg-path-layers.ts:970— static-svg-path-layers.isStaticSvgStyleSupported has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
input-handler-text.onInput (cyclomatic 47) rhwp-studio/src/engine/input-handler-text.ts:566— input-handler-text.onInput has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CanvasKitGlyphRunFontCache.registerResources (cyclomatic 46) rhwp-studio/src/view/canvaskit/glyph-run-fonts.ts:69— CanvasKitGlyphRunFontCache.registerResources 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.
showHoverCard (cyclomatic 46) rhwp-firefox/content-script.js:325— showHoverCard has cyclomatic complexity 46 (threshold 15). Of this number, 33 points are the body's own statements and 13 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Walk::walk (cyclomatic 45) src/document_core/commands/paragraph_block/owned.rs:72— Walk::walk has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CanvasKitReplayPlanBuilder::item_for_op (cyclomatic 45) src/renderer/canvaskit_policy.rs:1516— CanvasKitReplayPlanBuilder::item_for_op has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
fuzz_corpus.deterministic_mutants (cyclomatic 45) gym/tools/fuzz_corpus.py:913— fuzz_corpus.deterministic_mutants has cyclomatic complexity 45 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
robustness.deterministic_mutants (cyclomatic 45) gym/tools/robustness.py:755— robustness.deterministic_mutants has cyclomatic complexity 45 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CanvasKitLayerRenderer.renderCharOverlap (cyclomatic 45) rhwp-studio/src/view/canvaskit-renderer.ts:3738— CanvasKitLayerRenderer.renderCharOverlap has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (CanvasKitLayerRenderer.renderCharOverlap::draw::drawCell) 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.
CanvasKitLayerRenderer.renderTextDecoration::draw (cyclomatic 45) rhwp-studio/src/view/canvaskit-renderer.ts:4224— CanvasKitLayerRenderer.renderTextDecoration::draw has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
form-replay.formDrawingReplayRejection (cyclomatic 44) rhwp-studio/src/view/canvaskit/form-replay.ts:21— form-replay.formDrawingReplayRejection has cyclomatic complexity 44 (threshold 15). Of this number, 43 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous) (cyclomatic 44) mydocs/tech/investigations/issue-8403/validation/browser-verify.mjs:44— (anonymous) has cyclomatic complexity 44 (threshold 15). Of this number, 25 points are the body's own statements and 19 belong to 40 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.
action-runtime.evaluateFormAction.expression (cyclomatic 43) rhwp-shared/forms/action-runtime.ts:216— action-runtime.evaluateFormAction.expression 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.
HostCanvasFontSession.prepare (cyclomatic 43) rhwp-studio/src/core/host-canvas-fonts.ts:75— HostCanvasFontSession.prepare has cyclomatic complexity 43 (threshold 15). Of this number, 23 points are the body's own statements and 20 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TableCellPropsDialog.onConfirm (cyclomatic 43) rhwp-studio/src/ui/table-cell-props-dialog.ts:1364— TableCellPropsDialog.onConfirm 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.
onmessage (cyclomatic 43) rhwp-shared/pdf/import-worker.js:12— onmessage has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 1 of the 43 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 14, 45). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
fuzz_corpus.validate_report (cyclomatic 42) gym/tools/fuzz_corpus.py:1432— fuzz_corpus.validate_report 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.
schema-validate.validateToolInput (cyclomatic 42) rhwp-studio/src/ai/tools/schema-validate.ts:35— schema-validate.validateToolInput has cyclomatic complexity 42 (threshold 15). Of this number, 40 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
svg-image-header.parseSvgImageHeader (cyclomatic 42) rhwp-studio/src/view/canvaskit/svg-image-header.ts:7— svg-image-header.parseSvgImageHeader 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.
content-script.showHoverCard (cyclomatic 41) rhwp-chrome/content-script.js:322— content-script.showHoverCard has cyclomatic complexity 41 (threshold 15). Of this number, 32 points are the body's own statements and 9 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.
HostCanvasFontSession.resolve (cyclomatic 41) rhwp-studio/src/core/host-canvas-fonts.ts:176— HostCanvasFontSession.resolve has cyclomatic complexity 41 (threshold 15). Of this number, 36 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
raster-stroke.rasterLineGeometry (cyclomatic 41) rhwp-studio/src/view/canvaskit/raster-stroke.ts:4— raster-stroke.rasterLineGeometry has cyclomatic complexity 41 (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.
import-session.snapshotOptions (cyclomatic 40) rhwp-shared/pdf/import-session.js:134— import-session.snapshotOptions has cyclomatic complexity 40 (threshold 15). Of this number, 25 points are the body's own statements and 15 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.
nominal-text-replay.textRequiresComplexShaping (cyclomatic 40) rhwp-studio/src/view/canvaskit/nominal-text-replay.ts:7— nominal-text-replay.textRequiresComplexShaping has cyclomatic complexity 40 (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.
audit.pack_issue_line (cyclomatic 39) gym/tools/audit.py:655— audit.pack_issue_line 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.
declared-font-environment.prepareDeclaredFontPrograms (cyclomatic 38) rhwp-studio/src/core/declared-font-environment.ts:159— declared-font-environment.prepareDeclaredFontPrograms 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.
CanvasView.updateVisiblePages (cyclomatic 38) rhwp-studio/src/view/canvas-view.ts:631— CanvasView.updateVisiblePages has cyclomatic complexity 38 (threshold 15). Of this number, 36 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
input-handler-keyboard.onPaste (cyclomatic 38) rhwp-studio/src/engine/input-handler-keyboard.ts:1986— input-handler-keyboard.onPaste has cyclomatic complexity 38 (threshold 15). Of this number, 30 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CharShapeMods::apply_to (cyclomatic 37) src/model/style.rs:969— CharShapeMods::apply_to has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Accounting::operation (cyclomatic 37) src/native_host/render_snapshot.rs:269— Accounting::operation has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RenderNode::write_json (cyclomatic 37) src/renderer/render_tree.rs:335— RenderNode::write_json 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.
pack_health.scan_check_contract (cyclomatic 37) gym/tools/pack_health.py:1173— pack_health.scan_check_contract has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
diff-engine.annotateDiffSectionPages (cyclomatic 37) rhwp-studio/src/compare/diff-engine.ts:2895— diff-engine.annotateDiffSectionPages has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CanvasKitLayerRenderer.create (cyclomatic 37) rhwp-studio/src/view/canvaskit-renderer.ts:533— CanvasKitLayerRenderer.create has cyclomatic complexity 37 (threshold 15). Of this number, 36 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.
CanvasKitLayerRenderer.fontDecisionEvidence (cyclomatic 37) rhwp-studio/src/view/canvaskit-renderer.ts:1339— CanvasKitLayerRenderer.fontDecisionEvidence has cyclomatic complexity 37 (threshold 15). Of this number, 31 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CanvasView.renderCanvas (cyclomatic 36) rhwp-studio/src/view/canvas-view.ts:1657— CanvasView.renderCanvas has cyclomatic complexity 36 (threshold 15). Of this number, 30 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous) (cyclomatic 36) rhwp-safari/src/background.js:225— (anonymous) has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 12 of the 36 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 261, 239, 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.
authority_ledger.classify_authority (cyclomatic 35) gym/tools/authority_ledger.py:244— authority_ledger.classify_authority 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.
discriminate.validate_report (cyclomatic 35) gym/tools/discriminate.py:472— discriminate.validate_report 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.
evidence_report._role_statuses (cyclomatic 35) gym/tools/evidence_report.py:806— evidence_report._role_statuses has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
browser-font-cmap.repairTerminalFontCmap (cyclomatic 35) rhwp-studio/src/core/browser-font-cmap.ts:2— browser-font-cmap.repairTerminalFontCmap has cyclomatic complexity 35 (threshold 15). Of this number, 29 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CanvasKitLayerRenderer.prepareBundledFonts (cyclomatic 35) rhwp-studio/src/view/canvaskit-renderer.ts:707— CanvasKitLayerRenderer.prepareBundledFonts has cyclomatic complexity 35 (threshold 15). Of this number, 34 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.
CanvasKitLayerRenderer.prepareLocalFonts (cyclomatic 35) rhwp-studio/src/view/canvaskit-renderer.ts:801— CanvasKitLayerRenderer.prepareLocalFonts 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.
input-handler-mouse.onDblClick (cyclomatic 35) rhwp-studio/src/engine/input-handler-mouse.ts:1376— input-handler-mouse.onDblClick 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.
AssistantView.proposal (cyclomatic 34) rhwp-studio/src/ai/ui/ai-panel.ts:144— AssistantView.proposal has cyclomatic complexity 34 (threshold 15). Of this number, 28 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
glyph-run-fonts.glyphRunPaintIsSupported (cyclomatic 34) rhwp-studio/src/view/canvaskit/glyph-run-fonts.ts:572— glyph-run-fonts.glyphRunPaintIsSupported has cyclomatic complexity 34 (threshold 15). Of this number, 33 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.
input-handler-picture.renderPictureObjectSelection (cyclomatic 34) rhwp-studio/src/engine/input-handler-picture.ts:364— input-handler-picture.renderPictureObjectSelection has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
constructor::onmessage (cyclomatic 34) rhwp-shared/pdf/import-session.js:222— constructor::onmessage has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
evidence_report._validate_positive (cyclomatic 33) gym/tools/evidence_report.py:525— evidence_report._validate_positive 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.
background.browser.runtime.onMessage.addListener() (cyclomatic 33) rhwp-safari/src/background.js:225— background.browser.runtime.onMessage.addListener() has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 9 of the 33 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 261, 239, 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.
action-runtime.evaluateFormAction.invoke (cyclomatic 33) rhwp-shared/forms/action-runtime.ts:179— action-runtime.evaluateFormAction.invoke has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
input-handler-keyboard.handleF11 (cyclomatic 33) rhwp-studio/src/engine/input-handler-keyboard.ts:2302— input-handler-keyboard.handleF11 has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InputHandler.deleteSelectedCellBlock (cyclomatic 33) rhwp-studio/src/engine/input-handler.ts:5876— InputHandler.deleteSelectedCellBlock has cyclomatic complexity 33 (threshold 15). Of this number, 18 points are the body's own statements and 15 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.
Hwp3SpecialChar::parse (cyclomatic 32) src/parser/hwp3/special_char.rs:134— Hwp3SpecialChar::parse has cyclomatic complexity 32 (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.
audit.audit_one_pack (cyclomatic 32) gym/tools/audit.py:875— audit.audit_one_pack 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.
CanvasView.refreshRenderSurfacePlan (cyclomatic 32) rhwp-studio/src/view/canvas-view.ts:1239— CanvasView.refreshRenderSurfacePlan has cyclomatic complexity 32 (threshold 15). Of this number, 29 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Ruler.drawHorizontal (cyclomatic 32) rhwp-studio/src/view/ruler.ts:558— Ruler.drawHorizontal 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.
input-handler-text.onCompositionEnd (cyclomatic 32) rhwp-studio/src/engine/input-handler-text.ts:441— input-handler-text.onCompositionEnd 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.
leaderboard.verify_entry (cyclomatic 31) gym/tools/leaderboard.py:495— leaderboard.verify_entry 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.
compatibility-glyph-view.compatibilityGlyphView (cyclomatic 31) rhwp-studio/src/view/canvaskit/compatibility-glyph-view.ts:7— compatibility-glyph-view.compatibilityGlyphView has cyclomatic complexity 31 (threshold 15). Of this number, 17 points are the body's own statements and 14 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.
showHoverCard (cyclomatic 31) rhwp-safari/src/content-script.js:206— showHoverCard has cyclomatic complexity 31 (threshold 15). Of this number, 27 points are the body's own statements and 4 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_decode (cyclomatic 31) rhwp-shared/pdf/import-session.js:277— _decode has cyclomatic complexity 31 (threshold 15). Of this number, 29 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Planner::clone_series (cyclomatic 30) crates/rhwp-ooxml-chart/src/patch.rs:702— Planner::clone_series 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.
CartesianLayout::new (cyclomatic 30) crates/rhwp-ooxml-chart/src/renderer/cartesian_layout.rs:437— CartesianLayout::new 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.
ParaShapeMods::apply_to (cyclomatic 30) src/model/style.rs:1128— ParaShapeMods::apply_to has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ParagraphMachine::feed (cyclomatic 30) src/parser/pdf/recognition.rs:374— ParagraphMachine::feed 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.
FontEnvironment::from_document_lookup (cyclomatic 30) src/renderer/font_environment.rs:309— FontEnvironment::from_document_lookup 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.
trajectory.validate_report (cyclomatic 30) gym/tools/trajectory.py:571— trajectory.validate_report 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.
write-tools.prepareInsert (cyclomatic 30) rhwp-studio/src/ai/tools/write-tools.ts:988— write-tools.prepareInsert has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1023, 1000, 1031). 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. This is NOT this file's highest cyclomatic complexity: write-tools.prepareWrite (cyclomatic 33) 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.
diff-engine.matchSegmentDp (cyclomatic 30) rhwp-studio/src/compare/diff-engine.ts:1959— diff-engine.matchSegmentDp 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.
CanvasKitLayerRenderer.renderNodeContents (cyclomatic 30) rhwp-studio/src/view/canvaskit-renderer.ts:1821— CanvasKitLayerRenderer.renderNodeContents 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.
CanvasKitLayerRenderer.renderTextRun::drawPass (cyclomatic 30) rhwp-studio/src/view/canvaskit-renderer.ts:3424— CanvasKitLayerRenderer.renderTextRun::drawPass has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (CanvasKitLayerRenderer.renderTextRun) 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.
input-handler-table.finishImagePlacement (cyclomatic 30) rhwp-studio/src/engine/input-handler-table.ts:539— input-handler-table.finishImagePlacement has cyclomatic complexity 30 (threshold 15). Of this number, 25 points are the body's own statements and 5 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.
PagePaintContext::publish_glyph_geometry (cyclomatic 29) src/paint/paper_viewport.rs:162— PagePaintContext::publish_glyph_geometry has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 7 of the 29 points are its own statements and the rest belongs to 3 function items inside it that branch (collect, publish, header_footer_fill). 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.
LenientCfbReader::open (cyclomatic 29) src/parser/cfb_reader.rs:450— LenientCfbReader::open 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.
_gen_pack.build_menu (cyclomatic 29) .claude/skills/rhwp-explore/references/_gen_pack.py:300— _gen_pack.build_menu has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_gen_pack.parse_map (cyclomatic 29) .claude/skills/rhwp-knowledge-map/references/_gen_pack.py:342— _gen_pack.parse_map 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.
differential.validate_report (cyclomatic 29) gym/tools/differential.py:867— differential.validate_report has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Parser.statement (cyclomatic 29) rhwp-shared/forms/action-runtime.ts:71— Parser.statement 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.
ai-panel.formatSummary (cyclomatic 29) rhwp-studio/src/ai/ui/ai-panel.ts:46— ai-panel.formatSummary 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.
diff-engine.cleanupParagraphAlignStepsToDiffItems (cyclomatic 29) rhwp-studio/src/compare/diff-engine.ts:2264— diff-engine.cleanupParagraphAlignStepsToDiffItems 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.
MetafileFontSession.prepare (cyclomatic 29) rhwp-studio/src/core/metafile-font-session.ts:20— MetafileFontSession.prepare 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.
CursorState.comparePositions (cyclomatic 29) rhwp-studio/src/engine/cursor.ts:468— CursorState.comparePositions 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.
input-handler-text.replaceTextAtRaw (cyclomatic 29) rhwp-studio/src/engine/input-handler-text.ts:851— input-handler-text.replaceTextAtRaw has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
main.setupGlobalShortcuts (cyclomatic 29) rhwp-studio/src/main.ts:988— main.setupGlobalShortcuts 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 one function literal inside it that branches (line 989). 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.
#runPageAction (cyclomatic 29) npm/hwpctrl-ocx/src/index.mjs:3341— #runPageAction has cyclomatic complexity 29 (threshold 15). Of this number, 24 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChartScales::new (cyclomatic 28) crates/rhwp-ooxml-chart/src/renderer/cartesian_layout.rs:217— ChartScales::new 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.
authority_ledger.build_ledger (cyclomatic 28) gym/tools/authority_ledger.py:524— authority_ledger.build_ledger 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.
competitive_bench.scorecard_emptiness_issues (cyclomatic 28) gym/tools/competitive_bench.py:1473— competitive_bench.scorecard_emptiness_issues 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.
diff-engine.buildGranularControlDiffs (cyclomatic 28) rhwp-studio/src/compare/diff-engine.ts:709— diff-engine.buildGranularControlDiffs has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 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.
CanvasKitLayerRenderer.makeSurface (cyclomatic 28) rhwp-studio/src/view/canvaskit-renderer.ts:1498— CanvasKitLayerRenderer.makeSurface 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.
DocumentAgentController.revertTextCommand (cyclomatic 28) rhwp-studio/src/document-agent/controller.ts:590— DocumentAgentController.revertTextCommand has cyclomatic complexity 28 (threshold 15). Of this number, 17 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
input-handler-picture.finishPictureResizeDrag (cyclomatic 28) rhwp-studio/src/engine/input-handler-picture.ts:887— input-handler-picture.finishPictureResizeDrag 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.
agent_session.validate_session (cyclomatic 27) gym/tools/agent_session.py:442— agent_session.validate_session 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.
leaderboard.render_markdown (cyclomatic 27) gym/tools/leaderboard.py:922— leaderboard.render_markdown 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.
NativeOwnerTransport._poll (cyclomatic 27) bindings/Flutter/lib/src/native_ffi.dart:289— NativeOwnerTransport._poll 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.
index.imagePixelSize (cyclomatic 27) npm/hwpctrl-ocx/src/index.mjs:3731— index.imagePixelSize 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.
background.extractPrvImageFromZip (cyclomatic 27) rhwp-safari/src/background.js:460— background.extractPrvImageFromZip 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.
host-font-requests.hancomEquationFamilies (cyclomatic 27) rhwp-studio/src/core/host-font-requests.ts:78— host-font-requests.hancomEquationFamilies 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.
WasmBridge.prepareDeclaredFontEnvironment (cyclomatic 27) rhwp-studio/src/core/wasm-bridge.ts:1051— WasmBridge.prepareDeclaredFontEnvironment has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rhwp-dev.initRhwpDev (cyclomatic 27) rhwp-studio/src/core/rhwp-dev.ts:25— rhwp-dev.initRhwpDev has cyclomatic complexity 27 (threshold 15). Of this number, 26 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.
static-svg-path-layers.parseStaticSvgTransform (cyclomatic 27) rhwp-studio/src/view/static-svg-path-layers.ts:896— static-svg-path-layers.parseStaticSvgTransform 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.
CanvasKitLayerRenderer.renderColorPaintGraphNode (cyclomatic 27) rhwp-studio/src/view/canvaskit-renderer.ts:2640— CanvasKitLayerRenderer.renderColorPaintGraphNode 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.
CanvasView.refreshInvalidatedPage (cyclomatic 27) rhwp-studio/src/view/canvas-view.ts:2065— CanvasView.refreshInvalidatedPage has cyclomatic complexity 27 (threshold 15). Of this number, 19 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.
input-handler-table.finishResizeDrag (cyclomatic 27) rhwp-studio/src/engine/input-handler-table.ts:330— input-handler-table.finishResizeDrag has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 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.
input-handler-text.overwrittenTextAt (cyclomatic 27) rhwp-studio/src/engine/input-handler-text.ts:59— input-handler-text.overwrittenTextAt has cyclomatic complexity 27 (threshold 15). Of this number, 24 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.
InputHandler.getParaFormatTargetsForRange (cyclomatic 27) rhwp-studio/src/engine/input-handler.ts:2612— InputHandler.getParaFormatTargetsForRange 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.
#runTableAction (cyclomatic 27) npm/hwpctrl-ocx/src/index.mjs:3074— #runTableAction has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FontGlyphLowerer::lower_portable_glyph_run (cyclomatic 26) src/paint/font_glyph.rs:569— FontGlyphLowerer::lower_portable_glyph_run has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutFrame::try_carve (cyclomatic 26) src/renderer/layout_frame.rs:574— LayoutFrame::try_carve 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.
SourceFrameQuery::resolve (cyclomatic 26) src/renderer/typeset/table/scan/source_frame.rs:42— SourceFrameQuery::resolve 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.
SVGPlayer::ext_text_out (cyclomatic 26) src/wmf/converter/svg/mod.rs:868— SVGPlayer::ext_text_out 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.
authority_ledger.classify_baseline (cyclomatic 26) gym/tools/authority_ledger.py:398— authority_ledger.classify_baseline 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.
background.extractPrvImageFromCFB (cyclomatic 26) rhwp-safari/src/background.js:410— background.extractPrvImageFromCFB 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.
action-runtime.tokens (cyclomatic 26) rhwp-shared/forms/action-runtime.ts:23— action-runtime.tokens 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.
local-fonts.normalizeLocalFontRecords (cyclomatic 26) rhwp-studio/src/core/local-fonts.ts:491— local-fonts.normalizeLocalFontRecords has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
host-font-requests.collectHostFontRequests (cyclomatic 26) rhwp-studio/src/core/host-font-requests.ts:124— host-font-requests.collectHostFontRequests has cyclomatic complexity 26 (threshold 15). Of this number, 24 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.
LayerResourceStore.hydrate (cyclomatic 26) rhwp-studio/src/core/layer-resource-store.ts:22— LayerResourceStore.hydrate has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 29, resolve, a function literal at line 54). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
anisotropic-image.drawAnisotropicPrintImage (cyclomatic 26) rhwp-studio/src/view/canvaskit/anisotropic-image.ts:44— anisotropic-image.drawAnisotropicPrintImage 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.
image-header.parseJpegHeader (cyclomatic 26) rhwp-studio/src/view/canvaskit/image-header.ts:373— image-header.parseJpegHeader 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.
page-renderer.collectLayerPlaneSummary (cyclomatic 26) rhwp-studio/src/view/page-renderer.ts:1542— page-renderer.collectLayerPlaneSummary 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.
DeleteSelectionCommand.constructor (cyclomatic 26) rhwp-studio/src/engine/command.ts:1167— DeleteSelectionCommand.constructor has cyclomatic complexity 26 (threshold 15). Of this number, 20 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CompareResultWindow.highlightPreview (cyclomatic 26) rhwp-studio/src/ui/compare-result-window.ts:182— CompareResultWindow.highlightPreview has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
(anonymous) (cyclomatic 26) rhwp-studio/public/theme-init.js:7— (anonymous) 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.
Resources::prepare (cyclomatic 25) src/document_core/commands/paragraph_block/import/resources.rs:135— Resources::prepare 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.
SerializeContext::try_collect_from_document (cyclomatic 25) src/serializer/hwpx/context.rs:229— SerializeContext::try_collect_from_document 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.
batch_convert::bin::mock_rhwp::run (cyclomatic 25) tools/batch-convert/src/bin/mock_rhwp.rs:68— batch_convert::bin::mock_rhwp::run 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.
_gen_pack.pick_canonical_for_heading (cyclomatic 25) .claude/skills/rhwp-knowledge-map/references/_gen_pack.py:813— _gen_pack.pick_canonical_for_heading has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
audit.format_human_report (cyclomatic 25) gym/tools/audit.py:820— audit.format_human_report 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.
competitive_bench.render_report (cyclomatic 25) gym/tools/competitive_bench.py:687— competitive_bench.render_report 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.
fuzz_corpus.fuzz (cyclomatic 25) gym/tools/fuzz_corpus.py:1595— fuzz_corpus.fuzz 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.
leaderboard._cmd_verify_body (cyclomatic 25) gym/tools/leaderboard.py:594— leaderboard._cmd_verify_body has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Palette.pick (cyclomatic 25) rhwp-desk/ui/js/palette.js:134— Palette.pick has cyclomatic complexity 25 (threshold 15). Of this number, 13 points are the body's own statements and 12 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
agent-loop.runAgent (cyclomatic 25) rhwp-studio/src/ai/agent/agent-loop.ts:84— agent-loop.runAgent has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
diff-engine.scoreControlFallback (cyclomatic 25) rhwp-studio/src/compare/diff-engine.ts:2856— diff-engine.scoreControlFallback has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
sfnt-face.repairMinimalFormat4Length (cyclomatic 25) rhwp-studio/src/core/sfnt-face.ts:161— sfnt-face.repairMinimalFormat4Length 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.
font-substitution.fontFamilyCandidatesForDisplayWithRules (cyclomatic 25) rhwp-studio/src/core/font-substitution.ts:474— font-substitution.fontFamilyCandidatesForDisplayWithRules has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
anisotropic-image.drawPrintFrameImage (cyclomatic 25) rhwp-studio/src/view/canvaskit/anisotropic-image.ts:11— anisotropic-image.drawPrintFrameImage 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.
CanvasKitLayerRenderer.renderPage (cyclomatic 25) rhwp-studio/src/view/canvaskit-renderer.ts:978— CanvasKitLayerRenderer.renderPage has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
flow-image-clip.collectFlowImagePaintOps::visit (cyclomatic 25) rhwp-studio/src/view/flow-image-clip.ts:104— flow-image-clip.collectFlowImagePaintOps::visit 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.
ApplyCharFormatCommand.executeFormat (cyclomatic 25) rhwp-studio/src/engine/command.ts:1310— ApplyCharFormatCommand.executeFormat has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 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.
input-handler-keyboard.handleShiftF11 (cyclomatic 25) rhwp-studio/src/engine/input-handler-keyboard.ts:2417— input-handler-keyboard.handleShiftF11 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.
input-handler-picture.updatePictureResizeDrag (cyclomatic 25) rhwp-studio/src/engine/input-handler-picture.ts:785— input-handler-picture.updatePictureResizeDrag 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.
selection-text.readSelectionText (cyclomatic 25) rhwp-studio/src/plugin/selection-text.ts:53— selection-text.readSelectionText has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VerifyArgs::parse (cyclomatic 24) src/cli/queries/verification.rs:32— VerifyArgs::parse has cyclomatic complexity 24 (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.
evidence_html._pack_statistics (cyclomatic 24) gym/core/evidence_html.py:184— evidence_html._pack_statistics 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.
runner.exception_kind (cyclomatic 24) gym/core/runner.py:257— runner.exception_kind 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.
agent_session.score_session (cyclomatic 24) gym/tools/agent_session.py:798— agent_session.score_session 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.
release_diff.validate_report (cyclomatic 24) gym/tools/release_diff.py:793— release_diff.validate_report 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.
rhwp.__wbg_get_imports (cyclomatic 24) rhwp-studio/public/rhwp.js:14105— rhwp.__wbg_get_imports has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 15 function literals inside it that branch (lines 14108, 14134, 14140, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
navigation-keymap.getNavigationAction (cyclomatic 24) rhwp-studio/src/engine/navigation-keymap.ts:80— navigation-keymap.getNavigationAction 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.
diff-engine.matchWindowedGreedy (cyclomatic 24) rhwp-studio/src/compare/diff-engine.ts:2054— diff-engine.matchWindowedGreedy has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 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.
diff-engine.buildControlDiffs (cyclomatic 24) rhwp-studio/src/compare/diff-engine.ts:2687— diff-engine.buildControlDiffs 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.
chart-data-target.matchesOne (cyclomatic 24) rhwp-studio/src/core/chart-data-target.ts:374— chart-data-target.matchesOne has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
bounded-response.readBoundedResponseArrayBuffer (cyclomatic 24) rhwp-studio/src/view/canvaskit/bounded-response.ts:8— bounded-response.readBoundedResponseArrayBuffer has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
CanvasKitLayerRenderer.drawImageRect (cyclomatic 24) rhwp-studio/src/view/canvaskit-renderer.ts:2977— CanvasKitLayerRenderer.drawImageRect 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.
CanvasKitLayerRenderer.renderCharOverlap::draw::drawCell (cyclomatic 24) rhwp-studio/src/view/canvaskit-renderer.ts:3837— CanvasKitLayerRenderer.renderCharOverlap::draw::drawCell 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. This shape REPEATS in the file: one other method here (CanvasKitLayerRenderer.renderCharOverlap) 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.
CursorState.moveCellSelection (cyclomatic 24) rhwp-studio/src/engine/cursor.ts:1753— CursorState.moveCellSelection 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.
input-handler-hyperlink.followHyperlinkClick (cyclomatic 24) rhwp-studio/src/engine/input-handler-hyperlink.ts:65— input-handler-hyperlink.followHyperlinkClick has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
input-handler-keyboard.onCopy (cyclomatic 24) rhwp-studio/src/engine/input-handler-keyboard.ts:1841— input-handler-keyboard.onCopy 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.
input-handler-mouse.handleResizeHover (cyclomatic 24) rhwp-studio/src/engine/input-handler-mouse.ts:1903— input-handler-mouse.handleResizeHover 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.
InputHandler.insertDroppedImageAtClientPoint (cyclomatic 24) rhwp-studio/src/engine/input-handler.ts:917— InputHandler.insertDroppedImageAtClientPoint has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StyleEditDialog.onConfirm (cyclomatic 24) rhwp-studio/src/ui/style-edit-dialog.ts:284— StyleEditDialog.onConfirm has cyclomatic complexity 24 (threshold 15). Of this number, 12 points are the body's own statements and 12 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.
viewer.renderOutlineTree (cyclomatic 24) rhwp-vscode/src/webview/viewer.ts:1153— viewer.renderOutlineTree has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1196, 1176). 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.
BackendOverrides::apply (cyclomatic 23) src/parser/pdf/policy.rs:234— BackendOverrides::apply 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.
runner.render_report (cyclomatic 23) gym/core/runner.py:1172— runner.render_report 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.
robustness.validate_report (cyclomatic 23) gym/tools/robustness.py:1225— robustness.validate_report 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.
ModalDialog.show (cyclomatic 23) rhwp-studio/src/ui/dialog.ts:89— ModalDialog.show has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 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.
diff-engine.shouldPromoteEmptyTextEdit (cyclomatic 23) rhwp-studio/src/compare/diff-engine.ts:2146— diff-engine.shouldPromoteEmptyTextEdit has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
local-fonts.readSfntFontNames (cyclomatic 23) rhwp-studio/src/core/local-fonts.ts:399— local-fonts.readSfntFontNames 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.
CanvasKitLayerRenderer.renderImage (cyclomatic 23) rhwp-studio/src/view/canvaskit-renderer.ts:2318— CanvasKitLayerRenderer.renderImage has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PageRenderer.renderPage (cyclomatic 23) rhwp-studio/src/view/page-renderer.ts:213— PageRenderer.renderPage 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.
input-handler-mouse.finishMouseUp (cyclomatic 23) rhwp-studio/src/engine/input-handler-mouse.ts:2010— input-handler-mouse.finishMouseUp 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.
InputHandler.executeOperation (cyclomatic 23) rhwp-studio/src/engine/input-handler.ts:3321— InputHandler.executeOperation has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 3322). 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.
numbering-dialog.formatNumber (cyclomatic 23) rhwp-studio/src/ui/numbering-dialog.ts:95— numbering-dialog.formatNumber 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.
Hwp3DrawingObject::read (cyclomatic 22) src/parser/hwp3/drawing.rs:487— Hwp3DrawingObject::read 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.
KerningParagraphBreakSession::boundary_width (cyclomatic 22) src/renderer/kerning.rs:1823— KerningParagraphBreakSession::boundary_width 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.
SvgLayerRenderer::render_node (cyclomatic 22) src/renderer/svg_layer.rs:238— SvgLayerRenderer::render_node 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.
ConversionConfig::validate (cyclomatic 22) tools/batch-convert/src/config.rs:140— ConversionConfig::validate 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.
differential._values_equal (cyclomatic 22) gym/tools/differential.py:415— differential._values_equal 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.
pack_health.scan_manifest (cyclomatic 22) gym/tools/pack_health.py:1827— pack_health.scan_manifest 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.
release_diff._values_equal (cyclomatic 22) gym/tools/release_diff.py:465— release_diff._values_equal 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.
NativeTextureController._poll (cyclomatic 22) bindings/Flutter/lib/src/native_texture_view.dart:750— NativeTextureController._poll 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.
cards.addToolCard (cyclomatic 22) rhwp-desk/ui/js/cards.js:74— cards.addToolCard has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
diff-engine.findLongestEqualSignatureRun (cyclomatic 22) rhwp-studio/src/compare/diff-engine.ts:1853— diff-engine.findLongestEqualSignatureRun 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.
canvas-intrinsic-font.fontProgramOwnsFamily (cyclomatic 22) rhwp-studio/src/core/canvas-intrinsic-font.mjs:14— canvas-intrinsic-font.fontProgramOwnsFamily 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.
host-font-provider.copySnapshot (cyclomatic 22) rhwp-studio/src/core/host-font-provider.ts:46— host-font-provider.copySnapshot has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 51). 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.
metafile-print.drawPrintMetafile (cyclomatic 22) rhwp-studio/src/view/canvaskit/metafile-print.ts:15— metafile-print.drawPrintMetafile has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
static-svg-path-layers.decodeStaticSvgXmlEntities (cyclomatic 22) rhwp-studio/src/view/static-svg-path-layers.ts:363— static-svg-path-layers.decodeStaticSvgXmlEntities 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.
CanvasKitLayerRenderer.drawImageOp (cyclomatic 22) rhwp-studio/src/view/canvaskit-renderer.ts:2812— CanvasKitLayerRenderer.drawImageOp has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (CanvasKitLayerRenderer.drawImageOp::drawImage) 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. This is NOT this file's highest cyclomatic complexity: CanvasKitLayerRenderer.renderOp (cyclomatic 23) 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.
CanvasKitLayerRenderer.resolvePreparedTypeface (cyclomatic 22) rhwp-studio/src/view/canvaskit-renderer.ts:4638— CanvasKitLayerRenderer.resolvePreparedTypeface 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. This is NOT this file's highest cyclomatic complexity: CanvasKitLayerRenderer.renderOp (cyclomatic 23) 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.
PageRenderer.createOrReuseFlowImageLayer (cyclomatic 22) rhwp-studio/src/view/page-renderer.ts:627— PageRenderer.createOrReuseFlowImageLayer 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.
office-clipboard-images.extractEmfDibs (cyclomatic 22) rhwp-studio/src/engine/office-clipboard-images.ts:56— office-clipboard-images.extractEmfDibs 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.
input-handler-text.handleBackspace (cyclomatic 22) rhwp-studio/src/engine/input-handler-text.ts:214— input-handler-text.handleBackspace 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.
input-handler-text.handleDelete (cyclomatic 22) rhwp-studio/src/engine/input-handler-text.ts:286— input-handler-text.handleDelete 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.
input-handler-text.onCompositionStart (cyclomatic 22) rhwp-studio/src/engine/input-handler-text.ts:378— input-handler-text.onCompositionStart 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.
InputHandler.constructor (cyclomatic 22) rhwp-studio/src/engine/input-handler.ts:596— InputHandler.constructor has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 772, 674, 713, …). 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.
PdfImportDialog.onConfirm (cyclomatic 22) rhwp-studio/src/ui/pdf-import-dialog.ts:193— PdfImportDialog.onConfirm has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 223, 251, 248, …). 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.
CharShapeDialog.populateFromProps (cyclomatic 22) rhwp-studio/src/ui/char-shape-dialog.ts:858— CharShapeDialog.populateFromProps has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
(anonymous) (cyclomatic 22) mydocs/pr/assets/pr8296-maintainer-20261101/canvaskit-probe.mjs:18— (anonymous) has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Document::populate_external_images_from_dir (cyclomatic 21) src/model/document.rs:784— Document::populate_external_images_from_dir 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.
SnapshotWalk::paragraph (cyclomatic 21) src/native_host/accessibility.rs:278— SnapshotWalk::paragraph 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.
ParagraphFloatPlacement::from_stored_overlay_guide_chain (cyclomatic 21) src/renderer/float_placement/stored_empty_host_frame.rs:138— ParagraphFloatPlacement::from_stored_overlay_guide_chain 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.
RenderNormalizationOverlay::register_rendered_text_partitions_with_storage (cyclomatic 21) src/renderer/render_normalization.rs:431— RenderNormalizationOverlay::register_rendered_text_partitions_with_storage 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.
HorizontalShapingTransaction::shadow_measure_with_instance_request (cyclomatic 21) src/renderer/shaping_context.rs:755— HorizontalShapingTransaction::shadow_measure_with_instance_request 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.
extract_docx.main (cyclomatic 21) .claude/skills/rhwp-exam-ingest/helpers/extract_docx.py:40— extract_docx.main 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.
audit.validate_report (cyclomatic 21) gym/tools/audit.py:780— audit.validate_report 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.
competitive_bench.validate_capability_matrix (cyclomatic 21) gym/tools/competitive_bench.py:164— competitive_bench.validate_capability_matrix 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.
competitive_bench.main (cyclomatic 21) gym/tools/competitive_bench.py:1815— competitive_bench.main 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.
_Plan.geometry (cyclomatic 21) bindings/Flutter/lib/src/native_texture_view.dart:124— _Plan.geometry 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.
write-tools.prepareEditTable (cyclomatic 21) rhwp-studio/src/ai/tools/write-tools.ts:1385— write-tools.prepareEditTable has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1391, 1404). 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. This is NOT this file's highest cyclomatic complexity: write-tools.prepareWrite (cyclomatic 33) 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.
diff-engine.suppressPureReflowMoves (cyclomatic 21) rhwp-studio/src/compare/diff-engine.ts:1472— diff-engine.suppressPureReflowMoves has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1497, 1481, 1482). 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.
local-fonts.loadPreferredLocalFontBytes (cyclomatic 21) rhwp-studio/src/core/local-fonts.ts:1216— local-fonts.loadPreferredLocalFontBytes 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.
canvaskit-char-overlap.replayComposedCharOverlap (cyclomatic 21) rhwp-studio/src/view/canvaskit-char-overlap.ts:5— canvaskit-char-overlap.replayComposedCharOverlap has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
image-header.gifHasSingleFrame (cyclomatic 21) rhwp-studio/src/view/canvaskit/image-header.ts:69— image-header.gifHasSingleFrame 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.
flow-image-clip.flowImageOpsFromNarrowQuery (cyclomatic 21) rhwp-studio/src/view/flow-image-clip.ts:246— flow-image-clip.flowImageOpsFromNarrowQuery 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.
ViewportManager.onWheel (cyclomatic 21) rhwp-studio/src/view/viewport-manager.ts:132— ViewportManager.onWheel 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.
CanvasView.renderHeaderFooterEditOverlays (cyclomatic 21) rhwp-studio/src/view/canvas-view.ts:1021— CanvasView.renderHeaderFooterEditOverlays 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.
CanvasView.setPageViewSettings (cyclomatic 21) rhwp-studio/src/view/canvas-view.ts:2354— CanvasView.setPageViewSettings 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.
DocumentAgentController.applyTextCommand (cyclomatic 21) rhwp-studio/src/document-agent/controller.ts:416— DocumentAgentController.applyTextCommand has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 464). 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.
input-handler-hyperlink.hyperlinkAtPointer (cyclomatic 21) rhwp-studio/src/engine/input-handler-hyperlink.ts:11— input-handler-hyperlink.hyperlinkAtPointer has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
InputHandler.finishTextboxPlacement (cyclomatic 21) rhwp-studio/src/engine/input-handler.ts:1354— InputHandler.finishTextboxPlacement 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.
InputHandler.updateTextSelectionDragFromPointer (cyclomatic 21) rhwp-studio/src/engine/input-handler.ts:1645— InputHandler.updateTextSelectionDragFromPointer 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.
InputHandler.copySelectedObject (cyclomatic 21) rhwp-studio/src/engine/input-handler.ts:5685— InputHandler.copySelectedObject has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
#runObjectAction (cyclomatic 21) npm/hwpctrl-ocx/src/index.mjs:2819— #runObjectAction has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
resolveSettings (cyclomatic 21) rhwp-chrome/sw/settings-store.js:47— resolveSettings has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Parser::parse_pseudo (cyclomatic 20) src/agent/dsel/parse.rs:413— Parser::parse_pseudo has cyclomatic complexity 20 (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.
TypefaceCatalog::load (cyclomatic 20) src/renderer/skia/font_catalog.rs:155— TypefaceCatalog::load 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.
TextLines::shape (cyclomatic 20) src/renderer/skia/text_replay/lines.rs:85— TextLines::shape 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.
Bitmap::from (cyclomatic 20) src/wmf/converter/bitmap.rs:211— Bitmap::from 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.
runner.load_pack (cyclomatic 20) gym/core/runner.py:768— runner.load_pack 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.
report.render_card (cyclomatic 20) gym/report.py:638— report.render_card 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.
agent_session.classify_sequence (cyclomatic 20) gym/tools/agent_session.py:714— agent_session.classify_sequence 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.
agent_session.render_score (cyclomatic 20) gym/tools/agent_session.py:1056— agent_session.render_score 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.
competitive_bench.export_text_verdict (cyclomatic 20) gym/tools/competitive_bench.py:538— competitive_bench.export_text_verdict 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.
EditorTransport._handlePortMessage (cyclomatic 20) npm/editor/transport.js:174— EditorTransport._handlePortMessage 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.
Parser.expression (cyclomatic 20) rhwp-shared/forms/action-runtime.ts:108— Parser.expression 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.
action-runtime.evaluateFormAction.assign (cyclomatic 20) rhwp-shared/forms/action-runtime.ts:163— action-runtime.evaluateFormAction.assign 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.
write-tools.prepareFormatCell (cyclomatic 20) rhwp-studio/src/ai/tools/write-tools.ts:1554— write-tools.prepareFormatCell has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1564, 1584). 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. This is NOT this file's highest cyclomatic complexity: write-tools.prepareWrite (cyclomatic 33) 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.
claude.classifyClaudeError (cyclomatic 20) rhwp-studio/src/ai/provider/claude.ts:65— claude.classifyClaudeError 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.
WasmBridge.prepareCanvasMetrics (cyclomatic 20) rhwp-studio/src/core/wasm-bridge.ts:367— WasmBridge.prepareCanvasMetrics has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 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.
VirtualScroll.getVisibilitySnapshot (cyclomatic 20) rhwp-studio/src/view/virtual-scroll.ts:470— VirtualScroll.getVisibilitySnapshot 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.
print-image-sampling.drawPrintAreaImage (cyclomatic 20) rhwp-studio/src/view/canvaskit/print-image-sampling.ts:18— print-image-sampling.drawPrintAreaImage 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.
image-header.parseWebpHeader (cyclomatic 20) rhwp-studio/src/view/canvaskit/image-header.ts:295— image-header.parseWebpHeader 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.
CanvasKitLayerRenderer.renderTabLeader::draw (cyclomatic 20) rhwp-studio/src/view/canvaskit-renderer.ts:4077— CanvasKitLayerRenderer.renderTabLeader::draw 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. This is NOT this file's highest cyclomatic complexity: CanvasKitLayerRenderer.renderOp (cyclomatic 23) 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.
CanvasKitLayerRenderer.drawStaticSvgTextLayer (cyclomatic 20) rhwp-studio/src/view/canvaskit-renderer.ts:4827— CanvasKitLayerRenderer.drawStaticSvgTextLayer has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: CanvasKitLayerRenderer.renderOp (cyclomatic 23) 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.
CanvasView.buildPrefetchRenderWork (cyclomatic 20) rhwp-studio/src/view/canvas-view.ts:818— CanvasView.buildPrefetchRenderWork has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 843, 826). 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.
CursorState.moveToParagraphBoundary (cyclomatic 20) rhwp-studio/src/engine/cursor.ts:1073— CursorState.moveToParagraphBoundary has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
input-edit-invalidation.isPageLocalTextEditCommand (cyclomatic 20) rhwp-studio/src/engine/input-edit-invalidation.ts:33— input-edit-invalidation.isPageLocalTextEditCommand 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.
FormulaDialog.onConfirm (cyclomatic 20) rhwp-studio/src/ui/formula-dialog.ts:179— FormulaDialog.onConfirm has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Toolbar.setupFontControls (cyclomatic 20) rhwp-studio/src/ui/toolbar.ts:257— Toolbar.setupFontControls has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 274, 265, 319, …). 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.
(anonymous) (cyclomatic 20) mydocs/pr/assets/pr8187/browser-api.mjs:25— (anonymous) has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 14 function items inside it that branch (label, label::find, a function literal at line 111, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Record::read (cyclomatic 19) src/model/border_paint.rs:826— Record::read 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.
Catalogue::build (cyclomatic 19) src/paint/metafile_print/catalog.rs:156— Catalogue::build has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
schema.validate_task (cyclomatic 19) gym/core/schema.py:554— schema.validate_task 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.
agent_session.record_session (cyclomatic 19) gym/tools/agent_session.py:969— agent_session.record_session has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
audit.classify_schema_message (cyclomatic 19) gym/tools/audit.py:593— audit.classify_schema_message 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.
audit.audit (cyclomatic 19) gym/tools/audit.py:1109— audit.audit 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.
build_baseline.validate_step (cyclomatic 19) gym/tools/build_baseline.py:613— build_baseline.validate_step 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.
leaderboard.validate_invite (cyclomatic 19) gym/tools/leaderboard.py:725— leaderboard.validate_invite 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.
pack_health.extract_json_fragment_rows (cyclomatic 19) gym/tools/pack_health.py:461— pack_health.extract_json_fragment_rows 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.
pack_health.fragment_looks_like_answer (cyclomatic 19) gym/tools/pack_health.py:536— pack_health.fragment_looks_like_answer 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.
release_gate.render_summary_lines (cyclomatic 19) gym/tools/release_gate.py:876— release_gate.render_summary_lines 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.
BatchRunner.run (cyclomatic 19) rhwp-desk/ui/js/batch.js:36— BatchRunner.run has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CommandErrorBoundary.fail (cyclomatic 19) rhwp-studio/src/core/command-error.ts:73— CommandErrorBoundary.fail has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 78). 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.
http.readSse (cyclomatic 19) rhwp-studio/src/ai/provider/http.ts:25— http.readSse has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GeminiProvider.streamTurn (cyclomatic 19) rhwp-studio/src/ai/provider/gemini.ts:303— GeminiProvider.streamTurn has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 321). 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.
diff-engine.buildIdentityTextDiffs (cyclomatic 19) rhwp-studio/src/compare/diff-engine.ts:1335— diff-engine.buildIdentityTextDiffs has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
svg-image-header.svgCommentScanSource (cyclomatic 19) rhwp-studio/src/view/canvaskit/svg-image-header.ts:142— svg-image-header.svgCommentScanSource 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.
glyph-run-fonts.fontBlobPayloadBytes (cyclomatic 19) rhwp-studio/src/view/canvaskit/glyph-run-fonts.ts:533— glyph-run-fonts.fontBlobPayloadBytes has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: glyph-run-fonts.isBoundedVerticalHwp5CanvasKitCandidate (cyclomatic 31) 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.
CanvasKitParagraphFonts.source (cyclomatic 19) rhwp-studio/src/view/canvaskit/paragraph-fonts.ts:50— CanvasKitParagraphFonts.source has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CanvasKitLayerRenderer.drawStrokeWithDash (cyclomatic 19) rhwp-studio/src/view/canvaskit-renderer.ts:5833— CanvasKitLayerRenderer.drawStrokeWithDash has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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: CanvasKitLayerRenderer.renderOp (cyclomatic 23) 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.
PageRenderer.applyOverlays (cyclomatic 19) rhwp-studio/src/view/page-renderer.ts:496— PageRenderer.applyOverlays 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.
PageRenderer.scheduleReRender (cyclomatic 19) rhwp-studio/src/view/page-renderer.ts:1146— PageRenderer.scheduleReRender has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (finish, a function literal at line 1191, a function literal at line 1202, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
runtime.installEmbedRuntime::onMessage (cyclomatic 19) rhwp-studio/src/embed/runtime.ts:177— runtime.installEmbedRuntime::onMessage 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.
SetCellBorderFillCommand.execute (cyclomatic 19) rhwp-studio/src/engine/command.ts:2623— SetCellBorderFillCommand.execute has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's own statements and 9 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.
input-handler-picture.findPictureBbox (cyclomatic 19) rhwp-studio/src/engine/input-handler-picture.ts:323— input-handler-picture.findPictureBbox 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.
input-handler-picture.relocatePictureToDropPage (cyclomatic 19) rhwp-studio/src/engine/input-handler-picture.ts:1161— input-handler-picture.relocatePictureToDropPage has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RemapCtx::control (cyclomatic 18) src/document_core/commands/foreign_paste.rs:692— RemapCtx::control 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.
HftOutlineFonts::register (cyclomatic 18) src/renderer/hft_outline.rs:195— HftOutlineFonts::register 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.
CondensePlan::prepare (cyclomatic 18) src/renderer/layout/paragraph_layout/condense_spacing.rs:14— CondensePlan::prepare 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.
PdfFontFallbackIndex::select (cyclomatic 18) src/renderer/pdf.rs:1509— PdfFontFallbackIndex::select has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: rhwp::renderer::pdf::direct_pdf_validation::op_name (cyclomatic 19) 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 function is counted neither in this dimension's figures nor in its score.
TernaryRasterOperator::run (cyclomatic 18) src/wmf/converter/svg/ternary_raster_operator.rs:543— TernaryRasterOperator::run 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.
_gen_pack.transcript_for (cyclomatic 18) .claude/skills/rhwp-bulk-pipeline/references/_gen_pack.py:1185— _gen_pack.transcript_for 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.
schema.validate_profile (cyclomatic 18) gym/core/schema.py:697— schema.validate_profile has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
evidence_report._validate_authority (cyclomatic 18) gym/tools/evidence_report.py:475— evidence_report._validate_authority 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.
fuzz_corpus.mutant_family (cyclomatic 18) gym/tools/fuzz_corpus.py:773— fuzz_corpus.mutant_family 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.
pack_health.scan_reference_steps (cyclomatic 18) gym/tools/pack_health.py:1671— pack_health.scan_reference_steps 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.
release_gate.fold_preflight (cyclomatic 18) gym/tools/release_gate.py:312— release_gate.fold_preflight 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.
robustness.mutant_family (cyclomatic 18) gym/tools/robustness.py:611— robustness.mutant_family 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.
robustness.audit (cyclomatic 18) gym/tools/robustness.py:1288— robustness.audit 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.
inspect-hwp.inspect (cyclomatic 18) mydocs/pr/assets/chrisryugj_20261031/inspect-hwp.py:4— inspect-hwp.inspect 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.
_NativeEditorViewState._key (cyclomatic 18) bindings/Flutter/lib/src/native_editor_view.dart:195— _NativeEditorViewState._key 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.
OpenAiProvider.streamTurn (cyclomatic 18) rhwp-studio/src/ai/provider/openai.ts:220— OpenAiProvider.streamTurn has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 238). 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.
ChatController.executeWrite (cyclomatic 18) rhwp-studio/src/ai/agent/chat-controller.ts:167— ChatController.executeWrite 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.
block-calculation-plan.planBlockCalculation (cyclomatic 18) rhwp-studio/src/command/block-calculation-plan.ts:52— block-calculation-plan.planBlockCalculation 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.
file.runPdfPrint (cyclomatic 18) rhwp-studio/src/command/commands/file.ts:637— file.runPdfPrint 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
diff-engine.charEditOpsFullDp (cyclomatic 18) rhwp-studio/src/compare/diff-engine.ts:371— diff-engine.charEditOpsFullDp 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.
diff-engine.matchSegment (cyclomatic 18) rhwp-studio/src/compare/diff-engine.ts:1897— diff-engine.matchSegment has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 1914). 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.
local-fonts.matchingCollectionFace (cyclomatic 18) rhwp-studio/src/core/local-fonts.ts:1189— local-fonts.matchingCollectionFace 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.
declared-font-environment.loadLocalProgram (cyclomatic 18) rhwp-studio/src/core/declared-font-environment.ts:51— declared-font-environment.loadLocalProgram has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
image-crop-scale.imageCropSourceRect (cyclomatic 18) rhwp-studio/src/view/image-crop-scale.ts:117— image-crop-scale.imageCropSourceRect 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.
image-header.webpHasSingleFrame (cyclomatic 18) rhwp-studio/src/view/canvaskit/image-header.ts:153— image-header.webpHasSingleFrame 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.
glyph-outline-payload-status.glyphOutlinePayloadStatus (cyclomatic 18) rhwp-studio/src/view/glyph-outline-payload-status.ts:67— glyph-outline-payload-status.glyphOutlinePayloadStatus has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: glyph-outline-payload-status.hasSvgGlyphContract (cyclomatic 24) 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.
cursor.classifyChar (cyclomatic 18) rhwp-studio/src/engine/cursor.ts:2608— cursor.classifyChar 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.
InsertTextCommand.mergeWith (cyclomatic 18) rhwp-studio/src/engine/command.ts:804— InsertTextCommand.mergeWith 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.
TableResizeRenderer.hitTestBorder (cyclomatic 18) rhwp-studio/src/engine/table-resize-renderer.ts:104— TableResizeRenderer.hitTestBorder 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.
CompareDialog.formatFieldValue (cyclomatic 18) rhwp-studio/src/ui/compare-dialog.ts:446— CompareDialog.formatFieldValue 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.
HistoryDialog.formatFieldValue (cyclomatic 18) rhwp-studio/src/ui/history-dialog.ts:417— HistoryDialog.formatFieldValue 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.
Font::set_props (cyclomatic 17) src/wmf/converter/svg/util.rs:376— Font::set_props 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.
Visibility::project (cyclomatic 17) src/parser/hwpx/tracked_changes.rs:37— Visibility::project 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.
Compound::split (cyclomatic 17) src/parser/pdf/table_paint/compound.rs:295— Compound::split 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.
Plan::source (cyclomatic 17) src/renderer/equation/legacy_coordinate_plan.rs:84— Plan::source has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Cursor::parse_sequence (cyclomatic 17) src/renderer/equation/legacy_hwpeq.rs:115— Cursor::parse_sequence 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.
StrokeDash::intervals (cyclomatic 17) src/renderer/stroke_pattern.rs:66— StrokeDash::intervals has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
TacFlowQuery::tac_table_line_index (cyclomatic 17) src/renderer/typeset/controls/tac_flow.rs:58— TacFlowQuery::tac_table_line_index 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.
rhwp_desk::planner::substitute_cli_args (cyclomatic 17) rhwp-desk/src/planner.rs:231— rhwp_desk::planner::substitute_cli_args has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 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.
_gen_pack.write_queues (cyclomatic 17) .claude/skills/rhwp-chief/_gen_pack.py:882— _gen_pack.write_queues 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.
agent_session.resolve_token (cyclomatic 17) gym/tools/agent_session.py:352— agent_session.resolve_token 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.
pack_health.scan_hint (cyclomatic 17) gym/tools/pack_health.py:1737— pack_health.scan_hint 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.
release_gate.exception_kind (cyclomatic 17) gym/tools/release_gate.py:229— release_gate.exception_kind 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.
trajectory.audit (cyclomatic 17) gym/tools/trajectory.py:908— trajectory.audit 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.
_NativeEditorViewState.build (cyclomatic 17) bindings/Flutter/lib/src/native_editor_view.dart:297— _NativeEditorViewState.build 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.
action-runtime.evaluateFormAction.statement (cyclomatic 17) rhwp-shared/forms/action-runtime.ts:256— action-runtime.evaluateFormAction.statement 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.
PdfImportSession.importPdf (cyclomatic 17) rhwp-shared/pdf/import-session.js:11— PdfImportSession.importPdf has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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: Channel.constructor (cyclomatic 34) 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.
command-error.inspectCommandError (cyclomatic 17) rhwp-studio/src/core/command-error.ts:142— command-error.inspectCommandError 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.
write-tools.prepareTable (cyclomatic 17) rhwp-studio/src/ai/tools/write-tools.ts:1215— write-tools.prepareTable has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1226, 1245, 1260). 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. This is NOT this file's highest cyclomatic complexity: write-tools.prepareWrite (cyclomatic 33) 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.
diff-engine.buildTableSummary (cyclomatic 17) rhwp-studio/src/compare/diff-engine.ts:553— diff-engine.buildTableSummary 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.
diff-engine.compareSnapshots (cyclomatic 17) rhwp-studio/src/compare/diff-engine.ts:2991— diff-engine.compareSnapshots has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
font-rule-runtime.resolveProjectedCanvasKitFontPlan (cyclomatic 17) rhwp-studio/src/core/font-rule-runtime.ts:339— font-rule-runtime.resolveProjectedCanvasKitFontPlan 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.
font-decision-trace.canvas2dDecision (cyclomatic 17) rhwp-studio/src/core/font-decision-trace.ts:65— font-decision-trace.canvas2dDecision 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.
layer-tree-transport.readLayerTreeTransport (cyclomatic 17) rhwp-studio/src/core/layer-tree-transport.ts:13— layer-tree-transport.readLayerTreeTransport 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.
WasmBridge.getPageLayerTreeObject (cyclomatic 17) rhwp-studio/src/core/wasm-bridge.ts:1341— WasmBridge.getPageLayerTreeObject 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.
virtual-scroll.resolveAutoPageColumns (cyclomatic 17) rhwp-studio/src/view/virtual-scroll.ts:65— virtual-scroll.resolveAutoPageColumns 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.
sfnt-face.canvasKitSfntGlyphCount (cyclomatic 17) rhwp-studio/src/view/canvaskit/sfnt-face.ts:8— sfnt-face.canvasKitSfntGlyphCount 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.
CanvasKitLayerRenderer.renderLeaf (cyclomatic 17) rhwp-studio/src/view/canvaskit-renderer.ts:2012— CanvasKitLayerRenderer.renderLeaf 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. This is NOT this file's highest cyclomatic complexity: CanvasKitLayerRenderer.renderOp (cyclomatic 23) 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.
CanvasKitLayerRenderer.recordTextRunCoverageGaps (cyclomatic 17) rhwp-studio/src/view/canvaskit-renderer.ts:3106— CanvasKitLayerRenderer.recordTextRunCoverageGaps has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: CanvasKitLayerRenderer.renderOp (cyclomatic 23) 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.
CanvasKitLayerRenderer.drawCachedGlyphs (cyclomatic 17) rhwp-studio/src/view/canvaskit-renderer.ts:4590— CanvasKitLayerRenderer.drawCachedGlyphs has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: CanvasKitLayerRenderer.renderOp (cyclomatic 23) 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.
CanvasKitLayerRenderer.drawEquationDecoration (cyclomatic 17) rhwp-studio/src/view/canvaskit-renderer.ts:5385— CanvasKitLayerRenderer.drawEquationDecoration has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: CanvasKitLayerRenderer.renderOp (cyclomatic 23) 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.
PageRenderer.prefetchLayerImages (cyclomatic 17) rhwp-studio/src/view/page-renderer.ts:1333— PageRenderer.prefetchLayerImages has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 6 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
DeleteTextCommand.mergeWith (cyclomatic 17) rhwp-studio/src/engine/command.ts:922— DeleteTextCommand.mergeWith 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.
office-clipboard-images.imagePixelSize (cyclomatic 17) rhwp-studio/src/engine/office-clipboard-images.ts:161— office-clipboard-images.imagePixelSize 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.
input-handler-picture.calcResizedBboxRotated (cyclomatic 17) rhwp-studio/src/engine/input-handler-picture.ts:720— input-handler-picture.calcResizedBboxRotated 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.
InputHandler.restoreEditContextAfterHistory (cyclomatic 17) rhwp-studio/src/engine/input-handler.ts:3093— InputHandler.restoreEditContextAfterHistory 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. This is NOT this file's highest cyclomatic complexity: InputHandler.cutSelectedObject::isCurrent (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.
InputHandler.updateCaret (cyclomatic 17) rhwp-studio/src/engine/input-handler.ts:3865— InputHandler.updateCaret 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. This is NOT this file's highest cyclomatic complexity: InputHandler.cutSelectedObject::isCurrent (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.
InputHandler.cutSelectedObject (cyclomatic 17) rhwp-studio/src/engine/input-handler.ts:5764— InputHandler.cutSelectedObject has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: InputHandler.cutSelectedObject::isCurrent (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.
ChartDataDialog.menuItems (cyclomatic 17) rhwp-studio/src/ui/chart-data-dialog.ts:270— ChartDataDialog.menuItems 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.
ChartDataDialog.onConfirm (cyclomatic 17) rhwp-studio/src/ui/chart-data-dialog.ts:391— ChartDataDialog.onConfirm has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CompareDialog.renderValueDiff (cyclomatic 17) rhwp-studio/src/ui/compare-dialog.ts:362— CompareDialog.renderValueDiff 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.
HistoryDialog.renderValueDiff (cyclomatic 17) rhwp-studio/src/ui/history-dialog.ts:333— HistoryDialog.renderValueDiff 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.
BuildState::picture (cyclomatic 16) src/document_core/builders/exam_paper_images.rs:380— BuildState::picture 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.
Pool::import (cyclomatic 16) src/document_core/commands/paragraph_block/import/resources/binary.rs:109— Pool::import 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.
SignalSite::visit_control (cyclomatic 16) src/document_core/queries/injection_scan.rs:1312— SignalSite::visit_control 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.
CanvasRenderer::render_node (cyclomatic 16) src/renderer/canvas.rs:97— CanvasRenderer::render_node 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.
HorizontalShapingPageSidecars::attach (cyclomatic 16) src/renderer/shaping_publication.rs:181— HorizontalShapingPageSidecars::attach 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.
_gen_pack.build_ledger (cyclomatic 16) .claude/skills/rhwp-strategist/references/_gen_pack.py:550— _gen_pack.build_ledger 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.
runner.eval_check (cyclomatic 16) gym/core/runner.py:602— runner.eval_check 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.
runner.score_pack (cyclomatic 16) gym/core/runner.py:923— runner.score_pack 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.
agent_session.validate_trace_event (cyclomatic 16) gym/tools/agent_session.py:488— agent_session.validate_trace_event 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.
fuzz_corpus.exception_kind (cyclomatic 16) gym/tools/fuzz_corpus.py:658— fuzz_corpus.exception_kind 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.
leaderboard.validate_fingerprint (cyclomatic 16) gym/tools/leaderboard.py:674— leaderboard.validate_fingerprint 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.
release_diff.build_probe_failed_report (cyclomatic 16) gym/tools/release_diff.py:730— release_diff.build_probe_failed_report 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.
release_gate.gate (cyclomatic 16) gym/tools/release_gate.py:712— release_gate.gate 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.
condense_rule_replay.replay (cyclomatic 16) mydocs/tech/investigations/issue-7418/probes/condense_rule_replay.py:31— condense_rule_replay.replay 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.
NativeTextureController._closePlatform (cyclomatic 16) bindings/Flutter/lib/src/native_texture_view.dart:841— NativeTextureController._closePlatform 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.
write-tools.prepareFormatText (cyclomatic 16) rhwp-studio/src/ai/tools/write-tools.ts:1100— write-tools.prepareFormatText has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 1120). 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. This is NOT this file's highest cyclomatic complexity: write-tools.prepareWrite (cyclomatic 33) 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.
gemini.toGeminiSchema (cyclomatic 16) rhwp-studio/src/ai/provider/gemini.ts:62— gemini.toGeminiSchema 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.
file.runPrintPreview (cyclomatic 16) rhwp-studio/src/command/commands/file.ts:715— file.runPrintPreview has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
table.blockCalcCommand.execute (cyclomatic 16) rhwp-studio/src/command/commands/table.ts:140— table.blockCalcCommand.execute has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CanvasSupplementalMetricProvider.prepare (cyclomatic 16) rhwp-studio/src/core/supplemental-text-metrics.ts:102— CanvasSupplementalMetricProvider.prepare has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
local-fonts.normalizeSnapshot (cyclomatic 16) rhwp-studio/src/core/local-fonts.ts:582— local-fonts.normalizeSnapshot 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.
document-font-status.analyzeDocumentFonts.fonts (cyclomatic 16) rhwp-studio/src/core/document-font-status.ts:104— document-font-status.analyzeDocumentFonts.fonts 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.
replay-fingerprint.replayFingerprint::visit (cyclomatic 16) rhwp-studio/src/view/canvaskit/replay-fingerprint.ts:20— replay-fingerprint.replayFingerprint::visit 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.
CanvasKitLayerRenderer.prepareHostFonts (cyclomatic 16) rhwp-studio/src/view/canvaskit-renderer.ts:898— CanvasKitLayerRenderer.prepareHostFonts has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: CanvasKitLayerRenderer.renderOp (cyclomatic 23) 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.
CanvasKitLayerRenderer.renderGlyphOutline (cyclomatic 16) rhwp-studio/src/view/canvaskit-renderer.ts:2427— CanvasKitLayerRenderer.renderGlyphOutline has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: CanvasKitLayerRenderer.renderOp (cyclomatic 23) 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.
CanvasKitLayerRenderer.drawTiledImage (cyclomatic 16) rhwp-studio/src/view/canvaskit-renderer.ts:3034— CanvasKitLayerRenderer.drawTiledImage has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, 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. This is NOT this file's highest cyclomatic complexity: CanvasKitLayerRenderer.renderOp (cyclomatic 23) 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.
CanvasKitLayerRenderer.recordImageFailure (cyclomatic 16) rhwp-studio/src/view/canvaskit-renderer.ts:6100— CanvasKitLayerRenderer.recordImageFailure has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: CanvasKitLayerRenderer.renderOp (cyclomatic 23) 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.
raw-svg-prefetch.collectVectorRawSvgDataUrls (cyclomatic 16) rhwp-studio/src/view/raw-svg-prefetch.ts:37— raw-svg-prefetch.collectVectorRawSvgDataUrls 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.
PageRenderer.getLayerPlaneSummaryFromOverlayImages (cyclomatic 16) rhwp-studio/src/view/page-renderer.ts:1047— PageRenderer.getLayerPlaneSummaryFromOverlayImages 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.
RendererSession.resolveUncached (cyclomatic 16) rhwp-studio/src/view/renderer-session.ts:270— RendererSession.resolveUncached 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.
Ruler.drawVertical (cyclomatic 16) rhwp-studio/src/view/ruler.ts:755— Ruler.drawVertical 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.
CursorState.updateRect (cyclomatic 16) rhwp-studio/src/engine/cursor.ts:1447— CursorState.updateRect 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.
TextMutationEffectAccumulator.add (cyclomatic 16) rhwp-studio/src/engine/command.ts:165— TextMutationEffectAccumulator.add 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.
CellSelectionRenderer.render (cyclomatic 16) rhwp-studio/src/engine/cell-selection-renderer.ts:25— CellSelectionRenderer.render has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
input-handler-hyperlink-delete.tryConfirmDeleteHyperlink (cyclomatic 16) rhwp-studio/src/engine/input-handler-hyperlink-delete.ts:19— input-handler-hyperlink-delete.tryConfirmDeleteHyperlink has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 39, canEdit, a function literal at line 33, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
input-handler-keyboard.handleHeaderFooterNavigationShortcut (cyclomatic 16) rhwp-studio/src/engine/input-handler-keyboard.ts:372— input-handler-keyboard.handleHeaderFooterNavigationShortcut 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.
InputHandler.bodyTableRectsInRange (cyclomatic 16) rhwp-studio/src/engine/input-handler.ts:4294— InputHandler.bodyTableRectsInRange has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (inRange). 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: InputHandler.cutSelectedObject::isCurrent (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.
InputHandler.executeFormActionPlan (cyclomatic 16) rhwp-studio/src/engine/input-handler.ts:6420— InputHandler.executeFormActionPlan has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: InputHandler.cutSelectedObject::isCurrent (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.
CellBorderBgDialog.updateDiagonalPreview (cyclomatic 16) rhwp-studio/src/ui/cell-border-bg-dialog.ts:854— CellBorderBgDialog.updateDiagonalPreview has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChartDataDialog.renderGrid (cyclomatic 16) rhwp-studio/src/ui/chart-data-dialog.ts:140— ChartDataDialog.renderGrid has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
runAgentTask (cyclomatic 16) rhwp-desk/ui/js/agent.js:110— runAgentTask 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.
HackComment src/wmf/converter/svg/mod.rs:1092— // HACK: background color — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
input-handler-mouse.onClick (cognitive 502) rhwp-studio/src/engine/input-handler-mouse.ts:299— input-handler-mouse.onClick has cognitive complexity 502 (threshold 15). Drivers by points: if/else 124 (352 pts), boolean chains 51, error handling 12 (46 pts), ternaries 12 (35 pts), loops 3 (18 pts) (nesting depth added 300). 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.
HeightCursor::vpos_adjust (cognitive 486) src/renderer/height_cursor.rs:497— HeightCursor::vpos_adjust has cognitive complexity 486 (threshold 15). Drivers by points: if/else 196 (307 pts), boolean chains 172, match/switch 5 (7 pts) (nesting depth added 113). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-keyboard.onKeyDown (cognitive 477) rhwp-studio/src/engine/input-handler-keyboard.ts:709— input-handler-keyboard.onKeyDown has cognitive complexity 477 (threshold 15). Drivers by points: if/else 177 (336 pts), boolean chains 72, ternaries 11 (36 pts), error handling 9 (32 pts), match/switch 1 (nesting depth added 207). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SkiaTextReplay::draw_text (cognitive 244) src/renderer/skia/text_replay.rs:42— SkiaTextReplay::draw_text has cognitive complexity 244 (threshold 15). Drivers by points: if/else 89 (185 pts), loops 10 (24 pts), boolean chains 20, match/switch 4 (15 pts) (nesting depth added 121). 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.
PicturePropsDialog.populateFromProps (cognitive 207) rhwp-studio/src/ui/picture-props-dialog.ts:2151— PicturePropsDialog.populateFromProps has cognitive complexity 207 (threshold 15). Drivers by points: if/else 75 (178 pts), boolean chains 29 (nesting depth added 103). Of this number, 204 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
PaintOp::write_json (cognitive 160) src/paint/json.rs:645— PaintOp::write_json has cognitive complexity 160 (threshold 15). Drivers by points: if/else 75 (145 pts), boolean chains 7, loops 2 (5 pts), match/switch 2 (3 pts) (nesting depth added 74). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-mouse.onMouseMove (cognitive 137) rhwp-studio/src/engine/input-handler-mouse.ts:1572— input-handler-mouse.onMouseMove has cognitive complexity 137 (threshold 15). Drivers by points: if/else 52 (95 pts), boolean chains 23, error handling 4 (19 pts) (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.renderTextRun (cognitive 125) rhwp-studio/src/view/canvaskit-renderer.ts:3142— CanvasKitLayerRenderer.renderTextRun has cognitive complexity 125 (threshold 15). Drivers by points: if/else 65 (131 pts), loops 16 (34 pts), boolean chains 33, ternaries 16 (26 pts) (nesting depth added 94). To reduce it, split the body into named stages: move each independent 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 (CanvasKitLayerRenderer.renderTextRun::drawPass) 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.
TableBuilder::build_inner (cognitive 122) src/parser/pdf/structured_lowering.rs:1506— TableBuilder::build_inner has cognitive complexity 122 (threshold 15). Drivers by points: if/else 37 (76 pts), loops 13 (28 pts), match/switch 3 (12 pts), boolean chains 6 (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity· Run (cognitive 120) · ×1
Run (cognitive 120) npm/hwpctrl-ocx/src/index.mjs:2344— Run has cognitive complexity 120 (threshold 15). Drivers by points: if/else 47 (76 pts), error handling 7 (20 pts), boolean chains 11, ternaries 5 (11 pts), other 2 (nesting depth added 48). Of this number, 118 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
static-svg-path-layers.parseStaticSvgFragmentLayers (cognitive 111) rhwp-studio/src/view/static-svg-path-layers.ts:86— static-svg-path-layers.parseStaticSvgFragmentLayers has cognitive complexity 111 (threshold 15). Drivers by points: if/else 30 (69 pts), ternaries 9 (27 pts), boolean chains 10, loops 3 (5 pts) (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ColorPaintGraphPayload::has_colrv1_supported_graph_contract (cognitive 109) src/paint/paint_op.rs:1224— ColorPaintGraphPayload::has_colrv1_supported_graph_contract has cognitive complexity 109 (threshold 15). Drivers by points: if/else 32 (83 pts), boolean chains 21, match/switch 2 (3 pts), loops 2 (nesting depth added 52). Of this number, 102 points are the body's own statements and 7 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.
NativePuaFontSession.prepare (cognitive 103) rhwp-studio/src/core/native-pua-font-session.ts:60— NativePuaFontSession.prepare has cognitive complexity 103 (threshold 15). Drivers by points: if/else 22 (62 pts), ternaries 5 (17 pts), loops 6 (14 pts), boolean chains 10 (nesting depth added 60). Of this number, 97 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
text-variant-selection.selectLayerTextVariantsForLeaf (cognitive 102) rhwp-studio/src/view/canvaskit/text-variant-selection.ts:23— text-variant-selection.selectLayerTextVariantsForLeaf has cognitive complexity 102 (threshold 15). Drivers by points: ternaries 11 (40 pts), if/else 10 (36 pts), loops 7 (15 pts), boolean chains 11 (nesting depth added 63). Of this number, 94 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
diff-engine.fillSnapshotFromWasm (cognitive 98) rhwp-studio/src/compare/diff-engine.ts:929— diff-engine.fillSnapshotFromWasm has cognitive complexity 98 (threshold 15). Drivers by points: error handling 8 (26 pts), ternaries 7 (23 pts), if/else 9 (19 pts), boolean chains 16, loops 11 (14 pts) (nesting depth added 47). Of this number, 95 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
css-color.parseSupportedCssColor (cognitive 93) rhwp-studio/src/view/canvaskit/css-color.ts:173— css-color.parseSupportedCssColor has cognitive complexity 93 (threshold 15). Drivers by points: if/else 31 (52 pts), ternaries 13 (32 pts), boolean chains 9 (nesting depth added 40). Of this number, 89 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.renderEquationBox (cognitive 93) rhwp-studio/src/view/canvaskit-renderer.ts:4891— CanvasKitLayerRenderer.renderEquationBox has cognitive complexity 93 (threshold 15). Drivers by points: ternaries 15 (34 pts), boolean chains 31, if/else 11 (22 pts), loops 2 (5 pts), match/switch 1 (nesting depth added 33). Of this number, 90 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
declared-font-environment.prepareDeclaredFontPrograms (cognitive 86) rhwp-studio/src/core/declared-font-environment.ts:159— declared-font-environment.prepareDeclaredFontPrograms has cognitive complexity 86 (threshold 15). Drivers by points: if/else 21 (55 pts), loops 8 (16 pts), ternaries 2 (7 pts), boolean chains 4, error handling 1 (4 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeTextureController._pump (cognitive 85) bindings/Flutter/lib/src/native_texture_view.dart:474— NativeTextureController._pump has cognitive complexity 85 (threshold 15). Drivers by points: if/else 23 (52 pts), boolean chains 23, error handling 3 (5 pts), ternaries 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
audit.exception_kind (cognitive 83) gym/tools/audit.py:235— audit.exception_kind has cognitive complexity 83 (threshold 15). Drivers by points: if/else 46 (81 pts), ternaries 1 (2 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
showHoverCard (cognitive 82) rhwp-firefox/content-script.js:325— showHoverCard has cognitive complexity 82 (threshold 15). Drivers by points: if/else 36 (67 pts), boolean chains 11, error handling 2 (4 pts) (nesting depth added 33). Of this number, 45 points are the body's own statements and 37 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 80) mydocs/tech/investigations/issue-8403/validation/browser-verify.mjs:44— (anonymous) has cognitive complexity 80 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 12 (23 pts), ternaries 8 (19 pts), boolean chains 12, other 1 (nesting depth added 36). Of this number, 40 points are the body's own statements and 40 belong to 40 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.
Reader::body (cognitive 78) src/ole_chart/legacy_presentation.rs:293— Reader::body has cognitive complexity 78 (threshold 15). Drivers by points: if/else 27 (53 pts), loops 5 (10 pts), match/switch 5 (8 pts), boolean chains 7 (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.
NativeDocument._complete (cognitive 78) bindings/Flutter/lib/src/native_document.dart:595— NativeDocument._complete has cognitive complexity 78 (threshold 15). Drivers by points: if/else 27 (49 pts), boolean chains 23, ternaries 2 (4 pts), error handling 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CharShapeDialog.collectMods (cognitive 78) rhwp-studio/src/ui/char-shape-dialog.ts:946— CharShapeDialog.collectMods has cognitive complexity 78 (threshold 15). Drivers by points: boolean chains 43, if/else 29 (32 pts), loops 2, ternaries 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CanvasKitLayerRenderer.renderTextRun::drawPass (cognitive 77) rhwp-studio/src/view/canvaskit-renderer.ts:3424— CanvasKitLayerRenderer.renderTextRun::drawPass has cognitive complexity 77 (threshold 15). Drivers by points: if/else 22 (62 pts), loops 4 (10 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (CanvasKitLayerRenderer.renderTextRun) 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.
CanvasKitLayerRenderer.imageForOp (cognitive 77) rhwp-studio/src/view/canvaskit-renderer.ts:5901— CanvasKitLayerRenderer.imageForOp has cognitive complexity 77 (threshold 15). Drivers by points: if/else 27 (37 pts), ternaries 15 (26 pts), boolean chains 9, error handling 3 (5 pts) (nesting depth added 23). Of this number, 53 points are the body's own statements and 24 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.
input-handler-picture.renderPictureObjectSelection (cognitive 75) rhwp-studio/src/engine/input-handler-picture.ts:364— input-handler-picture.renderPictureObjectSelection has cognitive complexity 75 (threshold 15). Drivers by points: if/else 16 (50 pts), error handling 4 (13 pts), boolean chains 6, loops 3 (5 pts), ternaries 1 (nesting depth added 45). 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.
_gen_pack.parse_map (cognitive 73) .claude/skills/rhwp-knowledge-map/references/_gen_pack.py:342— _gen_pack.parse_map has cognitive complexity 73 (threshold 15). Drivers by points: if/else 15 (50 pts), loops 4 (13 pts), boolean chains 6, ternaries 1 (4 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-text.onInput (cognitive 72) rhwp-studio/src/engine/input-handler-text.ts:566— input-handler-text.onInput has cognitive complexity 72 (threshold 15). Drivers by points: if/else 32 (52 pts), boolean chains 10, error handling 4 (9 pts), ternaries 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitGlyphRunFontCache.replayStatus (cognitive 71) rhwp-studio/src/view/canvaskit/glyph-run-fonts.ts:159— CanvasKitGlyphRunFontCache.replayStatus has cognitive complexity 71 (threshold 15). Drivers by points: if/else 39, boolean chains 30, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
schema-validate.validateToolInput (cognitive 70) rhwp-studio/src/ai/tools/schema-validate.ts:35— schema-validate.validateToolInput has cognitive complexity 70 (threshold 15). Drivers by points: if/else 19 (52 pts), boolean chains 13, loops 3, match/switch 1 (2 pts) (nesting depth added 34). Of this number, 68 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
host-font-requests.collectHostFontRequests (cognitive 70) rhwp-studio/src/core/host-font-requests.ts:124— host-font-requests.collectHostFontRequests has cognitive complexity 70 (threshold 15). Drivers by points: if/else 13 (47 pts), loops 5 (14 pts), boolean chains 5, ternaries 1 (4 pts) (nesting depth added 46). Of this number, 67 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.drawStaticControlText (cognitive 69) rhwp-studio/src/view/canvaskit-renderer.ts:5239— CanvasKitLayerRenderer.drawStaticControlText has cognitive complexity 69 (threshold 15). Drivers by points: ternaries 12 (31 pts), if/else 9 (19 pts), boolean chains 15, error handling 1 (3 pts), loops 1 (nesting depth added 31). Of this number, 68 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.
content-script.showHoverCard (cognitive 68) rhwp-chrome/content-script.js:322— content-script.showHoverCard has cognitive complexity 68 (threshold 15). Drivers by points: if/else 34 (58 pts), boolean chains 10 (nesting depth added 24). Of this number, 42 points are the body's own statements and 26 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.
static-svg-path-layers.isStaticSvgStyleSupported (cognitive 67) rhwp-studio/src/view/static-svg-path-layers.ts:970— static-svg-path-layers.isStaticSvgStyleSupported has cognitive complexity 67 (threshold 15). Drivers by points: if/else 23 (46 pts), boolean chains 20, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChartScales::new (cognitive 66) crates/rhwp-ooxml-chart/src/renderer/cartesian_layout.rs:217— ChartScales::new has cognitive complexity 66 (threshold 15). Drivers by points: if/else 33 (61 pts), boolean chains 5 (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.
Accounting::operation (cognitive 66) src/native_host/render_snapshot.rs:269— Accounting::operation has cognitive complexity 66 (threshold 15). Drivers by points: if/else 19 (56 pts), loops 3 (9 pts), match/switch 1 (nesting depth added 43). 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.
ParaShapeDialog.collectMods (cognitive 66) rhwp-studio/src/ui/para-shape-dialog.ts:779— ParaShapeDialog.collectMods has cognitive complexity 66 (threshold 15). Drivers by points: if/else 30 (33 pts), boolean chains 29, loops 2, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
diff-engine.annotateDiffSectionPages (cognitive 64) rhwp-studio/src/compare/diff-engine.ts:2895— diff-engine.annotateDiffSectionPages has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (49 pts), boolean chains 12, loops 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.
input-handler-keyboard.handleCtrlKey (cognitive 64) rhwp-studio/src/engine/input-handler-keyboard.ts:1635— input-handler-keyboard.handleCtrlKey has cognitive complexity 64 (threshold 15). Drivers by points: if/else 33 (53 pts), boolean chains 10, match/switch 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.
Resources::prepare (cognitive 63) src/document_core/commands/paragraph_block/import/resources.rs:135— Resources::prepare has cognitive complexity 63 (threshold 15). Drivers by points: if/else 10 (39 pts), loops 5 (15 pts), match/switch 2 (8 pts), boolean chains 1 (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.
sfnt-face.normalizeFontFaceData (cognitive 63) rhwp-studio/src/core/sfnt-face.ts:15— sfnt-face.normalizeFontFaceData has cognitive complexity 63 (threshold 15). Drivers by points: if/else 23 (35 pts), boolean chains 16, loops 7 (9 pts), ternaries 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CursorState.comparePositions (cognitive 63) rhwp-studio/src/engine/cursor.ts:468— CursorState.comparePositions has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 13 (35 pts), if/else 12 (24 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CartesianLayout::new (cognitive 62) crates/rhwp-ooxml-chart/src/renderer/cartesian_layout.rs:437— CartesianLayout::new has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (50 pts), boolean chains 8, loops 2 (4 pts) (nesting depth added 29). 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.
svg-image-header.parseSvgImageHeader (cognitive 61) rhwp-studio/src/view/canvaskit/svg-image-header.ts:7— svg-image-header.parseSvgImageHeader has cognitive complexity 61 (threshold 15). Drivers by points: if/else 29 (52 pts), boolean chains 4, loops 3, error handling 1, ternaries 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.prepareBundledFonts (cognitive 61) rhwp-studio/src/view/canvaskit-renderer.ts:707— CanvasKitLayerRenderer.prepareBundledFonts has cognitive complexity 61 (threshold 15). Drivers by points: if/else 12 (33 pts), boolean chains 14, ternaries 3 (8 pts), error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 29). Of this number, 60 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fuzz_corpus.validate_report (cognitive 60) gym/tools/fuzz_corpus.py:1432— fuzz_corpus.validate_report has cognitive complexity 60 (threshold 15). Drivers by points: if/else 27 (44 pts), loops 6 (9 pts), boolean chains 7 (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.
input-handler-picture.findPictureAtClick (cognitive 60) rhwp-studio/src/engine/input-handler-picture.ts:212— input-handler-picture.findPictureAtClick has cognitive complexity 60 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 16, loops 3 (5 pts), error handling 2 (3 pts), ternaries 3 (nesting depth added 17). Of this number, 53 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 60) rhwp-safari/src/background.js:225— (anonymous) has cognitive complexity 60 (threshold 15). Drivers by points: if/else 16 (41 pts), boolean chains 10, error handling 4 (8 pts), match/switch 1 (nesting depth added 29). Most of this is not in the body itself: 15 of the 60 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 261, 239, 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.
Planner::clone_series (cognitive 59) crates/rhwp-ooxml-chart/src/patch.rs:702— Planner::clone_series has cognitive complexity 59 (threshold 15). Drivers by points: if/else 19 (44 pts), loops 4 (7 pts), match/switch 2 (6 pts), boolean chains 2 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
release_gate.validate_verdict (cognitive 59) gym/tools/release_gate.py:790— release_gate.validate_verdict has cognitive complexity 59 (threshold 15). Drivers by points: if/else 28 (38 pts), boolean chains 20, 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.
MetafileFontSession.prepare (cognitive 57) rhwp-studio/src/core/metafile-font-session.ts:20— MetafileFontSession.prepare has cognitive complexity 57 (threshold 15). Drivers by points: if/else 15 (32 pts), ternaries 3 (12 pts), boolean chains 8, loops 2 (3 pts), error handling 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.
page-renderer.collectLayerPlaneSummary (cognitive 57) rhwp-studio/src/view/page-renderer.ts:1542— page-renderer.collectLayerPlaneSummary has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (48 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
input-handler-keyboard.onPaste (cognitive 57) rhwp-studio/src/engine/input-handler-keyboard.ts:1986— input-handler-keyboard.onPaste has cognitive complexity 57 (threshold 15). Drivers by points: if/else 23 (41 pts), boolean chains 11, error handling 1 (3 pts), loops 1 (2 pts) (nesting depth added 21). Of this number, 37 points are the body's own statements and 20 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.
wire (cognitive 57) rhwp-desk/ui/js/main.js:821— wire has cognitive complexity 57 (threshold 15). Drivers by points: if/else 24 (28 pts), ternaries 11 (12 pts), boolean chains 9, error handling 2 (4 pts), loops 4 (nesting depth added 7). Most of this is not in the body itself: 2 of the 57 points are its own statements and the rest belongs to 25 function literals inside it that branch (lines 911, 972, 885, …). 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.
HostCanvasFontSession.resolve (cognitive 56) rhwp-studio/src/core/host-canvas-fonts.ts:176— HostCanvasFontSession.resolve has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 12 (22 pts), if/else 10 (21 pts), boolean chains 10, loops 2 (3 pts) (nesting depth added 22). Of this number, 51 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-mouse.onDblClick (cognitive 55) rhwp-studio/src/engine/input-handler-mouse.ts:1376— input-handler-mouse.onDblClick has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 9, error handling 3 (9 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
input-handler-text.onCompositionEnd (cognitive 55) rhwp-studio/src/engine/input-handler-text.ts:441— input-handler-text.onCompositionEnd has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 11, ternaries 3 (11 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
main.initialize (cognitive 55) rhwp-studio/src/main.ts:570— main.initialize has cognitive complexity 55 (threshold 15). Drivers by points: if/else 26 (34 pts), ternaries 6 (10 pts), boolean chains 7, loops 2 (3 pts), error handling 1 (nesting depth added 13). Most of this is not in the body itself: 14 of the 55 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 873, documentFontRequirements, a function literal at line 856, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Walk::walk (cognitive 54) src/document_core/commands/paragraph_block/owned.rs:72— Walk::walk has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (43 pts), match/switch 4 (10 pts), loops 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
background.browser.runtime.onMessage.addListener() (cognitive 54) rhwp-safari/src/background.js:225— background.browser.runtime.onMessage.addListener() has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (41 pts), boolean chains 10, error handling 1 (2 pts), match/switch 1 (nesting depth added 26). Most of this is not in the body itself: 9 of the 54 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 261, 239, 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.
CanvasKitLayerRenderer.renderCharOverlap (cognitive 54) rhwp-studio/src/view/canvaskit-renderer.ts:3738— CanvasKitLayerRenderer.renderCharOverlap has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 19 (50 pts), if/else 26 (40 pts), boolean chains 23, loops 3 (4 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (CanvasKitLayerRenderer.renderCharOverlap::draw::drawCell) 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.
input-handler-keyboard.handleF11 (cognitive 53) rhwp-studio/src/engine/input-handler-keyboard.ts:2302— input-handler-keyboard.handleF11 has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (24 pts), error handling 6 (13 pts), loops 2 (7 pts), ternaries 2 (5 pts), boolean chains 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pack_health.scan_check_contract (cognitive 52) gym/tools/pack_health.py:1173— pack_health.scan_check_contract has cognitive complexity 52 (threshold 15). Drivers by points: if/else 25 (38 pts), boolean chains 8, loops 2 (6 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.
AssistantView.proposal (cognitive 52) rhwp-studio/src/ai/ui/ai-panel.ts:144— AssistantView.proposal has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 9 (25 pts), if/else 19 (21 pts), boolean chains 6 (nesting depth added 18). Of this number, 45 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.
CanvasKitLayerRenderer.renderNodeContents (cognitive 52) rhwp-studio/src/view/canvaskit-renderer.ts:1821— CanvasKitLayerRenderer.renderNodeContents has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (30 pts), boolean chains 7, loops 2 (6 pts), error handling 1 (5 pts), ternaries 2 (4 pts) (nesting depth added 29). 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.
showHoverCard (cognitive 52) rhwp-safari/src/content-script.js:206— showHoverCard has cognitive complexity 52 (threshold 15). Drivers by points: if/else 24 (42 pts), boolean chains 7, error handling 1 (3 pts) (nesting depth added 20). Of this number, 42 points are the body's own statements and 10 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
audit.audit_one_pack (cognitive 51) gym/tools/audit.py:875— audit.audit_one_pack has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (31 pts), ternaries 3 (8 pts), boolean chains 6, loops 5 (6 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.
authority_ledger.build_ledger (cognitive 51) gym/tools/authority_ledger.py:524— authority_ledger.build_ledger has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 7, error handling 2 (6 pts), ternaries 4 (6 pts), loops 3 (5 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeOwnerTransport._poll (cognitive 51) bindings/Flutter/lib/src/native_ffi.dart:289— NativeOwnerTransport._poll has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (35 pts), boolean chains 8, ternaries 2 (5 pts), error handling 1 (2 pts), loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitGlyphRunFontCache.registerResources (cognitive 51) rhwp-studio/src/view/canvaskit/glyph-run-fonts.ts:69— CanvasKitGlyphRunFontCache.registerResources has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 11, error handling 1 (3 pts), loops 2, ternaries 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.create (cognitive 51) rhwp-studio/src/view/canvaskit-renderer.ts:533— CanvasKitLayerRenderer.create has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (29 pts), error handling 6 (9 pts), boolean chains 6, ternaries 4 (6 pts), loops 1 (nesting depth added 17). Of this number, 50 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.
Ruler.drawHorizontal (cognitive 50) rhwp-studio/src/view/ruler.ts:558— Ruler.drawHorizontal has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 9, loops 3 (6 pts), ternaries 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-table.finishResizeDrag (cognitive 50) rhwp-studio/src/engine/input-handler-table.ts:330— input-handler-table.finishResizeDrag has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (33 pts), loops 3 (10 pts), boolean chains 4, ternaries 2, error handling 1 (nesting depth added 22). Of this number, 46 points are the body's own statements and 4 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.
main.setupEventListeners (cognitive 50) rhwp-studio/src/main.ts:1230— main.setupEventListeners has cognitive complexity 50 (threshold 15). Drivers by points: if/else 27 (30 pts), ternaries 6 (10 pts), boolean chains 8, error handling 1 (2 pts) (nesting depth added 8). Most of this is not in the body itself: 1 of the 50 points is its own statement and the rest belongs to 15 function items inside it that branch (a function literal at line 1406, a function literal at line 1311, a function literal at line 1334, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Collector::paragraphs (cognitive 49) src/document_core/canvas_metric_requests.rs:61— Collector::paragraphs has cognitive complexity 49 (threshold 15). Drivers by points: if/else 6 (27 pts), loops 6 (16 pts), boolean chains 3, match/switch 1 (3 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.
LenientCfbReader::open (cognitive 49) src/parser/cfb_reader.rs:450— LenientCfbReader::open has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 7 (12 pts), boolean chains 6 (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.
Parser.statement (cognitive 49) rhwp-shared/forms/action-runtime.ts:71— Parser.statement has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (30 pts), ternaries 5 (11 pts), loops 3 (6 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.
diff-engine.matchSegmentDp (cognitive 49) rhwp-studio/src/compare/diff-engine.ts:1959— diff-engine.matchSegmentDp has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 9, loops 6 (9 pts), ternaries 3 (6 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputHandler.copySelectedObject (cognitive 49) rhwp-studio/src/engine/input-handler.ts:5685— InputHandler.copySelectedObject has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (33 pts), error handling 4 (12 pts), boolean chains 4 (nesting depth added 28). Of this number, 38 points are the body's own statements and 11 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
audit.pack_issue_line (cognitive 47) gym/tools/audit.py:655— audit.pack_issue_line has cognitive complexity 47 (threshold 15). Drivers by points: if/else 26, ternaries 9 (18 pts), boolean chains 3 (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.
discriminate.validate_report (cognitive 47) gym/tools/discriminate.py:472— discriminate.validate_report has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (34 pts), boolean chains 7, loops 5 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fuzz_corpus.deterministic_mutants (cognitive 47) gym/tools/fuzz_corpus.py:913— fuzz_corpus.deterministic_mutants has cognitive complexity 47 (threshold 15). Drivers by points: if/else 25 (27 pts), loops 17 (19 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.
robustness.deterministic_mutants (cognitive 47) gym/tools/robustness.py:755— robustness.deterministic_mutants has cognitive complexity 47 (threshold 15). Drivers by points: if/else 25 (27 pts), loops 17 (19 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.
HostCanvasFontSession.prepare (cognitive 47) rhwp-studio/src/core/host-canvas-fonts.ts:75— HostCanvasFontSession.prepare has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 9, loops 5 (7 pts) (nesting depth added 18). Of this number, 34 points are the body's own statements and 13 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
diff-engine.cleanupParagraphAlignStepsToDiffItems (cognitive 46) rhwp-studio/src/compare/diff-engine.ts:2264— diff-engine.cleanupParagraphAlignStepsToDiffItems has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (26 pts), ternaries 4 (13 pts), boolean chains 6, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extractPrvImageFromCFB (cognitive 46) rhwp-safari/src/background.js:410— extractPrvImageFromCFB has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 6 (12 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
action-runtime.evaluateFormAction.invoke (cognitive 45) rhwp-shared/forms/action-runtime.ts:179— action-runtime.evaluateFormAction.invoke has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (27 pts), ternaries 5 (11 pts), boolean chains 7 (nesting depth added 16). Of this number, 43 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
form-replay.formDrawingReplayRejection (cognitive 45) rhwp-studio/src/view/canvaskit/form-replay.ts:21— form-replay.formDrawingReplayRejection has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 10, match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.prepareLocalFonts (cognitive 45) rhwp-studio/src/view/canvaskit-renderer.ts:801— CanvasKitLayerRenderer.prepareLocalFonts has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 10, loops 4 (5 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
flow-image-clip.collectFlowImagePaintOps::visit (cognitive 45) rhwp-studio/src/view/flow-image-clip.ts:104— flow-image-clip.collectFlowImagePaintOps::visit has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 8 (22 pts), if/else 8 (14 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-keyboard.handleShiftF11 (cognitive 45) rhwp-studio/src/engine/input-handler-keyboard.ts:2417— input-handler-keyboard.handleShiftF11 has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (19 pts), error handling 5 (11 pts), loops 2 (7 pts), ternaries 2 (5 pts), boolean chains 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-picture.finishPictureResizeDrag (cognitive 45) rhwp-studio/src/engine/input-handler-picture.ts:887— input-handler-picture.finishPictureResizeDrag has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 4 (14 pts), boolean chains 5, error handling 3 (4 pts), loops 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MovePos (cognitive 45) npm/hwpctrl-ocx/src/index.mjs:2088— MovePos has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 6 (13 pts), other 8, loops 2 (5 pts), boolean chains 3, match/switch 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.
Bitmap::from (cognitive 44) src/wmf/converter/bitmap.rs:211— Bitmap::from has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 8 (19 pts), boolean chains 1, match/switch 1 (nesting depth added 24). 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.
agent_session.validate_session (cognitive 44) gym/tools/agent_session.py:442— agent_session.validate_session has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 10, loops 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
trajectory.validate_report (cognitive 44) gym/tools/trajectory.py:571— trajectory.validate_report has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 7, loops 2 (4 pts), ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
background.extractPrvImageFromZip (cognitive 44) rhwp-safari/src/background.js:460— background.extractPrvImageFromZip has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (30 pts), boolean chains 8, error handling 1 (4 pts), loops 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
write-tools.prepareInsert (cognitive 44) rhwp-studio/src/ai/tools/write-tools.ts:988— write-tools.prepareInsert has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 9 (14 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 14). Most of this is not in the body itself: 5 of the 44 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1023, 1000, 1031). 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.
static-svg-path-layers.isStaticSvgAttributeSupported (cognitive 44) rhwp-studio/src/view/static-svg-path-layers.ts:711— static-svg-path-layers.isStaticSvgAttributeSupported has cognitive complexity 44 (threshold 15). Drivers by points: if/else 32, boolean chains 10, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CharShapeMods::apply_to (cognitive 43) src/model/style.rs:969— CharShapeMods::apply_to has cognitive complexity 43 (threshold 15). Drivers by points: if/else 36 (41 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
agent_session.resolve_token (cognitive 43) gym/tools/agent_session.py:352— agent_session.resolve_token has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (32 pts), error handling 1 (6 pts), boolean chains 4, loops 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
action-runtime.tokens (cognitive 43) rhwp-shared/forms/action-runtime.ts:23— action-runtime.tokens has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 5, loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
onmessage (cognitive 43) rhwp-shared/pdf/import-worker.js:12— onmessage has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 11, ternaries 3 (5 pts), other 4, error handling 1, match/switch 1 (nesting depth added 11). None of this is in the body itself: all 43 points belong to 2 function literals inside it that branch (lines 14, 45). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Catalogue::build (cognitive 42) src/paint/metafile_print/catalog.rs:156— Catalogue::build has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (36 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
authority_ledger.classify_authority (cognitive 42) gym/tools/authority_ledger.py:244— authority_ledger.classify_authority has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 9, loops 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.
leaderboard.render_markdown (cognitive 42) gym/tools/leaderboard.py:922— leaderboard.render_markdown has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 4 (8 pts), loops 4 (7 pts), boolean chains 6 (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.
CanvasKitLayerRenderer.makeSurface (cognitive 42) rhwp-studio/src/view/canvaskit-renderer.ts:1498— CanvasKitLayerRenderer.makeSurface has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 8, ternaries 4 (5 pts), error handling 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.drawPatternFill (cognitive 42) rhwp-studio/src/view/canvaskit-renderer.ts:5712— CanvasKitLayerRenderer.drawPatternFill has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 7 (36 pts), loops 2 (3 pts), boolean chains 2, if/else 1 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CanvasView.renderCanvas (cognitive 42) rhwp-studio/src/view/canvas-view.ts:1657— CanvasView.renderCanvas has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 8, ternaries 3 (5 pts), error handling 1 (nesting depth added 13). Of this number, 32 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.
ApplyCharFormatCommand.executeFormat (cognitive 42) rhwp-studio/src/engine/command.ts:1310— ApplyCharFormatCommand.executeFormat has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (21 pts), error handling 4 (8 pts), loops 4 (6 pts), ternaries 4 (6 pts), boolean chains 1 (nesting depth added 16). Of this number, 32 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.
SetCellBorderFillCommand.execute (cognitive 42) rhwp-studio/src/engine/command.ts:2623— SetCellBorderFillCommand.execute has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 3 (8 pts), error handling 2 (3 pts) (nesting depth added 24). Most of this is not in the body itself: 13 of the 42 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 2667, 2663). 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.
InputHandler.deleteSelectedCellBlock (cognitive 42) rhwp-studio/src/engine/input-handler.ts:5876— InputHandler.deleteSelectedCellBlock has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 13, loops 2 (4 pts), ternaries 1 (nesting depth added 11). Of this number, 18 points are the body's own statements and 24 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.
TableCellPropsDialog.onConfirm (cognitive 42) rhwp-studio/src/ui/table-cell-props-dialog.ts:1364— TableCellPropsDialog.onConfirm has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 23, if/else 15 (17 pts), ternaries 2 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
audit.format_human_report (cognitive 41) gym/tools/audit.py:820— audit.format_human_report has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 5 (10 pts), boolean chains 8, ternaries 3 (6 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.
CanvasView.updateVisiblePages (cognitive 41) rhwp-studio/src/view/canvas-view.ts:631— CanvasView.updateVisiblePages has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 8, loops 4 (6 pts), ternaries 5 (6 pts) (nesting depth added 9). Of this number, 38 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
page-scroll-probe.installPageScrollProbe::observe (cognitive 41) rhwp-studio/src/dev/page-scroll-probe.ts:240— page-scroll-probe.installPageScrollProbe::observe has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 10, ternaries 4 (10 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.
runAgentTask (cognitive 41) rhwp-desk/ui/js/agent.js:110— runAgentTask has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (31 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 1, other 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.
batch_convert::bin::mock_rhwp::run (cognitive 40) tools/batch-convert/src/bin/mock_rhwp.rs:68— batch_convert::bin::mock_rhwp::run has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (27 pts), loops 3 (5 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
authority_ledger.classify_baseline (cognitive 40) gym/tools/authority_ledger.py:398— authority_ledger.classify_baseline has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 9, loops 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fuzz_corpus.fuzz (cognitive 40) gym/tools/fuzz_corpus.py:1595— fuzz_corpus.fuzz has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (18 pts), error handling 5 (10 pts), loops 4 (7 pts), boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasView.refreshRenderSurfacePlan (cognitive 40) rhwp-studio/src/view/canvas-view.ts:1239— CanvasView.refreshRenderSurfacePlan has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 8, ternaries 5 (8 pts), loops 3 (4 pts) (nesting depth added 13). Of this number, 36 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
snapshotOptions (cognitive 40) rhwp-shared/pdf/import-session.js:134— snapshotOptions has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 14, loops 4 (5 pts), ternaries 1 (nesting depth added 7). Of this number, 25 points are the body's own statements and 15 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.
differential.validate_report (cognitive 39) gym/tools/differential.py:867— differential.validate_report has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 6, loops 2, 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.
pack_health.scan_reference_steps (cognitive 39) gym/tools/pack_health.py:1671— pack_health.scan_reference_steps has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (30 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent-loop.runAgent (cognitive 39) rhwp-studio/src/ai/agent/agent-loop.ts:84— agent-loop.runAgent has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 6 (14 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 20). Of this number, 36 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
office-clipboard-images.extractEmfDibs (cognitive 39) rhwp-studio/src/engine/office-clipboard-images.ts:56— office-clipboard-images.extractEmfDibs has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 5 (17 pts), if/else 6 (14 pts), boolean chains 7, loops 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
input-handler-text.handleDelete (cognitive 39) rhwp-studio/src/engine/input-handler-text.ts:286— input-handler-text.handleDelete has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (25 pts), ternaries 4 (9 pts), error handling 2 (3 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.
leaderboard.verify_entry (cognitive 38) gym/tools/leaderboard.py:495— leaderboard.verify_entry has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 13, ternaries 4 (7 pts), error handling 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.
leaderboard._cmd_verify_body (cognitive 38) gym/tools/leaderboard.py:594— leaderboard._cmd_verify_body has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 8 (13 pts), boolean chains 7, error handling 1 (4 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
release_diff.validate_report (cognitive 38) gym/tools/release_diff.py:793— release_diff.validate_report has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (35 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
image-header.parseJpegHeader (cognitive 38) rhwp-studio/src/view/canvaskit/image-header.ts:373— image-header.parseJpegHeader has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 11, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-keyboard.onCopy (cognitive 38) rhwp-studio/src/engine/input-handler-keyboard.ts:1841— input-handler-keyboard.onCopy has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (26 pts), error handling 4 (9 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.
pick (cognitive 38) rhwp-desk/ui/js/palette.js:134— pick has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 4 (7 pts), boolean chains 5, ternaries 3 (5 pts) (nesting depth added 14). Of this number, 20 points are the body's own statements and 18 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParagraphMachine::feed (cognitive 37) src/parser/pdf/recognition.rs:374— ParagraphMachine::feed has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 16 (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.
evidence_report._role_statuses (cognitive 37) gym/tools/evidence_report.py:806— evidence_report._role_statuses has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (19 pts), ternaries 8 (10 pts), boolean chains 6, 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.
action-runtime.evaluateFormAction.expression (cognitive 37) rhwp-shared/forms/action-runtime.ts:216— action-runtime.evaluateFormAction.expression has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 3 (8 pts), boolean chains 6, match/switch 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.
diff-engine.matchWindowedGreedy (cognitive 37) rhwp-studio/src/compare/diff-engine.ts:2054— diff-engine.matchWindowedGreedy has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 5 (9 pts), boolean chains 5 (nesting depth added 16). Of this number, 29 points are the body's own statements and 8 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.
local-fonts.normalizeLocalFontRecords (cognitive 37) rhwp-studio/src/core/local-fonts.ts:491— local-fonts.normalizeLocalFontRecords has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 11 (22 pts), boolean chains 7, if/else 4 (7 pts), loops 1 (nesting depth added 14). Of this number, 35 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayerResourceStore.hydrate (cognitive 37) rhwp-studio/src/core/layer-resource-store.ts:22— LayerResourceStore.hydrate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (30 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 12). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 3 function items inside it that branch (a function literal at line 29, resolve, a function literal at line 54). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
text-v2-normalizer.normalizeTextV2Tree::expand (cognitive 37) rhwp-studio/src/core/text-v2-normalizer.ts:51— text-v2-normalizer.normalizeTextV2Tree::expand has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 10, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.drawImageOp::drawImage (cognitive 37) rhwp-studio/src/view/canvaskit-renderer.ts:2857— CanvasKitLayerRenderer.drawImageOp::drawImage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 13, error handling 1 (4 pts), ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (CanvasKitLayerRenderer.drawImageOp) 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.
input-handler-text.overwrittenTextAt (cognitive 37) rhwp-studio/src/engine/input-handler-text.ts:59— input-handler-text.overwrittenTextAt has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 9, loops 2, error handling 1, ternaries 1 (nesting depth added 11). Of this number, 34 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
competitive_bench.render_report (cognitive 36) gym/tools/competitive_bench.py:687— competitive_bench.render_report has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 8 (10 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evidence_report._validate_positive (cognitive 36) gym/tools/evidence_report.py:525— evidence_report._validate_positive has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 12, loops 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
inspect-hwp.inspect (cognitive 36) mydocs/pr/assets/chrisryugj_20261031/inspect-hwp.py:4— inspect-hwp.inspect has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 3 (7 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.fontDecisionEvidence (cognitive 36) rhwp-studio/src/view/canvaskit-renderer.ts:1339— CanvasKitLayerRenderer.fontDecisionEvidence has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 11 (17 pts), boolean chains 11, if/else 7 (8 pts) (nesting depth added 7). Of this number, 32 points are the body's own statements and 4 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.
SvgLayerRenderer::render_node (cognitive 35) src/renderer/svg_layer.rs:238— SvgLayerRenderer::render_node has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 4 (8 pts), loops 3 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_gen_pack.build_menu (cognitive 35) .claude/skills/rhwp-explore/references/_gen_pack.py:300— _gen_pack.build_menu has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 14, ternaries 3 (6 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.
_gen_pack.build_ledger (cognitive 35) .claude/skills/rhwp-strategist/references/_gen_pack.py:550— _gen_pack.build_ledger has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (9 pts), boolean chains 3 (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.
build_baseline.validate_step (cognitive 35) gym/tools/build_baseline.py:613— build_baseline.validate_step has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (32 pts), loops 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeDocument._pump (cognitive 35) bindings/Flutter/lib/src/native_document.dart:470— NativeDocument._pump has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (21 pts), boolean chains 5, ternaries 1 (4 pts), error handling 1 (3 pts), loops 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
navigation-keymap.getNavigationAction (cognitive 35) rhwp-studio/src/engine/navigation-keymap.ts:80— navigation-keymap.getNavigationAction has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
static-svg-path-layers.parseStaticSvgTransform (cognitive 35) rhwp-studio/src/view/static-svg-path-layers.ts:896— static-svg-path-layers.parseStaticSvgTransform has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 11, ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-table.finishImagePlacement (cognitive 35) rhwp-studio/src/engine/input-handler-table.ts:539— input-handler-table.finishImagePlacement has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 8, error handling 3 (5 pts), ternaries 3 (4 pts) (nesting depth added 8). Of this number, 32 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent_session.score_session (cognitive 34) gym/tools/agent_session.py:798— agent_session.score_session has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 7, loops 5 (6 pts), ternaries 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
competitive_bench.scorecard_emptiness_issues (cognitive 34) gym/tools/competitive_bench.py:1473— competitive_bench.scorecard_emptiness_issues has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 12 (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.
diff-engine.buildControlDiffs (cognitive 34) rhwp-studio/src/compare/diff-engine.ts:2687— diff-engine.buildControlDiffs has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 6 (7 pts), boolean chains 6 (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.
rhwp-dev.initRhwpDev (cognitive 34) rhwp-studio/src/core/rhwp-dev.ts:25— rhwp-dev.initRhwpDev has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 6, error handling 3 (4 pts), loops 3 (4 pts), ternaries 3 (nesting depth added 7). Of this number, 33 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.
svg-image-header.svgCommentScanSource (cognitive 34) rhwp-studio/src/view/canvaskit/svg-image-header.ts:142— svg-image-header.svgCommentScanSource has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 3, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-text.replaceTextAtRaw (cognitive 34) rhwp-studio/src/engine/input-handler-text.ts:851— input-handler-text.replaceTextAtRaw has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 8, error handling 1 (2 pts) (nesting depth added 10). Of this number, 30 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#runTableAction (cognitive 34) npm/hwpctrl-ocx/src/index.mjs:3074— #runTableAction has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 5 (9 pts), boolean chains 6, other 5 (nesting depth added 8). Of this number, 32 points are the body's own statements and 2 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
constructor::onmessage (cognitive 34) rhwp-shared/pdf/import-session.js:222— constructor::onmessage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 8, ternaries 2 (4 pts), error handling 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.
Compound::split (cognitive 33) src/parser/pdf/table_paint/compound.rs:295— Compound::split has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 4 (7 pts), match/switch 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evidence_html._pack_statistics (cognitive 33) gym/core/evidence_html.py:184— evidence_html._pack_statistics has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 8, ternaries 4 (8 pts), loops 5 (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.
competitive_bench.validate_capability_matrix (cognitive 33) gym/tools/competitive_bench.py:164— competitive_bench.validate_capability_matrix has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 4 (7 pts), boolean chains 3, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
leaderboard.validate_invite (cognitive 33) gym/tools/leaderboard.py:725— leaderboard.validate_invite has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 2 (4 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.
CanvasKitLayerRenderer.renderCharOverlap::draw::drawCell (cognitive 33) rhwp-studio/src/view/canvaskit-renderer.ts:3837— CanvasKitLayerRenderer.renderCharOverlap::draw::drawCell has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 7, loops 1 (2 pts), ternaries 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. This shape REPEATS in the file: one other method here (CanvasKitLayerRenderer.renderCharOverlap) 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.
CanvasKitLayerRenderer.resolvePreparedTypeface (cognitive 33) rhwp-studio/src/view/canvaskit-renderer.ts:4638— CanvasKitLayerRenderer.resolvePreparedTypeface has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3 (6 pts), ternaries 3 (6 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.
rpc-router.routeEmbedRequest (cognitive 33) rhwp-studio/src/embed/rpc-router.ts:122— rpc-router.routeEmbedRequest has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 6 (12 pts), boolean chains 8, match/switch 1 (nesting depth added 12). 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.
input-handler-picture.updatePictureResizeDrag (cognitive 33) rhwp-studio/src/engine/input-handler-picture.ts:785— input-handler-picture.updatePictureResizeDrag has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 3 (7 pts), boolean chains 6, error handling 3 (5 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.setupGlobalShortcuts (cognitive 33) rhwp-studio/src/main.ts:988— main.setupGlobalShortcuts has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 10, ternaries 1 (3 pts) (nesting depth added 9). None of this is in the body itself: all 33 points belong to one function literal inside it that branches (line 989). 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.
(anonymous) (cognitive 33) mydocs/pr/assets/pr8296-maintainer-20261101/canvaskit-probe.mjs:18— (anonymous) has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 5 (9 pts), ternaries 4 (7 pts), boolean chains 2, other 1 (nesting depth added 13). Of this number, 22 points are the body's own statements and 11 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParaShapeMods::apply_to (cognitive 32) src/model/style.rs:1128— ParaShapeMods::apply_to has cognitive complexity 32 (threshold 15). Drivers by points: if/else 31 (32 pts) (nesting depth added 1). Of this number, 30 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SerializeContext::try_collect_from_document (cognitive 32) src/serializer/hwpx/context.rs:229— SerializeContext::try_collect_from_document has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 12 (13 pts), boolean chains 6 (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.
runner.exception_kind (cognitive 32) gym/core/runner.py:257— runner.exception_kind has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (22 pts), ternaries 5 (10 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.
runner.render_report (cognitive 32) gym/core/runner.py:1172— runner.render_report has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 5 (7 pts), loops 4 (6 pts), boolean chains 5 (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.
NativeTextureController._poll (cognitive 32) bindings/Flutter/lib/src/native_texture_view.dart:750— NativeTextureController._poll has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 10, ternaries 1 (2 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser.expression (cognitive 32) rhwp-shared/forms/action-runtime.ts:108— Parser.expression has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 2 (4 pts), boolean chains 2, ternaries 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.
ChatController.executeWrite (cognitive 32) rhwp-studio/src/ai/agent/chat-controller.ts:167— ChatController.executeWrite has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 7 (17 pts), if/else 7 (12 pts), error handling 2, 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.
InputHandler.executeOperation (cognitive 32) rhwp-studio/src/engine/input-handler.ts:3321— InputHandler.executeOperation has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 3 (6 pts), boolean chains 5, error handling 1 (2 pts), match/switch 1 (nesting depth added 12). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to one function literal inside it that branches (line 3322). 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.
InputHandler.updateCaret (cognitive 32) rhwp-studio/src/engine/input-handler.ts:3865— InputHandler.updateCaret has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (22 pts), error handling 2 (7 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#runPageAction (cognitive 32) npm/hwpctrl-ocx/src/index.mjs:3341— #runPageAction has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 8, other 6, ternaries 4 (6 pts) (nesting depth added 3). Of this number, 28 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
pack_health.extract_json_fragment_rows (cognitive 31) gym/tools/pack_health.py:461— pack_health.extract_json_fragment_rows has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (19 pts), error handling 1 (5 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pack_health.fragment_looks_like_answer (cognitive 31) gym/tools/pack_health.py:536— pack_health.fragment_looks_like_answer has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
condense_rule_replay.replay (cognitive 31) mydocs/tech/investigations/issue-7418/probes/condense_rule_replay.py:31— condense_rule_replay.replay has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 4 (11 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
diff-engine.buildGranularControlDiffs (cognitive 31) rhwp-studio/src/compare/diff-engine.ts:709— diff-engine.buildGranularControlDiffs has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 17, ternaries 4 (10 pts), if/else 4 (nesting depth added 6). Of this number, 29 points are the body's own statements and 2 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.
flow-image-clip.flowImageOpsFromNarrowQuery (cognitive 31) rhwp-studio/src/view/flow-image-clip.ts:246— flow-image-clip.flowImageOpsFromNarrowQuery has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 7 (11 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PdfFontFallbackIndex::select (cognitive 30) src/renderer/pdf.rs:1509— PdfFontFallbackIndex::select has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
browser-font-cmap.repairTerminalFontCmap (cognitive 30) rhwp-studio/src/core/browser-font-cmap.ts:2— browser-font-cmap.repairTerminalFontCmap has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 6, loops 4 (5 pts) (nesting depth added 7). Of this number, 26 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
canvas-intrinsic-font.fontProgramOwnsFamily (cognitive 30) rhwp-studio/src/core/canvas-intrinsic-font.mjs:14— canvas-intrinsic-font.fontProgramOwnsFamily has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 7, loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sfnt-face.repairMinimalFormat4Length (cognitive 30) rhwp-studio/src/core/sfnt-face.ts:161— sfnt-face.repairMinimalFormat4Length has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 6, 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.
image-header.gifHasSingleFrame (cognitive 30) rhwp-studio/src/view/canvaskit/image-header.ts:69— image-header.gifHasSingleFrame has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 5, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bounded-response.readBoundedResponseArrayBuffer (cognitive 30) rhwp-studio/src/view/canvaskit/bounded-response.ts:8— bounded-response.readBoundedResponseArrayBuffer has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 5 (10 pts), boolean chains 5, loops 2, ternaries 1 (nesting depth added 8). Of this number, 27 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.renderColorPaintGraphNode (cognitive 30) rhwp-studio/src/view/canvaskit-renderer.ts:2640— CanvasKitLayerRenderer.renderColorPaintGraphNode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 9 (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.
CanvasKitLayerRenderer.drawImageRect (cognitive 30) rhwp-studio/src/view/canvaskit-renderer.ts:2977— CanvasKitLayerRenderer.drawImageRect has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-picture.findPictureBbox (cognitive 30) rhwp-studio/src/engine/input-handler-picture.ts:323— input-handler-picture.findPictureBbox has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (21 pts), boolean chains 4, loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_decode (cognitive 30) rhwp-shared/pdf/import-session.js:277— _decode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 9, other 1 (nesting depth added 6). Of this number, 29 points are the body's own statements and 1 belongs 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.
Cursor::parse_sequence (cognitive 29) src/renderer/equation/legacy_hwpeq.rs:115— Cursor::parse_sequence has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 3 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extract_docx.main (cognitive 29) .claude/skills/rhwp-exam-ingest/helpers/extract_docx.py:40— extract_docx.main has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 3 (4 pts), ternaries 3 (4 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
diff-engine.buildTableSummary (cognitive 29) rhwp-studio/src/compare/diff-engine.ts:553— diff-engine.buildTableSummary has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 3 (9 pts), error handling 5 (8 pts), if/else 2 (5 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
diff-engine.fillMissingParaAnchorsFromNeighbors (cognitive 29) rhwp-studio/src/compare/diff-engine.ts:873— diff-engine.fillMissingParaAnchorsFromNeighbors has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 3 (6 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.
font-rule-runtime.resolveProjectedCanvasKitFontPlan (cognitive 29) rhwp-studio/src/core/font-rule-runtime.ts:339— font-rule-runtime.resolveProjectedCanvasKitFontPlan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (8 pts), ternaries 2 (5 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
host-font-requests.collectDocumentCanvasKitFontUsage (cognitive 29) rhwp-studio/src/core/host-font-requests.ts:30— host-font-requests.collectDocumentCanvasKitFontUsage has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (7 pts), ternaries 1 (5 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VirtualScroll.getVisibilitySnapshot (cognitive 29) rhwp-studio/src/view/virtual-scroll.ts:470— VirtualScroll.getVisibilitySnapshot has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (8 pts), ternaries 4 (5 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compatibility-glyph-view.compatibilityGlyphView (cognitive 29) rhwp-studio/src/view/canvaskit/compatibility-glyph-view.ts:7— compatibility-glyph-view.compatibilityGlyphView has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 13, ternaries 3 (8 pts), if/else 4 (6 pts), loops 2 (nesting depth added 7). Of this number, 17 points are the body's own statements and 12 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.
static-svg-path-layers.decodeStaticSvgXmlEntities (cognitive 29) rhwp-studio/src/view/static-svg-path-layers.ts:363— static-svg-path-layers.decodeStaticSvgXmlEntities has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 2 (7 pts), boolean chains 5, 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.
InputHandler.finishTextboxPlacement (cognitive 29) rhwp-studio/src/engine/input-handler.ts:1354— InputHandler.finishTextboxPlacement has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 5, ternaries 2 (3 pts), error handling 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChartDataDialog.renderGrid (cognitive 29) rhwp-studio/src/ui/chart-data-dialog.ts:140— ChartDataDialog.renderGrid has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), ternaries 2 (7 pts), boolean chains 2, loops 1 (nesting depth added 13). Of this number, 16 points are the body's own statements and 13 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CondensePlan::prepare (cognitive 28) src/renderer/layout/paragraph_layout/condense_spacing.rs:14— CondensePlan::prepare has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 5, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_gen_pack.write_queues (cognitive 28) .claude/skills/rhwp-chief/_gen_pack.py:882— _gen_pack.write_queues has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
local-fonts.readSfntFontNames (cognitive 28) rhwp-studio/src/core/local-fonts.ts:399— local-fonts.readSfntFontNames has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
local-fonts.matchingCollectionFace (cognitive 28) rhwp-studio/src/core/local-fonts.ts:1189— local-fonts.matchingCollectionFace has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), ternaries 1 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitParagraphFonts.source (cognitive 28) rhwp-studio/src/view/canvaskit/paragraph-fonts.ts:50— CanvasKitParagraphFonts.source has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (8 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 12). Of this number, 25 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasView.renderHeaderFooterEditOverlays (cognitive 28) rhwp-studio/src/view/canvas-view.ts:1021— CanvasView.renderHeaderFooterEditOverlays has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, error handling 2 (5 pts), ternaries 2 (5 pts), loops 1 (nesting depth added 11). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocumentAgentController.revertTextCommand (cognitive 28) rhwp-studio/src/document-agent/controller.ts:590— DocumentAgentController.revertTextCommand has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (19 pts), error handling 3 (5 pts), boolean chains 4 (nesting depth added 4). Of this number, 14 points are the body's own statements and 14 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
CursorState.moveToParagraphBoundary (cognitive 28) rhwp-studio/src/engine/cursor.ts:1073— CursorState.moveToParagraphBoundary has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 2 (4 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-text.handleBackspace (cognitive 28) rhwp-studio/src/engine/input-handler-text.ts:214— input-handler-text.handleBackspace has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 4, 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.
InputHandler.findTableByOuterClick (cognitive 28) rhwp-studio/src/engine/input-handler.ts:1862— InputHandler.findTableByOuterClick has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (7 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompareDialog.renderValueDiff (cognitive 28) rhwp-studio/src/ui/compare-dialog.ts:362— CompareDialog.renderValueDiff has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HistoryDialog.renderValueDiff (cognitive 28) rhwp-studio/src/ui/history-dialog.ts:333— HistoryDialog.renderValueDiff has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
viewer.renderOutlineTree (cognitive 28) rhwp-vscode/src/webview/viewer.ts:1153— viewer.renderOutlineTree has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (6 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 12). Most of this is not in the body itself: 11 of the 28 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1196, 1176). 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.
Hwp3SpecialChar::parse (cognitive 27) src/parser/hwp3/special_char.rs:134— Hwp3SpecialChar::parse has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 1 (5 pts), match/switch 1 (nesting depth added 18). 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.
PageRenderTree::clip_overlapping_same_bin_images (cognitive 27) src/renderer/render_tree.rs:2480— PageRenderTree::clip_overlapping_same_bin_images has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
competitive_bench.main (cognitive 27) gym/tools/competitive_bench.py:1815— competitive_bench.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts), ternaries 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.imagePixelSize (cognitive 27) npm/hwpctrl-ocx/src/index.mjs:3731— index.imagePixelSize has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
diff-engine.buildIdentityTextDiffs (cognitive 27) rhwp-studio/src/compare/diff-engine.ts:1335— diff-engine.buildIdentityTextDiffs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 6, loops 1 (nesting depth added 10). Of this number, 26 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.
host-font-requests.hancomEquationFamilies (cognitive 27) rhwp-studio/src/core/host-font-requests.ts:78— host-font-requests.hancomEquationFamilies has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (4 pts), match/switch 1 (2 pts), ternaries 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.
layer-tree-transport.readLayerTreeTransport (cognitive 27) rhwp-studio/src/core/layer-tree-transport.ts:13— layer-tree-transport.readLayerTreeTransport has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 3 (6 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WasmBridge.prepareCanvasMetrics (cognitive 27) rhwp-studio/src/core/wasm-bridge.ts:367— WasmBridge.prepareCanvasMetrics has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 7, loops 3 (7 pts), ternaries 1 (nesting depth added 8). Of this number, 18 points are the body's own statements and 9 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-edit-invalidation.isPageLocalTextEditCommand (cognitive 27) rhwp-studio/src/engine/input-edit-invalidation.ts:33— input-edit-invalidation.isPageLocalTextEditCommand has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-table.findSingleCellResizeTarget (cognitive 27) rhwp-studio/src/engine/input-handler-table.ts:81— input-handler-table.findSingleCellResizeTarget has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputHandler.getParaFormatTargetsForRange (cognitive 27) rhwp-studio/src/engine/input-handler.ts:2612— InputHandler.getParaFormatTargetsForRange has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 7, loops 3 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PdfImportDialog.onConfirm (cognitive 27) rhwp-studio/src/ui/pdf-import-dialog.ts:193— PdfImportDialog.onConfirm has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12, ternaries 4 (9 pts), boolean chains 3, loops 2, error handling 1 (nesting depth added 5). Most of this is not in the body itself: 6 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 223, 251, 248, …). 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.
CompareResultWindow.highlightPreview (cognitive 27) rhwp-studio/src/ui/compare-result-window.ts:182— CompareResultWindow.highlightPreview has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, if/else 9 (10 pts), ternaries 4, loops 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.
Toolbar.setupFontControls (cognitive 27) rhwp-studio/src/ui/toolbar.ts:257— Toolbar.setupFontControls has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 6, loops 1 (3 pts) (nesting depth added 8). None of this is in the body itself: all 27 points belong to 5 function literals inside it that branch (lines 274, 319, 265, …). 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.
VerifyArgs::parse (cognitive 26) src/cli/queries/verification.rs:32— VerifyArgs::parse has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeGlPresenter::replay_tiles (cognitive 26) src/native_host/gpu_gl.rs:783— NativeGlPresenter::replay_tiles has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 4 (7 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.
NativeRuntime::try_recv (cognitive 26) src/native_host/runtime.rs:939— NativeRuntime::try_recv has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 1, match/switch 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.
ParagraphFloatPlacement::from_stored_overlay_guide_chain (cognitive 26) src/renderer/float_placement/stored_empty_host_frame.rs:138— ParagraphFloatPlacement::from_stored_overlay_guide_chain has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 9, 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.
differential.find_twins_in (cognitive 26) gym/tools/differential.py:605— differential.find_twins_in has cognitive complexity 26 (threshold 15). Drivers by points: error handling 6 (12 pts), if/else 3 (6 pts), loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
release_gate.gate (cognitive 26) gym/tools/release_gate.py:712— release_gate.gate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
robustness.validate_report (cognitive 26) gym/tools/robustness.py:1225— robustness.validate_report has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (20 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
trajectory.audit (cognitive 26) gym/tools/trajectory.py:908— trajectory.audit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gym-labnote.main (cognitive 26) mydocs/tech/investigations/issue-3587/probes/gym-labnote.py:60— gym-labnote.main has cognitive complexity 26 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 3 (7 pts), boolean chains 4 (nesting depth added 12). 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.
generate_native_border_sources.grid (cognitive 26) pdf/issue7998/generate_native_border_sources.py:6— generate_native_border_sources.grid has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 5 (18 pts), loops 2 (4 pts), if/else 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
claude.classifyClaudeError (cognitive 26) rhwp-studio/src/ai/provider/claude.ts:65— claude.classifyClaudeError has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 5 (10 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.
diff-engine.compareSnapshots (cognitive 26) rhwp-studio/src/compare/diff-engine.ts:2991— diff-engine.compareSnapshots has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 5 (9 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 10). Of this number, 21 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
local-fonts.loadPreferredLocalFontBytes (cognitive 26) rhwp-studio/src/core/local-fonts.ts:1216— local-fonts.loadPreferredLocalFontBytes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 7, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
font-substitution.fontFamilyCandidatesForDisplayWithRules (cognitive 26) rhwp-studio/src/core/font-substitution.ts:474— font-substitution.fontFamilyCandidatesForDisplayWithRules has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 3 (5 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nominal-text-replay.textRequiresComplexShaping (cognitive 26) rhwp-studio/src/view/canvaskit/nominal-text-replay.ts:7— nominal-text-replay.textRequiresComplexShaping has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 21, if/else 2 (4 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.
svg-image-header.parseSvgLength (cognitive 26) rhwp-studio/src/view/canvaskit/svg-image-header.ts:214— svg-image-header.parseSvgLength has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 6 (21 pts), if/else 4, boolean chains 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CanvasKitLayerRenderer.drawStaticSvgPathLayers (cognitive 26) rhwp-studio/src/view/canvaskit-renderer.ts:2548— CanvasKitLayerRenderer.drawStaticSvgPathLayers has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 4 (14 pts), if/else 5 (11 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.
CanvasView.buildPrefetchRenderWork (cognitive 26) rhwp-studio/src/view/canvas-view.ts:818— CanvasView.buildPrefetchRenderWork has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 7 (9 pts), boolean chains 4 (nesting depth added 7). None of this is in the body itself: all 26 points belong to 2 function literals inside it that branch (lines 826, 843). 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.
rhwp_native_ffi::session::rhwp_native_host_request (cognitive 25) bindings/Native/src/session.rs:425— rhwp_native_ffi::session::rhwp_native_host_request has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 6 (12 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.
Font::set_props (cognitive 25) src/wmf/converter/svg/util.rs:376— Font::set_props has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 4 (7 pts), 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.
CullingIndex::new (cognitive 25) src/renderer/skia/culling.rs:39— CullingIndex::new has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConversionConfig::validate (cognitive 25) tools/batch-convert/src/config.rs:140— ConversionConfig::validate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 8 (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.
_gen_pack.pick_canonical_for_heading (cognitive 25) .claude/skills/rhwp-knowledge-map/references/_gen_pack.py:813— _gen_pack.pick_canonical_for_heading has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (15 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.
runner.load_pack (cognitive 25) gym/core/runner.py:768— runner.load_pack has cognitive complexity 25 (threshold 15). Drivers by points: error handling 12 (16 pts), if/else 6 (8 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.
runner.score_pack (cognitive 25) gym/core/runner.py:923— runner.score_pack has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 6 (8 pts), error handling 4 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent_session.record_session (cognitive 25) gym/tools/agent_session.py:969— agent_session.record_session has cognitive complexity 25 (threshold 15). Drivers by points: error handling 5 (10 pts), if/else 6 (8 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
competitive_bench.discover_known_agents (cognitive 25) gym/tools/competitive_bench.py:1400— competitive_bench.discover_known_agents has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (17 pts), error handling 1 (4 pts), loops 2 (3 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.
differential._values_equal (cognitive 25) gym/tools/differential.py:415— differential._values_equal has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 11 (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.
discriminate.build_negative (cognitive 25) gym/tools/discriminate.py:683— discriminate.build_negative has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), ternaries 1 (4 pts), loops 1 (3 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.
release_diff._values_equal (cognitive 25) gym/tools/release_diff.py:465— release_diff._values_equal has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 11 (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.
robustness.audit (cognitive 25) gym/tools/robustness.py:1288— robustness.audit has cognitive complexity 25 (threshold 15). Drivers by points: error handling 6 (11 pts), if/else 3 (8 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
message-render.parseMarkdown (cognitive 25) rhwp-studio/src/ai/ui/message-render.ts:65— message-render.parseMarkdown has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 11). Of this number, 23 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
diff-engine.scoreControlFallback (cognitive 25) rhwp-studio/src/compare/diff-engine.ts:2856— diff-engine.scoreControlFallback has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (19 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.
raster-stroke.rasterLineGeometry (cognitive 25) rhwp-studio/src/view/canvaskit/raster-stroke.ts:4— raster-stroke.rasterLineGeometry has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, boolean chains 11, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
input-handler-mouse.handleResizeHover (cognitive 25) rhwp-studio/src/engine/input-handler-mouse.ts:1903— input-handler-mouse.handleResizeHover has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 4, 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.
InputHandler.insertDroppedImageAtClientPoint (cognitive 25) rhwp-studio/src/engine/input-handler.ts:917— InputHandler.insertDroppedImageAtClientPoint has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 9, if/else 7, ternaries 6 (7 pts), error handling 2 (nesting depth added 1). Of this number, 18 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
selection-text.readSelectionText (cognitive 25) rhwp-studio/src/plugin/selection-text.ts:53— selection-text.readSelectionText has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, ternaries 3 (6 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.
CompareDialog.formatFieldValue (cognitive 25) rhwp-studio/src/ui/compare-dialog.ts:446— CompareDialog.formatFieldValue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HistoryDialog.formatFieldValue (cognitive 25) rhwp-studio/src/ui/history-dialog.ts:417— HistoryDialog.formatFieldValue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity· run (cognitive 25) · ×1
run (cognitive 25) rhwp-desk/ui/js/batch.js:36— run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 5 (7 pts), loops 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 7). Of this number, 23 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.
Player::image (cognitive 24) src/emf/emfplus/player.rs:216— Player::image has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SourceFrameQuery::resolve (cognitive 24) src/renderer/typeset/table/scan/source_frame.rs:42— SourceFrameQuery::resolve has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 23, 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.
coverage.commands_in_doc (cognitive 24) gym/tools/coverage.py:52— coverage.commands_in_doc has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (5 pts), boolean chains 4 (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.
fuzz_corpus.exception_kind (cognitive 24) gym/tools/fuzz_corpus.py:658— fuzz_corpus.exception_kind has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
release_gate.fold_preflight (cognitive 24) gym/tools/release_gate.py:312— release_gate.fold_preflight has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate_periodic_border_sources.grid (cognitive 24) pdf/issue7998/generate_periodic_border_sources.py:6— generate_periodic_border_sources.grid has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 3 (7 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CpuFramePresenter._drain (cognitive 24) bindings/Flutter/lib/src/native_document.dart:822— CpuFramePresenter._drain has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 4, error handling 1 (3 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp.__wbg_get_imports (cognitive 24) rhwp-studio/public/rhwp.js:14105— rhwp.__wbg_get_imports has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 18 (19 pts), error handling 4, boolean chains 1 (nesting depth added 1). None of this is in the body itself: all 24 points belong to 15 function literals inside it that branch (lines 14108, 14134, 14140, …). 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.
diff-engine.pairAlignmentSlotControls (cognitive 24) rhwp-studio/src/compare/diff-engine.ts:2603— diff-engine.pairAlignmentSlotControls has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.drawStaticSvgTextLayer (cognitive 24) rhwp-studio/src/view/canvaskit-renderer.ts:4827— CanvasKitLayerRenderer.drawStaticSvgTextLayer has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 5 (9 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runtime.installEmbedRuntime::onMessage (cognitive 24) rhwp-studio/src/embed/runtime.ts:177— runtime.installEmbedRuntime::onMessage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 7, 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.
HwpEditorProvider.resolveCustomEditor (cognitive 24) rhwp-vscode/src/hwp-editor-provider.ts:74— HwpEditorProvider.resolveCustomEditor has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 10). None of this is in the body itself: all 24 points belong to one function literal inside it that branches (line 96). 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.
addToolCard (cognitive 24) rhwp-desk/ui/js/cards.js:74— addToolCard has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5, loops 1 (2 pts), ternaries 2 (nesting depth added 4). Of this number, 21 points are the body's own statements and 3 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
(anonymous) (cognitive 24) rhwp-studio/public/theme-init.js:7— (anonymous) has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, if/else 7, ternaries 4 (5 pts), error handling 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.
rhwp_contracts::ontology::push_ir_nodes (cognitive 23) crates/rhwp-contracts/src/ontology.rs:205— rhwp_contracts::ontology::push_ir_nodes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeDocumentSession::accessibility_snapshot (cognitive 23) src/native_host/accessibility.rs:153— NativeDocumentSession::accessibility_snapshot has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (5 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.
Bounds::cubic (cognitive 23) src/renderer/filled_path_bounds.rs:28— Bounds::cubic has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HorizontalShapingTransaction::shadow_measure_with_instance_request (cognitive 23) src/renderer/shaping_context.rs:755— HorizontalShapingTransaction::shadow_measure_with_instance_request has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (16 pts), match/switch 5 (6 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
TextLines::shape (cognitive 23) src/renderer/skia/text_replay/lines.rs:85— TextLines::shape has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TacFlowQuery::tac_table_line_index (cognitive 23) src/renderer/typeset/controls/tac_flow.rs:58— TacFlowQuery::tac_table_line_index has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 7 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runner.validate_scorecard (cognitive 23) gym/core/runner.py:1030— runner.validate_scorecard has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (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.
audit.validate_report (cognitive 23) gym/tools/audit.py:780— audit.validate_report has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4, 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.
competitive_bench.task_result_issues (cognitive 23) gym/tools/competitive_bench.py:1597— competitive_bench.task_result_issues has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (9 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.
action-runtime.evaluateFormAction.statement (cognitive 23) rhwp-shared/forms/action-runtime.ts:256— action-runtime.evaluateFormAction.statement has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 12). 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.
diff-engine.findLongestEqualSignatureRun (cognitive 23) rhwp-studio/src/compare/diff-engine.ts:1853— diff-engine.findLongestEqualSignatureRun has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
declared-font-environment.loadLocalProgram (cognitive 23) rhwp-studio/src/core/declared-font-environment.ts:51— declared-font-environment.loadLocalProgram has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 2 (3 pts), boolean chains 2, loops 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WasmBridge.prepareDeclaredFontEnvironment (cognitive 23) rhwp-studio/src/core/wasm-bridge.ts:1051— WasmBridge.prepareDeclaredFontEnvironment has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 8, if/else 8, ternaries 5 (6 pts), error handling 1 (nesting depth added 1). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: 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.
CanvasKitLayerRenderer.renderClipNode (cognitive 23) rhwp-studio/src/view/canvaskit-renderer.ts:1975— CanvasKitLayerRenderer.renderClipNode has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (16 pts), if/else 2 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 14). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 1986). 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.
CanvasKitLayerRenderer.drawTiledImage (cognitive 23) rhwp-studio/src/view/canvaskit-renderer.ts:3034— CanvasKitLayerRenderer.drawTiledImage has cognitive complexity 23 (threshold 15). Drivers by points: loops 4 (9 pts), boolean chains 5, if/else 5, ternaries 2 (4 pts) (nesting depth added 7). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RendererSession.resolveUncached (cognitive 23) rhwp-studio/src/view/renderer-session.ts:270— RendererSession.resolveUncached has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 3 (5 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocumentAgentController.applyTextCommand (cognitive 23) rhwp-studio/src/document-agent/controller.ts:416— DocumentAgentController.applyTextCommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (16 pts), error handling 3 (5 pts), boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 464). 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.
DeleteTextCommand.mergeWith (cognitive 23) rhwp-studio/src/engine/command.ts:922— DeleteTextCommand.mergeWith has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (22 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.
TableResizeRenderer.hitTestBorder (cognitive 23) rhwp-studio/src/engine/table-resize-renderer.ts:104— TableResizeRenderer.hitTestBorder has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 7, loops 2 (nesting depth added 6). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputHandler.constructor (cognitive 23) rhwp-studio/src/engine/input-handler.ts:596— InputHandler.constructor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, boolean chains 5, ternaries 1. Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 772, 713, 738, …). 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.
CharShapeDialog.populateFromProps (cognitive 23) rhwp-studio/src/ui/char-shape-dialog.ts:858— CharShapeDialog.populateFromProps has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 18, if/else 4 (5 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.
ChartDataDialog.menuItems (cognitive 23) rhwp-studio/src/ui/chart-data-dialog.ts:270— ChartDataDialog.menuItems has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 5, if/else 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Hwp3DrawingObject::read (cognitive 22) src/parser/hwp3/drawing.rs:487— Hwp3DrawingObject::read has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 3, match/switch 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BackendOverrides::apply (cognitive 22) src/parser/pdf/policy.rs:234— BackendOverrides::apply 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.
schema.validate_profile (cognitive 22) gym/core/schema.py:697— schema.validate_profile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
audit.audit (cognitive 22) gym/tools/audit.py:1109— audit.audit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, error handling 2 (4 pts), ternaries 2 (3 pts), loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
build_baseline.process_pack (cognitive 22) gym/tools/build_baseline.py:1122— build_baseline.process_pack has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 2 (5 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
competitive_bench.payload_honesty_issues (cognitive 22) gym/tools/competitive_bench.py:1622— competitive_bench.payload_honesty_issues has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (5 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.
file.runPdfPrint (cognitive 22) rhwp-studio/src/command/commands/file.ts:637— file.runPdfPrint has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 4). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
CanvasSupplementalMetricProvider.prepare (cognitive 22) rhwp-studio/src/core/supplemental-text-metrics.ts:102— CanvasSupplementalMetricProvider.prepare has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 1 (nesting depth added 7). Of this number, 21 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.
font-decision-trace.canvas2dDecision (cognitive 22) rhwp-studio/src/core/font-decision-trace.ts:65— font-decision-trace.canvas2dDecision has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
image-header.webpHasSingleFrame (cognitive 22) rhwp-studio/src/view/canvaskit/image-header.ts:153— image-header.webpHasSingleFrame has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
replay-fingerprint.replayFingerprint::visit (cognitive 22) rhwp-studio/src/view/canvaskit/replay-fingerprint.ts:20— replay-fingerprint.replayFingerprint::visit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.renderImage (cognitive 22) rhwp-studio/src/view/canvaskit-renderer.ts:2318— CanvasKitLayerRenderer.renderImage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 8, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
PageRenderer.createOrReuseFlowImageLayer (cognitive 22) rhwp-studio/src/view/page-renderer.ts:627— PageRenderer.createOrReuseFlowImageLayer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PageRenderer.scheduleReRender (cognitive 22) rhwp-studio/src/view/page-renderer.ts:1146— PageRenderer.scheduleReRender has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 5). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (finish, a function literal at line 1191, a function literal at line 1202, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CursorState.moveToCellByIndex (cognitive 22) rhwp-studio/src/engine/cursor.ts:1335— CursorState.moveToCellByIndex has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 6 (8 pts), boolean chains 3 (nesting depth added 9). Of this number, 17 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.
InsertTextCommand.execute (cognitive 22) rhwp-studio/src/engine/command.ts:719— InsertTextCommand.execute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (4 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-picture.calcResizedBboxRotated (cognitive 22) rhwp-studio/src/engine/input-handler-picture.ts:720— input-handler-picture.calcResizedBboxRotated has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 10 (16 pts), if/else 5, 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.
input-handler-table.clampCompensatedResizeDelta (cognitive 22) rhwp-studio/src/engine/input-handler-table.ts:188— input-handler-table.clampCompensatedResizeDelta has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (6 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 8). Of this number, 20 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.
InputHandler.cutSelectedObject (cognitive 22) rhwp-studio/src/engine/input-handler.ts:5764— InputHandler.cutSelectedObject has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10, boolean chains 8, ternaries 4. Of this number, 15 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StyleEditDialog.onConfirm::apply (cognitive 22) rhwp-studio/src/ui/style-edit-dialog.ts:302— StyleEditDialog.onConfirm::apply has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
renderQueue (cognitive 22) rhwp-desk/ui/js/main.js:75— renderQueue has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 4 (7 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.
renderProfiles (cognitive 22) rhwp-desk/ui/js/main.js:585— renderProfiles has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 3 (5 pts), error handling 1 (3 pts), loops 1, other 1 (nesting depth added 10). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 621, a function literal at line 612, mk, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
resolveSettings (cognitive 22) rhwp-chrome/sw/settings-store.js:47— resolveSettings has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 pts), other 3, ternaries 2 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
PdfStroke::try_segment_rectangles (cognitive 21) src/model/pdf_stroke.rs:125— PdfStroke::try_segment_rectangles has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Visibility::project (cognitive 21) src/parser/hwpx/tracked_changes.rs:37— Visibility::project has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 3 (7 pts), loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ObservedText::lines (cognitive 21) src/parser/pdf/text_analysis.rs:228— ObservedText::lines has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Plan::source (cognitive 21) src/renderer/equation/legacy_coordinate_plan.rs:84— Plan::source has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 10). 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.
PageControlEvents::collect_with_storage (cognitive 21) src/renderer/page_number.rs:153— PageControlEvents::collect_with_storage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 4 (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.
BatchConverter::format_args (cognitive 21) tools/batch-convert/src/converter.rs:687— BatchConverter::format_args has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (nesting depth added 10). 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.
_gen_pack.write_fixtures (cognitive 21) .claude/skills/rhwp-visual-regression/references/_gen_pack.py:1237— _gen_pack.write_fixtures has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (18 pts), loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
report.render_card (cognitive 21) gym/report.py:638— report.render_card has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7, ternaries 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
pack_health.scan_checks (cognitive 21) gym/tools/pack_health.py:1016— pack_health.scan_checks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pack_health.audit (cognitive 21) gym/tools/pack_health.py:2069— pack_health.audit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NativeEditorViewState._key (cognitive 21) bindings/Flutter/lib/src/native_editor_view.dart:195— _NativeEditorViewState._key has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
action-runtime.evaluateFormAction.assign (cognitive 21) rhwp-shared/forms/action-runtime.ts:163— action-runtime.evaluateFormAction.assign has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6 (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.
CommandErrorBoundary.fail (cognitive 21) rhwp-studio/src/core/command-error.ts:73— CommandErrorBoundary.fail has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (6 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 5). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to one function literal inside it that branches (line 78). 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.
diff-engine.charEditOpsFullDp (cognitive 21) rhwp-studio/src/compare/diff-engine.ts:371— diff-engine.charEditOpsFullDp has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (7 pts), loops 5 (6 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
diff-engine.suppressPureReflowMoves (cognitive 21) rhwp-studio/src/compare/diff-engine.ts:1472— diff-engine.suppressPureReflowMoves has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, loops 2, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1497, 1481, 1482). 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.
glyph-outline-payload-status.hasSupportedColrv1GraphContract (cognitive 21) rhwp-studio/src/view/glyph-outline-payload-status.ts:168— glyph-outline-payload-status.hasSupportedColrv1GraphContract has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (8 pts), loops 1, match/switch 1 (nesting depth added 2). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to one function item inside it that branches (visit). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ViewportManager.onWheel (cognitive 21) rhwp-studio/src/view/viewport-manager.ts:132— ViewportManager.onWheel has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasView.refreshInvalidatedPage (cognitive 21) rhwp-studio/src/view/canvas-view.ts:2065— CanvasView.refreshInvalidatedPage has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 5 (6 pts) (nesting depth added 1). Of this number, 16 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CursorState.updateRect (cognitive 21) rhwp-studio/src/engine/cursor.ts:1447— CursorState.updateRect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CursorState.moveCellSelection (cognitive 21) rhwp-studio/src/engine/cursor.ts:1753— CursorState.moveCellSelection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4, error handling 1 (nesting depth added 5). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InsertTextCommand.mergeWith (cognitive 21) rhwp-studio/src/engine/command.ts:804— InsertTextCommand.mergeWith has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
input-handler-mouse.finishMouseUp (cognitive 21) rhwp-studio/src/engine/input-handler-mouse.ts:2010— input-handler-mouse.finishMouseUp has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
input-handler-table.startResizeDrag (cognitive 21) rhwp-studio/src/engine/input-handler-table.ts:227— input-handler-table.startResizeDrag has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputHandler.restoreEditContextAfterHistory (cognitive 21) rhwp-studio/src/engine/input-handler.ts:3093— InputHandler.restoreEditContextAfterHistory has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputHandler.executeFormActionPlan (cognitive 21) rhwp-studio/src/engine/input-handler.ts:6420— InputHandler.executeFormActionPlan has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, ternaries 2 (5 pts), loops 2 (nesting depth added 6). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MenuBar.setupKeyboardClose (cognitive 21) rhwp-studio/src/ui/menu-bar.ts:113— MenuBar.setupKeyboardClose has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 10). None of this is in the body itself: all 21 points belong to one function literal inside it that branches (line 114). 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.
#runObjectAction (cognitive 21) npm/hwpctrl-ocx/src/index.mjs:2819— #runObjectAction has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, ternaries 2 (3 pts), other 2 (nesting depth added 4). Of this number, 17 points are the body's own statements and 4 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 21) mydocs/pr/assets/chrisryugj_20261031/edit-wasm.mjs:21— (anonymous) has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser::parse_pseudo (cognitive 20) src/agent/dsel/parse.rs:413— Parser::parse_pseudo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 6 (9 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdapterPayload::write (cognitive 20) src/document_core/converters/hwpx_to_hwp.rs:3046— AdapterPayload::write has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 4 (8 pts), match/switch 1 (nesting depth added 10). 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.
NativePngExporter::render_page (cognitive 20) src/document_core/queries/png_export.rs:48— NativePngExporter::render_page has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 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.
Cell::saved_reset_closes_initial_table_frame (cognitive 20) src/model/table.rs:339— Cell::saved_reset_closes_initial_table_frame has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Trial::width_for_cuts (cognitive 20) src/parser/pdf/structured_lowering/wrap_width.rs:126— Trial::width_for_cuts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 3, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RasterFingerprint::from_rgba (cognitive 20) src/renderer/pdf_raster_fidelity/fingerprint.rs:90— RasterFingerprint::from_rgba has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenderNode::write_json (cognitive 20) src/renderer/render_tree.rs:335— RenderNode::write_json has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_gen_pack.transcript_for (cognitive 20) .claude/skills/rhwp-bulk-pipeline/references/_gen_pack.py:1185— _gen_pack.transcript_for has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
runner.eval_check (cognitive 20) gym/core/runner.py:602— runner.eval_check has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 6, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runner.score_all (cognitive 20) gym/core/runner.py:1063— runner.score_all has cognitive complexity 20 (threshold 15). Drivers by points: error handling 7 (14 pts), if/else 4, 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.
pack_health.scan_hint (cognitive 20) gym/tools/pack_health.py:1737— pack_health.scan_hint has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pack_health.scan_manifest (cognitive 20) gym/tools/pack_health.py:1827— pack_health.scan_manifest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
release_gate.exception_kind (cognitive 20) gym/tools/release_gate.py:229— release_gate.exception_kind has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 2 (4 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.
_Plan.geometry (cognitive 20) bindings/Flutter/lib/src/native_texture_view.dart:124— _Plan.geometry has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 18, 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.
NativeTextureController._closePlatform (cognitive 20) bindings/Flutter/lib/src/native_texture_view.dart:841— NativeTextureController._closePlatform has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rhwp.__wbg_load (cognitive 20) rhwp-studio/public/rhwp.js:14877— rhwp.__wbg_load has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 8). Of this number, 19 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.
shortcut-map.matchShortcut (cognitive 20) rhwp-studio/src/command/shortcut-map.ts:142— shortcut-map.matchShortcut has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chart-data-target.needsStructure (cognitive 20) rhwp-studio/src/core/chart-data-target.ts:214— chart-data-target.needsStructure has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.prepareHostFonts (cognitive 20) rhwp-studio/src/view/canvaskit-renderer.ts:898— CanvasKitLayerRenderer.prepareHostFonts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.renderPage (cognitive 20) rhwp-studio/src/view/canvaskit-renderer.ts:978— CanvasKitLayerRenderer.renderPage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, error handling 2, loops 2, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
CanvasKitLayerRenderer.renderLeaf (cognitive 20) rhwp-studio/src/view/canvaskit-renderer.ts:2012— CanvasKitLayerRenderer.renderLeaf has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, ternaries 2 (4 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.renderGlyphRun (cognitive 20) rhwp-studio/src/view/canvaskit-renderer.ts:2387— CanvasKitLayerRenderer.renderGlyphRun has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1 (nesting depth added 6). Of this number, 19 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.
CanvasKitLayerRenderer.renderGlyphOutline (cognitive 20) rhwp-studio/src/view/canvaskit-renderer.ts:2427— CanvasKitLayerRenderer.renderGlyphOutline has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.drawImageOp (cognitive 20) rhwp-studio/src/view/canvaskit-renderer.ts:2812— CanvasKitLayerRenderer.drawImageOp has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 16, ternaries 7 (9 pts), error handling 1 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (CanvasKitLayerRenderer.drawImageOp::drawImage) 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.
CanvasKitLayerRenderer.drawCachedGlyphs (cognitive 20) rhwp-studio/src/view/canvaskit-renderer.ts:4590— CanvasKitLayerRenderer.drawCachedGlyphs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, error handling 2 (4 pts), loops 1 (2 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PageRenderer.applyOverlays (cognitive 20) rhwp-studio/src/view/page-renderer.ts:496— PageRenderer.applyOverlays has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
render-surface-budget.planRenderSurfaceBudget (cognitive 20) rhwp-studio/src/view/render-surface-budget.ts:183— render-surface-budget.planRenderSurfaceBudget has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasView.trimOffscreenZoomSurfaces (cognitive 20) rhwp-studio/src/view/canvas-view.ts:1551— CanvasView.trimOffscreenZoomSurfaces has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 10). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasView.setPageViewSettings (cognitive 20) rhwp-studio/src/view/canvas-view.ts:2354— CanvasView.setPageViewSettings has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6, error handling 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.
Ruler.drawVertical (cognitive 20) rhwp-studio/src/view/ruler.ts:755— Ruler.drawVertical has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, ternaries 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CursorState.moveHorizontalInCell (cognitive 20) rhwp-studio/src/engine/cursor.ts:796— CursorState.moveHorizontalInCell has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 5). Of this number, 14 points are the body's own statements and 6 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-text.onCompositionStart (cognitive 20) rhwp-studio/src/engine/input-handler-text.ts:378— input-handler-text.onCompositionStart has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
main.loadFromUrlParam (cognitive 20) rhwp-studio/src/main.ts:2090— main.loadFromUrlParam has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, error handling 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.
FormulaDialog.onConfirm (cognitive 20) rhwp-studio/src/ui/formula-dialog.ts:179— FormulaDialog.onConfirm has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, error handling 3 (4 pts) (nesting depth added 2). Of this number, 15 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_handlePortMessage (cognitive 20) npm/editor/transport.js:174— _handlePortMessage has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 4 (5 pts), error handling 1 (3 pts), loops 1 (2 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.
MeasuredTable::remaining_content_for_row (cognitive 19) src/renderer/height_measurer.rs:6443— MeasuredTable::remaining_content_for_row has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PrintRasterFrame::rasterize (cognitive 19) src/renderer/print_raster.rs:113— PrintRasterFrame::rasterize has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 4, boolean chains 3 (nesting depth added 6). 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.
TernaryRasterOperator::run (cognitive 19) src/wmf/converter/svg/ternary_raster_operator.rs:543— TernaryRasterOperator::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 3 (5 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.
discriminate.aggregate_rows (cognitive 19) gym/tools/discriminate.py:439— discriminate.aggregate_rows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evidence_report._validate_discrimination (cognitive 19) gym/tools/evidence_report.py:629— evidence_report._validate_discrimination has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fuzz_corpus.main (cognitive 19) gym/tools/fuzz_corpus.py:1749— fuzz_corpus.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, error handling 2, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
leaderboard.validate_fingerprint (cognitive 19) gym/tools/leaderboard.py:674— leaderboard.validate_fingerprint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oracle_probe.render_human (cognitive 19) gym/tools/oracle_probe.py:556— oracle_probe.render_human has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (8 pts), boolean chains 5, ternaries 2 (4 pts), if/else 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.
pack_health.scan_pack (cognitive 19) gym/tools/pack_health.py:1937— pack_health.scan_pack has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2, boolean chains 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
release_diff.observation_from_result (cognitive 19) gym/tools/release_diff.py:512— release_diff.observation_from_result has cognitive complexity 19 (threshold 15). Drivers by points: error handling 6 (9 pts), ternaries 3 (5 pts), if/else 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_NativeEditorViewState.build (cognitive 19) bindings/Flutter/lib/src/native_editor_view.dart:297— _NativeEditorViewState.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, ternaries 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.
background.openViewer (cognitive 19) rhwp-safari/src/background.js:155— background.openViewer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
file-signature.hasHwpmlRoot (cognitive 19) rhwp-shared/security/file-signature.js:83— file-signature.hasHwpmlRoot has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 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.
write-tools.prepareFormatText (cognitive 19) rhwp-studio/src/ai/tools/write-tools.ts:1100— write-tools.prepareFormatText has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 3, boolean chains 1, ternaries 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 1120). 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.
write-tools.prepareFormatCell (cognitive 19) rhwp-studio/src/ai/tools/write-tools.ts:1554— write-tools.prepareFormatCell has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, loops 2 (nesting depth added 2). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1564, 1584). 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.
http.readSse (cognitive 19) rhwp-studio/src/ai/provider/http.ts:25— http.readSse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (3 pts), boolean chains 2, ternaries 2 (nesting depth added 4). Of this number, 10 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
GeminiProvider.streamTurn (cognitive 19) rhwp-studio/src/ai/provider/gemini.ts:303— GeminiProvider.streamTurn has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 321). 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.
gemini.toGeminiSchema (cognitive 19) rhwp-studio/src/ai/provider/gemini.ts:62— gemini.toGeminiSchema has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
file.runPrintPreview (cognitive 19) rhwp-studio/src/command/commands/file.ts:715— file.runPrintPreview has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
diff-engine.buildUniqueSigPairsInSlices (cognitive 19) rhwp-studio/src/compare/diff-engine.ts:1566— diff-engine.buildUniqueSigPairsInSlices has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
diff-engine.matchSegment (cognitive 19) rhwp-studio/src/compare/diff-engine.ts:1897— diff-engine.matchSegment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, loops 1 (2 pts), ternaries 2 (nesting depth added 2). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 1914). 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.
CanvasKitLayerRenderer.preparePageResources (cognitive 19) rhwp-studio/src/view/canvaskit-renderer.ts:945— CanvasKitLayerRenderer.preparePageResources has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.recordImageFailure (cognitive 19) rhwp-studio/src/view/canvaskit-renderer.ts:6100— CanvasKitLayerRenderer.recordImageFailure has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 4 (7 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputHandler.updateSelection (cognitive 19) rhwp-studio/src/engine/input-handler.ts:4139— InputHandler.updateSelection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), error handling 3 (5 pts), boolean chains 3, 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, 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.
numbering-dialog.formatNumber (cognitive 19) rhwp-studio/src/ui/numbering-dialog.ts:95— numbering-dialog.formatNumber has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 6, match/switch 1 (nesting depth added 6). 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.
(anonymous) (cognitive 19) mydocs/pr/assets/pr8187/browser-api.mjs:25— (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), loops 3 (5 pts), error handling 1, ternaries 1 (nesting depth added 3). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 14 function items inside it that branch (label, label::find, check, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
caretToCursor (cognitive 19) npm/hwpctrl-ocx/src/cursor-map.mjs:129— caretToCursor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 5). Of this number, 18 points are the body's own statements and 1 belongs 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.
BuildState::picture (cognitive 18) src/document_core/builders/exam_paper_images.rs:380— BuildState::picture has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, 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.
HftOutlineFonts::register (cognitive 18) src/renderer/hft_outline.rs:195— HftOutlineFonts::register has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SourceWindow::for_image (cognitive 18) src/renderer/image_resolver/print_window.rs:15— SourceWindow::for_image has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HorizontalShapingPageSidecars::attach (cognitive 18) src/renderer/shaping_publication.rs:181— HorizontalShapingPageSidecars::attach has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, 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.
SupplementalMetricStore::replace (cognitive 18) src/renderer/supplemental_metrics.rs:346— SupplementalMetricStore::replace has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 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.
_gen_pack._fn_body (cognitive 18) .claude/skills/rhwp-agent-surface/references/_gen_pack.py:25— _gen_pack._fn_body has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
schema.validate_task (cognitive 18) gym/core/schema.py:554— schema.validate_task has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent_session.validate_trace_event (cognitive 18) gym/tools/agent_session.py:488— agent_session.validate_trace_event has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent_session.classify_sequence (cognitive 18) gym/tools/agent_session.py:714— agent_session.classify_sequence has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, 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.
audit.classify_schema_message (cognitive 18) gym/tools/audit.py:593— audit.classify_schema_message has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, 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.
evidence_report._validate_metadata (cognitive 18) gym/tools/evidence_report.py:294— evidence_report._validate_metadata has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
leaderboard.chain_walk (cognitive 18) gym/tools/leaderboard.py:281— leaderboard.chain_walk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 4 (5 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
leaderboard._cmd_attest_body (cognitive 18) gym/tools/leaderboard.py:413— leaderboard._cmd_attest_body has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
release_diff.compare_packs (cognitive 18) gym/tools/release_diff.py:924— release_diff.compare_packs has cognitive complexity 18 (threshold 15). Drivers by points: error handling 2 (6 pts), loops 3 (6 pts), ternaries 1 (4 pts), if/else 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.
release_gate.render_summary_lines (cognitive 18) gym/tools/release_gate.py:876— release_gate.render_summary_lines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 6, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NativeEditorController._synchronize (cognitive 18) bindings/Flutter/lib/src/native_editor_controller.dart:144— NativeEditorController._synchronize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, ternaries 1 (4 pts), error handling 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.
read-tools.pageTextFromLayout (cognitive 18) rhwp-studio/src/ai/tools/read-tools.ts:90— read-tools.pageTextFromLayout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 8). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
block-calculation-plan.planBlockCalculation (cognitive 18) rhwp-studio/src/command/block-calculation-plan.ts:52— block-calculation-plan.planBlockCalculation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, 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.
print-pages.namespaceSvgIds (cognitive 18) rhwp-studio/src/command/print-pages.ts:98— print-pages.namespaceSvgIds has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 pts), ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
diff-engine.shouldPromoteEmptyTextEdit (cognitive 18) rhwp-studio/src/compare/diff-engine.ts:2146— diff-engine.shouldPromoteEmptyTextEdit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7 (nesting depth added 2). 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, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
chart-data-target.matchesOne (cognitive 18) rhwp-studio/src/core/chart-data-target.ts:374— chart-data-target.matchesOne has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (8 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
font-substitution.resolveFontWithRules (cognitive 18) rhwp-studio/src/core/font-substitution.ts:382— font-substitution.resolveFontWithRules has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
glyph-outline-payload-status.glyphOutlinePayloadStatus (cognitive 18) rhwp-studio/src/view/glyph-outline-payload-status.ts:67— glyph-outline-payload-status.glyphOutlinePayloadStatus has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 5, if/else 3 (4 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.
CanvasKitLayerRenderer.renderTabLeader::draw (cognitive 18) rhwp-studio/src/view/canvaskit-renderer.ts:4077— CanvasKitLayerRenderer.renderTabLeader::draw has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (5 pts), boolean chains 3, match/switch 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.
input-handler-hyperlink.followHyperlinkClick (cognitive 18) rhwp-studio/src/engine/input-handler-hyperlink.ts:65— input-handler-hyperlink.followHyperlinkClick has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, boolean chains 5, ternaries 3 (4 pts), error handling 1 (nesting depth added 1). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 85, 78, 95, …). 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.
InputHandler.updateTextSelectionDragFromPointer (cognitive 18) rhwp-studio/src/engine/input-handler.ts:1645— InputHandler.updateTextSelectionDragFromPointer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 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.
InputHandler.applyToggleFormat (cognitive 18) rhwp-studio/src/engine/input-handler.ts:2302— InputHandler.applyToggleFormat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputHandler.clearSelectedCellBlock (cognitive 18) rhwp-studio/src/engine/input-handler.ts:2546— InputHandler.clearSelectedCellBlock has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 5). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 2555). 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.
InputHandler.emitCursorFormatState (cognitive 18) rhwp-studio/src/engine/input-handler.ts:2789— InputHandler.emitCursorFormatState has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (4 pts), error handling 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputHandler.bodyTableRectsInRange (cognitive 18) rhwp-studio/src/engine/input-handler.ts:4294— InputHandler.bodyTableRectsInRange has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, loops 3 (5 pts), if/else 2 (3 pts), error handling 1 (nesting depth added 3). Of this number, 9 points are the body's own statements and 9 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.
InputHandler.updateFieldMarkers (cognitive 18) rhwp-studio/src/engine/input-handler.ts:5549— InputHandler.updateFieldMarkers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.setupFileInput (cognitive 18) rhwp-studio/src/main.ts:1062— main.setupFileInput has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 4). None of this is in the body itself: all 18 points belong to 2 function literals inside it that branch (lines 1094, 1066). 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.
CellBorderBgDialog.onConfirm (cognitive 18) rhwp-studio/src/ui/cell-border-bg-dialog.ts:1002— CellBorderBgDialog.onConfirm has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 3 (5 pts), loops 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 3 function items inside it that branch (buildTargets, applyDirect, a function literal at line 1081). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CompareResultWindow.formatInspectorText (cognitive 18) rhwp-studio/src/ui/compare-result-window.ts:286— CompareResultWindow.formatInspectorText has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 1 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
Bands::cell_pens (cognitive 17) src/document_core/commands/border_paint_bands.rs:49— Bands::cell_pens has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceGraphemes::new (cognitive 17) src/renderer/emphasis.rs:15— SourceGraphemes::new has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceTailQuery::mirrored_correction (cognitive 17) src/renderer/typeset/table/scan/source_tail/extension.rs:21— SourceTailQuery::mirrored_correction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (2 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenedDocument::export_text (cognitive 17) src/service/query.rs:272— OpenedDocument::export_text has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 3 (5 pts), loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_gen_pack.extract_profiles (cognitive 17) .claude/skills/rhwp-agent-surface/references/_gen_pack.py:137— _gen_pack.extract_profiles has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 4 (6 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.
runner.find_bin (cognitive 17) gym/core/runner.py:415— runner.find_bin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runner.resolve_placeholder (cognitive 17) gym/core/runner.py:522— runner.resolve_placeholder has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent_session.render_score (cognitive 17) gym/tools/agent_session.py:1056— agent_session.render_score has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), loops 3, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
competitive_bench.export_text_verdict (cognitive 17) gym/tools/competitive_bench.py:538— competitive_bench.export_text_verdict has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, ternaries 5 (6 pts), if/else 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.
differential.compare_twins_detailed (cognitive 17) gym/tools/differential.py:760— differential.compare_twins_detailed has cognitive complexity 17 (threshold 15). Drivers by points: error handling 5 (9 pts), if/else 2 (4 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fuzz_corpus.mutant_family (cognitive 17) gym/tools/fuzz_corpus.py:773— fuzz_corpus.mutant_family has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, 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.
release_diff.build_probe_failed_report (cognitive 17) gym/tools/release_diff.py:730— release_diff.build_probe_failed_report has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (6 pts), if/else 2 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
robustness.mutant_family (cognitive 17) gym/tools/robustness.py:611— robustness.mutant_family has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, 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.
NativeOwnerTransport._request (cognitive 17) bindings/Flutter/lib/src/native_ffi.dart:208— NativeOwnerTransport._request has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, ternaries 3 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeTextureController._checkStatus (cognitive 17) bindings/Flutter/lib/src/native_texture_view.dart:667— NativeTextureController._checkStatus has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, ternaries 3 (6 pts), if/else 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PdfImportSession.importPdf (cognitive 17) rhwp-shared/pdf/import-session.js:11— PdfImportSession.importPdf has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, error handling 1 (nesting depth added 2). Of this number, 14 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
write-tools.prepareReplace (cognitive 17) rhwp-studio/src/ai/tools/write-tools.ts:861— write-tools.prepareReplace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, ternaries 1 (nesting depth added 5). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 887, 871). 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.
write-tools.prepareTable (cognitive 17) rhwp-studio/src/ai/tools/write-tools.ts:1215— write-tools.prepareTable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, ternaries 3 (4 pts), boolean chains 3, loops 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1226, 1245, 1260). 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.
write-tools.prepareCellSize (cognitive 17) rhwp-studio/src/ai/tools/write-tools.ts:1714— write-tools.prepareCellSize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 4). 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 literals inside it that branch (lines 1720, 1743). 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.
AiPanel.send (cognitive 17) rhwp-studio/src/ai/ui/ai-panel.ts:501— AiPanel.send has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (6 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.
diff-engine.fillMissingParaAnchorsFromPageLayout (cognitive 17) rhwp-studio/src/compare/diff-engine.ts:831— diff-engine.fillMissingParaAnchorsFromPageLayout has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (4 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
local-fonts.parseSfntNameTable (cognitive 17) rhwp-studio/src/core/local-fonts.ts:350— local-fonts.parseSfntNameTable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 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.
font-substitution.parseCssFontFamilyList (cognitive 17) rhwp-studio/src/core/font-substitution.ts:270— font-substitution.parseCssFontFamilyList has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
virtual-scroll.resolveAutoPageColumns (cognitive 17) rhwp-studio/src/view/virtual-scroll.ts:65— virtual-scroll.resolveAutoPageColumns has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (8 pts), boolean chains 5, if/else 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.
image-effect-pixels.applyLayerImageEffectPixels (cognitive 17) rhwp-studio/src/view/image-effect-pixels.ts:12— image-effect-pixels.applyLayerImageEffectPixels has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasKitLayerRenderer.drawCachedText (cognitive 17) rhwp-studio/src/view/canvaskit-renderer.ts:4565— CanvasKitLayerRenderer.drawCachedText has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PageRenderer.prefetchLayerImages (cognitive 17) rhwp-studio/src/view/page-renderer.ts:1333— PageRenderer.prefetchLayerImages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6, error handling 3 (4 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 2). Of this number, 9 points are the body's own statements and 8 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.
PageRenderScheduler.runVisibleSlice (cognitive 17) rhwp-studio/src/view/page-render-scheduler.ts:256— PageRenderScheduler.runVisibleSlice has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-hyperlink.hyperlinkAtPointer (cognitive 17) rhwp-studio/src/engine/input-handler-hyperlink.ts:11— input-handler-hyperlink.hyperlinkAtPointer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-keyboard.handleHeaderFooterNavigationShortcut (cognitive 17) rhwp-studio/src/engine/input-handler-keyboard.ts:372— input-handler-keyboard.handleHeaderFooterNavigationShortcut has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, 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.
input-handler-picture.finishPictureMoveDrag (cognitive 17) rhwp-studio/src/engine/input-handler-picture.ts:1123— input-handler-picture.finishPictureMoveDrag has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 5, if/else 4 (5 pts), ternaries 1 (4 pts), loops 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputHandler.showTextboxPlacementOverlay (cognitive 17) rhwp-studio/src/engine/input-handler.ts:1228— InputHandler.showTextboxPlacementOverlay has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
EquationPropertiesDialog.handleOk (cognitive 17) rhwp-studio/src/ui/equation-props-dialog.ts:338— EquationPropertiesDialog.handleOk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 3). Of this number, 14 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
classifyDownload (cognitive 17) rhwp-shared/sw/download-interceptor-common.js:96— classifyDownload has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 8. Of this number, 16 points are the body's own statements and 1 belongs 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.
RemapCtx::shape (cognitive 16) src/document_core/commands/foreign_paste.rs:746— RemapCtx::shape has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 1 (2 pts), 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.
LegendLayout::new (cognitive 16) src/ole_chart/legacy_legend_layout.rs:25— LegendLayout::new has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasRenderer::render_layer_node (cognitive 16) src/renderer/canvas.rs:191— CanvasRenderer::render_layer_node has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (8 pts), loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 10). 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.
runner.score_task (cognitive 16) gym/core/runner.py:730— runner.score_task has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), error handling 2 (4 pts), if/else 4, boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evidence_report._validate_audit (cognitive 16) gym/tools/evidence_report.py:398— evidence_report._validate_audit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
evidence_report._validate_authority (cognitive 16) gym/tools/evidence_report.py:475— evidence_report._validate_authority has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
evidence_report._validate_process_sidecars (cognitive 16) gym/tools/evidence_report.py:741— evidence_report._validate_process_sidecars has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorTransport._handleResponse (cognitive 16) npm/editor/transport.js:220— EditorTransport._handleResponse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 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.
openai.toOpenAiInput (cognitive 16) rhwp-studio/src/ai/provider/openai.ts:99— openai.toOpenAiInput has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (7 pts), loops 2 (4 pts), if/else 1 (3 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.
diff-engine.buildAnchorPairs (cognitive 16) rhwp-studio/src/compare/diff-engine.ts:1632— diff-engine.buildAnchorPairs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
diff-engine.textSimilarity (cognitive 16) rhwp-studio/src/compare/diff-engine.ts:1687— diff-engine.textSimilarity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 4, ternaries 4, loops 1 (2 pts) (nesting depth added 3). Of this number, 11 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
chart-data-target.hasAnyEdit (cognitive 16) rhwp-studio/src/core/chart-data-target.ts:292— chart-data-target.hasAnyEdit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
local-fonts.detectLocalFonts (cognitive 16) rhwp-studio/src/core/local-fonts.ts:933— local-fonts.detectLocalFonts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
local-fonts.resolveRendererLocalFont (cognitive 16) rhwp-studio/src/core/local-fonts.ts:1330— local-fonts.resolveRendererLocalFont has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 3 (5 pts), boolean chains 3 (nesting depth added 3). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
NativePuaFontSession.records (cognitive 16) rhwp-studio/src/core/native-pua-font-session.ts:41— NativePuaFontSession.records has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 2 (7 pts) (nesting depth added 9). 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.
sfnt-face.canvasKitSfntGlyphCount (cognitive 16) rhwp-studio/src/view/canvaskit/sfnt-face.ts:8— sfnt-face.canvasKitSfntGlyphCount has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, 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.
static-svg-path-layers.hasStaticSvgUnsupportedMarkup (cognitive 16) rhwp-studio/src/view/static-svg-path-layers.ts:419— static-svg-path-layers.hasStaticSvgUnsupportedMarkup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 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.
CanvasKitLayerRenderer.selectTextVariants (cognitive 16) rhwp-studio/src/view/canvaskit-renderer.ts:1580— CanvasKitLayerRenderer.selectTextVariants has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 4, loops 3 (4 pts), ternaries 1 (nesting depth added 2). Of this number, 11 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, 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.
cursor.findWordAt (cognitive 16) rhwp-studio/src/engine/cursor.ts:2661— cursor.findWordAt has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), boolean chains 5, if/else 3 (nesting depth added 4). 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.
input-handler-connector.findNearestConnectionPoint (cognitive 16) rhwp-studio/src/engine/input-handler-connector.ts:22— input-handler-connector.findNearestConnectionPoint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
office-clipboard-images.inlineOfficeClipboardImages (cognitive 16) rhwp-studio/src/engine/office-clipboard-images.ts:246— office-clipboard-images.inlineOfficeClipboardImages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 4). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
office-clipboard-images.liftImagesToBlockLevel (cognitive 16) rhwp-studio/src/engine/office-clipboard-images.ts:288— office-clipboard-images.liftImagesToBlockLevel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 4). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-keyboard.onCut (cognitive 16) rhwp-studio/src/engine/input-handler-keyboard.ts:1946— input-handler-keyboard.onCut has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
input-handler-picture.relocatePictureToDropPage (cognitive 16) rhwp-studio/src/engine/input-handler-picture.ts:1161— input-handler-picture.relocatePictureToDropPage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, boolean chains 5, error handling 2 (3 pts), ternaries 2 (nesting depth added 1). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, 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.
input-handler-table.resizeTableProportional (cognitive 16) rhwp-studio/src/engine/input-handler-table.ts:900— input-handler-table.resizeTableProportional has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 3, ternaries 3, error handling 1, loops 1 (nesting depth added 2). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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.
TableObjectRenderer.renderMultiPage (cognitive 16) rhwp-studio/src/engine/table-object-renderer.ts:197— TableObjectRenderer.renderMultiPage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputHandler.applyCharFormatToCellBlock (cognitive 16) rhwp-studio/src/engine/input-handler.ts:2251— InputHandler.applyCharFormatToCellBlock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), error handling 1 (nesting depth added 9). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 2259). 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.
InputHandler.findGuideTextRect (cognitive 16) rhwp-studio/src/engine/input-handler.ts:3975— InputHandler.findGuideTextRect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (3 pts), boolean chains 2, error handling 1, ternaries 1 (nesting depth added 4). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (visit). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
main.renderRecentSubmenu (cognitive 16) rhwp-studio/src/main.ts:1836— main.renderRecentSubmenu has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 3). Of this number, 11 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
recent-store.addRecentDoc (cognitive 16) rhwp-studio/src/recent/recent-store.ts:146— recent-store.addRecentDoc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4, error handling 2 (3 pts), ternaries 1 (nesting depth added 5). 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 literals inside it that branch (lines 156, 178). 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.
CellBorderBgDialog.updateDiagonalButtons (cognitive 16) rhwp-studio/src/ui/cell-border-bg-dialog.ts:829— CellBorderBgDialog.updateDiagonalButtons has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CellBorderBgDialog.updateDiagonalPreview (cognitive 16) rhwp-studio/src/ui/cell-border-bg-dialog.ts:854— CellBorderBgDialog.updateDiagonalPreview has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 1. Of this number, 9 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body: 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.
CharShapeDialog.saveLangFields (cognitive 16) rhwp-studio/src/ui/char-shape-dialog.ts:826— CharShapeDialog.saveLangFields has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, 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.
ChartDataDialog.onConfirm (cognitive 16) rhwp-studio/src/ui/chart-data-dialog.ts:391— ChartDataDialog.onConfirm has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 2, boolean chains 1 (nesting depth added 1). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, 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.
CompareResultWindow.renderSidePage (cognitive 16) rhwp-studio/src/ui/compare-result-window.ts:457— CompareResultWindow.renderSidePage has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 5 (6 pts), error handling 2 (nesting depth added 4). Of this number, 10 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContextMenu.show (cognitive 16) rhwp-studio/src/ui/context-menu.ts:30— ContextMenu.show has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, loops 1 (nesting depth added 5). Of this number, 13 points are the body's own statements and 3 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#deleteRange (cognitive 16) npm/hwpctrl-ocx/src/index.mjs:3034— #deleteRange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5, other 5, ternaries 2 (4 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
(anonymous) (cognitive 16) mydocs/pr/assets/issue8174/v2-s04/reproduce/performance.mjs:28— (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 2 (4 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyFunctions: rhwp::serializer::hml::body src/serializer/hml/body.rs:15— TooManyFunctions — 34 free functions. The bar is 30 free functions; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Near-duplicate member family (57 members, 40 shared lines) · ×1
Near-duplicate member family (57 members, 40 shared lines) src/cli/commands/edit/bookmarks.rs:137— src/cli/commands/edit/bookmarks.rs:137-242 | src/cli/commands/edit/cell_paragraphs.rs:10-165 | src/cli/commands/edit/cells.rs:486-653 | src/cli/commands/edit/cells.rs:656-822 | src/cli/commands/edit/controls.rs:9-103 | src/cli/commands/edit/document_objects.rs:11-143 | src/cli/commands/edit/document_objects.rs:145-269 | src/cli/commands/edit/document_text.rs:229-336 | src/cli/commands/edit/document_text.rs:338-472 | src/cli/commands/edit/document_text.rs:474-606 | src/cli/commands/edit/document_text.rs:608-721 | src/cli/commands/edit/document_text.rs:723-831 | src/cli/commands/edit/document_text.rs:833-927 | src/cli/commands/edit/document_text.rs:929-1023 | src/cli/commands/edit/document_text.rs:1025-1118 | src/cli/commands/edit/equations.rs:119-252 | src/cli/commands/edit/equations.rs:254-348 | src/cli/commands/edit/formatting.rs:591-703 | src/cli/commands/edit/formatting.rs:706-855 | src/cli/commands/edit/header_footer_content.rs:8-125 | src/cli/commands/edit/header_footer_content.rs:128-246 | src/cli/commands/edit/header_footer_content.rs:578-730 | src/cli/commands/edit/header_footer_content.rs:733-870 | src/cli/commands/edit/header_footer_content.rs:873-1001 | src/cli/commands/edit/header_footer_content.rs:1004-1158 | src/cli/commands/edit/header_footer_properties.rs:7-137 | src/cli/commands/edit/header_footer_properties.rs:139-274 | src/cli/commands/edit/header_footer_properties.rs:276-389 | src/cli/commands/edit/media.rs:803-897 | src/cli/commands/edit/note_content.rs:8-124 | src/cli/commands/edit/note_content.rs:126-223 | src/cli/commands/edit/note_content.rs:227-344 | src/cli/commands/edit/note_content.rs:346-453 | src/cli/commands/edit/note_content.rs:457-565 | src/cli/commands/edit/notes.rs:9-102 | src/cli/commands/edit/notes.rs:104-197 | src/cli/commands/edit/notes.rs:199-293 | src/cli/commands/edit/page.rs:217-340 | src/cli/commands/edit/page.rs:342-466 | src/cli/commands/edit/shapes.rs:181-275 | src/cli/commands/edit/shapes.rs:455-549 | src/cli/commands/edit/tables/grid.rs:8-114 | src/cli/commands/edit/tables/grid.rs:116-222 | src/cli/commands/edit/tables/grid.rs:224-328 | src/cli/commands/edit/tables/grid.rs:330-471 | src/cli/commands/edit/tables/grid.rs:473-577 | src/cli/commands/edit/tables/grid.rs:579-693 | src/cli/commands/edit/tables/grid.rs:695-853 | src/cli/commands/edit/tables/layout.rs:8-101 | src/cli/commands/edit/tables/layout.rs:103-225 | src/cli/commands/edit/tables/layout.rs:227-347 | src/cli/commands/edit/tables/layout.rs:349-473 | src/cli/commands/edit/tables/layout.rs:588-701 | src/cli/commands/edit/tables/structure.rs:9-119 | src/cli/commands/edit/tables/structure.rs:121-214 | src/cli/commands/edit/tables/structure.rs:216-309 | src/cli/commands/edit/tables/structure.rs:311-427 — These 57 members are variants of one another: a block of 40 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 57 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 57 times.
D4 · Code Duplication· Near-duplicate member family (24 members, 45 shared lines) · ×1
Near-duplicate member family (24 members, 45 shared lines) src/cli/commands/edit/bookmarks.rs:137— src/cli/commands/edit/bookmarks.rs:137-242 | src/cli/commands/edit/controls.rs:9-103 | src/cli/commands/edit/document_objects.rs:271-404 | src/cli/commands/edit/document_objects.rs:406-562 | src/cli/commands/edit/document_text.rs:723-831 | src/cli/commands/edit/document_text.rs:1025-1118 | src/cli/commands/edit/equations.rs:254-348 | src/cli/commands/edit/formatting.rs:10-149 | src/cli/commands/edit/formatting.rs:152-276 | src/cli/commands/edit/formatting.rs:591-703 | src/cli/commands/edit/header_footer_properties.rs:7-137 | src/cli/commands/edit/media.rs:803-897 | src/cli/commands/edit/media.rs:900-1010 | src/cli/commands/edit/note_content.rs:8-124 | src/cli/commands/edit/note_content.rs:227-344 | src/cli/commands/edit/note_content.rs:346-453 | src/cli/commands/edit/note_content.rs:457-565 | src/cli/commands/edit/note_content.rs:569-695 | src/cli/commands/edit/notes.rs:9-102 | src/cli/commands/edit/notes.rs:104-197 | src/cli/commands/edit/notes.rs:199-293 | src/cli/commands/edit/shapes.rs:8-179 | src/cli/commands/edit/shapes.rs:181-275 | src/cli/commands/edit/shapes.rs:455-549 — These 24 members are variants of one another: a block of 45 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 24 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 24 times.
D4 · Code Duplication· Near-duplicate member family (20 members, 45 shared lines) · ×1
Near-duplicate member family (20 members, 45 shared lines) src/cli/commands/edit/bookmarks.rs:9— src/cli/commands/edit/bookmarks.rs:9-135 | src/cli/commands/edit/cell_paragraphs.rs:10-165 | src/cli/commands/edit/cell_paragraphs.rs:168-308 | src/cli/commands/edit/cells.rs:486-653 | src/cli/commands/edit/cells.rs:656-822 | src/cli/commands/edit/document_text.rs:833-927 | src/cli/commands/edit/document_text.rs:929-1023 | src/cli/commands/edit/document_text.rs:1025-1118 | src/cli/commands/edit/header_footer_content.rs:249-404 | src/cli/commands/edit/header_footer_content.rs:407-575 | src/cli/commands/edit/header_footer_content.rs:578-730 | src/cli/commands/edit/header_footer_content.rs:733-870 | src/cli/commands/edit/header_footer_content.rs:873-1001 | src/cli/commands/edit/header_footer_content.rs:1004-1158 | src/cli/commands/edit/header_footer_properties.rs:391-541 | src/cli/commands/edit/note_content.rs:227-344 | src/cli/commands/edit/note_content.rs:346-453 | src/cli/commands/edit/note_content.rs:457-565 | src/cli/commands/edit/notes.rs:9-102 | src/cli/commands/edit/notes.rs:104-197 — These 20 members are variants of one another: a block of 45 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 20 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 20 times.
D4 · Code Duplication· Near-duplicate member family (17 members, 44 shared lines) · ×1
Near-duplicate member family (17 members, 44 shared lines) src/cli/commands/edit/tables/grid.rs:8— src/cli/commands/edit/tables/grid.rs:8-114 | src/cli/commands/edit/tables/grid.rs:116-222 | src/cli/commands/edit/tables/grid.rs:224-328 | src/cli/commands/edit/tables/grid.rs:330-471 | src/cli/commands/edit/tables/grid.rs:473-577 | src/cli/commands/edit/tables/grid.rs:579-693 | src/cli/commands/edit/tables/grid.rs:695-853 | src/cli/commands/edit/tables/layout.rs:8-101 | src/cli/commands/edit/tables/layout.rs:103-225 | src/cli/commands/edit/tables/layout.rs:227-347 | src/cli/commands/edit/tables/layout.rs:349-473 | src/cli/commands/edit/tables/layout.rs:475-586 | src/cli/commands/edit/tables/layout.rs:588-701 | src/cli/commands/edit/tables/structure.rs:9-119 | src/cli/commands/edit/tables/structure.rs:121-214 | src/cli/commands/edit/tables/structure.rs:216-309 | src/cli/commands/edit/tables/structure.rs:311-427 — These 17 members are variants of one another: a block of 44 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 17 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 17 times.
D4 · Code Duplication· Near-duplicate member family (15 members, 45 shared lines) · ×1
Near-duplicate member family (15 members, 45 shared lines) src/cli/commands/edit/cell_paragraphs.rs:10— src/cli/commands/edit/cell_paragraphs.rs:10-165 | src/cli/commands/edit/cell_paragraphs.rs:168-308 | src/cli/commands/edit/cells.rs:486-653 | src/cli/commands/edit/cells.rs:656-822 | src/cli/commands/edit/cells.rs:831-968 | src/cli/commands/edit/formatting.rs:706-855 | src/cli/commands/edit/formatting.rs:858-1019 | src/cli/commands/edit/tables/grid.rs:8-114 | src/cli/commands/edit/tables/grid.rs:116-222 | src/cli/commands/edit/tables/grid.rs:224-328 | src/cli/commands/edit/tables/grid.rs:330-471 | src/cli/commands/edit/tables/grid.rs:473-577 | src/cli/commands/edit/tables/grid.rs:579-693 | src/cli/commands/edit/tables/layout.rs:103-225 | src/cli/commands/edit/tables/layout.rs:349-473 — These 15 members are variants of one another: a block of 45 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 15 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 15 times.
D4 · Code Duplication· Near-duplicate member family (12 members, 45 shared lines) · ×1
Near-duplicate member family (12 members, 45 shared lines) src/cli/commands/edit/document_objects.rs:564— src/cli/commands/edit/document_objects.rs:564-668 | src/cli/commands/edit/note_content.rs:126-223 | src/cli/commands/edit/page.rs:8-109 | src/cli/commands/edit/page.rs:111-215 | src/cli/commands/edit/shapes.rs:277-419 | src/cli/commands/edit/tables/layout.rs:8-101 | src/cli/commands/edit/tables/layout.rs:227-347 | src/cli/commands/edit/tables/layout.rs:475-586 | src/cli/commands/edit/tables/layout.rs:588-701 | src/cli/commands/edit/tables/structure.rs:121-214 | src/cli/commands/edit/tables/structure.rs:216-309 | src/cli/commands/edit/tables/structure.rs:311-427 — These 12 members are variants of one another: a block of 45 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 12 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 12 times.
D4 · Code Duplication· Near-duplicate member family (11 members, 51 shared lines) · ×1
Near-duplicate member family (11 members, 51 shared lines) src/cli/commands/edit/cells.rs:831— src/cli/commands/edit/cells.rs:831-968 | src/cli/commands/edit/tables/grid.rs:8-114 | src/cli/commands/edit/tables/grid.rs:116-222 | src/cli/commands/edit/tables/grid.rs:224-328 | src/cli/commands/edit/tables/grid.rs:330-471 | src/cli/commands/edit/tables/grid.rs:473-577 | src/cli/commands/edit/tables/grid.rs:579-693 | src/cli/commands/edit/tables/grid.rs:695-853 | src/cli/commands/edit/tables/layout.rs:103-225 | src/cli/commands/edit/tables/layout.rs:349-473 | src/cli/commands/edit/tables/structure.rs:9-119 — These 11 members are variants of one another: a block of 51 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 11 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 11 times.
D4 · Code Duplication· Near-duplicate member family (11 members, 46 shared lines) · ×1
Near-duplicate member family (11 members, 46 shared lines) src/cli/commands/edit/header_footer_content.rs:8— src/cli/commands/edit/header_footer_content.rs:8-125 | src/cli/commands/edit/header_footer_content.rs:128-246 | src/cli/commands/edit/header_footer_content.rs:249-404 | src/cli/commands/edit/header_footer_content.rs:407-575 | src/cli/commands/edit/header_footer_content.rs:578-730 | src/cli/commands/edit/header_footer_content.rs:733-870 | src/cli/commands/edit/header_footer_content.rs:873-1001 | src/cli/commands/edit/header_footer_content.rs:1004-1158 | src/cli/commands/edit/header_footer_properties.rs:139-274 | src/cli/commands/edit/header_footer_properties.rs:276-389 | src/cli/commands/edit/header_footer_properties.rs:391-541 — These 11 members are variants of one another: a block of 46 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 11 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 11 times.
D4 · Code Duplication· Near-duplicate member family (10 members, 51 shared lines) · ×1
Near-duplicate member family (10 members, 51 shared lines) src/cli/commands/edit/bookmarks.rs:137— src/cli/commands/edit/bookmarks.rs:137-242 | src/cli/commands/edit/bookmarks.rs:244-372 | src/cli/commands/edit/controls.rs:9-103 | src/cli/commands/edit/document_objects.rs:271-404 | src/cli/commands/edit/equations.rs:254-348 | src/cli/commands/edit/media.rs:803-897 | src/cli/commands/edit/media.rs:900-1010 | src/cli/commands/edit/notes.rs:199-293 | src/cli/commands/edit/shapes.rs:181-275 | src/cli/commands/edit/shapes.rs:455-549 — These 10 members are variants of one another: a block of 51 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 10 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 10 times.
D4 · Code Duplication· Near-duplicate member family (10 members, 44 shared lines) · ×1
Near-duplicate member family (10 members, 44 shared lines) src/cli/commands/edit/document_objects.rs:145— src/cli/commands/edit/document_objects.rs:145-269 | src/cli/commands/edit/document_text.rs:338-472 | src/cli/commands/edit/document_text.rs:474-606 | src/cli/commands/edit/document_text.rs:723-831 | src/cli/commands/edit/document_text.rs:1025-1118 | src/cli/commands/edit/equations.rs:119-252 | src/cli/commands/edit/formatting.rs:10-149 | src/cli/commands/edit/notes.rs:9-102 | src/cli/commands/edit/notes.rs:104-197 | src/cli/commands/edit/shapes.rs:8-179 — These 10 members are variants of one another: a block of 44 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 10 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 10 times.
D4 · Code Duplication· Near-duplicate member family (10 members, 36 shared lines) · ×1
Near-duplicate member family (10 members, 36 shared lines) src/cli/commands/edit/bookmarks.rs:137— src/cli/commands/edit/bookmarks.rs:137-242 | src/cli/commands/edit/controls.rs:9-103 | src/cli/commands/edit/document_objects.rs:271-404 | src/cli/commands/edit/equations.rs:254-348 | src/cli/commands/edit/media.rs:803-897 | src/cli/commands/edit/media.rs:900-1010 | src/cli/commands/edit/notes.rs:199-293 | src/cli/commands/edit/shapes.rs:181-275 | src/cli/commands/edit/shapes.rs:455-549 | src/cli/queries/structured_objects.rs:14-119 — These 10 members are variants of one another: a block of 36 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 10 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 10 times.
D4 · Code Duplication· Near-duplicate member family (10 members, 34 shared lines) · ×1
Near-duplicate member family (10 members, 34 shared lines) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:72— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:72-155 | src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:63-138 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:71-154 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:75-158 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:64-139 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:63-134 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:63-138 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:70-138 | src/bin/rhwp-q/commands/rhwp-q-text-file.rs:75-120 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:64-139 — These 10 members are variants of one another: a block of 34 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 10 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 10 times.
D4 · Code Duplication· Near-duplicate member family (10 members, 17 shared lines) · ×1
Near-duplicate member family (10 members, 17 shared lines) src/bin/rhwp-q/kit/cursor_in_cell.rs:13— src/bin/rhwp-q/kit/cursor_in_cell.rs:13-55 | src/bin/rhwp-q/kit/cursor_in_footnote.rs:14-52 | src/bin/rhwp-q/kit/cursor_in_hf.rs:13-56 | src/bin/rhwp-q/kit/cursor_in_note.rs:13-53 | src/bin/rhwp-q/kit/flow_images.rs:13-40 | src/bin/rhwp-q/kit/footnote_hit.rs:13-45 | src/bin/rhwp-q/kit/footnote_info.rs:13-44 | src/bin/rhwp-q/kit/hit_header.rs:13-45 | src/bin/rhwp-q/kit/note_edit_info.rs:14-46 | src/bin/rhwp-q/kit/overlay_images.rs:13-44 — These 10 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 10 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 10 times.
D4 · Code Duplication· Near-duplicate member family (9 members, 31 shared lines) · ×1
Near-duplicate member family (9 members, 31 shared lines) src/cli/commands/edit/bookmarks.rs:137— src/cli/commands/edit/bookmarks.rs:137-242 | src/cli/commands/edit/controls.rs:9-103 | src/cli/commands/edit/equations.rs:254-348 | src/cli/commands/edit/media.rs:803-897 | src/cli/commands/edit/note_content.rs:227-344 | src/cli/commands/edit/notes.rs:199-293 | src/cli/commands/edit/shapes.rs:181-275 | src/cli/commands/edit/shapes.rs:455-549 | src/cli/queries/structured_objects.rs:14-119 — These 9 members are variants of one another: a block of 31 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication· Near-duplicate member family (8 members, 51 shared lines) · ×1
Near-duplicate member family (8 members, 51 shared lines) src/cli/commands/edit/document_objects.rs:145— src/cli/commands/edit/document_objects.rs:145-269 | src/cli/commands/edit/header_footer_content.rs:249-404 | src/cli/commands/edit/header_footer_content.rs:407-575 | src/cli/commands/edit/header_footer_content.rs:578-730 | src/cli/commands/edit/header_footer_content.rs:733-870 | src/cli/commands/edit/header_footer_content.rs:873-1001 | src/cli/commands/edit/header_footer_content.rs:1004-1158 | src/cli/commands/edit/header_footer_properties.rs:391-541 — These 8 members are variants of one another: a block of 51 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Near-duplicate member family (8 members, 46 shared lines) · ×1
Near-duplicate member family (8 members, 46 shared lines) src/cli/commands/edit/header_footer_content.rs:249— src/cli/commands/edit/header_footer_content.rs:249-404 | src/cli/commands/edit/header_footer_content.rs:407-575 | src/cli/commands/edit/header_footer_content.rs:578-730 | src/cli/commands/edit/header_footer_content.rs:733-870 | src/cli/commands/edit/header_footer_content.rs:873-1001 | src/cli/commands/edit/header_footer_content.rs:1004-1158 | src/cli/commands/edit/header_footer_properties.rs:391-541 | src/cli/commands/edit/page.rs:217-340 — These 8 members are variants of one another: a block of 46 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Near-duplicate member family (8 members, 44 shared lines) · ×1
Near-duplicate member family (8 members, 44 shared lines) src/cli/commands/edit/cells.rs:831— src/cli/commands/edit/cells.rs:831-968 | src/cli/commands/edit/formatting.rs:706-855 | src/cli/commands/edit/formatting.rs:858-1019 | src/cli/commands/edit/tables/grid.rs:224-328 | src/cli/commands/edit/tables/grid.rs:330-471 | src/cli/commands/edit/tables/grid.rs:473-577 | src/cli/commands/edit/tables/grid.rs:579-693 | src/cli/commands/edit/tables/structure.rs:9-119 — These 8 members are variants of one another: a block of 44 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Near-duplicate member family (8 members, 27 shared lines) · ×1
Near-duplicate member family (8 members, 27 shared lines) src/bin/rhwp-q/kit/caret_stops.rs:11— src/bin/rhwp-q/kit/caret_stops.rs:11-90 | src/bin/rhwp-q/kit/char_index.rs:12-113 | src/bin/rhwp-q/kit/chart_csv.rs:25-151 | src/bin/rhwp-q/kit/covering_pages.rs:8-90 | src/bin/rhwp-q/kit/page_border_fill.rs:11-80 | src/bin/rhwp-q/kit/page_text.rs:11-86 | src/bin/rhwp-q/kit/word_end.rs:12-105 | src/bin/rhwp-q/kit/word_starts.rs:11-90 — These 8 members are variants of one another: a block of 27 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Near-duplicate member family (7 members, 22 shared lines) · ×1
Near-duplicate member family (7 members, 22 shared lines) src/bin/rhwp-q/kit/caret_stops.rs:11— src/bin/rhwp-q/kit/caret_stops.rs:11-90 | src/bin/rhwp-q/kit/char_index.rs:12-113 | src/bin/rhwp-q/kit/cur_field_state.rs:11-102 | src/bin/rhwp-q/kit/line_starts.rs:11-92 | src/bin/rhwp-q/kit/para_bounds.rs:11-85 | src/bin/rhwp-q/kit/word_end.rs:12-105 | src/bin/rhwp-q/kit/word_starts.rs:11-90 — These 7 members are variants of one another: a block of 22 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Near-duplicate member family (6 members, 37 shared lines) · ×1
Near-duplicate member family (6 members, 37 shared lines) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:156— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:156-229 | src/diagnostics/hwp5_cell_header_probe.rs:227-295 | src/diagnostics/hwp5_contract_probe.rs:180-247 | src/diagnostics/hwp5_first_para_control_probe.rs:187-279 | src/diagnostics/hwp5_mel_personnel_probe.rs:173-239 | src/diagnostics/hwp5_table_probe.rs:179-242 — These 6 members are variants of one another: a block of 37 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Near-duplicate member family (6 members, 28 shared lines) · ×1
Near-duplicate member family (6 members, 28 shared lines) src/bin/rhwp-q/kit/form_at.rs:11— src/bin/rhwp-q/kit/form_at.rs:11-104 | src/bin/rhwp-q/kit/form_value.rs:12-114 | src/bin/rhwp-q/kit/hf_edit_target.rs:12-101 | src/bin/rhwp-q/kit/hit_fn_marker.rs:12-105 | src/bin/rhwp-q/kit/hit_in_footnote.rs:12-105 | src/bin/rhwp-q/kit/hit_in_hf.rs:12-129 — These 6 members are variants of one another: a block of 28 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Near-duplicate member family (6 members, 24 shared lines) · ×1
Near-duplicate member family (6 members, 24 shared lines) src/diagnostics/hwp5_cell_header_probe.rs:170— src/diagnostics/hwp5_cell_header_probe.rs:170-216 | src/diagnostics/hwp5_contract_analyze.rs:95-142 | src/diagnostics/hwp5_contract_probe.rs:117-169 | src/diagnostics/hwp5_first_para_control_probe.rs:123-173 | src/diagnostics/hwp5_mel_personnel_probe.rs:116-162 | src/diagnostics/hwp5_table_probe.rs:122-168 — These 6 members are variants of one another: a block of 24 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 48 shared lines) · ×1
Near-duplicate member family (5 members, 48 shared lines) src/cli/commands/edit/document_text.rs:229— src/cli/commands/edit/document_text.rs:229-336 | src/cli/commands/edit/document_text.rs:833-927 | src/cli/commands/edit/document_text.rs:929-1023 | src/cli/commands/edit/formatting.rs:152-276 | src/cli/commands/edit/page.rs:342-466 — These 5 members are variants of one another: a block of 48 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 44 shared lines) · ×1
Near-duplicate member family (5 members, 44 shared lines) src/cli/commands/edit/bookmarks.rs:9— src/cli/commands/edit/bookmarks.rs:9-135 | src/cli/commands/edit/bookmarks.rs:137-242 | src/cli/commands/edit/bookmarks.rs:244-372 | src/cli/commands/edit/document_objects.rs:271-404 | src/cli/commands/edit/document_objects.rs:406-562 — These 5 members are variants of one another: a block of 44 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 42 shared lines) · ×1
Near-duplicate member family (5 members, 42 shared lines) src/bin/rhwp-q/kit/cur_field_state.rs:11— src/bin/rhwp-q/kit/cur_field_state.rs:11-102 | src/bin/rhwp-q/kit/field_info_at.rs:11-104 | src/bin/rhwp-q/kit/form_value.rs:12-114 | src/bin/rhwp-q/kit/line_starts.rs:11-92 | src/bin/rhwp-q/kit/para_bounds.rs:11-85 — These 5 members are variants of one another: a block of 42 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 19 shared lines) · ×1
Near-duplicate member family (5 members, 19 shared lines) src/bin/rhwp-q/kit/caret_stops.rs:11— src/bin/rhwp-q/kit/caret_stops.rs:11-90 | src/bin/rhwp-q/kit/covering_pages.rs:8-90 | src/bin/rhwp-q/kit/line_starts.rs:11-92 | src/bin/rhwp-q/kit/para_bounds.rs:11-85 | src/bin/rhwp-q/kit/word_starts.rs:11-90 — These 5 members are variants of one another: a block of 19 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 53 shared lines) · ×1
Near-duplicate member family (4 members, 53 shared lines) src/cli/commands/edit/document_text.rs:1025— src/cli/commands/edit/document_text.rs:1025-1118 | src/cli/commands/edit/notes.rs:9-102 | src/cli/commands/edit/notes.rs:104-197 | src/cli/commands/edit/tables/insert.rs:9-243 — These 4 members are variants of one another: a block of 53 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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· Near-duplicate member family (4 members, 50 shared lines) · ×1
Near-duplicate member family (4 members, 50 shared lines) src/cli/commands/edit/formatting.rs:152— src/cli/commands/edit/formatting.rs:152-276 | src/cli/commands/edit/formatting.rs:858-1019 | src/cli/commands/edit/header_footer_properties.rs:391-541 | src/cli/commands/edit/note_content.rs:569-695 — These 4 members are variants of one another: a block of 50 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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· Near-duplicate member family (4 members, 44 shared lines) · ×1
Near-duplicate member family (4 members, 44 shared lines) src/document_core/commands/text_editing.rs:1398— src/document_core/commands/text_editing.rs:1398-1546 | src/document_core/commands/text_editing.rs:1639-1761 | src/document_core/commands/text_editing.rs:1919-2000 | src/document_core/commands/text_editing.rs:4819-4961 — These 4 members are variants of one another: a block of 44 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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· Near-duplicate member family (4 members, 40 shared lines) · ×1
Near-duplicate member family (4 members, 40 shared lines) src/bin/rhwp-q/kit/char_index.rs:12— src/bin/rhwp-q/kit/char_index.rs:12-113 | src/bin/rhwp-q/kit/cur_field_state.rs:11-102 | src/bin/rhwp-q/kit/field_info_at.rs:11-104 | src/bin/rhwp-q/kit/word_end.rs:12-105 — These 4 members are variants of one another: a block of 40 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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· Near-duplicate member family (4 members, 37 shared lines) · ×1
Near-duplicate member family (4 members, 37 shared lines) src/bin/rhwp-q/kit/fn_selection_rects.rs:11— src/bin/rhwp-q/kit/fn_selection_rects.rs:11-153 | src/bin/rhwp-q/kit/form_at.rs:11-104 | src/bin/rhwp-q/kit/hit_fn_marker.rs:12-105 | src/bin/rhwp-q/kit/hit_in_footnote.rs:12-105 — These 4 members are variants of one another: a block of 37 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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· Near-duplicate member family (4 members, 28 shared lines) · ×1
Near-duplicate member family (4 members, 28 shared lines) src/bin/rhwp-q/kit/bin_data.rs:9— src/bin/rhwp-q/kit/bin_data.rs:9-101 | src/bin/rhwp-q/kit/chart_csv.rs:25-151 | src/bin/rhwp-q/kit/page_border_fill.rs:11-80 | src/bin/rhwp-q/kit/page_text.rs:11-86 — These 4 members are variants of one another: a block of 28 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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· Near-duplicate member family (4 members, 23 shared lines) · ×1
Near-duplicate member family (4 members, 23 shared lines) src/document_core/commands/text_editing.rs:1398— src/document_core/commands/text_editing.rs:1398-1546 | src/document_core/commands/text_editing.rs:1639-1761 | src/document_core/commands/text_editing.rs:1919-2000 | src/document_core/commands/text_editing.rs:4216-4466 — These 4 members are variants of one another: a block of 23 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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· Near-duplicate member family (4 members, 5 shared lines) · ×1
Near-duplicate member family (4 members, 5 shared lines) src/document_core/commands/object_ops/common.rs:36— src/document_core/commands/object_ops/common.rs:36-45 | src/emf/converter/device_stroke.rs:9-18 | src/parser/control/shape.rs:486-648 | src/parser/hwpx/section.rs:4131-4243 — These 4 members are variants of one another: a block of 5 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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.
Near-duplicate member pair (281 shared lines) gym/tools/fuzz_corpus.py:914— gym/tools/fuzz_corpus.py:914-1209 | gym/tools/robustness.py:756-1053 — These two members are variants of one another: 281 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.
Near-duplicate member pair (237 shared lines) src/document_core/commands/text_editing.rs:2210— src/document_core/commands/text_editing.rs:2210-2534 | src/document_core/commands/text_editing.rs:2594-2902 — These two members are variants of one another: 237 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.
Near-duplicate member pair (170 shared lines) src/renderer/layout/shape_layout.rs:4727— src/renderer/layout/shape_layout.rs:4727-5006 | src/renderer/layout/table_cell_content.rs:77-642 — These two members are variants of one another: 170 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.
Near-duplicate member pair (141 shared lines) src/renderer/equation/canvas_render.rs:43— src/renderer/equation/canvas_render.rs:43-455 | src/renderer/equation/svg_render.rs:45-525 — These two members are variants of one another: 141 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.
Near-duplicate member pair (128 shared lines) src/cli/outputs/kitty.rs:15— src/cli/outputs/kitty.rs:15-182 | src/cli/outputs/sixel.rs:15-174 — These two members are variants of one another: 128 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.
Near-duplicate member pair (125 shared lines) src/parser/hwpx/section.rs:3114— src/parser/hwpx/section.rs:3114-3528 | src/parser/hwpx/section.rs:3853-4022 — These two members are variants of one another: 125 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.
Near-duplicate member pair (110 shared lines) src/cli/outputs/tabular.rs:116— src/cli/outputs/tabular.rs:116-293 | src/cli/outputs/tabular.rs:326-536 — These two members are variants of one another: 110 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.
Near-duplicate member pair (95 shared lines) src/parser/pdf/recognition.rs:849— src/parser/pdf/recognition.rs:849-1311 | tools/pdf-ir-poc/src/recognition.rs:572-881 — These two members are variants of one another: 95 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.
Near-duplicate member pair (93 shared lines) src/cli/commands/edit/media.rs:212— src/cli/commands/edit/media.rs:212-515 | src/cli/commands/edit/media.rs:519-800 — These two members are variants of one another: 93 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.
Near-duplicate member pair (90 shared lines) src/bin/rhwp-q/more/probe.rs:77— src/bin/rhwp-q/more/probe.rs:77-185 | src/bin/rhwp-q/pack/probe.rs:77-175 — These two members are variants of one another: 90 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.
Near-duplicate member pair (89 shared lines) src/document_core/commands/object_ops/chart.rs:875— src/document_core/commands/object_ops/chart.rs:875-1019 | src/document_core/commands/object_ops/chart.rs:1032-1172 — These two members are variants of one another: 89 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.
Near-duplicate member pair (68 shared lines) src/document_core/commands/text_editing.rs:6639— src/document_core/commands/text_editing.rs:6639-6743 | src/document_core/commands/text_editing.rs:6751-6862 — These two members are variants of one another: 68 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.
Near-duplicate member pair (65 shared lines) src/parser/mod.rs:430— src/parser/mod.rs:430-637 | src/parser/mod.rs:921-1116 — These two members are variants of one another: 65 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.
Near-duplicate member pair (61 shared lines) src/cli/commands/generation.rs:18— src/cli/commands/generation.rs:18-197 | src/cli/commands/generation.rs:205-341 — These two members are variants of one another: 61 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.
Near-duplicate member pair (60 shared lines) src/parser/pdf/structured_lowering.rs:1399— src/parser/pdf/structured_lowering.rs:1399-1485 | tools/pdf-ir-poc/src/structured_lowering.rs:332-407 — These two members are variants of one another: 60 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.
Near-duplicate member pair (58 shared lines) src/cli/commands/edit/formatting.rs:279— src/cli/commands/edit/formatting.rs:279-558 | src/cli/commands/edit/tables/grid.rs:330-471 — These two members are variants of one another: 58 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.
Near-duplicate member pair (54 shared lines) src/cli/commands/edit/cells.rs:204— src/cli/commands/edit/cells.rs:204-484 | src/cli/commands/edit/cells.rs:486-653 — These two members are variants of one another: 54 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.
Near-duplicate member pair (53 shared lines) src/parser/pdf/table_topology.rs:27— src/parser/pdf/table_topology.rs:27-150 | tools/pdf-ir-poc/src/table_topology.rs:16-114 — These two members are variants of one another: 53 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.
Near-duplicate member pair (45 shared lines) src/document_core/commands/object_ops/common.rs:573— src/document_core/commands/object_ops/common.rs:573-632 | src/document_core/commands/object_ops/equation.rs:523-647 — These two members are variants of one another: 45 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.
Near-duplicate member pair (43 shared lines) src/renderer/layout/shape_layout.rs:5033— src/renderer/layout/shape_layout.rs:5033-5155 | src/renderer/layout/shape_layout.rs:5250-5338 — These two members are variants of one another: 43 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.
Near-duplicate member pair (42 shared lines) src/document_core/queries/cursor_nav.rs:810— src/document_core/queries/cursor_nav.rs:810-898 | src/document_core/queries/cursor_nav.rs:931-1040 — These two members are variants of one another: 42 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.
Near-duplicate member pair (40 shared lines) src/cli/commands/edit/fields.rs:202— src/cli/commands/edit/fields.rs:202-365 | src/mcp_serve.rs:2216-2333 — These two members are variants of one another: 40 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.
Near-duplicate member pair (32 shared lines) src/cli/protocol/exchange/disclosure.rs:4— src/cli/protocol/exchange/disclosure.rs:4-106 | src/cli/protocol/trust/anchor.rs:156-261 — These two members are variants of one another: 32 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.
Near-duplicate member pair (31 shared lines) src/cli/commands/edit/equations.rs:7— src/cli/commands/edit/equations.rs:7-116 | src/cli/commands/edit/media.rs:900-1010 — These two members are variants of one another: 31 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.
Near-duplicate member pair (30 shared lines) src/native_host/gpu_d3d.rs:612— src/native_host/gpu_d3d.rs:612-692 | src/native_host/gpu_metal.rs:404-462 — These two members are variants of one another: 30 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (55 corresponding lines) · ×1
Edited copy of a member (55 corresponding lines) src/parser/hwpx/section.rs:5805— src/parser/hwpx/section.rs:5805-5871 | src/parser/hwpx/section.rs:5877-5937 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (92 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (92 members, 50+ identical tokens) src/bin/rhwp-q/more/inventory.rs:137— src/bin/rhwp-q/more/inventory.rs:137-162 | src/bin/rhwp-q/more/inventory.rs:164-189 | src/bin/rhwp-q/more/inventory.rs:191-216 | src/bin/rhwp-q/more/inventory.rs:218-243 | src/bin/rhwp-q/more/inventory.rs:245-270 | src/bin/rhwp-q/more/inventory.rs:272-297 | src/bin/rhwp-q/more/inventory.rs:299-324 | src/bin/rhwp-q/more/inventory.rs:326-351 | src/bin/rhwp-q/more/inventory.rs:353-378 | src/bin/rhwp-q/more/inventory.rs:380-405 | src/bin/rhwp-q/more/inventory.rs:407-432 | src/bin/rhwp-q/more/inventory.rs:434-459 | src/bin/rhwp-q/more/inventory.rs:461-486 | src/bin/rhwp-q/more/inventory.rs:488-513 | src/bin/rhwp-q/more/inventory.rs:515-540 | src/bin/rhwp-q/more/inventory.rs:542-567 | src/bin/rhwp-q/more/inventory.rs:569-594 | src/bin/rhwp-q/more/inventory.rs:596-621 | src/bin/rhwp-q/more/inventory.rs:623-648 | src/bin/rhwp-q/more/inventory.rs:650-675 | src/bin/rhwp-q/more/inventory.rs:677-700 | src/bin/rhwp-q/more/inventory.rs:702-727 | src/bin/rhwp-q/more/inventory.rs:729-752 | src/bin/rhwp-q/more/inventory.rs:754-777 | src/bin/rhwp-q/more/inventory.rs:779-802 | src/bin/rhwp-q/more/inventory.rs:804-827 | src/bin/rhwp-q/more/inventory.rs:829-852 | src/bin/rhwp-q/more/inventory.rs:854-877 | src/bin/rhwp-q/more/inventory.rs:879-902 | src/bin/rhwp-q/more/inventory.rs:904-929 | src/bin/rhwp-q/more/inventory.rs:931-956 | src/bin/rhwp-q/more/inventory.rs:958-983 | src/bin/rhwp-q/more/inventory.rs:985-1010 | src/bin/rhwp-q/more/inventory.rs:1012-1037 | src/bin/rhwp-q/more/inventory.rs:1039-1064 | src/bin/rhwp-q/more/inventory.rs:1101-1126 | src/bin/rhwp-q/more/inventory.rs:1128-1153 | src/bin/rhwp-q/more/inventory.rs:1155-1180 | src/bin/rhwp-q/more/inventory.rs:1182-1207 | src/bin/rhwp-q/more/inventory.rs:1209-1234 | src/bin/rhwp-q/more/inventory.rs:1236-1261 | src/bin/rhwp-q/more/inventory.rs:1263-1288 | src/bin/rhwp-q/more/inventory.rs:1290-1315 | src/bin/rhwp-q/pack/inventory.rs:82-107 | src/bin/rhwp-q/pack/inventory.rs:109-132 | src/bin/rhwp-q/pack/inventory.rs:134-157 | src/bin/rhwp-q/pack/inventory.rs:159-182 | src/bin/rhwp-q/pack/inventory.rs:184-207 | src/bin/rhwp-q/pack/inventory.rs:209-232 | src/bin/rhwp-q/pack/inventory.rs:234-257 | src/bin/rhwp-q/pack/inventory.rs:259-282 | src/bin/rhwp-q/pack/inventory.rs:284-307 | src/bin/rhwp-q/pack/inventory.rs:309-332 | src/bin/rhwp-q/pack/inventory.rs:334-357 | src/bin/rhwp-q/pack/inventory.rs:359-382 | src/bin/rhwp-q/pack/inventory.rs:384-413 | src/bin/rhwp-q/pack/inventory.rs:415-438 | src/bin/rhwp-q/pack/inventory.rs:440-463 | src/bin/rhwp-q/pack/inventory.rs:465-477 | src/bin/rhwp-q/pack/inventory.rs:479-491 | src/bin/rhwp-q/pack/inventory.rs:493-518 | src/bin/rhwp-q/pack/inventory.rs:520-545 | src/bin/rhwp-q/pack/inventory.rs:547-572 | src/bin/rhwp-q/pack/inventory.rs:574-597 | src/bin/rhwp-q/pack/inventory.rs:599-624 | src/bin/rhwp-q/pack/inventory.rs:626-651 | src/bin/rhwp-q/pack/inventory.rs:653-676 | src/bin/rhwp-q/pack/inventory.rs:678-701 | src/bin/rhwp-q/pack/inventory.rs:703-726 | src/bin/rhwp-q/pack/inventory.rs:728-753 | src/bin/rhwp-q/pack/inventory.rs:755-780 | src/bin/rhwp-q/pack/inventory.rs:782-805 | src/bin/rhwp-q/pack/inventory.rs:807-830 | src/bin/rhwp-q/pack/inventory.rs:832-855 | src/bin/rhwp-q/pack/inventory.rs:857-880 | src/bin/rhwp-q/pack/inventory.rs:882-905 | src/bin/rhwp-q/pack/inventory.rs:907-932 | src/bin/rhwp-q/pack/inventory.rs:934-959 | src/bin/rhwp-q/pack/inventory.rs:961-986 | src/bin/rhwp-q/pack/inventory.rs:988-1013 | src/bin/rhwp-q/pack/inventory.rs:1015-1038 | src/bin/rhwp-q/pack/inventory.rs:1040-1063 | src/bin/rhwp-q/pack/inventory.rs:1065-1090 | src/bin/rhwp-q/pack/inventory.rs:1092-1115 | src/bin/rhwp-q/pack/inventory.rs:1117-1142 | src/bin/rhwp-q/pack/inventory.rs:1166-1189 | src/bin/rhwp-q/pack/inventory.rs:1191-1214 | src/bin/rhwp-q/pack/inventory.rs:1216-1241 | src/bin/rhwp-q/pack/inventory.rs:1243-1266 | src/bin/rhwp-q/pack/inventory.rs:1268-1293 | src/bin/rhwp-q/pack/inventory.rs:1295-1320 | src/bin/rhwp-q/pack/inventory.rs:1322-1345 — These 92 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 92 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 92 times.
D4 · Code Duplication· Members sharing a duplicated core (17 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (17 members, 50+ identical tokens) src/bin/rhwp-agent/envelope.rs:44— src/bin/rhwp-agent/envelope.rs:44-57 | src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:312-324 | src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:254-266 | src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:27-39 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:285-297 | src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:33-45 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:307-319 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:202-214 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:27-39 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:250-262 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:238-250 | src/bin/rhwp-q/commands/rhwp-q-page-items.rs:29-41 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:293-305 | src/bin/rhwp-q/commands/rhwp-q-scan-items.rs:28-40 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:27-39 | src/bin/rhwp-q/commands/rhwp-q-text-file.rs:204-216 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:243-255 — These 17 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 17 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 17 times.
D4 · Code Duplication· Edited copy of a member (68 corresponding lines) · ×1
Edited copy of a member (68 corresponding lines) src/bin/rhwp-q/more/main.rs:41— src/bin/rhwp-q/more/main.rs:41-108 | src/bin/rhwp-q/pack/main.rs:41-108 — These two members are one piece of code written twice and then edited apart: 68 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (97 corresponding lines) · ×1
Edited copy of a member (97 corresponding lines) src/parser/pdf/table_detection.rs:644— src/parser/pdf/table_detection.rs:644-740 | tools/pdf-ir-poc/src/table_detection.rs:332-440 — These two members are one piece of code written twice and then edited apart: 97 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (63 corresponding lines) · ×1
Edited copy of a member (63 corresponding lines) src/renderer/skia/text_replay/decorations.rs:32— src/renderer/skia/text_replay/decorations.rs:32-97 | src/renderer/skia/text_replay/lines.rs:85-147 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (83 corresponding lines) · ×1
Edited copy of a member (83 corresponding lines) src/document_core/commands/text_editing.rs:5677— src/document_core/commands/text_editing.rs:5677-5762 | src/document_core/commands/text_editing.rs:5770-5852 — These two members are one piece of code written twice and then edited apart: 83 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (119 corresponding lines) · ×1
Edited copy of a member (119 corresponding lines) src/model/table.rs:1713— src/model/table.rs:1713-1840 | src/model/table.rs:1854-1972 — These two members are one piece of code written twice and then edited apart: 119 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (96 corresponding lines) · ×1
Edited copy of a member (96 corresponding lines) src/document_core/queries/doc_tree_nav.rs:1343— src/document_core/queries/doc_tree_nav.rs:1343-1439 | src/renderer/layout/shape_layout.rs:808-903 — These two members are one piece of code written twice and then edited apart: 96 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (56 corresponding lines) · ×1
Edited copy of a member (56 corresponding lines) src/renderer/svg.rs:4526— src/renderer/svg.rs:4526-4581 | src/renderer/web_canvas.rs:314-369 — 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 (48 corresponding lines) · ×1
Edited copy of a member (48 corresponding lines) mydocs/tech/investigations/issue-4969/probes/scratch_r6_hwp5_slice.rs:5— mydocs/tech/investigations/issue-4969/probes/scratch_r6_hwp5_slice.rs:5-52 | mydocs/tech/investigations/issue-4969/probes/scratch_r6_hwpx_slice.rs:6-53 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (52 corresponding lines) · ×1
Edited copy of a member (52 corresponding lines) src/parser/pdf/table_detection.rs:446— src/parser/pdf/table_detection.rs:446-501 | tools/pdf-ir-poc/src/table_detection.rs:224-275 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (77 corresponding lines) · ×1
Edited copy of a member (77 corresponding lines) src/bin/rhwp-agent/inspect.rs:141— src/bin/rhwp-agent/inspect.rs:141-236 | src/bin/rhwp-agent/locate.rs:209-285 — These two members are one piece of code written twice and then edited apart: 77 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (66 corresponding lines) · ×1
Edited copy of a member (66 corresponding lines) src/renderer/float_placement.rs:5302— src/renderer/float_placement.rs:5302-5368 | src/renderer/float_placement.rs:5381-5446 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (65 corresponding lines) · ×1
Edited copy of a member (65 corresponding lines) src/document_core/queries/memo_query.rs:1388— src/document_core/queries/memo_query.rs:1388-1473 | src/document_core/queries/memo_query.rs:1476-1540 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (87 corresponding lines) · ×1
Edited copy of a member (87 corresponding lines) src/document_core/commands/formatting.rs:2331— src/document_core/commands/formatting.rs:2331-2417 | src/document_core/commands/formatting.rs:2428-2545 — These two members are one piece of code written twice and then edited apart: 87 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 73+ corresponding lines) · ×1
Edited copies of one member (4 members, 73+ corresponding lines) src/wmf/parser/records/bitmap/bit_blt.rs:114— src/wmf/parser/records/bitmap/bit_blt.rs:114-186 | src/wmf/parser/records/bitmap/dib_bit_blt.rs:118-193 | src/wmf/parser/records/bitmap/dib_stretch_blt.rs:135-222 | src/wmf/parser/records/bitmap/stretch_blt.rs:132-214 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 73 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (76 corresponding lines) · ×1
Edited copy of a member (76 corresponding lines) src/bin/rhwp-agent/safety.rs:115— src/bin/rhwp-agent/safety.rs:115-208 | src/bin/rhwp-agent/structurecmd.rs:9-84 — These two members are one piece of code written twice and then edited apart: 76 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) src/document_core/commands/header_footer_ops.rs:401— src/document_core/commands/header_footer_ops.rs:401-467 | src/document_core/commands/header_footer_ops.rs:476-534 — 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 copies of one member (3 members, 47+ corresponding lines) · ×1
Edited copies of one member (3 members, 47+ corresponding lines) src/renderer/height_measurer.rs:611— src/renderer/height_measurer.rs:611-657 | src/renderer/layout/paragraph_layout.rs:925-982 | src/renderer/typeset.rs:117-184 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 47 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, 54+ corresponding lines) · ×1
Edited copies of one member (3 members, 54+ corresponding lines) src/diagnostics/hwp5_anchor_trace.rs:74— src/diagnostics/hwp5_anchor_trace.rs:74-136 | src/diagnostics/hwp5_ctrl_data_trace.rs:51-110 | src/diagnostics/hwp5_inventory.rs:139-192 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 54 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (53 corresponding lines) · ×1
Edited copy of a member (53 corresponding lines) src/document_core/commands/text_editing.rs:6458— src/document_core/commands/text_editing.rs:6458-6516 | src/document_core/commands/text_editing.rs:6526-6578 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (73 corresponding lines) · ×1
Edited copy of a member (73 corresponding lines) gym/tools/fuzz_corpus.py:774— gym/tools/fuzz_corpus.py:774-851 | gym/tools/robustness.py:612-684 — These two members are one piece of code written twice and then edited apart: 73 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (44 corresponding lines) · ×1
Edited copy of a member (44 corresponding lines) src/serializer/hwpx/field.rs:148— src/serializer/hwpx/field.rs:148-191 | src/serializer/hwpx/section.rs:3699-3745 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 38+ corresponding lines) · ×1
Edited copies of one member (3 members, 38+ corresponding lines) src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:177— src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:177-216 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:194-236 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:178-215 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 38 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, 37+ corresponding lines) · ×1
Edited copies of one member (5 members, 37+ corresponding lines) src/bin/rhwp-agent/inspect.rs:327— src/bin/rhwp-agent/inspect.rs:327-363 | src/bin/rhwp-agent/locate.rs:42-78 | src/bin/rhwp-agent/locate.rs:80-116 | src/bin/rhwp-agent/locate.rs:171-207 | src/bin/rhwp-agent/locate.rs:287-323 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 37 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, 34+ corresponding lines) · ×1
Edited copies of one member (4 members, 34+ corresponding lines) src/bin/rhwp-agent/inspect.rs:106— src/bin/rhwp-agent/inspect.rs:106-139 | src/bin/rhwp-agent/inspect.rs:238-273 | src/bin/rhwp-agent/inspect.rs:365-407 | src/bin/rhwp-agent/lookups.rs:176-222 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 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) src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:48— src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:48-84 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:48-84 — 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 copies of one member (4 members, 26+ corresponding lines) · ×1
Edited copies of one member (4 members, 26+ corresponding lines) src/document_core/queries/grep.rs:144— src/document_core/queries/grep.rs:144-169 | src/document_core/queries/hidden_text.rs:496-524 | src/document_core/queries/hidden_text.rs:529-554 | src/document_core/queries/injection_scan.rs:1214-1240 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 29+ corresponding lines) · ×1
Edited copies of one member (3 members, 29+ corresponding lines) src/bin/rhwp-agent/fields.rs:6— src/bin/rhwp-agent/fields.rs:6-38 | src/bin/rhwp-agent/harvest.rs:99-140 | src/bin/rhwp-agent/lookups.rs:224-252 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×1
Edited copies of one member (3 members, 20+ corresponding lines) mydocs/tech/investigations/issue-1058/probes/dump_footnote_inner.rs:72— mydocs/tech/investigations/issue-1058/probes/dump_footnote_inner.rs:72-91 | mydocs/tech/investigations/issue-1061/probes/dump_equation_records.rs:167-187 | mydocs/tech/investigations/issue-1067/probes/dump_polygon_transform.rs:83-102 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 25+ corresponding lines) · ×1
Edited copies of one member (8 members, 25+ corresponding lines) src/wmf/parser/records/drawing/ellipse.rs:47— src/wmf/parser/records/drawing/ellipse.rs:47-77 | src/wmf/parser/records/drawing/ext_flood_fill.rs:42-66 | src/wmf/parser/records/drawing/frame_region.rs:41-70 | src/wmf/parser/records/drawing/rectangle.rs:46-76 | src/wmf/parser/records/state/exclude_clip_rect.rs:43-67 | src/wmf/parser/records/state/intersect_clip_rect.rs:43-67 | src/wmf/parser/records/state/scale_viewport_ext.rs:44-73 | src/wmf/parser/records/state/scale_window_ext.rs:44-73 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 25 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, 14+ corresponding lines) · ×1
Edited copies of one member (4 members, 14+ corresponding lines) src/parser/pdf/allocation.rs:264— src/parser/pdf/allocation.rs:264-277 | src/parser/pdf/allocation.rs:540-554 | src/parser/pdf/allocation.rs:796-809 | src/parser/pdf/allocation.rs:876-891 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 19+ corresponding lines) · ×1
Edited copies of one member (4 members, 19+ corresponding lines) src/bin/rhwp-agent/stats.rs:110— src/bin/rhwp-agent/stats.rs:110-128 | src/bin/rhwp-agent/stats.rs:130-153 | src/bin/rhwp-agent/stats.rs:188-212 | src/bin/rhwp-agent/stats.rs:214-238 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 26+ corresponding lines) · ×1
Edited copies of one member (3 members, 26+ corresponding lines) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:250— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:250-276 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:225-257 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:232-257 — 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 copies of one member (5 members, 14+ corresponding lines) · ×1
Edited copies of one member (5 members, 14+ corresponding lines) src/wasm_api.rs:7366— src/wasm_api.rs:7366-7382 | src/wasm_api.rs:7421-7435 | src/wasm_api.rs:7537-7552 | src/wasm_api.rs:9486-9499 | src/wasm_api.rs:9702-9715 — 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 (4 members, 33+ corresponding lines) · ×1
Edited copies of one member (4 members, 33+ corresponding lines) gym/tools/differential.py:191— gym/tools/differential.py:191-224 | gym/tools/release_diff.py:189-221 | gym/tools/release_gate.py:230-267 | gym/tools/trajectory.py:332-367 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 33 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, 17+ corresponding lines) · ×1
Edited copies of one member (3 members, 17+ corresponding lines) src/serializer/hwpx/char_shapes.rs:82— src/serializer/hwpx/char_shapes.rs:82-98 | src/serializer/hwpx/header.rs:692-711 | src/serializer/hwpx/shape.rs:1683-1699 — 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) src/doclang/writer/escape.rs:49— src/doclang/writer/escape.rs:49-67 | src/ole_chart/svg_renderer.rs:408-427 | src/renderer/equation/svg_render.rs:769-788 | src/renderer/pdf.rs:1810-1829 | src/renderer/svg.rs:4410-4429 — 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 (7 members, 12+ corresponding lines) · ×1
Edited copies of one member (7 members, 12+ corresponding lines) src/wasm_api.rs:2021— src/wasm_api.rs:2021-2033 | src/wasm_api.rs:2066-2078 | src/wasm_api.rs:3319-3331 | src/wasm_api.rs:6353-6364 | src/wasm_api.rs:6421-6438 | src/wasm_api.rs:6484-6495 | src/wasm_api.rs:9888-9900 — These 7 members are one piece of code written 7 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 7 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) src/wmf/parser/objects/structure/color_ref.rs:25— src/wmf/parser/objects/structure/color_ref.rs:25-57 | src/wmf/parser/objects/structure/rect.rs:27-44 | src/wmf/parser/objects/structure/rect_l.rs:29-46 | src/wmf/parser/objects/structure/rgb_quad.rs:28-56 — 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, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) gym/core/checks.py:203— gym/core/checks.py:203-212 | gym/core/checks.py:382-392 | gym/core/checks.py:444-454 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×1
Edited copies of one member (3 members, 16+ corresponding lines) src/paint/text_variants.rs:523— src/paint/text_variants.rs:523-541 | src/paint/text_variants.rs:547-562 | src/paint/text_variants.rs:679-700 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 16+ corresponding lines) · ×1
Edited copies of one member (6 members, 16+ corresponding lines) src/serializer/hwpx/header.rs:396— src/serializer/hwpx/header.rs:396-413 | src/serializer/hwpx/header.rs:724-740 | src/serializer/hwpx/header.rs:778-793 | src/serializer/hwpx/header.rs:937-952 | src/serializer/hwpx/header.rs:1044-1059 | src/serializer/hwpx/header.rs:1579-1595 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 1+ corresponding lines) · ×1
Edited copies of one member (6 members, 1+ corresponding lines) src/renderer/pagination.rs:159— src/renderer/pagination.rs:159-159 | src/renderer/pagination.rs:1114-1114 | src/renderer/pagination.rs:1139-1139 | src/renderer/style_resolver/resolved.rs:709-709 | src/renderer/typeset.rs:224-224 | src/renderer/typeset.rs:345-345 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 1 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, 17+ corresponding lines) · ×1
Edited copies of one member (8 members, 17+ corresponding lines) src/wmf/parser/records/drawing/invert_region.rs:32— src/wmf/parser/records/drawing/invert_region.rs:32-48 | src/wmf/parser/records/drawing/paint_region.rs:32-48 | src/wmf/parser/records/object/delete_object.rs:35-51 | src/wmf/parser/records/object/select_clip_region.rs:32-48 | src/wmf/parser/records/object/select_object.rs:38-54 | src/wmf/parser/records/object/select_palette.rs:32-48 | src/wmf/parser/records/state/resize_palette.rs:32-49 | src/wmf/parser/records/state/set_text_char_extra.rs:37-53 — These 8 members are one piece of code written 8 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 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 13+ corresponding lines) · ×1
Edited copies of one member (8 members, 13+ corresponding lines) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:52— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:52-70 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:52-69 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:52-73 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:50-62 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:49-61 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:49-61 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:51-68 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:50-62 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 3+ corresponding lines) · ×1
Edited copies of one member (5 members, 3+ corresponding lines) .claude/skills/rhwp-exam-ingest/references/_gen_pack.py:37— .claude/skills/rhwp-exam-ingest/references/_gen_pack.py:37-39 | .claude/skills/rhwp-form-fill/references/_gen_pack.py:414-416 | .claude/skills/rhwp-knowledge-map/references/_gen_pack.py:295-297 | tools/inspect_msec/gen_msec_fixtures.py:571-573 | tools/layout_anomaly/gen_m02f_fixtures.py:426-428 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 1+ corresponding lines) · ×1
Edited copies of one member (5 members, 1+ corresponding lines) src/renderer/char_overlap.rs:32— src/renderer/char_overlap.rs:32-32 | src/renderer/height_measurer.rs:1816-1816 | src/renderer/layout_frame.rs:86-86 | src/renderer/pagination.rs:315-315 | src/renderer/typeset.rs:208-208 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 1 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 (8 members, 4+ corresponding lines) · ×1
Edited copies of one member (8 members, 4+ corresponding lines) .agents/skills/bug-hunter/references/_gen_pack.py:1145— .agents/skills/bug-hunter/references/_gen_pack.py:1145-1148 | .claude/skills/rhwp-bulk-pipeline/references/_gen_pack.py:235-238 | .claude/skills/rhwp-cli/references/_gen_pack.py:493-496 | .claude/skills/rhwp-codex/tools/gen_skill_pack.py:24-27 | .claude/skills/rhwp-explore/references/_gen_pack.py:1350-1353 | .claude/skills/rhwp-fde/references/_gen_pack.py:228-231 | .claude/skills/rhwp-visual-regression/references/_gen_pack.py:424-427 | tools/proptest_roundtrip/gen_m04f_catalogs.py:304-307 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
Duplicated block (120 lines × 2) src/renderer/height_measurer.rs:4025— src/renderer/height_measurer.rs:4025-4144 | src/renderer/height_measurer.rs:5041-5160 — both copies are in the same file, so extract the 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 `src/renderer/height_measurer.rs:4025` 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 (165–176 lines × 2) src/document_core/commands/formatting.rs:434— src/document_core/commands/formatting.rs:434-609 | src/document_core/commands/formatting.rs:619-783 — both copies are in the same file, so extract the 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 `src/document_core/commands/formatting.rs:434` 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 (82–83 lines × 2) src/document_core/commands/text_editing.rs:2386— src/document_core/commands/text_editing.rs:2386-2468 | src/document_core/commands/text_editing.rs:2755-2836 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:2386` 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 (69–79 lines × 2) src/renderer/layout/table_layout.rs:1127— src/renderer/layout/table_layout.rs:1127-1195 | src/renderer/layout/table_layout.rs:1450-1528 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:1127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/renderer/layout/table_layout.rs:1195` calls `Some`, `has_fragment_border_line`, `push_fragment_border_line` and `src/renderer/layout/table_layout.rs:1528` 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 (67–75 lines × 2) src/cli/commands/edit/media.rs:232— src/cli/commands/edit/media.rs:232-306 | src/cli/commands/edit/media.rs:646-712 — both copies are in the same file, so extract the 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 (74 lines × 2) src/cli/outputs/kitty.rs:19— src/cli/outputs/kitty.rs:19-92 | src/cli/outputs/sixel.rs:19-92 — before extracting anything, compare `src/cli/outputs/kitty.rs` and `src/cli/outputs/sixel.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 128 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 `src/cli/outputs/kitty.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.
Duplicated block (67–70 lines × 2) src/document_core/queries/field_query.rs:937— src/document_core/queries/field_query.rs:937-1006 | src/document_core/queries/field_query.rs:1124-1190 — both copies are in the same file, so extract the 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 `src/document_core/queries/field_query.rs:937` 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 (56–65 lines × 3) src/renderer/height_measurer.rs:4140— src/renderer/height_measurer.rs:4140-4204 | src/renderer/height_measurer.rs:5156-5220 | src/renderer/height_measurer.rs:5852-5907 — 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 (59 lines × 2) src/parser/pdf/recognition.rs:1014— src/parser/pdf/recognition.rs:1014-1072 | tools/pdf-ir-poc/src/recognition.rs:717-775 — before extracting anything, compare `src/parser/pdf/recognition.rs` and `tools/pdf-ir-poc/src/recognition.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/recognition.rs:1014` 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 (56–57 lines × 2) src/renderer/height_measurer.rs:2093— src/renderer/height_measurer.rs:2093-2149 | src/renderer/layout/table_layout.rs:3475-3530 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 300 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/height_measurer.rs:2093` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (52–56 lines × 2) src/parser/hwpx/section.rs:5810— src/parser/hwpx/section.rs:5810-5865 | src/parser/hwpx/section.rs:5880-5931 — both copies are in the same file, so extract the 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 (51–55 lines × 2) src/parser/hwpx/section.rs:3318— src/parser/hwpx/section.rs:3318-3372 | src/parser/hwpx/section.rs:3929-3979 — both copies are in the same file, so extract the 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 `src/parser/hwpx/section.rs:3318` 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 (54–55 lines × 2) src/parser/mod.rs:832— src/parser/mod.rs:832-886 | src/parser/mod.rs:972-1025 — both copies are in the same file, so extract the 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 `src/parser/mod.rs:832` 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–52 lines × 2) src/renderer/composer/line_breaking.rs:191— src/renderer/composer/line_breaking.rs:191-242 | src/renderer/layout/text_measurement.rs:3195-3213 — 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 (76 lines × 2) src/document_core/queries/cursor_rect.rs:1681— src/document_core/queries/cursor_rect.rs:1681-1756 | src/document_core/queries/cursor_rect.rs:3912-3987 — both copies are in the same file, so extract the 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 (48 lines × 2) src/bin/rhwp-q/more/probe.rs:89— src/bin/rhwp-q/more/probe.rs:89-136 | src/bin/rhwp-q/pack/probe.rs:89-136 — `src/bin/rhwp-q/more/probe.rs` and `src/bin/rhwp-q/pack/probe.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 113 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/probe.rs: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.
Duplicated block (46–48 lines × 2) src/renderer/layout/shape_layout.rs:4833— src/renderer/layout/shape_layout.rs:4833-4878 | src/renderer/layout/table_cell_content.rs:215-262 — before extracting anything, compare `src/renderer/layout/shape_layout.rs` and `src/renderer/layout/table_cell_content.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 185 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 `src/renderer/layout/shape_layout.rs:4833` 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 (42–47 lines × 2) src/renderer/layout/table_layout.rs:16852— src/renderer/layout/table_layout.rs:16852-16898 | src/renderer/layout/table_layout.rs:16942-16983 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:16942` 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 (44–46 lines × 2) src/document_core/queries/doc_tree_nav.rs:1356— src/document_core/queries/doc_tree_nav.rs:1356-1399 | src/renderer/layout/shape_layout.rs:825-870 — before extracting anything, compare `src/document_core/queries/doc_tree_nav.rs` and `src/renderer/layout/shape_layout.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/queries/doc_tree_nav.rs:1356` 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 (42–43 lines × 2) src/document_core/commands/clipboard.rs:1051— src/document_core/commands/clipboard.rs:1051-1092 | src/document_core/commands/html_import.rs:524-566 — before extracting anything, compare `src/document_core/commands/clipboard.rs` and `src/document_core/commands/html_import.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 191 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. 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 (39–43 lines × 2) src/renderer/layout/paragraph_layout.rs:5510— src/renderer/layout/paragraph_layout.rs:5510-5548 | src/renderer/layout/paragraph_layout.rs:10258-10300 — both copies are in the same file, so extract the 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 `src/renderer/layout/paragraph_layout.rs:5510` 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 (40 lines × 4) src/bin/rhwp-q/kit/form_at.rs:27— src/bin/rhwp-q/kit/form_at.rs:27-66 | src/bin/rhwp-q/kit/hit_fn_marker.rs:28-67 | src/bin/rhwp-q/kit/hit_in_footnote.rs:28-67 | src/bin/rhwp-q/kit/hit_in_hf.rs:45-84 — before extracting anything, compare `src/bin/rhwp-q/kit/form_at.rs` and `src/bin/rhwp-q/kit/hit_fn_marker.rs` as WHOLE FILES: this scan already matched 11 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 `src/bin/rhwp-q/kit/form_at.rs:27` 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 (32–40 lines × 2) src/parser/hwpx/section.rs:3227— src/parser/hwpx/section.rs:3227-3266 | src/parser/hwpx/section.rs:3855-3886 — both copies are in the same file, so extract the 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 `src/parser/hwpx/section.rs:3227` 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 (40 lines × 2) src/renderer/layout/shape_layout.rs:3532— src/renderer/layout/shape_layout.rs:3532-3571 | src/renderer/layout/shape_layout.rs:3865-3904 — both copies are in the same file, so extract the 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 `src/renderer/layout/shape_layout.rs:3532` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/renderer/layout/shape_layout.rs:3858` calls `push` and `src/renderer/layout/shape_layout.rs:3531` 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 (39–40 lines × 2) src/renderer/svg.rs:2664— src/renderer/svg.rs:2664-2703 | src/renderer/svg.rs:2792-2830 — both copies are in the same file, so extract the 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 (100 lines × 2) src/paint/metafile_masks.rs:19— src/paint/metafile_masks.rs:19-118 | src/paint/metafile_print/masks.rs:19-118 — before extracting anything, compare `src/paint/metafile_masks.rs` and `src/paint/metafile_print/masks.rs` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (36–39 lines × 2) src/renderer/height_measurer.rs:3932— src/renderer/height_measurer.rs:3932-3970 | src/renderer/height_measurer.rs:4975-5010 — both copies are in the same file, so extract the 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 `src/renderer/height_measurer.rs:3932` 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 (39 lines × 2) src/parser/pdf/structured_lowering.rs:1409— src/parser/pdf/structured_lowering.rs:1409-1447 | tools/pdf-ir-poc/src/structured_lowering.rs:340-378 — before extracting anything, compare `src/parser/pdf/structured_lowering.rs` and `tools/pdf-ir-poc/src/structured_lowering.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 309 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/structured_lowering.rs:1409` 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 (37 lines × 2) src/parser/hwpx/section.rs:2917— src/parser/hwpx/section.rs:2917-2953 | src/parser/hwpx/section.rs:3042-3078 — both copies are in the same file, so extract the 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 `src/parser/hwpx/section.rs:2917` 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 (31–36 lines × 2) src/cli/commands/conversion.rs:341— src/cli/commands/conversion.rs:341-371 | src/cli/commands/conversion.rs:543-578 — both copies are in the same file, so extract the 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 `src/cli/commands/conversion.rs:341` 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 (25–36 lines × 2) src/renderer/layout/table_layout.rs:5786— src/renderer/layout/table_layout.rs:5786-5821 | src/renderer/layout/table_layout.rs:5924-5948 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:5786` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17–35 lines × 2) src/renderer/layout.rs:2555— src/renderer/layout.rs:2555-2589 | src/renderer/layout.rs:2679-2695 — both copies are in the same file, so extract the 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 (34–35 lines × 2) src/wmf/parser/records/drawing/poly_line.rs:41— src/wmf/parser/records/drawing/poly_line.rs:41-75 | src/wmf/parser/records/drawing/polygon.rs:44-77 — 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 `src/wmf/parser/records/drawing/poly_line.rs:41` 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 (34 lines × 3) src/renderer/layout/shape_layout.rs:2159— src/renderer/layout/shape_layout.rs:2159-2192 | src/renderer/layout/shape_layout.rs:2389-2422 | src/renderer/layout/shape_layout.rs:2457-2490 — 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 `src/renderer/layout/shape_layout.rs:2159` 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 (33–34 lines × 2) src/parser/pdf/lowering.rs:327— src/parser/pdf/lowering.rs:327-359 | tools/pdf-ir-poc/src/lowering.rs:155-188 — before extracting anything, compare `src/parser/pdf/lowering.rs` and `tools/pdf-ir-poc/src/lowering.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/parser/pdf/lowering.rs:327` 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 (57–60 lines × 2) src/renderer/equation/canvas_render.rs:309— src/renderer/equation/canvas_render.rs:309-365 | src/renderer/equation/svg_render.rs:368-427 — before extracting anything, compare `src/renderer/equation/canvas_render.rs` and `src/renderer/equation/svg_render.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 198 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 `src/renderer/equation/canvas_render.rs:309` 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 (29–33 lines × 3) src/document_core/commands/clipboard.rs:1001— src/document_core/commands/clipboard.rs:1001-1033 | src/document_core/commands/foreign_paste.rs:223-251 | src/document_core/commands/html_import.rs:411-439 — before extracting anything, compare `src/document_core/commands/clipboard.rs` and `src/document_core/commands/foreign_paste.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 134 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 `src/document_core/commands/clipboard.rs:1001` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (30–33 lines × 3) src/renderer/typeset.rs:3659— src/renderer/typeset.rs:3659-3690 | src/renderer/typeset/notes/endnotes/measure.rs:599-628 | src/renderer/typeset/notes/endnotes/measure.rs:725-757 — before extracting anything, compare `src/renderer/typeset.rs` and `src/renderer/typeset/notes/endnotes/measure.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/typeset.rs:3659` 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 (32–33 lines × 2) src/document_core/commands/object_ops/table.rs:524— src/document_core/commands/object_ops/table.rs:524-556 | src/document_core/commands/object_ops/table.rs:956-987 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26–32 lines × 2) src/document_core/queries/field_query.rs:496— src/document_core/queries/field_query.rs:496-521 | src/document_core/queries/field_query.rs:550-581 — both copies are in the same file, so extract the 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 `src/document_core/queries/field_query.rs:496` 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 (31–32 lines × 2) src/renderer/layout/table_layout.rs:1197— src/renderer/layout/table_layout.rs:1197-1227 | src/renderer/layout/table_layout.rs:1530-1561 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:1197` 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 (29–31 lines × 2) src/cli/outputs/text.rs:584— src/cli/outputs/text.rs:584-612 | src/cli/outputs/vector.rs:395-425 — before extracting anything, compare `src/cli/outputs/text.rs` and `src/cli/outputs/vector.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (30–31 lines × 2) src/document_core/queries/rendering.rs:8746— src/document_core/queries/rendering.rs:8746-8776 | src/document_core/queries/rendering.rs:8865-8894 — both copies are in the same file, so extract the 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 `src/document_core/queries/rendering.rs:8746` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (30 lines × 4) src/wmf/converter/svg/mod.rs:210— src/wmf/converter/svg/mod.rs:210-239 | src/wmf/converter/svg/mod.rs:288-317 | src/wmf/converter/svg/mod.rs:405-434 | src/wmf/converter/svg/mod.rs:497-526 — 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 `src/wmf/converter/svg/mod.rs:210` 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 (23–30 lines × 3) src/serializer/hwpx/section.rs:2518— src/serializer/hwpx/section.rs:2518-2540 | src/serializer/hwpx/section.rs:2644-2673 | src/serializer/hwpx/section.rs:2947-2976 — 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 `src/serializer/hwpx/section.rs:2518` 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 (47 lines × 3) src/wmf/parser/records/drawing/arc.rs:64— src/wmf/parser/records/drawing/arc.rs:64-110 | src/wmf/parser/records/drawing/chord.rs:67-113 | src/wmf/parser/records/drawing/pie.rs:66-112 — before extracting anything, compare `src/wmf/parser/records/drawing/arc.rs` and `src/wmf/parser/records/drawing/chord.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 112 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 `src/wmf/parser/records/drawing/arc.rs:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 6) src/renderer/layout/paragraph_layout.rs:8912— src/renderer/layout/paragraph_layout.rs:8912-8940 | src/renderer/layout/table_layout.rs:7366-7394 | src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs:88-116 | src/renderer/typeset/notes/endnotes/paragraph/new_note_fit.rs:109-137 | src/renderer/typeset/notes/endnotes/paragraph/rewind_tail.rs:75-103 | src/renderer/typeset/notes/endnotes/paragraph/tail_fit.rs:153-181 — before extracting anything, compare `src/renderer/typeset/notes/endnotes/paragraph/initial_fit.rs` and `src/renderer/typeset/notes/endnotes/paragraph/new_note_fit.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 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 `src/renderer/layout/paragraph_layout.rs:8912` 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 `input` to `InitialFitInput<'_>` in one and `NewNoteFitInput<'_>` 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 (24–29 lines × 2) src/document_core/converters/common_obj_attr_writer.rs:53— src/document_core/converters/common_obj_attr_writer.rs:53-81 | src/serializer/control.rs:2575-2598 — 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 `src/document_core/converters/common_obj_attr_writer.rs:53` 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 (25–29 lines × 2) src/document_core/queries/doc_tree_nav.rs:436— src/document_core/queries/doc_tree_nav.rs:436-464 | src/document_core/queries/doc_tree_nav.rs:467-491 — both copies are in the same file, so extract the 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 `src/document_core/queries/doc_tree_nav.rs:436` 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 (27–29 lines × 2) src/parser/hwpx/section.rs:3288— src/parser/hwpx/section.rs:3288-3316 | src/parser/hwpx/section.rs:3900-3926 — both copies are in the same file, so extract the 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 `src/parser/hwpx/section.rs:3288` 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 (27–28 lines × 3) src/renderer/web_canvas.rs:3982— src/renderer/web_canvas.rs:3982-4008 | src/renderer/web_canvas.rs:4032-4059 | src/renderer/web_canvas.rs:4113-4140 — 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 (47 lines × 2) src/bin/rhwp-q/kit/char_index.rs:39— src/bin/rhwp-q/kit/char_index.rs:39-85 | src/bin/rhwp-q/kit/word_end.rs:39-85 — before extracting anything, compare `src/bin/rhwp-q/kit/char_index.rs` and `src/bin/rhwp-q/kit/word_end.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 173 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 `src/bin/rhwp-q/kit/char_index.rs:39` 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 (3–27 lines × 10) mydocs/tech/investigations/issue-1061/probes/dump_eqedit_raw.rs:29— mydocs/tech/investigations/issue-1061/probes/dump_eqedit_raw.rs:29-31 | mydocs/tech/investigations/issue-1061/probes/dump_equation_records.rs:113-115 | mydocs/tech/investigations/issue-1064/probes/dump_table_ctrl_data.rs:125-127 | mydocs/tech/investigations/issue-1064/probes/repro_1064_save.rs:42-44 | src/diagnostics/hwp5_borderfill_diagonal_probe.rs:481-507 | src/diagnostics/hwp5_cell_header_probe.rs:753-779 | src/diagnostics/hwp5_contract_probe.rs:671-697 | src/diagnostics/hwp5_first_para_control_probe.rs:1353-1379 | src/diagnostics/hwp5_mel_personnel_probe.rs:667-693 | src/diagnostics/hwp5_table_probe.rs:518-544 — before extracting anything, compare `mydocs/tech/investigations/issue-1061/probes/dump_equation_records.rs` and `mydocs/tech/investigations/issue-1064/probes/repro_1064_save.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mydocs/tech/investigations/issue-1061/probes/dump_eqedit_raw.rs:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/diagnostics/hwp5_borderfill_diagonal_probe.rs:480` calls `from_le_bytes` and `mydocs/tech/investigations/issue-1064/probes/repro_1064_save.rs:42` 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 (27 lines × 4) src/cli/commands/edit/header_footer_content.rs:33— src/cli/commands/edit/header_footer_content.rs:33-59 | src/cli/commands/edit/header_footer_content.rs:153-179 | src/cli/commands/edit/header_footer_properties.rs:179-205 | src/cli/queries/structured_objects.rs:143-169 — before extracting anything, compare `src/cli/commands/edit/header_footer_content.rs` and `src/cli/commands/edit/header_footer_properties.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 296 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 (26–27 lines × 3) src/cli/commands/edit/document_text.rs:96— src/cli/commands/edit/document_text.rs:96-122 | src/cli/commands/edit/document_text.rs:402-427 | src/cli/commands/edit/document_text.rs:538-563 — 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 `src/cli/commands/edit/document_text.rs:96` 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 (27 lines × 3) src/cli/queries/diagnostics.rs:416— src/cli/queries/diagnostics.rs:416-442 | src/diagnostics/hwp5_contract_analyze.rs:900-926 | src/document_core/commands/clipboard.rs:47-73 — 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 `src/cli/queries/diagnostics.rs:416` 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 (41–43 lines × 2) src/parser/mod.rs:1190— src/parser/mod.rs:1190-1230 | src/parser/mod.rs:2162-2204 — both copies are in the same file, so extract the 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 `src/parser/mod.rs:1190` 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 (18–27 lines × 2) src/renderer/height_measurer.rs:5613— src/renderer/height_measurer.rs:5613-5639 | src/renderer/height_measurer.rs:5662-5679 — both copies are in the same file, so extract the 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 `src/renderer/height_measurer.rs:5613` 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 (25–26 lines × 4) src/main.rs:1064— src/main.rs:1064-1089 | src/main.rs:1144-1169 | src/main.rs:1218-1242 | src/main.rs:1300-1325 — 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.
Duplicated block (26 lines × 3) src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:118— src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:118-143 | src/bin/rhwp-q/commands/rhwp-q-page-items.rs:106-131 | src/bin/rhwp-q/commands/rhwp-q-scan-items.rs:86-111 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-font-trace.rs` and `src/bin/rhwp-q/commands/rhwp-q-page-items.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 101 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 `src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:118` 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 (25 lines × 4) src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:64— src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:64-88 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:65-89 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:64-88 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:65-89 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs` and `src/bin/rhwp-q/commands/rhwp-q-markdown.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 158 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 `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:64` 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 (25 lines × 3) src/bin/rhwp-q/kit/envelope.rs:100— src/bin/rhwp-q/kit/envelope.rs:100-124 | src/bin/rhwp-q/more/envelope.rs:64-88 | src/bin/rhwp-q/pack/envelope.rs:64-88 — `src/bin/rhwp-q/kit/envelope.rs` and `src/bin/rhwp-q/more/envelope.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (24–25 lines × 3) src/cli/outputs/text.rs:584— src/cli/outputs/text.rs:584-607 | src/cli/outputs/vector.rs:395-419 | src/cli/outputs/vector.rs:680-703 — before extracting anything, compare `src/cli/outputs/text.rs` and `src/cli/outputs/vector.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 130 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 (23–25 lines × 2) src/document_core/commands/object_ops/table.rs:598— src/document_core/commands/object_ops/table.rs:598-622 | src/document_core/commands/object_ops/table.rs:1003-1025 — both copies are in the same file, so extract the 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 `src/document_core/commands/object_ops/table.rs:598` 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 (24–25 lines × 2) src/document_core/commands/text_editing.rs:2214— src/document_core/commands/text_editing.rs:2214-2237 | src/document_core/commands/text_editing.rs:2595-2619 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:2214` 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–25 lines × 2) src/serializer/hwpx/shape.rs:1622— src/serializer/hwpx/shape.rs:1622-1646 | src/serializer/hwpx/table.rs:234-243 — before extracting anything, compare `src/serializer/hwpx/shape.rs` and `src/serializer/hwpx/table.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 119 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 `src/serializer/hwpx/table.rs:234` 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 (24 lines × 4) src/diagnostics/hwp5_cell_header_probe.rs:357— src/diagnostics/hwp5_cell_header_probe.rs:357-380 | src/diagnostics/hwp5_contract_probe.rs:324-347 | src/diagnostics/hwp5_mel_personnel_probe.rs:300-323 | src/diagnostics/hwp5_table_probe.rs:294-317 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_contract_probe.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 370 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 `src/diagnostics/hwp5_cell_header_probe.rs:357` 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 (23–24 lines × 3) src/renderer/layout.rs:15406— src/renderer/layout.rs:15406-15428 | src/renderer/layout.rs:16473-16495 | src/renderer/layout.rs:16665-16688 — 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 `src/renderer/layout.rs:15406` 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–24 lines × 3) src/renderer/layout/table_cell_content.rs:1485— src/renderer/layout/table_cell_content.rs:1485-1501 | src/renderer/layout/table_layout.rs:4847-4870 | src/renderer/layout/table_partial.rs:8017-8040 — before extracting anything, compare `src/renderer/layout/table_cell_content.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 97 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 `src/renderer/layout/table_cell_content.rs:1485` 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 × 10) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:110— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:110-132 | src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:109-131 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:109-131 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:113-135 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:110-132 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:101-123 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:109-131 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:99-121 | src/bin/rhwp-q/commands/rhwp-q-text-file.rs:96-118 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:110-132 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 105 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 `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:110` 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–23 lines × 5) src/cli/commands/edit/cells.rs:402— src/cli/commands/edit/cells.rs:402-424 | src/cli/commands/edit/document_text.rs:146-167 | src/cli/commands/edit/media.rs:406-428 | src/cli/commands/tabular_import.rs:376-397 | src/cli/commands/tabular_import.rs:672-693 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 218 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 `src/cli/commands/edit/cells.rs:402` 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 (22–23 lines × 4) src/cli/outputs/text.rs:124— src/cli/outputs/text.rs:124-145 | src/cli/outputs/text.rs:586-607 | src/cli/outputs/vector.rs:397-419 | src/cli/outputs/vector.rs:682-703 — before extracting anything, compare `src/cli/outputs/text.rs` and `src/cli/outputs/vector.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 130 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 `src/cli/outputs/text.rs:124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22–23 lines × 3) src/serializer/hwpx/section.rs:2635— src/serializer/hwpx/section.rs:2635-2657 | src/serializer/hwpx/section.rs:2717-2738 | src/serializer/hwpx/section.rs:2796-2817 — 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 `src/serializer/hwpx/section.rs:2635` 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 (20–23 lines × 2) src/serializer/hwpx/section.rs:2756— src/serializer/hwpx/section.rs:2756-2775 | src/serializer/hwpx/section.rs:2864-2886 — both copies are in the same file, so extract the 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 `src/serializer/hwpx/section.rs:2756` 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–23 lines × 2) src/wmf/converter/svg/mod.rs:897— src/wmf/converter/svg/mod.rs:897-919 | src/wmf/converter/svg/mod.rs:1663-1677 — both copies are in the same file, so extract the 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 `src/wmf/converter/svg/mod.rs:897` 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 (22 lines × 82) src/cli/commands/edit/bookmarks.rs:56— src/cli/commands/edit/bookmarks.rs:56-77 | src/cli/commands/edit/bookmarks.rs:173-194 | src/cli/commands/edit/bookmarks.rs:291-312 | src/cli/commands/edit/cell_paragraphs.rs:64-85 | src/cli/commands/edit/cell_paragraphs.rs:220-241 | src/cli/commands/edit/cells.rs:271-292 | src/cli/commands/edit/cells.rs:551-572 | src/cli/commands/edit/cells.rs:720-741 | src/cli/commands/edit/cells.rs:890-911 | src/cli/commands/edit/controls.rs:45-66 | src/cli/commands/edit/document_objects.rs:47-68 | src/cli/commands/edit/document_objects.rs:205-226 | src/cli/commands/edit/document_objects.rs:318-339 | src/cli/commands/edit/document_objects.rs:459-480 | src/cli/commands/edit/document_objects.rs:604-625 | src/cli/commands/edit/document_text.rs:58-79 | src/cli/commands/edit/document_text.rs:262-283 | src/cli/commands/edit/document_text.rs:372-393 | src/cli/commands/edit/document_text.rs:508-529 | src/cli/commands/edit/document_text.rs:664-685 | src/cli/commands/edit/document_text.rs:767-788 | src/cli/commands/edit/document_text.rs:870-891 | src/cli/commands/edit/document_text.rs:966-987 | src/cli/commands/edit/document_text.rs:1061-1082 | src/cli/commands/edit/equations.rs:187-208 | src/cli/commands/edit/equations.rs:290-311 | src/cli/commands/edit/formatting.rs:59-80 | src/cli/commands/edit/formatting.rs:197-218 | src/cli/commands/edit/formatting.rs:380-401 | src/cli/commands/edit/formatting.rs:627-648 | src/cli/commands/edit/formatting.rs:760-781 | src/cli/commands/edit/formatting.rs:921-942 | src/cli/commands/edit/header_footer_content.rs:64-85 | src/cli/commands/edit/header_footer_content.rs:184-205 | src/cli/commands/edit/header_footer_content.rs:331-352 | src/cli/commands/edit/header_footer_content.rs:481-502 | src/cli/commands/edit/header_footer_content.rs:661-682 | src/cli/commands/edit/header_footer_content.rs:804-825 | src/cli/commands/edit/header_footer_content.rs:936-957 | src/cli/commands/edit/header_footer_content.rs:1090-1111 | src/cli/commands/edit/header_footer_properties.rs:58-79 | src/cli/commands/edit/header_footer_properties.rs:210-231 | src/cli/commands/edit/header_footer_properties.rs:318-339 | src/cli/commands/edit/header_footer_properties.rs:465-486 | src/cli/commands/edit/media.rs:614-635 | src/cli/commands/edit/media.rs:839-860 | src/cli/commands/edit/media.rs:947-968 | src/cli/commands/edit/note_content.rs:56-77 | src/cli/commands/edit/note_content.rs:166-187 | src/cli/commands/edit/note_content.rs:278-299 | src/cli/commands/edit/note_content.rs:386-407 | src/cli/commands/edit/note_content.rs:501-522 | src/cli/commands/edit/note_content.rs:618-639 | src/cli/commands/edit/notes.rs:45-66 | src/cli/commands/edit/notes.rs:140-161 | src/cli/commands/edit/notes.rs:235-256 | src/cli/commands/edit/page.rs:48-69 | src/cli/commands/edit/page.rs:151-172 | src/cli/commands/edit/page.rs:276-297 | src/cli/commands/edit/page.rs:391-412 | src/cli/commands/edit/shapes.rs:92-113 | src/cli/commands/edit/shapes.rs:217-238 | src/cli/commands/edit/shapes.rs:335-356 | src/cli/commands/edit/shapes.rs:491-512 | src/cli/commands/edit/tables/grid.rs:50-71 | src/cli/commands/edit/tables/grid.rs:158-179 | src/cli/commands/edit/tables/grid.rs:264-285 | src/cli/commands/edit/tables/grid.rs:394-415 | src/cli/commands/edit/tables/grid.rs:513-534 | src/cli/commands/edit/tables/grid.rs:627-648 | src/cli/commands/edit/tables/grid.rs:771-792 | src/cli/commands/edit/tables/insert.rs:100-121 | src/cli/commands/edit/tables/layout.rs:37-58 | src/cli/commands/edit/tables/layout.rs:157-178 | src/cli/commands/edit/tables/layout.rs:283-304 | src/cli/commands/edit/tables/layout.rs:401-422 | src/cli/commands/edit/tables/layout.rs:515-536 | src/cli/commands/edit/tables/layout.rs:635-656 | src/cli/commands/edit/tables/structure.rs:55-76 | src/cli/commands/edit/tables/structure.rs:150-171 | src/cli/commands/edit/tables/structure.rs:245-266 | src/cli/commands/edit/tables/structure.rs:340-361 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/cell_paragraphs.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 170 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 `src/cli/commands/edit/bookmarks.rs:56` 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 (22 lines × 6) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:157— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:157-178 | src/diagnostics/hwp5_cell_header_probe.rs:228-249 | src/diagnostics/hwp5_contract_probe.rs:181-202 | src/diagnostics/hwp5_first_para_control_probe.rs:188-209 | src/diagnostics/hwp5_mel_personnel_probe.rs:174-195 | src/diagnostics/hwp5_table_probe.rs:180-201 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 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 (20–22 lines × 4) src/cli/commands/edit/document_text.rs:94— src/cli/commands/edit/document_text.rs:94-115 | src/cli/commands/edit/document_text.rs:290-309 | src/cli/commands/edit/document_text.rs:400-420 | src/cli/commands/edit/document_text.rs:536-556 — 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 `src/cli/commands/edit/document_text.rs:94` 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 (21–22 lines × 4) src/cli/commands/edit/formatting.rs:220— src/cli/commands/edit/formatting.rs:220-240 | src/cli/commands/edit/formatting.rs:945-966 | src/cli/commands/edit/header_footer_properties.rs:488-508 | src/cli/commands/edit/note_content.rs:642-663 — before extracting anything, compare `src/cli/commands/edit/formatting.rs` and `src/cli/commands/edit/header_footer_properties.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 185 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 `src/cli/commands/edit/formatting.rs:220` 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 × 3) src/cli/commands/edit/cell_paragraphs.rs:108— src/cli/commands/edit/cell_paragraphs.rs:108-129 | src/cli/commands/edit/cells.rs:595-616 | src/cli/commands/edit/cells.rs:764-785 — before extracting anything, compare `src/cli/commands/edit/cell_paragraphs.rs` and `src/cli/commands/edit/cells.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 262 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 `src/cli/commands/edit/cell_paragraphs.rs:108` 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 (45 lines × 2) src/document_core/commands/text_editing.rs:2470— src/document_core/commands/text_editing.rs:2470-2514 | src/document_core/commands/text_editing.rs:2838-2882 — both copies are in the same file, so extract the 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 `src/document_core/commands/text_editing.rs:2470` 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 (18–22 lines × 2) src/renderer/layout/paragraph_layout.rs:5481— src/renderer/layout/paragraph_layout.rs:5481-5498 | src/renderer/layout/paragraph_layout.rs:10220-10241 — both copies are in the same file, so extract the 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 `src/renderer/layout/paragraph_layout.rs:5481` 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) src/renderer/typeset/table/continuation/fragment/scan.rs:731— src/renderer/typeset/table/continuation/fragment/scan.rs:731-752 | src/renderer/typeset/table/continuation/fragment/scan.rs:778-796 — both copies are in the same file, so extract the 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 `src/renderer/typeset/table/continuation/fragment/scan.rs:731` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–22 lines × 2) src/wmf/parser/records/drawing/ext_text_out.rs:125— src/wmf/parser/records/drawing/ext_text_out.rs:125-138 | src/wmf/parser/records/drawing/text_out.rs:68-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (21 lines × 10) src/cli/commands/edit/bookmarks.rs:148— src/cli/commands/edit/bookmarks.rs:148-168 | src/cli/commands/edit/controls.rs:20-40 | src/cli/commands/edit/document_objects.rs:283-303 | src/cli/commands/edit/equations.rs:265-285 | src/cli/commands/edit/media.rs:814-834 | src/cli/commands/edit/media.rs:912-932 | src/cli/commands/edit/notes.rs:210-230 | src/cli/commands/edit/shapes.rs:192-212 | src/cli/commands/edit/shapes.rs:466-486 | src/cli/queries/structured_objects.rs:23-43 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/controls.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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 `src/cli/commands/edit/bookmarks.rs:148` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 7) src/cli/commands/edit/tables/layout.rs:12— src/cli/commands/edit/tables/layout.rs:12-32 | src/cli/commands/edit/tables/layout.rs:232-252 | src/cli/commands/edit/tables/layout.rs:480-500 | src/cli/commands/edit/tables/layout.rs:594-614 | src/cli/commands/edit/tables/structure.rs:125-145 | src/cli/commands/edit/tables/structure.rs:220-240 | src/cli/commands/edit/tables/structure.rs:315-335 — before extracting anything, compare `src/cli/commands/edit/tables/layout.rs` and `src/cli/commands/edit/tables/structure.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 187 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 `src/cli/commands/edit/tables/layout.rs:12` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–21 lines × 3) src/document_core/queries/cursor_rect.rs:224— src/document_core/queries/cursor_rect.rs:224-239 | src/document_core/queries/cursor_rect.rs:995-1015 | src/document_core/queries/cursor_rect.rs:4783-4797 — 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 (20–21 lines × 3) src/parser/hwpx/section.rs:6556— src/parser/hwpx/section.rs:6556-6575 | src/parser/hwpx/section.rs:6621-6641 | src/parser/hwpx/section.rs:6872-6891 — 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 `src/parser/hwpx/section.rs:6556` 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–21 lines × 3) src/renderer/layout/table_layout.rs:16863— src/renderer/layout/table_layout.rs:16863-16883 | src/renderer/layout/table_layout.rs:16950-16968 | src/renderer/layout/table_partial.rs:3072-3081 — before extracting anything, compare `src/renderer/layout/table_layout.rs` and `src/renderer/layout/table_partial.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 327 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 `src/renderer/layout/table_layout.rs:16863` 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–21 lines × 3) src/renderer/skia/anisotropic_image.rs:41— src/renderer/skia/anisotropic_image.rs:41-61 | src/renderer/skia/anisotropic_image.rs:113-132 | src/renderer/skia/metafile_print.rs:51-68 — 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 `src/renderer/skia/anisotropic_image.rs:41` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18–21 lines × 2) src/cli/protocol/exchange/disclosure.rs:132— src/cli/protocol/exchange/disclosure.rs:132-152 | src/cli/protocol/exchange/disclosure.rs:238-255 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/exchange/disclosure.rs:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/cli/protocol/exchange/disclosure.rs:236` calls `read`, `map_err`, `to_string` and `src/cli/protocol/exchange/disclosure.rs:132` 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 (19–21 lines × 2) src/document_core/queries/cursor_rect.rs:4032— src/document_core/queries/cursor_rect.rs:4032-4050 | src/document_core/queries/cursor_rect.rs:4176-4196 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:4032` 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 (1–21 lines × 4) src/document_core/html_table_import.rs:1106— src/document_core/html_table_import.rs:1106-1108 | src/document_core/html_table_import.rs:1130-1130 | src/renderer/svg.rs:4534-4554 | src/renderer/web_canvas.rs:322-340 — before extracting anything, compare `src/renderer/svg.rs` and `src/renderer/web_canvas.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 321 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 `src/document_core/html_table_import.rs:1106` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (20 lines × 8) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:91— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:91-110 | src/diagnostics/hwp5_cell_header_probe.rs:149-168 | src/diagnostics/hwp5_contract_analyze.rs:74-93 | src/diagnostics/hwp5_contract_probe.rs:96-115 | src/diagnostics/hwp5_ctrl_data_trace.rs:30-49 | src/diagnostics/hwp5_first_para_control_probe.rs:102-121 | src/diagnostics/hwp5_mel_personnel_probe.rs:95-114 | src/diagnostics/hwp5_table_probe.rs:101-120 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 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 `src/diagnostics/hwp5_borderfill_diagonal_probe.rs:91` 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 (20 lines × 7) src/cli/commands/edit/header_footer_content.rs:291— src/cli/commands/edit/header_footer_content.rs:291-310 | src/cli/commands/edit/header_footer_content.rs:448-467 | src/cli/commands/edit/header_footer_content.rs:610-629 | src/cli/commands/edit/header_footer_content.rs:764-783 | src/cli/commands/edit/header_footer_content.rs:903-922 | src/cli/commands/edit/header_footer_content.rs:1050-1069 | src/cli/commands/edit/header_footer_properties.rs:432-451 — before extracting anything, compare `src/cli/commands/edit/header_footer_content.rs` and `src/cli/commands/edit/header_footer_properties.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 296 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 `src/cli/commands/edit/header_footer_content.rs:291` 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–20 lines × 5) src/wmf/parser/records/state/set_bk_mode.rs:45— src/wmf/parser/records/state/set_bk_mode.rs:45-64 | src/wmf/parser/records/state/set_polyfill_mode.rs:44-62 | src/wmf/parser/records/state/set_rop2.rs:46-65 | src/wmf/parser/records/state/set_stretch_blt_mode.rs:44-63 | src/wmf/parser/records/state/set_text_align.rs:46-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/wmf/parser/records/state/set_bk_mode.rs:45` 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 (17–20 lines × 2) src/document_core/commands/html_import.rs:374— src/document_core/commands/html_import.rs:374-393 | src/document_core/commands/html_import.rs:428-444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/html_import.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.
Duplicated block (15–20 lines × 2) src/parser/control/shape.rs:1109— src/parser/control/shape.rs:1109-1123 | src/parser/control/shape.rs:1134-1153 — both copies are in the same file, so extract the 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–20 lines × 2) src/renderer/layout/table_layout.rs:14409— src/renderer/layout/table_layout.rs:14409-14419 | src/renderer/layout/table_layout.rs:15059-15078 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:14409` 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 (17–19 lines × 15) src/cli/commands/edit/document_objects.rs:216— src/cli/commands/edit/document_objects.rs:216-232 | src/cli/commands/edit/document_text.rs:273-289 | src/cli/commands/edit/document_text.rs:383-399 | src/cli/commands/edit/document_text.rs:519-535 | src/cli/commands/edit/document_text.rs:881-897 | src/cli/commands/edit/document_text.rs:977-993 | src/cli/commands/edit/document_text.rs:1072-1088 | src/cli/commands/edit/note_content.rs:397-413 | src/cli/commands/edit/note_content.rs:512-528 | src/cli/commands/edit/notes.rs:56-72 | src/cli/commands/edit/notes.rs:151-167 | src/cli/commands/edit/page.rs:402-418 | src/cli/queries/security_inspection.rs:165-183 | src/cli/queries/security_inspection.rs:278-296 | src/cli/queries/security_inspection.rs:376-394 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 213 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 `src/cli/commands/edit/document_objects.rs:216` 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 × 10) src/bin/rhwp-agent/grepcmd.rs:56— src/bin/rhwp-agent/grepcmd.rs:56-74 | src/bin/rhwp-agent/harvest.rs:43-61 | src/bin/rhwp-agent/harvest.rs:168-186 | src/bin/rhwp-agent/inspect.rs:171-189 | src/bin/rhwp-agent/lookups.rs:99-117 | src/bin/rhwp-agent/safety.rs:151-169 | src/bin/rhwp-agent/safety.rs:248-266 | src/bin/rhwp-agent/safety.rs:394-412 | src/bin/rhwp-agent/safety.rs:553-571 | src/bin/rhwp-agent/structurecmd.rs:34-52 — before extracting anything, compare `src/bin/rhwp-agent/grepcmd.rs` and `src/bin/rhwp-agent/inspect.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-agent/grepcmd.rs:56` 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–19 lines × 3) src/document_core/helpers.rs:1641— src/document_core/helpers.rs:1641-1659 | src/parser/doc_info.rs:364-381 | src/renderer/layout/border_rendering.rs:1599-1617 — 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 `src/document_core/helpers.rs:1641` 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–19 lines × 3) src/document_core/queries/rendering.rs:4252— src/document_core/queries/rendering.rs:4252-4270 | src/document_core/queries/rendering.rs:4295-4311 | src/document_core/queries/rendering.rs:4365-4381 — 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 (20–28 lines × 3) src/renderer/height_measurer.rs:2230— src/renderer/height_measurer.rs:2230-2257 | src/renderer/height_measurer.rs:6236-6260 | src/renderer/height_measurer.rs:6373-6392 — 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 `src/renderer/height_measurer.rs:2230` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–19 lines × 3) src/renderer/layout/table_layout.rs:8263— src/renderer/layout/table_layout.rs:8263-8277 | src/renderer/layout/table_partial.rs:3653-3671 | src/renderer/layout/table_partial.rs:3750-3766 — before extracting anything, compare `src/renderer/layout/table_layout.rs` and `src/renderer/layout/table_partial.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 327 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/renderer/layout/table_layout.rs:8278` calls `Some`, `get` and `src/renderer/layout/table_partial.rs:3672` 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 (15–19 lines × 2) src/document_core/builders/exam_paper.rs:111— src/document_core/builders/exam_paper.rs:111-125 | src/scaffold/builder.rs:141-159 — 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 `src/document_core/builders/exam_paper.rs:111` 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 × 13) src/bin/rhwp-q/kit/cur_field_state.rs:59— src/bin/rhwp-q/kit/cur_field_state.rs:59-76 | src/bin/rhwp-q/kit/field_by_id.rs:33-50 | src/bin/rhwp-q/kit/field_info_at.rs:59-76 | src/bin/rhwp-q/kit/field_list_json.rs:19-36 | src/bin/rhwp-q/kit/fn_selection_rects.rs:98-115 | src/bin/rhwp-q/kit/form_at.rs:59-76 | src/bin/rhwp-q/kit/form_value.rs:60-77 | src/bin/rhwp-q/kit/hf_edit_target.rs:51-68 | src/bin/rhwp-q/kit/hit_fn_marker.rs:60-77 | src/bin/rhwp-q/kit/hit_in_footnote.rs:60-77 | src/bin/rhwp-q/kit/hit_in_hf.rs:77-94 | src/bin/rhwp-q/kit/line_starts.rs:46-63 | src/bin/rhwp-q/kit/para_bounds.rs:46-63 — before extracting anything, compare `src/bin/rhwp-q/kit/cur_field_state.rs` and `src/bin/rhwp-q/kit/field_info_at.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 133 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 `src/bin/rhwp-q/kit/cur_field_state.rs:59` 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 (17–18 lines × 13) src/cli/commands/edit/bookmarks.rs:189— src/cli/commands/edit/bookmarks.rs:189-205 | src/cli/commands/edit/cell_paragraphs.rs:80-97 | src/cli/commands/edit/controls.rs:61-77 | src/cli/commands/edit/equations.rs:306-322 | src/cli/commands/edit/media.rs:855-871 | src/cli/commands/edit/notes.rs:251-267 | src/cli/commands/edit/shapes.rs:233-249 | src/cli/commands/edit/shapes.rs:507-523 | src/cli/commands/edit/tables/grid.rs:643-660 | src/cli/commands/edit/tables/layout.rs:173-190 | src/cli/commands/edit/tables/layout.rs:417-434 | src/cli/commands/edit/tables/layout.rs:651-668 | src/cli/queries/structured_objects.rs:52-68 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/cell_paragraphs.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 170 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 `src/cli/commands/edit/bookmarks.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 (18 lines × 10) src/bin/rhwp-q/kit/bin_data.rs:35— src/bin/rhwp-q/kit/bin_data.rs:35-52 | src/bin/rhwp-q/kit/caret_stops.rs:45-62 | src/bin/rhwp-q/kit/char_index.rs:59-76 | src/bin/rhwp-q/kit/chart_csv.rs:52-69 | src/bin/rhwp-q/kit/covering_pages.rs:42-59 | src/bin/rhwp-q/kit/page_border_fill.rs:32-49 | src/bin/rhwp-q/kit/page_text.rs:32-49 | src/bin/rhwp-q/kit/source_image_bytes.rs:33-50 | src/bin/rhwp-q/kit/word_end.rs:59-76 | src/bin/rhwp-q/kit/word_starts.rs:45-62 — before extracting anything, compare `src/bin/rhwp-q/kit/bin_data.rs` and `src/bin/rhwp-q/kit/source_image_bytes.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 `src/bin/rhwp-q/kit/bin_data.rs:35` 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–18 lines × 7) src/cli/commands/edit/cell_paragraphs.rs:96— src/cli/commands/edit/cell_paragraphs.rs:96-109 | src/cli/commands/edit/cell_paragraphs.rs:256-269 | src/cli/commands/edit/cells.rs:312-329 | src/cli/commands/edit/cells.rs:583-596 | src/cli/commands/edit/cells.rs:752-765 | src/cli/commands/edit/cells.rs:929-942 | src/cli/commands/edit/formatting.rs:963-976 — before extracting anything, compare `src/cli/commands/edit/cell_paragraphs.rs` and `src/cli/commands/edit/cells.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 262 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 `src/cli/commands/edit/cell_paragraphs.rs:96` 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 (17–18 lines × 6) src/bin/rhwp-agent/grepcmd.rs:77— src/bin/rhwp-agent/grepcmd.rs:77-94 | src/bin/rhwp-agent/safety.rs:167-183 | src/bin/rhwp-agent/safety.rs:264-280 | src/bin/rhwp-agent/safety.rs:410-426 | src/bin/rhwp-agent/safety.rs:569-585 | src/bin/rhwp-agent/structurecmd.rs:50-66 — before extracting anything, compare `src/bin/rhwp-agent/grepcmd.rs` and `src/bin/rhwp-agent/safety.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-agent/grepcmd.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 (18 lines × 5) src/serializer/hwpx/section.rs:2517— src/serializer/hwpx/section.rs:2517-2534 | src/serializer/hwpx/section.rs:2643-2660 | src/serializer/hwpx/section.rs:2724-2741 | src/serializer/hwpx/section.rs:2803-2820 | src/serializer/hwpx/section.rs:2946-2963 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (18 lines × 4) src/renderer/layout/table_layout.rs:12207— src/renderer/layout/table_layout.rs:12207-12224 | src/renderer/layout/table_layout.rs:28647-28664 | src/renderer/layout/table_layout.rs:28698-28715 | src/renderer/layout/table_layout.rs:28743-28760 — 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.
Duplicated block (15–18 lines × 3) src/document_core/commands/clipboard.rs:946— src/document_core/commands/clipboard.rs:946-963 | src/document_core/commands/foreign_paste.rs:175-189 | src/document_core/commands/html_import.rs:253-269 — before extracting anything, compare `src/document_core/commands/clipboard.rs` and `src/document_core/commands/foreign_paste.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 134 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 (12–18 lines × 2) src/document_core/commands/object_ops/common.rs:615— src/document_core/commands/object_ops/common.rs:615-626 | src/document_core/commands/object_ops/equation.rs:620-637 — before extracting anything, compare `src/document_core/commands/object_ops/common.rs` and `src/document_core/commands/object_ops/equation.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–18 lines × 2) src/document_core/queries/cursor_rect.rs:964— src/document_core/queries/cursor_rect.rs:964-977 | src/document_core/queries/cursor_rect.rs:1008-1025 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:964` 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–18 lines × 2) src/parser/hwp3/mod.rs:362— src/parser/hwp3/mod.rs:362-379 | src/parser/hwpx/section.rs:2773-2785 — 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 `src/parser/hwp3/mod.rs:362` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `common` to `&crate::model::shape::CommonObjAttr` in one and `&CommonObjAttr` 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 (15–18 lines × 2) src/renderer/layout/text_measurement.rs:577— src/renderer/layout/text_measurement.rs:577-594 | src/renderer/layout/text_measurement.rs:746-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.
Duplicated block (17 lines × 83) src/cli/commands/edit/bookmarks.rs:52— src/cli/commands/edit/bookmarks.rs:52-68 | src/cli/commands/edit/bookmarks.rs:169-185 | src/cli/commands/edit/bookmarks.rs:287-303 | src/cli/commands/edit/cell_paragraphs.rs:60-76 | src/cli/commands/edit/cell_paragraphs.rs:216-232 | src/cli/commands/edit/cells.rs:267-283 | src/cli/commands/edit/cells.rs:547-563 | src/cli/commands/edit/cells.rs:716-732 | src/cli/commands/edit/cells.rs:886-902 | src/cli/commands/edit/controls.rs:41-57 | src/cli/commands/edit/document_objects.rs:43-59 | src/cli/commands/edit/document_objects.rs:201-217 | src/cli/commands/edit/document_objects.rs:314-330 | src/cli/commands/edit/document_objects.rs:455-471 | src/cli/commands/edit/document_objects.rs:600-616 | src/cli/commands/edit/document_text.rs:54-70 | src/cli/commands/edit/document_text.rs:258-274 | src/cli/commands/edit/document_text.rs:368-384 | src/cli/commands/edit/document_text.rs:504-520 | src/cli/commands/edit/document_text.rs:660-676 | src/cli/commands/edit/document_text.rs:763-779 | src/cli/commands/edit/document_text.rs:866-882 | src/cli/commands/edit/document_text.rs:962-978 | src/cli/commands/edit/document_text.rs:1057-1073 | src/cli/commands/edit/equations.rs:183-199 | src/cli/commands/edit/equations.rs:286-302 | src/cli/commands/edit/fields.rs:55-71 | src/cli/commands/edit/formatting.rs:55-71 | src/cli/commands/edit/formatting.rs:193-209 | src/cli/commands/edit/formatting.rs:376-392 | src/cli/commands/edit/formatting.rs:623-639 | src/cli/commands/edit/formatting.rs:756-772 | src/cli/commands/edit/formatting.rs:917-933 | src/cli/commands/edit/header_footer_content.rs:60-76 | src/cli/commands/edit/header_footer_content.rs:180-196 | src/cli/commands/edit/header_footer_content.rs:327-343 | src/cli/commands/edit/header_footer_content.rs:477-493 | src/cli/commands/edit/header_footer_content.rs:657-673 | src/cli/commands/edit/header_footer_content.rs:800-816 | src/cli/commands/edit/header_footer_content.rs:932-948 | src/cli/commands/edit/header_footer_content.rs:1086-1102 | src/cli/commands/edit/header_footer_properties.rs:54-70 | src/cli/commands/edit/header_footer_properties.rs:206-222 | src/cli/commands/edit/header_footer_properties.rs:314-330 | src/cli/commands/edit/header_footer_properties.rs:461-477 | src/cli/commands/edit/media.rs:610-626 | src/cli/commands/edit/media.rs:835-851 | src/cli/commands/edit/media.rs:943-959 | src/cli/commands/edit/note_content.rs:52-68 | src/cli/commands/edit/note_content.rs:162-178 | src/cli/commands/edit/note_content.rs:274-290 | src/cli/commands/edit/note_content.rs:382-398 | src/cli/commands/edit/note_content.rs:497-513 | src/cli/commands/edit/note_content.rs:614-630 | src/cli/commands/edit/notes.rs:41-57 | src/cli/commands/edit/notes.rs:136-152 | src/cli/commands/edit/notes.rs:231-247 | src/cli/commands/edit/page.rs:44-60 | src/cli/commands/edit/page.rs:147-163 | src/cli/commands/edit/page.rs:272-288 | src/cli/commands/edit/page.rs:387-403 | src/cli/commands/edit/shapes.rs:88-104 | src/cli/commands/edit/shapes.rs:213-229 | src/cli/commands/edit/shapes.rs:331-347 | src/cli/commands/edit/shapes.rs:487-503 | src/cli/commands/edit/tables/grid.rs:46-62 | src/cli/commands/edit/tables/grid.rs:154-170 | src/cli/commands/edit/tables/grid.rs:260-276 | src/cli/commands/edit/tables/grid.rs:390-406 | src/cli/commands/edit/tables/grid.rs:509-525 | src/cli/commands/edit/tables/grid.rs:623-639 | src/cli/commands/edit/tables/grid.rs:767-783 | src/cli/commands/edit/tables/insert.rs:96-112 | src/cli/commands/edit/tables/layout.rs:33-49 | src/cli/commands/edit/tables/layout.rs:153-169 | src/cli/commands/edit/tables/layout.rs:279-295 | src/cli/commands/edit/tables/layout.rs:397-413 | src/cli/commands/edit/tables/layout.rs:511-527 | src/cli/commands/edit/tables/layout.rs:631-647 | src/cli/commands/edit/tables/structure.rs:51-67 | src/cli/commands/edit/tables/structure.rs:146-162 | src/cli/commands/edit/tables/structure.rs:241-257 | src/cli/commands/edit/tables/structure.rs:336-352 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/cell_paragraphs.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 170 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, `src/cli/commands/edit/tables/insert.rs:95` calls `Some` and `src/cli/commands/edit/bookmarks.rs:51` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16–17 lines × 17) src/cli/commands/edit/document_objects.rs:215— src/cli/commands/edit/document_objects.rs:215-230 | src/cli/commands/edit/document_text.rs:272-287 | src/cli/commands/edit/document_text.rs:382-397 | src/cli/commands/edit/document_text.rs:518-533 | src/cli/commands/edit/document_text.rs:880-895 | src/cli/commands/edit/document_text.rs:976-991 | src/cli/commands/edit/document_text.rs:1071-1086 | src/cli/commands/edit/formatting.rs:390-405 | src/cli/commands/edit/note_content.rs:396-411 | src/cli/commands/edit/note_content.rs:511-526 | src/cli/commands/edit/notes.rs:55-70 | src/cli/commands/edit/notes.rs:150-165 | src/cli/commands/edit/page.rs:401-416 | src/cli/commands/edit/shapes.rs:345-360 | src/cli/queries/security_inspection.rs:164-180 | src/cli/queries/security_inspection.rs:277-293 | src/cli/queries/security_inspection.rs:375-391 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 213 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 `src/cli/commands/edit/document_objects.rs:215` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16–17 lines × 14) src/cli/commands/edit/bookmarks.rs:184— src/cli/commands/edit/bookmarks.rs:184-199 | src/cli/commands/edit/cell_paragraphs.rs:75-91 | src/cli/commands/edit/cell_paragraphs.rs:231-247 | src/cli/commands/edit/controls.rs:56-71 | src/cli/commands/edit/equations.rs:301-316 | src/cli/commands/edit/media.rs:850-865 | src/cli/commands/edit/notes.rs:246-261 | src/cli/commands/edit/shapes.rs:228-243 | src/cli/commands/edit/shapes.rs:502-517 | src/cli/commands/edit/tables/grid.rs:638-654 | src/cli/commands/edit/tables/layout.rs:168-184 | src/cli/commands/edit/tables/layout.rs:412-428 | src/cli/commands/edit/tables/layout.rs:646-662 | src/cli/queries/structured_objects.rs:47-62 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/cell_paragraphs.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 170 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 `src/cli/commands/edit/bookmarks.rs:184` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16–17 lines × 8) src/wmf/parser/records/drawing/ellipse.rs:61— src/wmf/parser/records/drawing/ellipse.rs:61-77 | src/wmf/parser/records/drawing/ext_flood_fill.rs:51-66 | src/wmf/parser/records/drawing/frame_region.rs:55-70 | src/wmf/parser/records/drawing/rectangle.rs:60-76 | src/wmf/parser/records/state/exclude_clip_rect.rs:52-67 | src/wmf/parser/records/state/intersect_clip_rect.rs:52-67 | src/wmf/parser/records/state/scale_viewport_ext.rs:58-73 | src/wmf/parser/records/state/scale_window_ext.rs:58-73 — before extracting anything, compare `src/wmf/parser/records/drawing/ellipse.rs` and `src/wmf/parser/records/drawing/rectangle.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `src/wmf/parser/records/drawing/ellipse.rs:61` 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 (16–17 lines × 6) src/cli/commands/edit/cells.rs:408— src/cli/commands/edit/cells.rs:408-424 | src/cli/commands/edit/document_text.rs:152-167 | src/cli/commands/edit/media.rs:412-428 | src/cli/commands/edit/runtime.rs:231-246 | src/cli/commands/tabular_import.rs:382-397 | src/cli/commands/tabular_import.rs:678-693 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 218 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 `src/cli/commands/edit/cells.rs:408` 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 (17 lines × 6) src/cli/commands/edit/cells.rs:850— src/cli/commands/edit/cells.rs:850-866 | src/cli/commands/edit/tables/grid.rs:350-366 | src/cli/commands/edit/tables/grid.rs:597-613 | src/cli/commands/edit/tables/grid.rs:719-735 | src/cli/commands/edit/tables/layout.rs:127-143 | src/cli/commands/edit/tables/layout.rs:371-387 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/tables/grid.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 189 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/cells.rs:850` 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 (15–17 lines × 3) src/renderer/layout/table_layout.rs:13065— src/renderer/layout/table_layout.rs:13065-13081 | src/renderer/layout/table_layout.rs:13247-13263 | src/renderer/layout/table_layout.rs:14237-14251 — 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 `src/renderer/layout/table_layout.rs:13065` 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–17 lines × 2) src/document_core/commands/clipboard.rs:905— src/document_core/commands/clipboard.rs:905-918 | src/document_core/commands/clipboard.rs:1326-1342 — both copies are in the same file, so extract the 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 `src/document_core/commands/clipboard.rs:905` 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 (13–17 lines × 2) src/parser/hwpx/section.rs:3366— src/parser/hwpx/section.rs:3366-3378 | src/parser/hwpx/section.rs:7895-7911 — both copies are in the same file, so extract the 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 `src/parser/hwpx/section.rs:3366` 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 (14–16 lines × 24) src/cli/commands/edit/document_objects.rs:214— src/cli/commands/edit/document_objects.rs:214-227 | src/cli/commands/edit/document_text.rs:271-284 | src/cli/commands/edit/document_text.rs:381-394 | src/cli/commands/edit/document_text.rs:517-530 | src/cli/commands/edit/document_text.rs:879-892 | src/cli/commands/edit/document_text.rs:975-988 | src/cli/commands/edit/document_text.rs:1070-1083 | src/cli/commands/edit/formatting.rs:389-402 | src/cli/commands/edit/note_content.rs:395-408 | src/cli/commands/edit/note_content.rs:510-523 | src/cli/commands/edit/notes.rs:54-67 | src/cli/commands/edit/notes.rs:149-162 | src/cli/commands/edit/page.rs:400-413 | src/cli/commands/edit/privacy.rs:600-615 | src/cli/commands/edit/shapes.rs:344-357 | src/cli/outputs/preview.rs:37-51 | src/cli/outputs/tabular.rs:151-166 | src/cli/outputs/tabular.rs:361-376 | src/cli/outputs/text.rs:70-84 | src/cli/queries/security_inspection.rs:163-177 | src/cli/queries/security_inspection.rs:276-290 | src/cli/queries/security_inspection.rs:374-388 | src/cli/queries/structure.rs:62-77 | src/cli/queries/structured_objects.rs:171-185 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 213 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 `src/cli/commands/edit/document_objects.rs:214` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 10) src/cli/commands/edit/cell_paragraphs.rs:44— src/cli/commands/edit/cell_paragraphs.rs:44-59 | src/cli/commands/edit/cell_paragraphs.rs:200-215 | src/cli/commands/edit/cells.rs:521-536 | src/cli/commands/edit/cells.rs:700-715 | src/cli/commands/edit/cells.rs:860-875 | src/cli/commands/edit/formatting.rs:740-755 | src/cli/commands/edit/formatting.rs:891-906 | src/cli/commands/edit/tables/grid.rs:607-622 | src/cli/commands/edit/tables/layout.rs:137-152 | src/cli/commands/edit/tables/layout.rs:381-396 — before extracting anything, compare `src/cli/commands/edit/cell_paragraphs.rs` and `src/cli/commands/edit/cells.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 262 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 `src/cli/commands/edit/cell_paragraphs.rs:44` 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 (16 lines × 7) src/cli/commands/edit/header_footer_content.rs:137— src/cli/commands/edit/header_footer_content.rs:137-152 | src/cli/commands/edit/header_footer_content.rs:261-276 | src/cli/commands/edit/header_footer_content.rs:418-433 | src/cli/commands/edit/header_footer_content.rs:590-605 | src/cli/commands/edit/header_footer_content.rs:744-759 | src/cli/commands/edit/header_footer_content.rs:883-898 | src/cli/queries/structured_objects.rs:127-142 — before extracting anything, compare `src/cli/commands/edit/header_footer_content.rs` and `src/cli/queries/structured_objects.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/header_footer_content.rs:137` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–16 lines × 7) src/parser/hwp3/mod.rs:2618— src/parser/hwp3/mod.rs:2618-2626 | src/parser/hwp3/mod.rs:2809-2821 | src/parser/hwp3/mod.rs:2871-2886 | src/parser/hwp3/mod.rs:2927-2936 | src/parser/hwp3/mod.rs:2958-2967 | src/parser/hwp3/mod.rs:2985-2994 | src/parser/hwp3/mod.rs:3012-3021 — all 7 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 `src/parser/hwp3/mod.rs:2809` 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–16 lines × 5) src/cli/commands/edit/cells.rs:458— src/cli/commands/edit/cells.rs:458-469 | src/cli/commands/edit/document_text.rs:199-212 | src/cli/commands/edit/media.rs:463-477 | src/cli/commands/edit/privacy.rs:322-337 | src/cli/commands/edit/text.rs:234-245 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 218 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 `src/cli/commands/edit/cells.rs:458` 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–16 lines × 5) src/doclang/writer/escape.rs:51— src/doclang/writer/escape.rs:51-65 | src/ole_chart/svg_renderer.rs:410-425 | src/renderer/equation/svg_render.rs:771-786 | src/renderer/pdf.rs:1812-1827 | src/renderer/svg.rs:4412-4427 — before extracting anything, compare `src/doclang/writer/escape.rs` and `src/ole_chart/svg_renderer.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 4) src/cli/commands/edit/document_objects.rs:627— src/cli/commands/edit/document_objects.rs:627-641 | src/cli/commands/edit/equations.rs:75-90 | src/cli/commands/edit/page.rs:71-85 | src/cli/commands/edit/page.rs:174-188 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/equations.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 228 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 `src/cli/commands/edit/document_objects.rs:627` 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 (11–16 lines × 3) src/document_core/commands/formatting.rs:808— src/document_core/commands/formatting.rs:808-818 | src/document_core/commands/formatting.rs:885-900 | src/document_core/commands/table_ops.rs:1094-1104 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (13–16 lines × 3) src/document_core/commands/text_editing.rs:6488— src/document_core/commands/text_editing.rs:6488-6503 | src/document_core/commands/text_editing.rs:6554-6566 | src/document_core/commands/text_editing.rs:6833-6845 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–16 lines × 2) src/cli/commands/conversion.rs:260— src/cli/commands/conversion.rs:260-270 | src/cli/commands/conversion.rs:481-496 — both copies are in the same file, so extract the 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 `src/cli/commands/conversion.rs:260` 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 (10–24 lines × 6) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:276— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:276-285 | src/diagnostics/hwp5_cell_header_probe.rs:385-408 | src/diagnostics/hwp5_contract_probe.rs:362-371 | src/diagnostics/hwp5_first_para_control_probe.rs:391-400 | src/diagnostics/hwp5_mel_personnel_probe.rs:348-357 | src/diagnostics/hwp5_table_probe.rs:323-346 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 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 `src/diagnostics/hwp5_borderfill_diagonal_probe.rs:276` 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–15 lines × 69) src/cli/commands/edit/bookmarks.rs:65— src/cli/commands/edit/bookmarks.rs:65-77 | src/cli/commands/edit/bookmarks.rs:182-194 | src/cli/commands/edit/bookmarks.rs:300-312 | src/cli/commands/edit/cell_paragraphs.rs:73-85 | src/cli/commands/edit/cell_paragraphs.rs:229-241 | src/cli/commands/edit/cells.rs:280-292 | src/cli/commands/edit/cells.rs:560-572 | src/cli/commands/edit/cells.rs:729-741 | src/cli/commands/edit/cells.rs:899-911 | src/cli/commands/edit/controls.rs:54-66 | src/cli/commands/edit/document_objects.rs:56-68 | src/cli/commands/edit/document_objects.rs:327-339 | src/cli/commands/edit/document_objects.rs:468-482 | src/cli/commands/edit/document_objects.rs:613-625 | src/cli/commands/edit/document_text.rs:67-79 | src/cli/commands/edit/document_text.rs:673-685 | src/cli/commands/edit/document_text.rs:776-788 | src/cli/commands/edit/equations.rs:196-208 | src/cli/commands/edit/equations.rs:299-311 | src/cli/commands/edit/formatting.rs:68-80 | src/cli/commands/edit/formatting.rs:206-218 | src/cli/commands/edit/formatting.rs:636-648 | src/cli/commands/edit/formatting.rs:769-781 | src/cli/commands/edit/formatting.rs:930-942 | src/cli/commands/edit/header_footer_content.rs:73-85 | src/cli/commands/edit/header_footer_content.rs:193-205 | src/cli/commands/edit/header_footer_content.rs:340-352 | src/cli/commands/edit/header_footer_content.rs:490-502 | src/cli/commands/edit/header_footer_content.rs:670-682 | src/cli/commands/edit/header_footer_content.rs:813-825 | src/cli/commands/edit/header_footer_content.rs:945-957 | src/cli/commands/edit/header_footer_content.rs:1099-1111 | src/cli/commands/edit/header_footer_properties.rs:67-81 | src/cli/commands/edit/header_footer_properties.rs:219-231 | src/cli/commands/edit/header_footer_properties.rs:327-339 | src/cli/commands/edit/header_footer_properties.rs:474-486 | src/cli/commands/edit/media.rs:623-635 | src/cli/commands/edit/media.rs:848-860 | src/cli/commands/edit/media.rs:956-968 | src/cli/commands/edit/note_content.rs:65-77 | src/cli/commands/edit/note_content.rs:175-187 | src/cli/commands/edit/note_content.rs:287-299 | src/cli/commands/edit/note_content.rs:627-639 | src/cli/commands/edit/notes.rs:244-256 | src/cli/commands/edit/page.rs:57-69 | src/cli/commands/edit/page.rs:160-172 | src/cli/commands/edit/page.rs:285-297 | src/cli/commands/edit/shapes.rs:101-113 | src/cli/commands/edit/shapes.rs:226-238 | src/cli/commands/edit/shapes.rs:500-512 | src/cli/commands/edit/tables/grid.rs:59-71 | src/cli/commands/edit/tables/grid.rs:167-179 | src/cli/commands/edit/tables/grid.rs:273-285 | src/cli/commands/edit/tables/grid.rs:403-415 | src/cli/commands/edit/tables/grid.rs:522-534 | src/cli/commands/edit/tables/grid.rs:636-648 | src/cli/commands/edit/tables/grid.rs:780-792 | src/cli/commands/edit/tables/insert.rs:109-121 | src/cli/commands/edit/tables/layout.rs:46-58 | src/cli/commands/edit/tables/layout.rs:166-178 | src/cli/commands/edit/tables/layout.rs:292-304 | src/cli/commands/edit/tables/layout.rs:410-422 | src/cli/commands/edit/tables/layout.rs:524-536 | src/cli/commands/edit/tables/layout.rs:644-656 | src/cli/commands/edit/tables/structure.rs:64-76 | src/cli/commands/edit/tables/structure.rs:159-171 | src/cli/commands/edit/tables/structure.rs:254-266 | src/cli/commands/edit/tables/structure.rs:349-361 | src/cli/queries/structured_objects.rs:45-57 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/cell_paragraphs.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 170 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 `src/cli/commands/edit/bookmarks.rs:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–15 lines × 18) src/cli/commands/edit/document_objects.rs:57— src/cli/commands/edit/document_objects.rs:57-69 | src/cli/commands/edit/header_footer_content.rs:341-353 | src/cli/commands/edit/header_footer_content.rs:491-503 | src/cli/commands/edit/header_footer_content.rs:671-683 | src/cli/commands/edit/header_footer_content.rs:1100-1113 | src/cli/commands/edit/header_footer_properties.rs:220-233 | src/cli/commands/edit/header_footer_properties.rs:475-487 | src/cli/commands/edit/note_content.rs:288-300 | src/cli/commands/edit/shapes.rs:102-114 | src/cli/commands/edit/tables/grid.rs:60-72 | src/cli/commands/edit/tables/grid.rs:168-180 | src/cli/commands/edit/tables/grid.rs:274-286 | src/cli/commands/edit/tables/grid.rs:523-535 | src/cli/commands/edit/tables/insert.rs:110-122 | src/cli/commands/edit/tables/layout.rs:293-305 | src/cli/commands/edit/tables/layout.rs:525-537 | src/cli/commands/edit/tables/structure.rs:65-77 | src/cli/commands/tabular_import.rs:530-544 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/header_footer_content.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 163 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 `src/cli/commands/edit/document_objects.rs:57` 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 (15 lines × 17) src/cli/commands/edit/tables/grid.rs:79— src/cli/commands/edit/tables/grid.rs:79-93 | src/cli/commands/edit/tables/grid.rs:187-201 | src/cli/commands/edit/tables/grid.rs:293-307 | src/cli/commands/edit/tables/grid.rs:430-444 | src/cli/commands/edit/tables/grid.rs:542-556 | src/cli/commands/edit/tables/grid.rs:658-672 | src/cli/commands/edit/tables/grid.rs:802-816 | src/cli/commands/edit/tables/layout.rs:66-80 | src/cli/commands/edit/tables/layout.rs:188-202 | src/cli/commands/edit/tables/layout.rs:312-326 | src/cli/commands/edit/tables/layout.rs:432-446 | src/cli/commands/edit/tables/layout.rs:551-565 | src/cli/commands/edit/tables/layout.rs:666-680 | src/cli/commands/edit/tables/structure.rs:84-98 | src/cli/commands/edit/tables/structure.rs:179-193 | src/cli/commands/edit/tables/structure.rs:274-288 | src/cli/commands/edit/tables/structure.rs:369-383 — before extracting anything, compare `src/cli/commands/edit/tables/grid.rs` and `src/cli/commands/edit/tables/layout.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 253 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 `src/cli/commands/edit/tables/grid.rs:79` 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 (15 lines × 11) src/bin/rhwp-agent/grepcmd.rs:55— src/bin/rhwp-agent/grepcmd.rs:55-69 | src/bin/rhwp-agent/harvest.rs:42-56 | src/bin/rhwp-agent/harvest.rs:167-181 | src/bin/rhwp-agent/inspect.rs:170-184 | src/bin/rhwp-agent/locate.rs:238-252 | src/bin/rhwp-agent/lookups.rs:98-112 | src/bin/rhwp-agent/safety.rs:150-164 | src/bin/rhwp-agent/safety.rs:247-261 | src/bin/rhwp-agent/safety.rs:393-407 | src/bin/rhwp-agent/safety.rs:552-566 | src/bin/rhwp-agent/structurecmd.rs:33-47 — before extracting anything, compare `src/bin/rhwp-agent/grepcmd.rs` and `src/bin/rhwp-agent/inspect.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-agent/grepcmd.rs:55` 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 × 7) src/wmf/converter/svg/mod.rs:187— src/wmf/converter/svg/mod.rs:187-201 | src/wmf/converter/svg/mod.rs:210-224 | src/wmf/converter/svg/mod.rs:265-279 | src/wmf/converter/svg/mod.rs:288-302 | src/wmf/converter/svg/mod.rs:405-419 | src/wmf/converter/svg/mod.rs:474-488 | src/wmf/converter/svg/mod.rs:497-511 — all 7 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 `src/wmf/converter/svg/mod.rs:187` 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 after the matched lines, `src/wmf/converter/svg/mod.rs:203` calls `use_source`, `source_bitmap16` and `src/wmf/converter/svg/mod.rs:226` 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–17 lines × 6) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:196— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:196-210 | src/diagnostics/hwp5_cell_header_probe.rs:267-283 | src/diagnostics/hwp5_contract_probe.rs:219-235 | src/diagnostics/hwp5_first_para_control_probe.rs:240-254 | src/diagnostics/hwp5_mel_personnel_probe.rs:211-227 | src/diagnostics/hwp5_table_probe.rs:214-230 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 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 `src/diagnostics/hwp5_borderfill_diagonal_probe.rs:196` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 5) src/document_core/commands/text_editing.rs:1476— src/document_core/commands/text_editing.rs:1476-1489 | src/document_core/commands/text_editing.rs:1701-1715 | src/document_core/commands/text_editing.rs:1954-1968 | src/document_core/commands/text_editing.rs:4426-4440 | src/document_core/commands/text_editing.rs:4924-4938 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/text_editing.rs:1476` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/document_core/commands/text_editing.rs:4441` calls `reflow_paragraph` and `src/document_core/commands/text_editing.rs:1490` 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 (11–15 lines × 2) src/model/control.rs:369— src/model/control.rs:369-379 | src/renderer/layout/text_measurement.rs:3238-3252 — 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 `src/model/control.rs:369` 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 (17–22 lines × 2) src/renderer/layout/table_layout.rs:23852— src/renderer/layout/table_layout.rs:23852-23868 | src/renderer/layout/table_layout/row_block_cut.rs:205-226 — 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–15 lines × 2) src/renderer/layout/table_partial.rs:3534— src/renderer/layout/table_partial.rs:3534-3541 | src/renderer/layout/table_partial.rs:4750-4764 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_partial.rs:3534` 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 (3–15 lines × 4) src/renderer/char_overlap.rs:343— src/renderer/char_overlap.rs:343-345 | src/renderer/char_overlap.rs:454-456 | src/renderer/svg.rs:1256-1270 | src/renderer/svg.rs:1317-1330 — 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. 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–14 lines × 23) src/document_core/commands/clipboard.rs:959— src/document_core/commands/clipboard.rs:959-972 | src/document_core/commands/foreign_paste.rs:188-198 | src/document_core/commands/html_import.rs:266-278 | src/document_core/commands/object_ops/equation.rs:411-421 | src/document_core/commands/object_ops/picture.rs:648-658 | src/document_core/commands/object_ops/table.rs:1213-1223 | src/document_core/commands/table_ops.rs:554-564 | src/document_core/commands/table_ops.rs:3477-3487 | src/document_core/commands/table_ops.rs:3799-3809 | src/document_core/commands/text_editing.rs:1448-1458 | src/document_core/commands/text_editing.rs:1489-1499 | src/document_core/commands/text_editing.rs:1687-1697 | src/document_core/commands/text_editing.rs:1715-1725 | src/document_core/commands/text_editing.rs:1940-1950 | src/document_core/commands/text_editing.rs:1968-1978 | src/document_core/commands/text_editing.rs:4037-4047 | src/document_core/commands/text_editing.rs:4110-4120 | src/document_core/commands/text_editing.rs:4909-4919 | src/document_core/commands/text_editing.rs:4938-4948 | src/document_core/hyperlink.rs:560-570 | src/document_core/queries/field_query.rs:183-193 | src/document_core/queries/hwpctrl_sets.rs:2004-2014 | src/document_core/queries/memo_query.rs:1303-1313 — before extracting anything, compare `src/document_core/commands/clipboard.rs` and `src/document_core/commands/foreign_paste.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 134 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 `self` to `crate) fn stamp_caret(&mut` in one and `&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/document_core/commands/text_editing.rs:4920` calls `remove_composed_paragraph` and `src/document_core/commands/clipboard.rs:973` 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 (14 lines × 11) src/cli/commands/edit/cells.rs:846— src/cli/commands/edit/cells.rs:846-859 | src/cli/commands/edit/tables/grid.rs:22-35 | src/cli/commands/edit/tables/grid.rs:130-143 | src/cli/commands/edit/tables/grid.rs:237-250 | src/cli/commands/edit/tables/grid.rs:346-359 | src/cli/commands/edit/tables/grid.rs:486-499 | src/cli/commands/edit/tables/grid.rs:593-606 | src/cli/commands/edit/tables/grid.rs:715-728 | src/cli/commands/edit/tables/layout.rs:123-136 | src/cli/commands/edit/tables/layout.rs:367-380 | src/cli/commands/edit/tables/structure.rs:22-35 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/tables/grid.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 189 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/commands/edit/cells.rs:846` 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 × 10) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:37— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:37-50 | src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:34-47 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:37-50 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:37-50 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:35-48 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:34-47 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:34-47 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:36-49 | src/bin/rhwp-q/commands/rhwp-q-text-file.rs:37-50 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:35-48 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 105 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. 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 lines × 8) src/cli/commands/edit/document_objects.rs:160— src/cli/commands/edit/document_objects.rs:160-173 | src/cli/commands/edit/header_footer_content.rs:288-301 | src/cli/commands/edit/header_footer_content.rs:445-458 | src/cli/commands/edit/header_footer_content.rs:607-620 | src/cli/commands/edit/header_footer_content.rs:761-774 | src/cli/commands/edit/header_footer_content.rs:900-913 | src/cli/commands/edit/header_footer_content.rs:1047-1060 | src/cli/commands/edit/header_footer_properties.rs:429-442 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/header_footer_content.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 163 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 `src/cli/commands/edit/document_objects.rs:160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–14 lines × 6) src/document_core/commands/text_editing.rs:4411— src/document_core/commands/text_editing.rs:4411-4421 | src/document_core/commands/text_editing.rs:4441-4451 | src/document_core/commands/text_editing.rs:4511-4524 | src/document_core/commands/text_editing.rs:4573-4585 | src/document_core/commands/text_editing.rs:4632-4642 | src/document_core/commands/text_editing.rs:4697-4709 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/text_editing.rs:4511` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/document_core/commands/text_editing.rs:4410` calls `reflow_paragraph` and `src/document_core/commands/text_editing.rs:4511` 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 (10–14 lines × 5) src/document_core/commands/object_ops/equation.rs:161— src/document_core/commands/object_ops/equation.rs:161-170 | src/document_core/commands/table_ops.rs:1005-1018 | src/document_core/commands/table_ops.rs:1041-1054 | src/document_core/commands/table_ops.rs:1215-1228 | src/document_core/commands/table_ops.rs:2954-2967 — before extracting anything, compare `src/document_core/commands/object_ops/equation.rs` and `src/document_core/commands/table_ops.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/object_ops/equation.rs:161` 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 (13–14 lines × 4) src/bin/rhwp-agent/inspect.rs:113— src/bin/rhwp-agent/inspect.rs:113-126 | src/bin/rhwp-agent/inspect.rs:372-384 | src/bin/rhwp-agent/lookups.rs:119-131 | src/bin/rhwp-agent/lookups.rs:183-195 — before extracting anything, compare `src/bin/rhwp-agent/inspect.rs` and `src/bin/rhwp-agent/lookups.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 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 `src/bin/rhwp-agent/inspect.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. 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–14 lines × 4) src/renderer/layout/picture_footnote.rs:633— src/renderer/layout/picture_footnote.rs:633-644 | src/renderer/layout/shape_layout.rs:1311-1324 | src/renderer/layout/table_layout.rs:4917-4928 | src/renderer/layout/table_partial.rs:8294-8305 — before extracting anything, compare `src/renderer/layout/shape_layout.rs` and `src/renderer/layout/table_layout.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 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 `src/renderer/layout/picture_footnote.rs:633` 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 × 3) src/document_core/commands/clipboard.rs:107— src/document_core/commands/clipboard.rs:107-120 | src/document_core/commands/document.rs:3916-3928 | src/model/paragraph.rs:831-844 — 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 `src/document_core/commands/clipboard.rs:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–14 lines × 3) src/renderer/height_measurer.rs:3961— src/renderer/height_measurer.rs:3961-3974 | src/renderer/height_measurer.rs:5001-5014 | src/renderer/height_measurer.rs:5797-5805 — 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 `src/renderer/height_measurer.rs:3961` 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–14 lines × 3) src/renderer/height_measurer.rs:4109— src/renderer/height_measurer.rs:4109-4122 | src/renderer/height_measurer.rs:5125-5138 | src/renderer/height_measurer.rs:5836-5845 — 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 `src/renderer/height_measurer.rs:4109` 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–14 lines × 3) src/renderer/layout.rs:15390— src/renderer/layout.rs:15390-15403 | src/renderer/layout.rs:16445-16458 | src/renderer/layout.rs:16652-16663 — 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 `src/renderer/layout.rs:15390` 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–14 lines × 3) src/renderer/pagination/engine.rs:1018— src/renderer/pagination/engine.rs:1018-1028 | src/renderer/typeset.rs:1353-1363 | src/renderer/typeset/controls/wrap_match.rs:29-42 — before extracting anything, compare `src/renderer/pagination/engine.rs` and `src/renderer/typeset.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (4–14 lines × 4) src/cli/queries/security_inspection.rs:648— src/cli/queries/security_inspection.rs:648-661 | src/cli/queries/security_inspection.rs:920-933 | src/document_core/queries/memo_query.rs:913-916 | src/document_core/queries/search_query.rs:230-233 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/queries/security_inspection.rs:648` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–14 lines × 2) src/document_core/commands/object_ops/picture.rs:663— src/document_core/commands/object_ops/picture.rs:663-676 | src/document_core/commands/object_ops/picture.rs:1571-1580 — both copies are in the same file, so extract the 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–14 lines × 2) src/renderer/layout/table_layout.rs:8276— src/renderer/layout/table_layout.rs:8276-8289 | src/renderer/layout/table_layout.rs:9114-9122 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:8276` 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 (7–14 lines × 2) src/renderer/skia/glyph_replay.rs:466— src/renderer/skia/glyph_replay.rs:466-472 | src/renderer/skia/renderer.rs:2235-2248 — 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 `src/renderer/skia/glyph_replay.rs:466` 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/renderer/skia/glyph_replay.rs:463` calls `into_iter`, `all` and `src/renderer/skia/renderer.rs:2234` 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 (30–32 lines × 2) src/renderer/svg.rs:4552— src/renderer/svg.rs:4552-4581 | src/renderer/web_canvas.rs:338-369 — before extracting anything, compare `src/renderer/svg.rs` and `src/renderer/web_canvas.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 321 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 `src/renderer/svg.rs:4552` 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 × 70) src/cli/commands/edit/bookmarks.rs:65— src/cli/commands/edit/bookmarks.rs:65-77 | src/cli/commands/edit/bookmarks.rs:182-194 | src/cli/commands/edit/bookmarks.rs:300-312 | src/cli/commands/edit/cell_paragraphs.rs:73-85 | src/cli/commands/edit/cell_paragraphs.rs:229-241 | src/cli/commands/edit/cells.rs:280-292 | src/cli/commands/edit/cells.rs:560-572 | src/cli/commands/edit/cells.rs:729-741 | src/cli/commands/edit/cells.rs:899-911 | src/cli/commands/edit/controls.rs:54-66 | src/cli/commands/edit/document_objects.rs:56-68 | src/cli/commands/edit/document_objects.rs:327-339 | src/cli/commands/edit/document_objects.rs:468-482 | src/cli/commands/edit/document_objects.rs:613-625 | src/cli/commands/edit/document_text.rs:67-79 | src/cli/commands/edit/document_text.rs:673-685 | src/cli/commands/edit/document_text.rs:776-788 | src/cli/commands/edit/equations.rs:196-208 | src/cli/commands/edit/equations.rs:299-311 | src/cli/commands/edit/formatting.rs:68-80 | src/cli/commands/edit/formatting.rs:206-218 | src/cli/commands/edit/formatting.rs:636-648 | src/cli/commands/edit/formatting.rs:769-781 | src/cli/commands/edit/formatting.rs:930-942 | src/cli/commands/edit/header_footer_content.rs:73-85 | src/cli/commands/edit/header_footer_content.rs:193-205 | src/cli/commands/edit/header_footer_content.rs:340-352 | src/cli/commands/edit/header_footer_content.rs:490-502 | src/cli/commands/edit/header_footer_content.rs:670-682 | src/cli/commands/edit/header_footer_content.rs:813-825 | src/cli/commands/edit/header_footer_content.rs:945-957 | src/cli/commands/edit/header_footer_content.rs:1099-1111 | src/cli/commands/edit/header_footer_properties.rs:67-81 | src/cli/commands/edit/header_footer_properties.rs:219-231 | src/cli/commands/edit/header_footer_properties.rs:327-339 | src/cli/commands/edit/header_footer_properties.rs:474-486 | src/cli/commands/edit/media.rs:623-635 | src/cli/commands/edit/media.rs:848-860 | src/cli/commands/edit/media.rs:956-968 | src/cli/commands/edit/note_content.rs:65-77 | src/cli/commands/edit/note_content.rs:175-187 | src/cli/commands/edit/note_content.rs:287-299 | src/cli/commands/edit/note_content.rs:627-639 | src/cli/commands/edit/notes.rs:244-256 | src/cli/commands/edit/page.rs:57-69 | src/cli/commands/edit/page.rs:160-172 | src/cli/commands/edit/page.rs:285-297 | src/cli/commands/edit/shapes.rs:101-113 | src/cli/commands/edit/shapes.rs:226-238 | src/cli/commands/edit/shapes.rs:500-512 | src/cli/commands/edit/tables/grid.rs:59-71 | src/cli/commands/edit/tables/grid.rs:167-179 | src/cli/commands/edit/tables/grid.rs:273-285 | src/cli/commands/edit/tables/grid.rs:403-415 | src/cli/commands/edit/tables/grid.rs:522-534 | src/cli/commands/edit/tables/grid.rs:636-648 | src/cli/commands/edit/tables/grid.rs:780-792 | src/cli/commands/edit/tables/insert.rs:109-121 | src/cli/commands/edit/tables/layout.rs:46-58 | src/cli/commands/edit/tables/layout.rs:166-178 | src/cli/commands/edit/tables/layout.rs:292-304 | src/cli/commands/edit/tables/layout.rs:410-422 | src/cli/commands/edit/tables/layout.rs:524-536 | src/cli/commands/edit/tables/layout.rs:644-656 | src/cli/commands/edit/tables/structure.rs:64-76 | src/cli/commands/edit/tables/structure.rs:159-171 | src/cli/commands/edit/tables/structure.rs:254-266 | src/cli/commands/edit/tables/structure.rs:349-361 | src/cli/commands/tabular_import.rs:529-541 | src/cli/queries/structured_objects.rs:45-57 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/cell_paragraphs.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 170 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 `src/cli/commands/edit/bookmarks.rs:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 57) src/cli/commands/edit/bookmarks.rs:196— src/cli/commands/edit/bookmarks.rs:196-208 | src/cli/commands/edit/cell_paragraphs.rs:88-100 | src/cli/commands/edit/cells.rs:575-587 | src/cli/commands/edit/cells.rs:744-756 | src/cli/commands/edit/controls.rs:68-80 | src/cli/commands/edit/document_objects.rs:70-81 | src/cli/commands/edit/document_objects.rs:228-239 | src/cli/commands/edit/document_text.rs:285-296 | src/cli/commands/edit/document_text.rs:395-406 | src/cli/commands/edit/document_text.rs:531-542 | src/cli/commands/edit/document_text.rs:687-698 | src/cli/commands/edit/document_text.rs:790-801 | src/cli/commands/edit/document_text.rs:893-904 | src/cli/commands/edit/document_text.rs:989-1000 | src/cli/commands/edit/document_text.rs:1084-1095 | src/cli/commands/edit/equations.rs:210-221 | src/cli/commands/edit/equations.rs:313-325 | src/cli/commands/edit/formatting.rs:650-661 | src/cli/commands/edit/formatting.rs:784-796 | src/cli/commands/edit/header_footer_content.rs:87-98 | src/cli/commands/edit/header_footer_content.rs:207-218 | src/cli/commands/edit/header_footer_content.rs:684-695 | src/cli/commands/edit/header_footer_content.rs:827-838 | src/cli/commands/edit/header_footer_content.rs:959-970 | src/cli/commands/edit/header_footer_content.rs:1113-1125 | src/cli/commands/edit/header_footer_properties.rs:91-103 | src/cli/commands/edit/header_footer_properties.rs:233-245 | src/cli/commands/edit/header_footer_properties.rs:341-352 | src/cli/commands/edit/media.rs:862-874 | src/cli/commands/edit/note_content.rs:79-90 | src/cli/commands/edit/note_content.rs:189-200 | src/cli/commands/edit/note_content.rs:301-312 | src/cli/commands/edit/note_content.rs:409-420 | src/cli/commands/edit/note_content.rs:524-535 | src/cli/commands/edit/notes.rs:68-79 | src/cli/commands/edit/notes.rs:163-174 | src/cli/commands/edit/notes.rs:258-270 | src/cli/commands/edit/page.rs:299-310 | src/cli/commands/edit/page.rs:414-425 | src/cli/commands/edit/shapes.rs:240-252 | src/cli/commands/edit/shapes.rs:514-526 | src/cli/commands/edit/tables/grid.rs:73-84 | src/cli/commands/edit/tables/grid.rs:181-192 | src/cli/commands/edit/tables/grid.rs:287-298 | src/cli/commands/edit/tables/grid.rs:424-435 | src/cli/commands/edit/tables/grid.rs:536-547 | src/cli/commands/edit/tables/grid.rs:651-663 | src/cli/commands/edit/tables/grid.rs:795-807 | src/cli/commands/edit/tables/layout.rs:60-71 | src/cli/commands/edit/tables/layout.rs:181-193 | src/cli/commands/edit/tables/layout.rs:306-317 | src/cli/commands/edit/tables/layout.rs:425-437 | src/cli/commands/edit/tables/layout.rs:659-671 | src/cli/commands/edit/tables/structure.rs:78-89 | src/cli/commands/edit/tables/structure.rs:173-184 | src/cli/commands/edit/tables/structure.rs:268-279 | src/cli/commands/edit/tables/structure.rs:363-374 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/cell_paragraphs.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 170 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 `src/cli/commands/edit/bookmarks.rs:196` 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–13 lines × 11) src/cli/outputs/tabular.rs:47— src/cli/outputs/tabular.rs:47-58 | src/cli/outputs/text.rs:300-312 | src/cli/queries/document_inventory.rs:36-46 | src/cli/queries/document_inventory.rs:101-111 | src/cli/queries/document_inventory.rs:173-183 | src/cli/queries/document_inventory.rs:245-256 | src/cli/queries/search.rs:90-102 | src/cli/queries/security_inspection.rs:58-69 | src/cli/queries/structure.rs:79-91 | src/cli/queries/structured_objects.rs:61-71 | src/cli/queries/structured_objects.rs:279-289 — before extracting anything, compare `src/cli/outputs/tabular.rs` and `src/cli/outputs/text.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 116 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 `src/cli/outputs/tabular.rs:47` 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 (13 lines × 10) src/wmf/parser/records/drawing/line_to.rs:42— src/wmf/parser/records/drawing/line_to.rs:42-54 | src/wmf/parser/records/drawing/text_out.rs:91-103 | src/wmf/parser/records/state/move_to.rs:41-53 | src/wmf/parser/records/state/offset_clip_rgn.rs:41-53 | src/wmf/parser/records/state/offset_viewport_org.rs:41-53 | src/wmf/parser/records/state/offset_window_org.rs:41-53 | src/wmf/parser/records/state/set_viewport_ext.rs:41-53 | src/wmf/parser/records/state/set_viewport_org.rs:41-53 | src/wmf/parser/records/state/set_window_ext.rs:41-53 | src/wmf/parser/records/state/set_window_org.rs:41-53 — before extracting anything, compare `src/wmf/parser/records/state/move_to.rs` and `src/wmf/parser/records/state/set_window_org.rs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/wmf/parser/records/drawing/line_to.rs:42` 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–13 lines × 4) src/document_core/queries/cursor_rect.rs:230— src/document_core/queries/cursor_rect.rs:230-240 | src/document_core/queries/cursor_rect.rs:960-969 | src/document_core/queries/cursor_rect.rs:1004-1016 | src/document_core/queries/cursor_rect.rs:4789-4798 — 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.
Duplicated block (8–13 lines × 3) src/renderer/equation/canvas_render.rs:313— src/renderer/equation/canvas_render.rs:313-320 | src/renderer/equation/svg_render.rs:372-380 | src/renderer/skia/equation_conv.rs:431-443 — before extracting anything, compare `src/renderer/equation/canvas_render.rs` and `src/renderer/equation/svg_render.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 198 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 `src/renderer/equation/canvas_render.rs:313` 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 (8–13 lines × 2) src/document_core/queries/cursor_rect.rs:6261— src/document_core/queries/cursor_rect.rs:6261-6268 | src/document_core/queries/cursor_rect.rs:6584-6596 — both copies are in the same file, so extract the 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 `src/document_core/queries/cursor_rect.rs:6584` 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–12 lines × 23) src/cli/commands/edit/bookmarks.rs:84— src/cli/commands/edit/bookmarks.rs:84-94 | src/cli/commands/edit/bookmarks.rs:321-331 | src/cli/commands/edit/cell_paragraphs.rs:250-260 | src/cli/commands/edit/cells.rs:305-316 | src/cli/commands/edit/cells.rs:923-933 | src/cli/commands/edit/document_objects.rs:632-642 | src/cli/commands/edit/document_text.rs:89-100 | src/cli/commands/edit/equations.rs:81-91 | src/cli/commands/edit/formatting.rs:92-103 | src/cli/commands/edit/formatting.rs:230-241 | src/cli/commands/edit/formatting.rs:434-445 | src/cli/commands/edit/formatting.rs:956-967 | src/cli/commands/edit/header_footer_content.rs:359-369 | src/cli/commands/edit/header_footer_content.rs:509-519 | src/cli/commands/edit/header_footer_properties.rs:498-509 | src/cli/commands/edit/media.rs:977-987 | src/cli/commands/edit/note_content.rs:653-664 | src/cli/commands/edit/page.rs:76-86 | src/cli/commands/edit/page.rs:179-189 | src/cli/commands/edit/shapes.rs:124-134 | src/cli/commands/edit/shapes.rs:364-374 | src/cli/commands/edit/tables/insert.rs:128-138 | src/cli/commands/edit/tables/layout.rs:546-556 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/cell_paragraphs.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 170 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 `src/cli/commands/edit/bookmarks.rs:84` 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–12 lines × 18) src/cli/outputs/tabular.rs:50— src/cli/outputs/tabular.rs:50-60 | src/cli/outputs/text.rs:304-314 | src/cli/outputs/text.rs:562-573 | src/cli/queries/data_extraction.rs:76-86 | src/cli/queries/diagnostics.rs:19-30 | src/cli/queries/diagnostics.rs:145-156 | src/cli/queries/diagnostics.rs:603-613 | src/cli/queries/diagnostics.rs:833-844 | src/cli/queries/document_inventory.rs:38-48 | src/cli/queries/document_inventory.rs:103-113 | src/cli/queries/document_inventory.rs:175-185 | src/cli/queries/document_inventory.rs:248-258 | src/cli/queries/search.rs:94-104 | src/cli/queries/security_inspection.rs:61-71 | src/cli/queries/structure.rs:83-93 | src/cli/queries/structured_objects.rs:63-73 | src/cli/queries/structured_objects.rs:191-201 | src/cli/queries/structured_objects.rs:281-291 — before extracting anything, compare `src/cli/outputs/tabular.rs` and `src/cli/outputs/text.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 116 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, `src/cli/queries/structured_objects.rs:190` calls `unwrap_or` and `src/cli/outputs/tabular.rs:48` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 16) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:313— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:313-324 | src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:255-266 | src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:28-39 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:286-297 | src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:34-45 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:308-319 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:203-214 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:28-39 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:251-262 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:239-250 | src/bin/rhwp-q/commands/rhwp-q-page-items.rs:30-41 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:294-305 | src/bin/rhwp-q/commands/rhwp-q-scan-items.rs:29-40 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:28-39 | src/bin/rhwp-q/commands/rhwp-q-text-file.rs:205-216 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:244-255 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 105 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. 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 × 12) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:112— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:112-123 | src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:111-122 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:111-122 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:115-126 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:112-123 | src/bin/rhwp-q/commands/rhwp-q-object-cycle.rs:49-60 | src/bin/rhwp-q/commands/rhwp-q-objects.rs:49-60 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:103-114 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:111-122 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:101-112 | src/bin/rhwp-q/commands/rhwp-q-text-file.rs:98-109 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:112-123 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 105 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 `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 11) src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:231— src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:231-242 | src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:164-175 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:206-217 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:209-220 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:166-177 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:183-194 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:181-192 | src/bin/rhwp-q/commands/rhwp-q-page-items.rs:136-147 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:214-225 | src/bin/rhwp-q/commands/rhwp-q-text-file.rs:157-168 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:165-176 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 105 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. 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 × 8) src/cli/commands/edit/cell_paragraphs.rs:103— src/cli/commands/edit/cell_paragraphs.rs:103-114 | src/cli/commands/edit/cell_paragraphs.rs:263-274 | src/cli/commands/edit/cells.rs:323-334 | src/cli/commands/edit/cells.rs:590-601 | src/cli/commands/edit/cells.rs:759-770 | src/cli/commands/edit/cells.rs:936-947 | src/cli/commands/edit/formatting.rs:806-817 | src/cli/commands/edit/formatting.rs:970-981 — before extracting anything, compare `src/cli/commands/edit/cell_paragraphs.rs` and `src/cli/commands/edit/cells.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 262 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 × 8) src/wmf/parser/records/bitmap/bit_blt.rs:139— src/wmf/parser/records/bitmap/bit_blt.rs:139-149 | src/wmf/parser/records/bitmap/dib_bit_blt.rs:143-153 | src/wmf/parser/records/bitmap/dib_stretch_blt.rs:166-176 | src/wmf/parser/records/bitmap/stretch_blt.rs:163-173 | src/wmf/parser/records/drawing/ellipse.rs:53-64 | src/wmf/parser/records/drawing/rectangle.rs:52-63 | src/wmf/parser/records/state/scale_viewport_ext.rs:50-60 | src/wmf/parser/records/state/scale_window_ext.rs:50-60 — before extracting anything, compare `src/wmf/parser/records/bitmap/bit_blt.rs` and `src/wmf/parser/records/bitmap/dib_bit_blt.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. 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 × 7) crates/rhwp-ooxml-chart/src/renderer.rs:229— crates/rhwp-ooxml-chart/src/renderer.rs:229-241 | src/doclang/writer/escape.rs:56-67 | src/emf/converter/svg.rs:63-75 | src/ole_chart/svg_renderer.rs:415-427 | src/renderer/equation/svg_render.rs:776-788 | src/renderer/pdf.rs:1817-1829 | src/renderer/svg.rs:4417-4429 — before extracting anything, compare `src/doclang/writer/escape.rs` and `src/ole_chart/svg_renderer.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/rhwp-ooxml-chart/src/renderer.rs:229` 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–12 lines × 7) src/cli/commands/edit/cells.rs:419— src/cli/commands/edit/cells.rs:419-430 | src/cli/commands/edit/document_text.rs:163-173 | src/cli/commands/edit/media.rs:423-434 | src/cli/commands/edit/privacy.rs:268-278 | src/cli/commands/edit/text.rs:197-208 | src/cli/commands/tabular_import.rs:393-403 | src/cli/commands/tabular_import.rs:689-699 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 218 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 `src/cli/commands/edit/cells.rs:419` 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–12 lines × 7) src/document_core/commands/clipboard.rs:907— src/document_core/commands/clipboard.rs:907-918 | src/document_core/commands/clipboard.rs:1329-1340 | src/document_core/commands/foreign_paste.rs:43-54 | src/document_core/commands/formatting.rs:1168-1176 | src/document_core/commands/formatting.rs:1248-1256 | src/document_core/commands/formatting.rs:1803-1811 | src/document_core/commands/html_import.rs:189-200 — before extracting anything, compare `src/document_core/commands/clipboard.rs` and `src/document_core/commands/foreign_paste.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 6) src/document_core/commands/text_editing.rs:1699— src/document_core/commands/text_editing.rs:1699-1710 | src/document_core/commands/text_editing.rs:1952-1963 | src/document_core/commands/text_editing.rs:4268-4279 | src/document_core/commands/text_editing.rs:4424-4435 | src/document_core/commands/text_editing.rs:4922-4933 | src/document_core/commands/text_editing.rs:5144-5155 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/text_editing.rs:1699` 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 after the matched lines, `src/document_core/commands/text_editing.rs:1712` calls `paragraph_flow_end` and `src/document_core/commands/text_editing.rs:4280` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 5) src/diagnostics/hwp5_cell_header_probe.rs:790— src/diagnostics/hwp5_cell_header_probe.rs:790-802 | src/diagnostics/hwp5_contract_probe.rs:708-720 | src/diagnostics/hwp5_first_para_control_probe.rs:1390-1402 | src/diagnostics/hwp5_mel_personnel_probe.rs:704-716 | src/diagnostics/hwp5_table_probe.rs:555-567 — before extracting anything, compare `src/diagnostics/hwp5_cell_header_probe.rs` and `src/diagnostics/hwp5_contract_probe.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 370 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/diagnostics/hwp5_table_probe.rs:569` calls `is_table_ctrl_header`, `read_u32`, `Some` and `src/diagnostics/hwp5_cell_header_probe.rs:804` 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–12 lines × 5) src/wmf/parser/records/bitmap/stretch_dib.rs:99— src/wmf/parser/records/bitmap/stretch_dib.rs:99-110 | src/wmf/parser/records/drawing/arc.rs:80-91 | src/wmf/parser/records/drawing/chord.rs:83-94 | src/wmf/parser/records/drawing/pie.rs:82-93 | src/wmf/parser/records/drawing/round_rect.rs:68-78 — before extracting anything, compare `src/wmf/parser/records/bitmap/stretch_dib.rs` and `src/wmf/parser/records/drawing/arc.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/wmf/parser/records/bitmap/stretch_dib.rs:99` 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 (4–12 lines × 4) src/renderer/equation/brace_outline.rs:41— src/renderer/equation/brace_outline.rs:41-52 | src/renderer/equation/integral_outline.rs:48-59 | src/renderer/equation/multiplication_outline.rs:39-50 | src/renderer/equation/radical_outline.rs:51-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/equation/brace_outline.rs:41` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–12 lines × 3) src/renderer/equation/canvas_render.rs:441— src/renderer/equation/canvas_render.rs:441-450 | src/renderer/equation/svg_render.rs:511-520 | src/renderer/skia/equation_conv.rs:605-616 — before extracting anything, compare `src/renderer/equation/canvas_render.rs` and `src/renderer/equation/svg_render.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 198 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 `src/renderer/equation/canvas_render.rs:441` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–12 lines × 2) src/renderer/layout/shape_layout.rs:2582— src/renderer/layout/shape_layout.rs:2582-2593 | src/renderer/layout/tac_picture_item.inc.rs:275-282 — 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 `src/renderer/layout/shape_layout.rs:2582` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/renderer/layout/tac_picture_item.inc.rs:283` calls `Some` and `src/renderer/layout/shape_layout.rs:2594` 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–11 lines × 20) src/document_core/commands/clipboard.rs:956— src/document_core/commands/clipboard.rs:956-966 | src/document_core/commands/foreign_paste.rs:185-192 | src/document_core/commands/html_import.rs:263-272 | src/document_core/commands/object_ops/equation.rs:408-415 | src/document_core/commands/table_ops.rs:551-558 | src/document_core/commands/table_ops.rs:3474-3481 | src/document_core/commands/table_ops.rs:3796-3803 | src/document_core/commands/text_editing.rs:1486-1493 | src/document_core/commands/text_editing.rs:1684-1691 | src/document_core/commands/text_editing.rs:1712-1719 | src/document_core/commands/text_editing.rs:1937-1944 | src/document_core/commands/text_editing.rs:1965-1972 | src/document_core/commands/text_editing.rs:4034-4041 | src/document_core/commands/text_editing.rs:4107-4114 | src/document_core/commands/text_editing.rs:4509-4518 | src/document_core/commands/text_editing.rs:4571-4579 | src/document_core/commands/text_editing.rs:4695-4703 | src/document_core/commands/text_editing.rs:4906-4913 | src/document_core/commands/text_editing.rs:4935-4942 | src/document_core/queries/field_query.rs:180-187 — before extracting anything, compare `src/document_core/commands/clipboard.rs` and `src/document_core/commands/foreign_paste.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 134 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 `src/document_core/commands/clipboard.rs:956` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn stamp_caret(&mut` in one and `&mut` 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 × 17) src/cli/commands/edit/bookmarks.rs:196— src/cli/commands/edit/bookmarks.rs:196-206 | src/cli/commands/edit/cell_paragraphs.rs:88-98 | src/cli/commands/edit/cells.rs:575-585 | src/cli/commands/edit/cells.rs:744-754 | src/cli/commands/edit/controls.rs:68-78 | src/cli/commands/edit/equations.rs:313-323 | src/cli/commands/edit/formatting.rs:784-794 | src/cli/commands/edit/media.rs:862-872 | src/cli/commands/edit/notes.rs:258-268 | src/cli/commands/edit/shapes.rs:240-250 | src/cli/commands/edit/shapes.rs:514-524 | src/cli/commands/edit/tables/grid.rs:651-661 | src/cli/commands/edit/tables/grid.rs:795-805 | src/cli/commands/edit/tables/layout.rs:181-191 | src/cli/commands/edit/tables/layout.rs:425-435 | src/cli/commands/edit/tables/layout.rs:659-669 | src/cli/queries/structured_objects.rs:59-69 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/cell_paragraphs.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 170 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 `src/cli/commands/edit/bookmarks.rs:196` 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 × 11) src/bin/rhwp-agent/envlint.rs:10— src/bin/rhwp-agent/envlint.rs:10-20 | src/bin/rhwp-agent/envlint.rs:66-76 | src/bin/rhwp-agent/explorecmd.rs:16-26 | src/bin/rhwp-agent/files.rs:10-20 | src/bin/rhwp-agent/files.rs:55-65 | src/bin/rhwp-agent/inspect.rs:85-95 | src/bin/rhwp-agent/planlint.rs:10-20 | src/bin/rhwp-agent/safety.rs:13-23 | src/bin/rhwp-agent/safety.rs:52-62 | src/bin/rhwp-agent/safety.rs:673-683 | src/bin/rhwp-agent/stats.rs:157-167 — before extracting anything, compare `src/bin/rhwp-agent/inspect.rs` and `src/bin/rhwp-agent/safety.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/bin/rhwp-agent/explorecmd.rs:27` calls `detect_format` and `src/bin/rhwp-agent/safety.rs:63` 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 (11 lines × 9) src/cli/protocol/capsule/signing.rs:85— src/cli/protocol/capsule/signing.rs:85-95 | src/cli/protocol/exchange/bundle.rs:28-38 | src/cli/protocol/exchange/disclosure.rs:18-28 | src/cli/protocol/exchange/disclosure.rs:118-128 | src/cli/protocol/exchange/disclosure.rs:221-231 | src/cli/protocol/harness.rs:13-23 | src/cli/protocol/trust/anchor.rs:16-26 | src/cli/protocol/trust/anchor.rs:170-180 | src/cli/protocol/trust/governance.rs:596-606 — before extracting anything, compare `src/cli/protocol/capsule/signing.rs` and `src/cli/protocol/exchange/bundle.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/capsule/signing.rs: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.
Duplicated block (11 lines × 8) src/bin/rhwp-q/kit/caret_stops.rs:15— src/bin/rhwp-q/kit/caret_stops.rs:15-25 | src/bin/rhwp-q/kit/char_index.rs:17-27 | src/bin/rhwp-q/kit/cur_field_state.rs:17-27 | src/bin/rhwp-q/kit/field_info_at.rs:17-27 | src/bin/rhwp-q/kit/line_starts.rs:16-26 | src/bin/rhwp-q/kit/para_bounds.rs:16-26 | src/bin/rhwp-q/kit/word_end.rs:17-27 | src/bin/rhwp-q/kit/word_starts.rs:15-25 — before extracting anything, compare `src/bin/rhwp-q/kit/caret_stops.rs` and `src/bin/rhwp-q/kit/char_index.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 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 `src/bin/rhwp-q/kit/caret_stops.rs:15` 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–11 lines × 8) src/wmf/parser/records/bitmap/dib_stretch_blt.rs:149— src/wmf/parser/records/bitmap/dib_stretch_blt.rs:149-154 | src/wmf/parser/records/bitmap/stretch_blt.rs:146-151 | src/wmf/parser/records/bitmap/stretch_dib.rs:99-109 | src/wmf/parser/records/drawing/arc.rs:80-90 | src/wmf/parser/records/drawing/chord.rs:83-93 | src/wmf/parser/records/drawing/pat_blt.rs:62-67 | src/wmf/parser/records/drawing/pie.rs:82-92 | src/wmf/parser/records/drawing/round_rect.rs:68-78 — before extracting anything, compare `src/wmf/parser/records/bitmap/dib_stretch_blt.rs` and `src/wmf/parser/records/bitmap/stretch_blt.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 89 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 `src/wmf/parser/records/bitmap/dib_stretch_blt.rs:149` 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 (11 lines × 7) src/bin/rhwp-q/kit/caret_stops.rs:27— src/bin/rhwp-q/kit/caret_stops.rs:27-37 | src/bin/rhwp-q/kit/char_index.rs:29-39 | src/bin/rhwp-q/kit/cur_field_state.rs:29-39 | src/bin/rhwp-q/kit/line_starts.rs:28-38 | src/bin/rhwp-q/kit/para_bounds.rs:28-38 | src/bin/rhwp-q/kit/word_end.rs:29-39 | src/bin/rhwp-q/kit/word_starts.rs:27-37 — before extracting anything, compare `src/bin/rhwp-q/kit/caret_stops.rs` and `src/bin/rhwp-q/kit/char_index.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 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 `src/bin/rhwp-q/kit/caret_stops.rs:27` 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–11 lines × 7) src/cli/commands/edit/cells.rs:423— src/cli/commands/edit/cells.rs:423-433 | src/cli/commands/edit/document_text.rs:166-175 | src/cli/commands/edit/fields.rs:323-333 | src/cli/commands/edit/media.rs:427-437 | src/cli/commands/edit/privacy.rs:271-280 | src/cli/commands/edit/text.rs:201-211 | src/cli/commands/tabular_import.rs:396-406 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 218 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 `src/cli/commands/edit/cells.rs:423` 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 (4–11 lines × 7) src/document_core/queries/grep.rs:150— src/document_core/queries/grep.rs:150-160 | src/document_core/queries/grep.rs:185-188 | src/document_core/queries/hidden_text.rs:502-512 | src/document_core/queries/hidden_text.rs:535-545 | src/document_core/queries/hwpctrl_sets.rs:1577-1587 | src/document_core/queries/injection_scan.rs:1221-1231 | src/document_core/queries/rendering.rs:7036-7046 — before extracting anything, compare `src/document_core/queries/grep.rs` and `src/document_core/queries/injection_scan.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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 `src/document_core/queries/grep.rs:150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/document_core/queries/grep.rs:148` calls `iter`, `enumerate` and `src/document_core/queries/grep.rs:185` 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–11 lines × 5) src/document_core/commands/object_ops/table.rs:1186— src/document_core/commands/object_ops/table.rs:1186-1193 | src/document_core/commands/text_editing.rs:1510-1519 | src/document_core/commands/text_editing.rs:1553-1563 | src/document_core/commands/text_editing.rs:1737-1747 | src/document_core/commands/text_editing.rs:1987-1996 — before extracting anything, compare `src/document_core/commands/object_ops/table.rs` and `src/document_core/commands/text_editing.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/object_ops/table.rs:1186` 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 (10–11 lines × 4) src/parser/hwpx/section.rs:2844— src/parser/hwpx/section.rs:2844-2854 | src/parser/hwpx/section.rs:2908-2918 | src/parser/hwpx/section.rs:6706-6715 | src/parser/hwpx/section.rs:6818-6827 — 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 `src/parser/hwpx/section.rs:2844` 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 (3–11 lines × 3) bindings/Native/src/lib.rs:214— bindings/Native/src/lib.rs:214-224 | bindings/Native/src/lib.rs:244-246 | bindings/Native/src/lib.rs:269-279 — 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 `bindings/Native/src/lib.rs:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `bindings/Native/src/lib.rs:213` calls `from_bytes`, `map_err`, `page_count` and `bindings/Native/src/lib.rs:244` 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 (4–11 lines × 3) src/document_core/commands/header_footer_ops.rs:420— src/document_core/commands/header_footer_ops.rs:420-430 | src/document_core/commands/header_footer_ops.rs:502-512 | src/document_core/commands/header_footer_ops.rs:1135-1138 — 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 `src/document_core/commands/header_footer_ops.rs:1135` 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 (3–11 lines × 4) src/renderer/height_measurer.rs:2381— src/renderer/height_measurer.rs:2381-2391 | src/renderer/layout/paragraph_layout.rs:5722-5724 | src/renderer/layout/picture_footnote.rs:1945-1947 | src/renderer/typeset/paragraph/format.rs:445-453 — before extracting anything, compare `src/renderer/height_measurer.rs` and `src/renderer/layout/paragraph_layout.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/height_measurer.rs:2381` 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–11 lines × 2) src/renderer/layout/table_layout.rs:12181— src/renderer/layout/table_layout.rs:12181-12191 | src/renderer/layout/table_layout.rs:28626-28631 — both copies are in the same file, so extract the 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 `src/renderer/layout/table_layout.rs:12181` 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–11 lines × 2) src/renderer/layout/table_layout.rs:24959— src/renderer/layout/table_layout.rs:24959-24969 | src/renderer/layout/table_layout/reflow_nested_band.rs:84-90 — 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 × 28) src/cli/commands/edit/bookmarks.rs:196— src/cli/commands/edit/bookmarks.rs:196-206 | src/cli/commands/edit/cell_paragraphs.rs:88-98 | src/cli/commands/edit/cells.rs:575-585 | src/cli/commands/edit/cells.rs:744-754 | src/cli/commands/edit/controls.rs:68-78 | src/cli/commands/edit/document_objects.rs:70-79 | src/cli/commands/edit/equations.rs:313-323 | src/cli/commands/edit/formatting.rs:784-794 | src/cli/commands/edit/header_footer_content.rs:684-693 | src/cli/commands/edit/header_footer_content.rs:1113-1123 | src/cli/commands/edit/header_footer_properties.rs:233-243 | src/cli/commands/edit/media.rs:862-872 | src/cli/commands/edit/note_content.rs:301-310 | src/cli/commands/edit/notes.rs:258-268 | src/cli/commands/edit/shapes.rs:240-250 | src/cli/commands/edit/shapes.rs:514-524 | src/cli/commands/edit/tables/grid.rs:73-82 | src/cli/commands/edit/tables/grid.rs:181-190 | src/cli/commands/edit/tables/grid.rs:287-296 | src/cli/commands/edit/tables/grid.rs:536-545 | src/cli/commands/edit/tables/grid.rs:651-661 | src/cli/commands/edit/tables/grid.rs:795-805 | src/cli/commands/edit/tables/layout.rs:181-191 | src/cli/commands/edit/tables/layout.rs:306-315 | src/cli/commands/edit/tables/layout.rs:425-435 | src/cli/commands/edit/tables/layout.rs:659-669 | src/cli/commands/edit/tables/structure.rs:78-87 | src/cli/queries/structured_objects.rs:59-69 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/cell_paragraphs.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 170 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 `src/cli/commands/edit/bookmarks.rs:196` 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–10 lines × 9) src/cli/commands/edit/document_objects.rs:568— src/cli/commands/edit/document_objects.rs:568-575 | src/cli/commands/edit/fields.rs:35-44 | src/cli/commands/edit/formatting.rs:17-24 | src/cli/commands/edit/formatting.rs:157-164 | src/cli/commands/edit/formatting.rs:865-872 | src/cli/commands/edit/header_footer_properties.rs:15-22 | src/cli/commands/edit/note_content.rs:576-583 | src/cli/commands/edit/page.rs:12-19 | src/cli/commands/edit/page.rs:115-122 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/formatting.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 217 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 `src/cli/commands/edit/document_objects.rs:568` 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–10 lines × 7) src/cli/protocol/capsule/signing.rs:88— src/cli/protocol/capsule/signing.rs:88-97 | src/cli/protocol/exchange/bundle.rs:31-39 | src/cli/protocol/exchange/disclosure.rs:121-129 | src/cli/protocol/exchange/settlement.rs:325-333 | src/cli/protocol/trust/anchor.rs:19-27 | src/cli/protocol/trust/anchor.rs:173-181 | src/cli/protocol/trust/governance.rs:599-607 — before extracting anything, compare `src/cli/protocol/capsule/signing.rs` and `src/cli/protocol/exchange/bundle.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/cli/protocol/capsule/signing.rs:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–10 lines × 5) src/document_core/commands/text_editing.rs:1427— src/document_core/commands/text_editing.rs:1427-1435 | src/document_core/commands/text_editing.rs:1677-1686 | src/document_core/commands/text_editing.rs:1930-1939 | src/document_core/commands/text_editing.rs:4400-4409 | src/document_core/commands/text_editing.rs:4899-4908 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn stamp_caret(&mut` in one and `&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/document_core/commands/text_editing.rs:4411` calls `reflow_paragraph` and `src/document_core/commands/text_editing.rs:1688` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–10 lines × 3) src/document_core/commands/header_footer_ops.rs:409— src/document_core/commands/header_footer_ops.rs:409-415 | src/document_core/commands/header_footer_ops.rs:486-495 | src/document_core/commands/header_footer_ops.rs:550-556 — 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 `src/document_core/commands/header_footer_ops.rs:486` 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 (4–10 lines × 3) src/serializer/hwpx/picture.rs:748— src/serializer/hwpx/picture.rs:748-757 | src/serializer/hwpx/section.rs:5118-5121 | src/serializer/hwpx/shape.rs:1661-1670 — before extracting anything, compare `src/serializer/hwpx/picture.rs` and `src/serializer/hwpx/shape.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 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 `src/serializer/hwpx/picture.rs:748` 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 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 × 17) src/bin/rhwp-agent/envelope.rs:46— src/bin/rhwp-agent/envelope.rs:46-54 | src/bin/rhwp-q/commands/rhwp-q-char-shape.rs:313-321 | src/bin/rhwp-q/commands/rhwp-q-control-layout.rs:255-263 | src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:28-36 | src/bin/rhwp-q/commands/rhwp-q-cursor-rect.rs:286-294 | src/bin/rhwp-q/commands/rhwp-q-font-trace.rs:34-42 | src/bin/rhwp-q/commands/rhwp-q-form-info.rs:308-316 | src/bin/rhwp-q/commands/rhwp-q-markdown.rs:203-211 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:28-36 | src/bin/rhwp-q/commands/rhwp-q-page-def.rs:251-259 | src/bin/rhwp-q/commands/rhwp-q-page-images.rs:239-247 | src/bin/rhwp-q/commands/rhwp-q-page-items.rs:30-38 | src/bin/rhwp-q/commands/rhwp-q-para-shape.rs:294-302 | src/bin/rhwp-q/commands/rhwp-q-scan-items.rs:29-37 | src/bin/rhwp-q/commands/rhwp-q-section-starts.rs:28-36 | src/bin/rhwp-q/commands/rhwp-q-text-file.rs:205-213 | src/bin/rhwp-q/commands/rhwp-q-text-layout.rs:244-252 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-char-shape.rs` and `src/bin/rhwp-q/commands/rhwp-q-control-layout.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 105 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 `src/bin/rhwp-agent/envelope.rs:46` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 16) src/cli/commands/edit/bookmarks.rs:142— src/cli/commands/edit/bookmarks.rs:142-149 | src/cli/commands/edit/controls.rs:14-21 | src/cli/commands/edit/document_text.rs:729-736 | src/cli/commands/edit/equations.rs:259-266 | src/cli/commands/edit/formatting.rs:596-603 | src/cli/commands/edit/formatting.rs:713-720 | src/cli/commands/edit/media.rs:808-815 | src/cli/commands/edit/note_content.rs:16-23 | src/cli/commands/edit/notes.rs:204-211 | src/cli/commands/edit/shapes.rs:186-193 | src/cli/commands/edit/shapes.rs:460-467 | src/cli/commands/edit/tables/layout.rs:11-18 | src/cli/commands/edit/tables/structure.rs:124-131 | src/cli/commands/edit/tables/structure.rs:219-226 | src/cli/commands/edit/tables/structure.rs:314-321 | src/cli/commands/tabular_import.rs:37-45 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/controls.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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 `src/cli/commands/edit/bookmarks.rs:142` 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 × 14) src/wmf/parser/objects/graphics/font.rs:123— src/wmf/parser/objects/graphics/font.rs:123-131 | src/wmf/parser/objects/structure/bitmap16.rs:79-87 | src/wmf/parser/records/bitmap/bit_blt.rs:140-148 | src/wmf/parser/records/bitmap/dib_bit_blt.rs:144-152 | src/wmf/parser/records/bitmap/dib_stretch_blt.rs:167-175 | src/wmf/parser/records/bitmap/stretch_blt.rs:164-172 | src/wmf/parser/records/drawing/arc.rs:71-79 | src/wmf/parser/records/drawing/chord.rs:74-82 | src/wmf/parser/records/drawing/ellipse.rs:54-62 | src/wmf/parser/records/drawing/pie.rs:73-81 | src/wmf/parser/records/drawing/rectangle.rs:53-61 | src/wmf/parser/records/drawing/round_rect.rs:61-69 | src/wmf/parser/records/state/scale_viewport_ext.rs:51-59 | src/wmf/parser/records/state/scale_window_ext.rs:51-59 — before extracting anything, compare `src/wmf/parser/records/bitmap/bit_blt.rs` and `src/wmf/parser/records/bitmap/dib_bit_blt.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 `src/wmf/parser/objects/graphics/font.rs:123` 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 (8–9 lines × 7) src/cli/commands/edit/document_text.rs:18— src/cli/commands/edit/document_text.rs:18-26 | src/cli/commands/edit/document_text.rs:233-240 | src/cli/commands/edit/document_text.rs:343-350 | src/cli/commands/edit/document_text.rs:479-486 | src/cli/commands/edit/document_text.rs:614-621 | src/cli/commands/edit/equations.rs:127-134 | src/cli/commands/edit/header_footer_properties.rs:280-287 — before extracting anything, compare `src/cli/commands/edit/document_text.rs` and `src/cli/commands/edit/equations.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 163 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 `src/cli/commands/edit/document_text.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 (9 lines × 7) src/document_core/queries/hwpctrl_sets.rs:1026— src/document_core/queries/hwpctrl_sets.rs:1026-1034 | src/document_core/queries/hwpctrl_sets.rs:1100-1108 | src/document_core/queries/hwpctrl_sets.rs:1304-1312 | src/document_core/queries/hwpctrl_sets.rs:1654-1662 | src/document_core/queries/hwpctrl_sets.rs:1710-1718 | src/document_core/queries/hwpctrl_sets.rs:1756-1764 | src/document_core/queries/hwpctrl_sets.rs:1972-1980 — all 7 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 (6–9 lines × 2) src/renderer/layout/table_layout.rs:24447— src/renderer/layout/table_layout.rs:24447-24452 | src/renderer/layout/table_layout.rs:28506-28514 — both copies are in the same file, so extract the 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 (8 lines × 25) src/cli/commands/edit/bookmarks.rs:151— src/cli/commands/edit/bookmarks.rs:151-158 | src/cli/commands/edit/controls.rs:23-30 | src/cli/commands/edit/document_objects.rs:286-293 | src/cli/commands/edit/document_objects.rs:424-431 | src/cli/commands/edit/document_text.rs:738-745 | src/cli/commands/edit/document_text.rs:1039-1046 | src/cli/commands/edit/equations.rs:268-275 | src/cli/commands/edit/formatting.rs:26-33 | src/cli/commands/edit/formatting.rs:166-173 | src/cli/commands/edit/formatting.rs:605-612 | src/cli/commands/edit/header_footer_properties.rs:24-31 | src/cli/commands/edit/media.rs:817-824 | src/cli/commands/edit/media.rs:915-922 | src/cli/commands/edit/note_content.rs:25-32 | src/cli/commands/edit/note_content.rs:254-261 | src/cli/commands/edit/note_content.rs:362-369 | src/cli/commands/edit/note_content.rs:472-479 | src/cli/commands/edit/note_content.rs:585-592 | src/cli/commands/edit/notes.rs:23-30 | src/cli/commands/edit/notes.rs:118-125 | src/cli/commands/edit/notes.rs:213-220 | src/cli/commands/edit/shapes.rs:29-36 | src/cli/commands/edit/shapes.rs:195-202 | src/cli/commands/edit/shapes.rs:469-476 | src/cli/queries/structured_objects.rs:26-33 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/controls.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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 `src/cli/commands/edit/bookmarks.rs:151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 20) src/cli/commands/edit/bookmarks.rs:15— src/cli/commands/edit/bookmarks.rs:15-22 | src/cli/commands/edit/cell_paragraphs.rs:17-24 | src/cli/commands/edit/cell_paragraphs.rs:174-181 | src/cli/commands/edit/cells.rs:494-501 | src/cli/commands/edit/cells.rs:664-671 | src/cli/commands/edit/document_text.rs:837-844 | src/cli/commands/edit/document_text.rs:933-940 | src/cli/commands/edit/document_text.rs:1030-1037 | src/cli/commands/edit/header_footer_content.rs:257-264 | src/cli/commands/edit/header_footer_content.rs:414-421 | src/cli/commands/edit/header_footer_content.rs:586-593 | src/cli/commands/edit/header_footer_content.rs:740-747 | src/cli/commands/edit/header_footer_content.rs:879-886 | src/cli/commands/edit/header_footer_content.rs:1012-1019 | src/cli/commands/edit/header_footer_properties.rs:398-405 | src/cli/commands/edit/note_content.rs:235-242 | src/cli/commands/edit/note_content.rs:353-360 | src/cli/commands/edit/note_content.rs:463-470 | src/cli/commands/edit/notes.rs:14-21 | src/cli/commands/edit/notes.rs:109-116 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/cell_paragraphs.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 170 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 `src/cli/commands/edit/bookmarks.rs:15` 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 × 17) src/bin/rhwp-agent/fields.rs:8— src/bin/rhwp-agent/fields.rs:8-15 | src/bin/rhwp-agent/fields.rs:42-49 | src/bin/rhwp-agent/harvest.rs:101-108 | src/bin/rhwp-agent/harvest.rs:251-258 | src/bin/rhwp-agent/locate.rs:18-25 | src/bin/rhwp-agent/lookups.rs:13-20 | src/bin/rhwp-agent/lookups.rs:51-58 | src/bin/rhwp-agent/lookups.rs:178-185 | src/bin/rhwp-agent/lookups.rs:226-233 | src/bin/rhwp-agent/lookups.rs:256-263 | src/bin/rhwp-agent/lookups.rs:299-306 | src/bin/rhwp-agent/lookups.rs:326-333 | src/bin/rhwp-agent/lookups.rs:374-381 | src/bin/rhwp-agent/lookups.rs:450-457 | src/bin/rhwp-agent/lookups.rs:487-494 | src/bin/rhwp-agent/tables.rs:8-15 | src/bin/rhwp-agent/tables.rs:45-52 — before extracting anything, compare `src/bin/rhwp-agent/harvest.rs` and `src/bin/rhwp-agent/lookups.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–8 lines × 10) src/wmf/parser/records/bitmap/bit_blt.rs:144— src/wmf/parser/records/bitmap/bit_blt.rs:144-150 | src/wmf/parser/records/bitmap/dib_bit_blt.rs:148-154 | src/wmf/parser/records/bitmap/dib_stretch_blt.rs:171-177 | src/wmf/parser/records/bitmap/stretch_blt.rs:168-174 | src/wmf/parser/records/drawing/ellipse.rs:58-65 | src/wmf/parser/records/drawing/rectangle.rs:57-64 | src/wmf/parser/records/state/exclude_clip_rect.rs:50-55 | src/wmf/parser/records/state/intersect_clip_rect.rs:50-55 | src/wmf/parser/records/state/scale_viewport_ext.rs:55-61 | src/wmf/parser/records/state/scale_window_ext.rs:55-61 — before extracting anything, compare `src/wmf/parser/records/bitmap/bit_blt.rs` and `src/wmf/parser/records/bitmap/dib_bit_blt.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 `src/wmf/parser/records/bitmap/bit_blt.rs:144` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 4) src/serializer/hwpx/section.rs:3480— src/serializer/hwpx/section.rs:3480-3486 | src/serializer/hwpx/section.rs:5001-5007 | src/serializer/hwpx/shape.rs:733-740 | src/serializer/hwpx/table.rs:510-517 — before extracting anything, compare `src/serializer/hwpx/section.rs` and `src/serializer/hwpx/shape.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–8 lines × 3) src/renderer/float_placement/stored_column_spacing.rs:71— src/renderer/float_placement/stored_column_spacing.rs:71-76 | src/renderer/layout/table_layout.rs:2735-2742 | src/renderer/layout/table_layout.rs:14852-14858 — 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 `src/renderer/float_placement/stored_column_spacing.rs:71` 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 × 17) src/cli/commands/edit/bookmarks.rs:143— src/cli/commands/edit/bookmarks.rs:143-149 | src/cli/commands/edit/controls.rs:15-21 | src/cli/commands/edit/document_objects.rs:278-284 | src/cli/commands/edit/document_objects.rs:416-422 | src/cli/commands/edit/document_text.rs:730-736 | src/cli/commands/edit/equations.rs:260-266 | src/cli/commands/edit/formatting.rs:18-24 | src/cli/commands/edit/formatting.rs:158-164 | src/cli/commands/edit/formatting.rs:597-603 | src/cli/commands/edit/header_footer_properties.rs:16-22 | src/cli/commands/edit/media.rs:809-815 | src/cli/commands/edit/media.rs:907-913 | src/cli/commands/edit/note_content.rs:17-23 | src/cli/commands/edit/note_content.rs:577-583 | src/cli/commands/edit/notes.rs:205-211 | src/cli/commands/edit/shapes.rs:187-193 | src/cli/commands/edit/shapes.rs:461-467 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/controls.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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 `src/cli/commands/edit/bookmarks.rs:143` 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 × 14) src/cli/commands/edit/bookmarks.rs:143— src/cli/commands/edit/bookmarks.rs:143-149 | src/cli/commands/edit/controls.rs:15-21 | src/cli/commands/edit/document_objects.rs:278-284 | src/cli/commands/edit/equations.rs:260-266 | src/cli/commands/edit/header_footer_properties.rs:16-22 | src/cli/commands/edit/media.rs:809-815 | src/cli/commands/edit/media.rs:907-913 | src/cli/commands/edit/note_content.rs:17-23 | src/cli/commands/edit/note_content.rs:354-360 | src/cli/commands/edit/note_content.rs:464-470 | src/cli/commands/edit/note_content.rs:577-583 | src/cli/commands/edit/notes.rs:205-211 | src/cli/commands/edit/shapes.rs:187-193 | src/cli/commands/edit/shapes.rs:461-467 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/controls.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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 `src/cli/commands/edit/bookmarks.rs:143` 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 × 13) src/cli/commands/edit/document_objects.rs:152— src/cli/commands/edit/document_objects.rs:152-158 | src/cli/commands/edit/document_text.rs:234-240 | src/cli/commands/edit/document_text.rs:344-350 | src/cli/commands/edit/document_text.rs:480-486 | src/cli/commands/edit/document_text.rs:615-621 | src/cli/commands/edit/document_text.rs:838-844 | src/cli/commands/edit/document_text.rs:934-940 | src/cli/commands/edit/document_text.rs:1031-1037 | src/cli/commands/edit/equations.rs:128-134 | src/cli/commands/edit/note_content.rs:354-360 | src/cli/commands/edit/note_content.rs:464-470 | src/cli/commands/edit/notes.rs:15-21 | src/cli/commands/edit/notes.rs:110-116 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 213 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 `src/cli/commands/edit/document_objects.rs:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 8) src/document_core/queries/hwpctrl_sets.rs:1024— src/document_core/queries/hwpctrl_sets.rs:1024-1030 | src/document_core/queries/hwpctrl_sets.rs:1098-1104 | src/document_core/queries/hwpctrl_sets.rs:1158-1164 | src/document_core/queries/hwpctrl_sets.rs:1302-1308 | src/document_core/queries/hwpctrl_sets.rs:1652-1658 | src/document_core/queries/hwpctrl_sets.rs:1708-1714 | src/document_core/queries/hwpctrl_sets.rs:1754-1760 | src/document_core/queries/hwpctrl_sets.rs:2059-2065 — all 8 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 (6–7 lines × 7) src/bin/rhwp-q/more/inventory.rs:463— src/bin/rhwp-q/more/inventory.rs:463-469 | src/bin/rhwp-q/more/inventory.rs:490-496 | src/bin/rhwp-q/more/inventory.rs:960-966 | src/bin/rhwp-q/more/inventory.rs:1292-1298 | src/bin/rhwp-q/pack/inventory.rs:417-422 | src/bin/rhwp-q/pack/inventory.rs:1017-1022 | src/bin/rhwp-q/pack/inventory.rs:1042-1047 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:463` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–7 lines × 5) src/document_core/queries/rendering_metafile_resources.rs:203— src/document_core/queries/rendering_metafile_resources.rs:203-208 | src/renderer/layout.rs:1122-1128 | src/renderer/layout.rs:6816-6821 | src/renderer/layout.rs:10090-10095 | src/renderer/typeset.rs:1312-1318 — before extracting anything, compare `src/renderer/layout.rs` and `src/renderer/typeset.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 110 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 `src/renderer/layout.rs:1122` 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–7 lines × 4) src/renderer/layout/table_layout.rs:22241— src/renderer/layout/table_layout.rs:22241-22247 | src/renderer/layout/table_layout.rs:22278-22284 | src/renderer/layout/table_layout.rs:22338-22344 | src/renderer/layout/table_layout.rs:24952-24956 — 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 `src/renderer/layout/table_layout.rs:22241` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–13 lines × 4) src/bin/rhwp-agent/envelope.rs:33— src/bin/rhwp-agent/envelope.rs:33-39 | src/bin/rhwp-q/kit/envelope.rs:17-29 | src/bin/rhwp-q/more/envelope.rs:13-25 | src/bin/rhwp-q/pack/envelope.rs:13-25 — `src/bin/rhwp-q/kit/envelope.rs` and `src/bin/rhwp-q/more/envelope.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-agent/envelope.rs:33` 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 (1–7 lines × 3) src/document_core/html_table_import.rs:1105— src/document_core/html_table_import.rs:1105-1105 | src/renderer/svg.rs:4527-4533 | src/renderer/web_canvas.rs:315-321 — before extracting anything, compare `src/renderer/svg.rs` and `src/renderer/web_canvas.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 321 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 `src/renderer/svg.rs:4527` 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 × 10) src/bin/rhwp-q/more/inventory.rs:382— src/bin/rhwp-q/more/inventory.rs:382-387 | src/bin/rhwp-q/more/inventory.rs:409-414 | src/bin/rhwp-q/more/inventory.rs:436-441 | src/bin/rhwp-q/more/inventory.rs:987-992 | src/bin/rhwp-q/more/inventory.rs:1130-1135 | src/bin/rhwp-q/more/inventory.rs:1265-1270 | src/bin/rhwp-q/pack/inventory.rs:84-89 | src/bin/rhwp-q/pack/inventory.rs:549-554 | src/bin/rhwp-q/pack/inventory.rs:990-995 | src/bin/rhwp-q/pack/inventory.rs:1067-1072 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:382` 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 × 7) src/bin/rhwp-q/more/inventory.rs:301— src/bin/rhwp-q/more/inventory.rs:301-306 | src/bin/rhwp-q/more/inventory.rs:328-333 | src/bin/rhwp-q/more/inventory.rs:355-360 | src/bin/rhwp-q/more/inventory.rs:1014-1019 | src/bin/rhwp-q/more/inventory.rs:1184-1189 | src/bin/rhwp-q/pack/inventory.rs:522-527 | src/bin/rhwp-q/pack/inventory.rs:963-968 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/bin/rhwp-q/more/inventory.rs:301` 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 (4–6 lines × 3) src/cli/batch/query.rs:80— src/cli/batch/query.rs:80-85 | src/cli/queries/data_extraction.rs:86-93 | src/mcp_serve.rs:1968-1971 — 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 `src/cli/batch/query.rs:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (2–6 lines × 8) src/document_core/commands/object_ops/common.rs:37— src/document_core/commands/object_ops/common.rs:37-39 | src/document_core/commands/object_ops/common.rs:41-42 | src/emf/converter/device_stroke.rs:10-12 | src/emf/converter/device_stroke.rs:13-14 | src/parser/control/shape.rs:554-559 | src/parser/control/shape.rs:562-563 | src/parser/hwpx/section.rs:4158-4163 | src/parser/hwpx/section.rs:4166-4167 — there are 8 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/object_ops/common.rs: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.
Duplicated block (5 lines × 18) src/wmf/parser/records/bitmap/bit_blt.rs:145— src/wmf/parser/records/bitmap/bit_blt.rs:145-149 | src/wmf/parser/records/bitmap/dib_bit_blt.rs:149-153 | src/wmf/parser/records/bitmap/dib_stretch_blt.rs:149-154 | src/wmf/parser/records/bitmap/dib_stretch_blt.rs:172-176 | src/wmf/parser/records/bitmap/stretch_blt.rs:146-151 | src/wmf/parser/records/bitmap/stretch_blt.rs:169-173 | src/wmf/parser/records/bitmap/stretch_dib.rs:99-107 | src/wmf/parser/records/drawing/arc.rs:80-88 | src/wmf/parser/records/drawing/chord.rs:83-91 | src/wmf/parser/records/drawing/ellipse.rs:59-64 | src/wmf/parser/records/drawing/pat_blt.rs:62-67 | src/wmf/parser/records/drawing/pie.rs:82-90 | src/wmf/parser/records/drawing/rectangle.rs:58-63 | src/wmf/parser/records/drawing/round_rect.rs:68-76 | src/wmf/parser/records/state/exclude_clip_rect.rs:50-54 | src/wmf/parser/records/state/intersect_clip_rect.rs:50-54 | src/wmf/parser/records/state/scale_viewport_ext.rs:56-60 | src/wmf/parser/records/state/scale_window_ext.rs:56-60 — before extracting anything, compare `src/wmf/parser/records/bitmap/bit_blt.rs` and `src/wmf/parser/records/bitmap/dib_bit_blt.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 `src/wmf/parser/records/bitmap/bit_blt.rs:145` 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/wmf/parser/records/bitmap/dib_stretch_blt.rs:148` calls `parse` and `src/wmf/parser/records/bitmap/bit_blt.rs:144` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 10) src/cli/commands/edit/bookmarks.rs:139— src/cli/commands/edit/bookmarks.rs:139-143 | src/cli/commands/edit/bookmarks.rs:246-250 | src/cli/commands/edit/controls.rs:11-15 | src/cli/commands/edit/document_objects.rs:273-277 | src/cli/commands/edit/equations.rs:256-260 | src/cli/commands/edit/media.rs:805-809 | src/cli/commands/edit/media.rs:902-906 | src/cli/commands/edit/notes.rs:201-205 | src/cli/commands/edit/shapes.rs:183-187 | src/cli/commands/edit/shapes.rs:457-461 — before extracting anything, compare `src/cli/commands/edit/bookmarks.rs` and `src/cli/commands/edit/controls.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 9) src/diagnostics/hwp5_anchor_trace.rs:149— src/diagnostics/hwp5_anchor_trace.rs:149-153 | src/diagnostics/hwp5_borderfill_diagonal_probe.rs:432-436 | src/diagnostics/hwp5_cell_header_probe.rs:691-695 | src/diagnostics/hwp5_char_shape_audit.rs:359-363 | src/diagnostics/hwp5_char_shape_audit.rs:385-389 | src/diagnostics/hwp5_contract_probe.rs:599-603 | src/diagnostics/hwp5_first_para_control_probe.rs:1296-1300 | src/diagnostics/hwp5_mel_personnel_probe.rs:605-609 | src/diagnostics/hwp5_table_probe.rs:350-354 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 7) src/cli/commands/edit/cells.rs:396— src/cli/commands/edit/cells.rs:396-400 | src/cli/commands/edit/document_text.rs:140-144 | src/cli/commands/edit/media.rs:400-404 | src/cli/commands/edit/runtime.rs:220-224 | src/cli/commands/edit/text.rs:158-162 | src/cli/commands/tabular_import.rs:370-374 | src/cli/commands/tabular_import.rs:666-670 — before extracting anything, compare `src/cli/commands/edit/cells.rs` and `src/cli/commands/edit/document_text.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 218 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 `src/cli/commands/edit/cells.rs:396` 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 (4–5 lines × 5) src/diagnostics/hwp5_inventory_diff.rs:758— src/diagnostics/hwp5_inventory_diff.rs:758-761 | src/diagnostics/hwp5_inventory_diff.rs:857-861 | src/diagnostics/hwp5_inventory_diff.rs:921-925 | src/diagnostics/hwp5_inventory_diff.rs:980-984 | src/diagnostics/hwp5_inventory_diff.rs:1043-1047 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/diagnostics/hwp5_inventory_diff.rs:1039` calls `table_probe_axes` and `src/diagnostics/hwp5_inventory_diff.rs:976` 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 (3–5 lines × 6) src/document_core/commands/document/grown_table_heights.rs:70— src/document_core/commands/document/grown_table_heights.rs:70-74 | src/document_core/commands/header_footer_ops.rs:947-949 | src/document_core/queries/hwpctrl_sets.rs:1598-1600 | src/document_core/queries/rendering.rs:4963-4967 | src/document_core/queries/rendering.rs:6737-6741 | src/renderer/render_normalization.rs:134-138 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/document_core/commands/document/grown_table_heights.rs:70` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/renderer/render_normalization.rs:139` calls `top_level` and `src/document_core/commands/document/grown_table_heights.rs:75` 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 (3–5 lines × 3) src/native_host/gpu_d3d.rs:129— src/native_host/gpu_d3d.rs:129-133 | src/native_host/gpu_gl.rs:98-100 | src/native_host/gpu_metal.rs:70-74 — before extracting anything, compare `src/native_host/gpu_d3d.rs` and `src/native_host/gpu_metal.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 170 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 `src/native_host/gpu_d3d.rs:129` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/native_host/gpu_d3d.rs:128` calls `contains` and `src/native_host/gpu_gl.rs:98` 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 (3–5 lines × 7) src/diagnostics/layout_anomaly.rs:603— src/diagnostics/layout_anomaly.rs:603-605 | src/document_core/queries/rendering.rs:2740-2742 | src/native_host/view.rs:296-298 | src/paint/paint_bounds.rs:332-336 | src/parser/pdf/table_detection.rs:39-41 | src/parser/pdf/table_detection/cell_regions.rs:154-156 | src/renderer/hyperlinks.rs:43-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/paint/paint_bounds.rs:332` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `a` to `&BoundingBox` in one and `BoundingBox` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 11) src/bin/rhwp-q/kit/cell_shape.rs:77— src/bin/rhwp-q/kit/cell_shape.rs:77-86 | src/bin/rhwp-q/kit/cursor_in_cell.rs:115-124 | src/bin/rhwp-q/kit/cursor_in_footnote.rs:110-119 | src/bin/rhwp-q/kit/cursor_in_hf.rs:148-157 | src/bin/rhwp-q/kit/cursor_in_note.rs:109-118 | src/bin/rhwp-q/kit/flow_images.rs:80-89 | src/bin/rhwp-q/kit/footnote_hit.rs:99-108 | src/bin/rhwp-q/kit/footnote_info.rs:94-103 | src/bin/rhwp-q/kit/hit_header.rs:99-108 | src/bin/rhwp-q/kit/note_edit_info.rs:94-103 | src/bin/rhwp-q/kit/overlay_images.rs:84-93 — before extracting anything, compare `src/bin/rhwp-q/kit/cell_shape.rs` and `src/bin/rhwp-q/kit/flow_images.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 8) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:519— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:519-523 | src/diagnostics/hwp5_cell_header_probe.rs:867-871 | src/diagnostics/hwp5_contract_probe.rs:785-789 | src/diagnostics/hwp5_first_para_control_probe.rs:1404-1408 | src/diagnostics/hwp5_inventory_diff.rs:1800-1804 | src/diagnostics/hwp5_mel_personnel_probe.rs:781-785 | src/diagnostics/hwp5_table_probe.rs:636-640 | src/renderer/image_header.rs:262-266 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 14) src/document_core/commands/document.rs:2640— src/document_core/commands/document.rs:2640-2647 | src/document_core/queries/rendering.rs:5462-5467 | src/model/paragraph.rs:2508-2513 | src/renderer/composer/frame_geometry.rs:82-87 | src/renderer/page_number.rs:59-64 | src/renderer/pagination.rs:735-740 | src/renderer/render_normalization.rs:389-394 | src/renderer/typeset/state.rs:483-488 | src/renderer/typeset/state.rs:769-774 | src/renderer/typeset/state.rs:787-794 | src/renderer/typeset/state.rs:815-822 | src/renderer/typeset/state.rs:868-873 | src/renderer/typeset/state.rs:964-971 | src/renderer/typeset/state.rs:1098-1105 — before extracting anything, compare `src/renderer/render_normalization.rs` and `src/renderer/typeset/state.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/renderer/composer/frame_geometry.rs:82` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn paginate_pass(&mut` in one and `&mut` 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 (12 lines × 14) src/renderer/composer/conjoining_jamo.rs:89— src/renderer/composer/conjoining_jamo.rs:89-100 | src/renderer/composer/line_breaking.rs:4347-4358 | src/renderer/composer/line_breaking.rs:5427-5438 | src/renderer/composer/line_breaking.rs:5466-5477 | src/renderer/composer/reflow_helpers.inc.rs:703-714 | src/renderer/composer/reflow_helpers.inc.rs:904-915 | src/renderer/composer/stored_word_tail.rs:28-39 | src/renderer/composer/stored_word_tail.rs:119-130 | src/renderer/composer/stored_word_tail.rs:184-195 | src/renderer/height_measurer.rs:1727-1738 | src/renderer/inline_flow.rs:1009-1020 | src/renderer/render_normalization/stored_text_metrics.rs:203-214 | src/renderer/typeset.rs:1723-1734 | src/renderer/typeset/table.rs:50-61 — before extracting anything, compare `src/renderer/composer/reflow_helpers.inc.rs` and `src/renderer/composer/stored_word_tail.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `src/renderer/composer/conjoining_jamo.rs:89` 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 × 13) src/renderer/composer/reflow_helpers.inc.rs:201— src/renderer/composer/reflow_helpers.inc.rs:201-214 | src/renderer/composer/stored_cell_reflow.inc.rs:703-716 | src/renderer/composer/stored_margin_context.rs:52-65 | src/renderer/composer/stored_margin_context.rs:108-121 | src/renderer/composer/stored_word_tail.rs:506-519 | src/renderer/equation_tac_flow.rs:42-55 | src/renderer/inline_flow.rs:263-276 | src/renderer/pagination.rs:563-576 | src/renderer/typeset.rs:1761-1774 | src/renderer/typeset/paragraph.rs:81-94 | src/renderer/typeset/paragraph.rs:1296-1309 | src/renderer/typeset/paragraph/columns.rs:15-28 | src/renderer/typeset/table.rs:239-252 — before extracting anything, compare `src/renderer/composer/reflow_helpers.inc.rs` and `src/renderer/composer/stored_word_tail.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `src/renderer/composer/reflow_helpers.inc.rs:201` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 12) src/renderer/composer/reflow_helpers.inc.rs:536— src/renderer/composer/reflow_helpers.inc.rs:536-548 | src/renderer/composer/stored_margin_context.rs:200-212 | src/renderer/composer/stored_margin_context.rs:259-271 | src/renderer/composer/stored_word_tail.rs:404-416 | src/renderer/composer/stored_word_tail.rs:467-479 | src/renderer/layout/shape_layout.rs:376-388 | src/renderer/mod.rs:2705-2717 | src/renderer/pagination.rs:1395-1407 | src/renderer/render_normalization/cached_frame_owner.rs:82-94 | src/renderer/render_normalization/stored_nested_text_frames.rs:63-75 | src/renderer/render_normalization/stored_text_metrics.rs:139-151 | src/renderer/typeset/paragraph.rs:1472-1484 — before extracting anything, compare `src/renderer/composer/reflow_helpers.inc.rs` and `src/renderer/composer/stored_word_tail.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `src/renderer/composer/reflow_helpers.inc.rs:536` 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 × 11) src/serializer/char_shape.rs:9— src/serializer/char_shape.rs:9-13 | src/serializer/doc_info.rs:300-304 | src/serializer/doc_info.rs:324-328 | src/serializer/doc_info.rs:377-381 | src/serializer/doc_info.rs:596-600 | src/serializer/doc_info.rs:702-706 | src/serializer/doc_info.rs:817-821 | src/serializer/doc_info.rs:842-846 | src/serializer/doc_info.rs:906-910 | src/serializer/doc_info.rs:970-974 | src/serializer/doc_info.rs:1060-1064 — there are 11 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 11 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (13 lines × 6) src/serializer/hwpx/context.rs:582— src/serializer/hwpx/context.rs:582-594 | src/serializer/hwpx/context.rs:600-612 | src/serializer/hwpx/context.rs:618-630 | src/serializer/hwpx/context.rs:636-648 | src/serializer/hwpx/context.rs:654-666 | src/serializer/hwpx/context.rs:672-684 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/serializer/hwpx/context.rs:582` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 9) src/diagnostics/hwp5_borderfill_diagonal_probe.rs:129— src/diagnostics/hwp5_borderfill_diagonal_probe.rs:129-141 | src/diagnostics/hwp5_cell_header_probe.rs:199-211 | src/diagnostics/hwp5_char_shape_audit.rs:203-215 | src/diagnostics/hwp5_contract_probe.rs:151-163 | src/diagnostics/hwp5_ctrl_data_trace.rs:92-104 | src/diagnostics/hwp5_first_para_control_probe.rs:155-167 | src/diagnostics/hwp5_inventory_diff.rs:323-335 | src/diagnostics/hwp5_mel_personnel_probe.rs:145-157 | src/diagnostics/hwp5_table_probe.rs:151-163 — before extracting anything, compare `src/diagnostics/hwp5_borderfill_diagonal_probe.rs` and `src/diagnostics/hwp5_cell_header_probe.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 254 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 `src/diagnostics/hwp5_borderfill_diagonal_probe.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/diagnostics/hwp5_contract_probe.rs:165` calls `ok_or_else`, `to_string` and `src/diagnostics/hwp5_inventory_diff.rs:337` 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 × 25) src/bin/rhwp-agent/doctor.rs:20— src/bin/rhwp-agent/doctor.rs:20-28 | src/bin/rhwp-agent/harvest.rs:19-27 | src/bin/rhwp-agent/safety.rs:220-229 | src/bin/rhwp-agent/safety.rs:525-534 | src/bin/rhwp-agent/structurecmd.rs:14-22 | src/bin/rhwp-q/kit/caret_stops.rs:16-24 | src/bin/rhwp-q/kit/char_index.rs:18-26 | src/bin/rhwp-q/kit/chart_csv.rs:29-37 | src/bin/rhwp-q/kit/covering_pages.rs:13-21 | src/bin/rhwp-q/kit/cur_field_state.rs:18-26 | src/bin/rhwp-q/kit/field_by_id.rs:16-24 | src/bin/rhwp-q/kit/field_info_at.rs:18-26 | src/bin/rhwp-q/kit/fn_selection_rects.rs:21-29 | src/bin/rhwp-q/kit/form_at.rs:18-26 | src/bin/rhwp-q/kit/form_value.rs:19-27 | src/bin/rhwp-q/kit/hit_fn_marker.rs:19-27 | src/bin/rhwp-q/kit/hit_in_footnote.rs:19-27 | src/bin/rhwp-q/kit/line_starts.rs:17-25 | src/bin/rhwp-q/kit/page_border_fill.rs:15-23 | src/bin/rhwp-q/kit/page_text.rs:15-23 | src/bin/rhwp-q/kit/para_bounds.rs:17-25 | src/bin/rhwp-q/kit/word_end.rs:18-26 | src/bin/rhwp-q/kit/word_starts.rs:16-24 | src/bin/rhwp-q/more/envelope.rs:94-102 | src/bin/rhwp-q/pack/envelope.rs:94-102 — before extracting anything, compare `src/bin/rhwp-agent/harvest.rs` and `src/bin/rhwp-agent/safety.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 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 `src/bin/rhwp-agent/doctor.rs:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/bin/rhwp-agent/harvest.rs:17` calls `to_string` and `src/bin/rhwp-agent/doctor.rs:18` 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 × 8) src/cli/commands/edit/header_footer_content.rs:296— src/cli/commands/edit/header_footer_content.rs:296-305 | src/cli/commands/edit/header_footer_content.rs:453-462 | src/cli/commands/edit/header_footer_content.rs:615-624 | src/cli/commands/edit/header_footer_content.rs:769-778 | src/cli/commands/edit/header_footer_content.rs:908-917 | src/cli/commands/edit/header_footer_content.rs:1055-1064 | src/cli/commands/edit/header_footer_properties.rs:437-446 | src/cli/commands/edit/page.rs:248-256 — before extracting anything, compare `src/cli/commands/edit/header_footer_content.rs` and `src/cli/commands/edit/header_footer_properties.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 296 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 `src/cli/commands/edit/header_footer_content.rs:296` 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 (8 lines × 13) src/cli/commands/edit/document_objects.rs:570— src/cli/commands/edit/document_objects.rs:570-577 | src/cli/commands/edit/note_content.rs:132-139 | src/cli/commands/edit/page.rs:14-21 | src/cli/commands/edit/page.rs:117-124 | src/cli/commands/edit/privacy.rs:57-65 | src/cli/commands/edit/shapes.rs:283-290 | src/cli/commands/edit/tables/layout.rs:13-20 | src/cli/commands/edit/tables/layout.rs:233-240 | src/cli/commands/edit/tables/layout.rs:481-488 | src/cli/commands/edit/tables/layout.rs:595-602 | src/cli/commands/edit/tables/structure.rs:126-133 | src/cli/commands/edit/tables/structure.rs:221-228 | src/cli/commands/edit/tables/structure.rs:316-323 — before extracting anything, compare `src/cli/commands/edit/document_objects.rs` and `src/cli/commands/edit/note_content.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 278 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 `src/cli/commands/edit/document_objects.rs:570` 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 × 6) src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:138— src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:138-144 | src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:167-173 | src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:177-183 | src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:187-193 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:143-149 | src/bin/rhwp-q/commands/rhwp-q-page-items.rs:220-226 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs` and `src/bin/rhwp-q/commands/rhwp-q-page-caret.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 101 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 `src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (3–7 lines × 4) src/serializer/hwpx/roundtrip.rs:1391— src/serializer/hwpx/roundtrip.rs:1391-1393 | src/serializer/hwpx/roundtrip.rs:1401-1403 | src/serializer/hwpx/roundtrip.rs:1573-1579 | src/serializer/hwpx/roundtrip.rs:1620-1626 — 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 `src/serializer/hwpx/roundtrip.rs:1391` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/serializer/hwpx/roundtrip.rs:1400` calls `Picture` and `src/serializer/hwpx/roundtrip.rs:1388` 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 × 7) src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:136— src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:136-142 | src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:146-152 | src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:170-176 | src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:180-186 | src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs:190-196 | src/bin/rhwp-q/commands/rhwp-q-page-caret.rs:141-147 | src/bin/rhwp-q/commands/rhwp-q-page-items.rs:218-224 — before extracting anything, compare `src/bin/rhwp-q/commands/rhwp-q-cursor-model.rs` and `src/bin/rhwp-q/commands/rhwp-q-page-caret.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 101 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 `src/bin/rhwp-q/commands/rhwp-q-cursor-model.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.
Duplicated block (6 lines × 92) src/bin/rhwp-q/more/inventory.rs:138— src/bin/rhwp-q/more/inventory.rs:138-143 | src/bin/rhwp-q/more/inventory.rs:165-170 | src/bin/rhwp-q/more/inventory.rs:192-197 | src/bin/rhwp-q/more/inventory.rs:219-224 | src/bin/rhwp-q/more/inventory.rs:246-251 | src/bin/rhwp-q/more/inventory.rs:273-278 | src/bin/rhwp-q/more/inventory.rs:300-305 | src/bin/rhwp-q/more/inventory.rs:327-332 | src/bin/rhwp-q/more/inventory.rs:354-359 | src/bin/rhwp-q/more/inventory.rs:381-386 | src/bin/rhwp-q/more/inventory.rs:408-413 | src/bin/rhwp-q/more/inventory.rs:435-440 | src/bin/rhwp-q/more/inventory.rs:462-467 | src/bin/rhwp-q/more/inventory.rs:489-494 | src/bin/rhwp-q/more/inventory.rs:516-521 | src/bin/rhwp-q/more/inventory.rs:543-548 | src/bin/rhwp-q/more/inventory.rs:570-575 | src/bin/rhwp-q/more/inventory.rs:597-602 | src/bin/rhwp-q/more/inventory.rs:624-629 | src/bin/rhwp-q/more/inventory.rs:651-656 | src/bin/rhwp-q/more/inventory.rs:678-683 | src/bin/rhwp-q/more/inventory.rs:703-708 | src/bin/rhwp-q/more/inventory.rs:730-735 | src/bin/rhwp-q/more/inventory.rs:755-760 | src/bin/rhwp-q/more/inventory.rs:780-785 | src/bin/rhwp-q/more/inventory.rs:805-810 | src/bin/rhwp-q/more/inventory.rs:830-835 | src/bin/rhwp-q/more/inventory.rs:855-860 | src/bin/rhwp-q/more/inventory.rs:880-885 | src/bin/rhwp-q/more/inventory.rs:905-910 | src/bin/rhwp-q/more/inventory.rs:932-937 | src/bin/rhwp-q/more/inventory.rs:959-964 | src/bin/rhwp-q/more/inventory.rs:986-991 | src/bin/rhwp-q/more/inventory.rs:1013-1018 | src/bin/rhwp-q/more/inventory.rs:1040-1045 | src/bin/rhwp-q/more/inventory.rs:1102-1107 | src/bin/rhwp-q/more/inventory.rs:1129-1134 | src/bin/rhwp-q/more/inventory.rs:1156-1161 | src/bin/rhwp-q/more/inventory.rs:1183-1188 | src/bin/rhwp-q/more/inventory.rs:1210-1215 | src/bin/rhwp-q/more/inventory.rs:1237-1242 | src/bin/rhwp-q/more/inventory.rs:1264-1269 | src/bin/rhwp-q/more/inventory.rs:1291-1296 | src/bin/rhwp-q/pack/inventory.rs:83-88 | src/bin/rhwp-q/pack/inventory.rs:110-115 | src/bin/rhwp-q/pack/inventory.rs:135-140 | src/bin/rhwp-q/pack/inventory.rs:160-165 | src/bin/rhwp-q/pack/inventory.rs:185-190 | src/bin/rhwp-q/pack/inventory.rs:210-215 | src/bin/rhwp-q/pack/inventory.rs:235-240 | src/bin/rhwp-q/pack/inventory.rs:260-265 | src/bin/rhwp-q/pack/inventory.rs:285-290 | src/bin/rhwp-q/pack/inventory.rs:310-315 | src/bin/rhwp-q/pack/inventory.rs:335-340 | src/bin/rhwp-q/pack/inventory.rs:360-365 | src/bin/rhwp-q/pack/inventory.rs:385-390 | src/bin/rhwp-q/pack/inventory.rs:416-421 | src/bin/rhwp-q/pack/inventory.rs:441-446 | src/bin/rhwp-q/pack/inventory.rs:466-471 | src/bin/rhwp-q/pack/inventory.rs:480-485 | src/bin/rhwp-q/pack/inventory.rs:494-499 | src/bin/rhwp-q/pack/inventory.rs:521-526 | src/bin/rhwp-q/pack/inventory.rs:548-553 | src/bin/rhwp-q/pack/inventory.rs:575-580 | src/bin/rhwp-q/pack/inventory.rs:600-605 | src/bin/rhwp-q/pack/inventory.rs:627-632 | src/bin/rhwp-q/pack/inventory.rs:654-659 | src/bin/rhwp-q/pack/inventory.rs:679-684 | src/bin/rhwp-q/pack/inventory.rs:704-709 | src/bin/rhwp-q/pack/inventory.rs:729-734 | src/bin/rhwp-q/pack/inventory.rs:756-761 | src/bin/rhwp-q/pack/inventory.rs:783-788 | src/bin/rhwp-q/pack/inventory.rs:808-813 | src/bin/rhwp-q/pack/inventory.rs:833-838 | src/bin/rhwp-q/pack/inventory.rs:858-863 | src/bin/rhwp-q/pack/inventory.rs:883-888 | src/bin/rhwp-q/pack/inventory.rs:908-913 | src/bin/rhwp-q/pack/inventory.rs:935-940 | src/bin/rhwp-q/pack/inventory.rs:962-967 | src/bin/rhwp-q/pack/inventory.rs:989-994 | src/bin/rhwp-q/pack/inventory.rs:1016-1021 | src/bin/rhwp-q/pack/inventory.rs:1041-1046 | src/bin/rhwp-q/pack/inventory.rs:1066-1071 | src/bin/rhwp-q/pack/inventory.rs:1093-1098 | src/bin/rhwp-q/pack/inventory.rs:1118-1123 | src/bin/rhwp-q/pack/inventory.rs:1167-1172 | src/bin/rhwp-q/pack/inventory.rs:1192-1197 | src/bin/rhwp-q/pack/inventory.rs:1217-1222 | src/bin/rhwp-q/pack/inventory.rs:1244-1249 | src/bin/rhwp-q/pack/inventory.rs:1269-1274 | src/bin/rhwp-q/pack/inventory.rs:1296-1301 | src/bin/rhwp-q/pack/inventory.rs:1323-1328 — `src/bin/rhwp-q/more/inventory.rs` and `src/bin/rhwp-q/pack/inventory.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 22 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (128–129 lines × 2) gym/tools/fuzz_corpus.py:967— gym/tools/fuzz_corpus.py:967-1094 | gym/tools/robustness.py:785-913 — before extracting anything, compare `gym/tools/fuzz_corpus.py` and `gym/tools/robustness.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 421 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 `gym/tools/fuzz_corpus.py:967` 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 (118–119 lines × 2) gym/tools/fuzz_corpus.py:1092— gym/tools/fuzz_corpus.py:1092-1209 | gym/tools/robustness.py:935-1053 — before extracting anything, compare `gym/tools/fuzz_corpus.py` and `gym/tools/robustness.py` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 421 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10–22 lines × 5) gym/tools/audit.py:781— gym/tools/audit.py:781-790 | gym/tools/differential.py:868-886 | gym/tools/discriminate.py:473-482 | gym/tools/release_diff.py:794-815 | gym/tools/trajectory.py:572-581 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `gym/tools/audit.py:792` calls `isinstance`, `get` and `gym/tools/discriminate.py:483` 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 (15 lines × 4) gym/core/runner.py:229— gym/core/runner.py:229-243 | gym/tools/differential.py:251-265 | gym/tools/release_diff.py:246-260 | gym/tools/trajectory.py:376-390 — 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. The matched lines also transfer control out of the body holding them, 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, `gym/tools/differential.py:246` calls `update` and `gym/tools/release_diff.py:242` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication· Near-duplicate member family (3 members, 12 shared lines) · ×1
Near-duplicate member family (3 members, 12 shared lines) scripts/font_rank1_metric_hypothesis.py:513— scripts/font_rank1_metric_hypothesis.py:513-526 | scripts/font_rank7_metric_hypothesis.py:169-186 | scripts/font_rank8_metric_hypothesis.py:669-683 — These 3 members are variants of one another: a block of 12 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (25 shared lines) tools/llm_verifier/repeat_eval/src/loader.rs:91— tools/llm_verifier/repeat_eval/src/loader.rs:91-119 | tools/llm_verifier/tool_version_gate/src/loader.rs:150-177 — These two members are variants of one another: 25 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.
Near-duplicate member pair (21 shared lines) tools/task2279/footer_flip_run.py:119— tools/task2279/footer_flip_run.py:119-169 | tools/task2279/footer_flip_worker.py:31-119 — These two members are variants of one another: 21 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copies of one member (3 members, 32+ corresponding lines) · ×1
Edited copies of one member (3 members, 32+ corresponding lines) tools/oracle_public/coverage_report.py:101— tools/oracle_public/coverage_report.py:101-136 | tools/oracle_public/oracle_resolver.py:95-128 | tools/oracle_public/sweep_runner.py:283-314 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 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 (118 corresponding lines) · ×1
Edited copy of a member (118 corresponding lines) scripts/font_rank1_qualification.py:250— scripts/font_rank1_qualification.py:250-367 | scripts/font_rank7_qualification.py:354-484 — These two members are one piece of code written twice and then edited apart: 118 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 44+ corresponding lines) · ×1
Edited copies of one member (3 members, 44+ corresponding lines) tools/inspect_msec/gen_msec_fixtures.py:1256— tools/inspect_msec/gen_msec_fixtures.py:1256-1299 | tools/inspect_msec/gen_msec_fixtures.py:1317-1374 | tools/inspect_msec/gen_msec_fixtures.py:1539-1592 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 44 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, 7+ corresponding lines) · ×1
Edited copies of one member (5 members, 7+ corresponding lines) samples/anchor_char_line_height/make_anchor_char_height.py:31— samples/anchor_char_line_height/make_anchor_char_height.py:31-37 | samples/float_push_spacing_before/make_float_push_spacing_before.py:47-58 | samples/float_push_spacing_before/make_float_push_spacing_before_boundaries.py:67-79 | samples/float_push_spacing_before/make_float_push_spacing_before_column_top.py:53-64 | samples/issue7679/gen_tac_after_text.py:54-65 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 4+ corresponding lines) · ×1
Edited copies of one member (6 members, 4+ corresponding lines) tools/llm_verifier/claim_bind/src/loader.rs:61— tools/llm_verifier/claim_bind/src/loader.rs:61-65 | tools/llm_verifier/criteria_decomp/src/loader.rs:62-66 | tools/llm_verifier/process_steps/src/loader.rs:87-90 | tools/llm_verifier/repeat_eval/src/loader.rs:71-75 | tools/llm_verifier/tool_version_gate/src/loader.rs:77-81 | tools/llm_verifier/verdict_protocol/src/loader.rs:88-91 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 4+ corresponding lines) · ×1
Edited copies of one member (5 members, 4+ corresponding lines) tools/layout_anomaly/gen_m02f_fixtures.py:432— tools/layout_anomaly/gen_m02f_fixtures.py:432-436 | tools/llm_verifier/abstain/generate_corpus.py:419-422 | tools/llm_verifier/oracle_vs_self/generate_corpus.py:229-232 | tools/llm_verifier/shadow_agree/generate_corpus.py:203-206 | tools/llm_verifier/untrusted_sandbox/generate_corpus.py:315-318 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 2+ corresponding lines) · ×1
Edited copies of one member (3 members, 2+ corresponding lines) tools/hwp5_inventory/fatten_catalog.py:81— tools/hwp5_inventory/fatten_catalog.py:81-82 | tools/oracle_public/fatten_catalog.py:126-128 | tools/table_exchange/fatten_catalog.py:81-82 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×1
Edited copies of one member (3 members, 5+ corresponding lines) samples/float_push_spacing_before/make_float_push_spacing_before_boundaries.py:58— samples/float_push_spacing_before/make_float_push_spacing_before_boundaries.py:58-63 | samples/issue7679/gen_tac_after_text.py:45-50 | samples/issue8507/gen_tac_adjacent.py:16-20 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 2+ corresponding lines) · ×1
Edited copies of one member (5 members, 2+ corresponding lines) samples/issue7679/gen_tac_after_text.py:36— samples/issue7679/gen_tac_after_text.py:36-37 | samples/issue7687/gen_empty_host.py:49-50 | samples/issue7695/gen_footnote_page_tail.py:40-41 | samples/issue8474/gen_section_top_spacing.py:29-30 | samples/issue8474/gen_top_tac_cases.py:29-30 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 2+ corresponding lines) · ×1
Edited copies of one member (6 members, 2+ corresponding lines) samples/issue7092/gen_subst_font.py:58— samples/issue7092/gen_subst_font.py:58-59 | samples/issue8149/gen_headerrow.py:65-66 | samples/issue8149/gen_rowfit.py:60-61 | samples/issue8470/gen_vertical_cell_table.py:69-70 | samples/issue8471/gen_pushed_none_table.py:67-68 | samples/issue8478/gen_span_page_bottom.py:37-38 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Duplicated block (58–74 lines × 2) scripts/renderer_baseline.py:1326— scripts/renderer_baseline.py:1326-1399 | scripts/renderer_baseline.py:1670-1727 — both copies are in the same file, so extract the 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 (33–62 lines × 3) scripts/renderer_baseline.py:1348— scripts/renderer_baseline.py:1348-1380 | scripts/renderer_baseline.py:1447-1508 | scripts/renderer_baseline.py:1669-1727 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `scripts/renderer_baseline.py:1510` calls `get` and `scripts/renderer_baseline.py:1729` 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 (45–46 lines × 2) scripts/oracle_stage4_profile.py:341— scripts/oracle_stage4_profile.py:341-385 | scripts/oracle_stage5_rank8_profile.py:245-290 — before extracting anything, compare `scripts/oracle_stage4_profile.py` and `scripts/oracle_stage5_rank8_profile.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 65 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 (40–43 lines × 2) scripts/font_rank1_qualification.py:261— scripts/font_rank1_qualification.py:261-303 | scripts/font_rank8_qualification.py:464-503 — before extracting anything, compare `scripts/font_rank1_qualification.py` and `scripts/font_rank8_qualification.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 108 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 `scripts/font_rank1_qualification.py:261` 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 (40 lines × 3) tools/oracle_public/coverage_report.py:198— tools/oracle_public/coverage_report.py:198-237 | tools/oracle_public/oracle_resolver.py:190-229 | tools/oracle_public/sweep_runner.py:374-413 — before extracting anything, compare `tools/oracle_public/coverage_report.py` and `tools/oracle_public/oracle_resolver.py` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 187 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 (32 lines × 3) tools/inspect_msec/gen_msec_fixtures.py:1383— tools/inspect_msec/gen_msec_fixtures.py:1383-1414 | tools/inspect_msec/gen_msec_fixtures.py:1451-1482 | tools/inspect_msec/gen_msec_fixtures.py:1498-1529 — 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 `tools/inspect_msec/gen_msec_fixtures.py:1383` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28–29 lines × 2) tools/table_exchange/cases.py:999— tools/table_exchange/cases.py:999-1026 | tools/table_exchange/cases.py:1053-1081 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `tools/table_exchange/cases.py:999` 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 (24–26 lines × 2) tools/skill_router/audit_skill_commands.py:267— tools/skill_router/audit_skill_commands.py:267-292 | tools/skill_router/gate_new_skill.py:475-498 — before extracting anything, compare `tools/skill_router/audit_skill_commands.py` and `tools/skill_router/gate_new_skill.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20–24 lines × 2) tools/fidelity_compare/fidelity_compare.py:3026— tools/fidelity_compare/fidelity_compare.py:3026-3045 | tools/fidelity_compare/fidelity_compare.py:3081-3104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15–21 lines × 2) scripts/visual_sweep.py:3430— scripts/visual_sweep.py:3430-3450 | scripts/visual_sweep.py:3628-3642 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–16 lines × 3) scripts/font_rank1_qualification.py:220— scripts/font_rank1_qualification.py:220-233 | scripts/font_rank7_qualification.py:290-303 | scripts/font_rank8_qualification.py:430-445 — before extracting anything, compare `scripts/font_rank1_qualification.py` and `scripts/font_rank7_qualification.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 128 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 (15 lines × 9) tools/inspect_msec/gen_msec_fixtures.py:1071— tools/inspect_msec/gen_msec_fixtures.py:1071-1093 | tools/inspect_msec/gen_msec_fixtures.py:1390-1414 | tools/inspect_msec/gen_msec_fixtures.py:1458-1482 | tools/inspect_msec/gen_msec_fixtures.py:1505-1529 | tools/inspect_msec/gen_msec_fixtures.py:1752-1776 | tools/inspect_msec/gen_msec_fixtures.py:1829-1853 | tools/inspect_msec/gen_msec_fixtures.py:2069-2083 | tools/inspect_msec/gen_msec_fixtures.py:2205-2234 | tools/inspect_msec/gen_msec_fixtures.py:2294-2308 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `tools/inspect_msec/gen_msec_fixtures.py:1071` 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, `tools/inspect_msec/gen_msec_fixtures.py:1070` calls `_ht_graphic_suppress` and `tools/inspect_msec/gen_msec_fixtures.py:2204` 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 (4–13 lines × 3) tools/llm_verifier/oracle_vs_self/verify_corpus.py:73— tools/llm_verifier/oracle_vs_self/verify_corpus.py:73-85 | tools/llm_verifier/shadow_agree/verify_corpus.py:76-79 | tools/llm_verifier/untrusted_sandbox/verify_corpus.py:98-111 — `tools/llm_verifier/oracle_vs_self/verify_corpus.py` and `tools/llm_verifier/shadow_agree/verify_corpus.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 32 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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 (1–10 lines × 6) samples/anchor_char_line_height/make_anchor_char_height.py:31— samples/anchor_char_line_height/make_anchor_char_height.py:31-32 | samples/anchor_char_line_height/make_anchor_char_height.py:33-33 | samples/float_push_spacing_before/make_float_push_spacing_before.py:49-58 | samples/float_push_spacing_before/make_float_push_spacing_before_boundaries.py:70-73 | samples/float_push_spacing_before/make_float_push_spacing_before_column_top.py:55-64 | samples/page_anchored_square/make_page_anchored_square.py:60-61 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `samples/anchor_char_line_height/make_anchor_char_height.py:33` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `samples/float_push_spacing_before/make_float_push_spacing_before.py:48` calls `join`, `cell` and `samples/anchor_char_line_height/make_anchor_char_height.py:31` 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–10 lines × 2) tools/layout_anomaly_batch_report.py:794— tools/layout_anomaly_batch_report.py:794-799 | tools/oracle_public/sweep_runner.py:1241-1250 — 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 `tools/oracle_public/sweep_runner.py:1241` 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 (2–9 lines × 3) tools/fidelity_compare/fidelity_compare.py:2297— tools/fidelity_compare/fidelity_compare.py:2297-2298 | tools/fidelity_compare/fidelity_compare.py:3056-3064 | tools/fidelity_compare/fidelity_compare.py:3115-3122 — 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 `tools/fidelity_compare/fidelity_compare.py:3056` 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 (3–6 lines × 4) tools/oracle_public/sweep_runner.py:645— tools/oracle_public/sweep_runner.py:645-650 | tools/oracle_public/sweep_runner.py:779-784 | tools/oracle_public/sweep_runner.py:802-807 | tools/oracle_public/sweep_runner.py:898-900 — 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 `tools/oracle_public/sweep_runner.py:645` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (2–5 lines × 8) scripts/visual_sweep.py:4841— scripts/visual_sweep.py:4841-4845 | scripts/visual_sweep.py:4851-4852 | scripts/visual_sweep.py:4860-4862 | scripts/visual_sweep.py:4867-4869 | scripts/visual_sweep.py:4879-4883 | scripts/visual_sweep.py:4889-4893 | scripts/visual_sweep.py:4898-4900 | scripts/visual_sweep.py:4905-4906 — all 8 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 `scripts/visual_sweep.py:4841` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `scripts/visual_sweep.py:4841` calls `draw_bbox`, `get` and `scripts/visual_sweep.py:4860` does not — after which the two agree again for 5 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 (69 lines × 2) mydocs/tech/investigations/issue-7418/probes/make_condense_bullet_fixture.py:33— mydocs/tech/investigations/issue-7418/probes/make_condense_bullet_fixture.py:33-101 | mydocs/tech/investigations/issue-7418/probes/make_condense_numbered_fixture.py:29-97 — before extracting anything, compare `mydocs/tech/investigations/issue-7418/probes/make_condense_bullet_fixture.py` and `mydocs/tech/investigations/issue-7418/probes/make_condense_numbered_fixture.py` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mydocs/tech/investigations/issue-7418/probes/make_condense_bullet_fixture.py:33` 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 (50 lines × 3) mydocs/tech/investigations/issue-7418/probes/make_condense_cell_fixture.py:24— mydocs/tech/investigations/issue-7418/probes/make_condense_cell_fixture.py:24-73 | mydocs/tech/investigations/issue-7418/probes/make_condense_fixture.py:29-78 | mydocs/tech/investigations/issue-7418/probes/make_condense_letter_spacing_fixture.py:27-76 — before extracting anything, compare `mydocs/tech/investigations/issue-7418/probes/make_condense_cell_fixture.py` and `mydocs/tech/investigations/issue-7418/probes/make_condense_fixture.py` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mydocs/tech/investigations/issue-7418/probes/make_condense_cell_fixture.py:24` 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.
End-of-life runtime: Rust 1.93 rust-toolchain.toml:1— rust-toolchain.toml declares Rust 1.93 as this project's toolchain file, and Rust 1.93, superseded by 1.94 on 2026-03-05 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-03-05 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Duplication concentrated across 12 sibling directories (36 clone groups) rhwp-studio/src/recent/recent-store.ts:61— 36 duplicated blocks under rhwp-studio/src/ have copies in at least two of the sibling directories ai, command, compare, core, dev, document-agent (+6 more sibling(s) not listed) — 21 of them are reported below, and 15 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 36 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 36 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 36 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 10 sibling directories (34 clone groups) rhwp-chrome/content-script.js:4— 34 duplicated blocks under the repository root have copies in at least two of the sibling directories mydocs, npm, rhwp-chrome, rhwp-desk, rhwp-firefox, rhwp-safari (+4 more sibling(s) not listed) — 25 of them are reported below, and 9 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 34 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 34 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 34 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 8 sibling directories (6 clone groups) mydocs/pr/assets/pr7518_p22_spacing_20261004/capture-cdp.mjs:6— 6 duplicated blocks under mydocs/pr/assets/ have copies in at least two of the sibling directories chrisryugj_20261031, hyunmyungjanelee-20261106, issue8174, pr7518_p22_spacing_20261004, pr7518_p39_wrapper_flow_20261005, pr8309-latestbase-20261102 (+2 more sibling(s) not listed) — 4 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Wholesale file copy (325 identical lines × 2 files) rhwp-chrome/content-script.js:4— rhwp-chrome/content-script.js:4 · rhwp-firefox/content-script.js:4 — these 2 files are line-for-line copies of one another — 325 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Wholesale file copy (204 identical lines × 2 files) rhwp-chrome/sw/thumbnail-extractor.js:6— rhwp-chrome/sw/thumbnail-extractor.js:6 · rhwp-firefox/sw/thumbnail-extractor.js:6 — these 2 files are line-for-line copies of one another — 204 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (126 matched lines × 2 locations) · ×1
Duplicated block with local edits (126 matched lines × 2 locations) rhwp-chrome/sw/download-interceptor.js:31— rhwp-chrome/sw/download-interceptor.js:31 · rhwp-firefox/sw/download-interceptor.js:26 — the two spans are one implementation copied and then locally edited — 892 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.
Wholesale file copy (106 identical lines × 2 files) rhwp-chrome/sw/fetch-security.js:7— rhwp-chrome/sw/fetch-security.js:7 · rhwp-firefox/sw/fetch-security.js:7 — these 2 files are line-for-line copies of one another — 106 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (105 matched lines × 2 locations) · ×1
Duplicated block with local edits (105 matched lines × 2 locations) rhwp-studio/src/ui/field-edit-dialog.ts:79— rhwp-studio/src/ui/field-edit-dialog.ts:79 · rhwp-studio/src/ui/field-insert-dialog.ts:35 — the two spans are one implementation copied and then locally edited — 834 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 (84 matched lines × 2 locations) · ×1
Duplicated block with local edits (84 matched lines × 2 locations) rhwp-studio/src/ui/bookmark-dialog.ts:29— rhwp-studio/src/ui/bookmark-dialog.ts:29 · rhwp-studio/src/ui/symbols-dialog.ts:72 — the two spans are one implementation copied and then locally edited — 616 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.
Wholesale file copy (81 identical lines × 2 files) rhwp-chrome/dev-tools-inject.js:3— rhwp-chrome/dev-tools-inject.js:3 · rhwp-firefox/dev-tools-inject.js:3 — these 2 files are line-for-line copies of one another — 81 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Wholesale file copy (77 identical lines × 2 files) rhwp-chrome/build.mjs:7— rhwp-chrome/build.mjs:7 · rhwp-firefox/build.mjs:7 — these 2 files are line-for-line copies of one another — 77 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (76 matched lines × 2 locations) · ×1
Duplicated block with local edits (76 matched lines × 2 locations) rhwp-studio/src/recent/recent-store.ts:61— rhwp-studio/src/recent/recent-store.ts:61 · rhwp-studio/src/recovery/autosave-store.ts:62 — the two spans are one implementation copied and then locally edited — 598 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 (74 lines × 3 locations) rhwp-chrome/sw/download-interceptor-common.js:17— rhwp-chrome/sw/download-interceptor-common.js:17 · rhwp-firefox/sw/download-interceptor-common.js:17 · rhwp-shared/sw/download-interceptor-common.js:17 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. 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.
Wholesale file copy (74 identical lines × 3 files) rhwp-chrome/sw/download-observer-state.js:6— rhwp-chrome/sw/download-observer-state.js:6 · rhwp-firefox/sw/download-observer-state.js:6 · rhwp-shared/sw/download-observer-state.js:6 — these 3 files are line-for-line copies of one another — 74 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (71 matched lines × 2 locations) · ×1
Duplicated block with local edits (71 matched lines × 2 locations) rhwp-studio/src/ai/provider/gemini.ts:200— rhwp-studio/src/ai/provider/gemini.ts:200 · rhwp-studio/src/ai/provider/openai.ts:75 — the two spans are one implementation copied and then locally edited — 417 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.
Wholesale file copy (67 identical lines × 3 files) rhwp-chrome/sw/document-url-resolver.js:6— rhwp-chrome/sw/document-url-resolver.js:6 · rhwp-firefox/sw/document-url-resolver.js:6 · rhwp-shared/sw/document-url-resolver.js:6 — these 3 files are line-for-line copies of one another — 67 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (67 matched lines × 2 locations) · ×1
Duplicated block with local edits (67 matched lines × 2 locations) rhwp-studio/src/ui/context-menu.ts:30— rhwp-studio/src/ui/context-menu.ts:30 · rhwp-studio/src/ui/local-context-menu.ts:36 — the two spans are one implementation copied and then locally edited — 478 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 (66 lines × 2 locations) rhwp-studio/src/ui/compare-dialog.ts:362— rhwp-studio/src/ui/compare-dialog.ts:362 · rhwp-studio/src/ui/history-dialog.ts:333 — 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 (64 matched lines × 2 locations) · ×1
Duplicated block with local edits (64 matched lines × 2 locations) scripts/cell-lineseg-agreement.mjs:247— scripts/cell-lineseg-agreement.mjs:247 · scripts/layout-coverage-sweep.mjs:96 — the two spans are one implementation copied and then locally edited — 503 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 (55 matched lines × 2 locations) · ×1
Duplicated block with local edits (55 matched lines × 2 locations) mydocs/pr/assets/pr7518_p22_spacing_20261004/capture-cdp.mjs:6— mydocs/pr/assets/pr7518_p22_spacing_20261004/capture-cdp.mjs:6 · mydocs/pr/assets/pr7518_p39_wrapper_flow_20261005/capture-cdp.mjs:6 — the two spans are one implementation copied and then locally edited — 1086 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 (52 lines × 2 locations) rhwp-studio/src/engine/input-handler-keyboard.ts:2323— rhwp-studio/src/engine/input-handler-keyboard.ts:2323 · rhwp-studio/src/engine/input-handler-keyboard.ts:2430 — 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 (51 lines × 2 locations) rhwp-studio/src/ui/char-shape-dialog.ts:221— rhwp-studio/src/ui/char-shape-dialog.ts:221 · rhwp-studio/src/ui/para-shape-dialog.ts:215 — 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 (48 lines × 2 locations) rhwp-studio/src/ui/compare-dialog.ts:510— rhwp-studio/src/ui/compare-dialog.ts:510 · rhwp-studio/src/ui/history-dialog.ts:481 — 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 (46 matched lines × 2 locations) · ×1
Duplicated block with local edits (46 matched lines × 2 locations) tools/hwpctrl_compat/runner_rhwp.mjs:228— tools/hwpctrl_compat/runner_rhwp.mjs:228 · tools/hwpctrl_compat/runner_webhwp.mjs:166 — the two spans are one implementation copied and then locally edited — 342 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 (45 lines × 2 locations) rhwp-studio/src/ui/page-setup-dialog.ts:323— rhwp-studio/src/ui/page-setup-dialog.ts:323 · rhwp-studio/src/ui/table-cell-props-dialog.ts:1520 — 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 (42 lines × 2 locations) rhwp-studio/src/ui/compare-dialog.ts:52— rhwp-studio/src/ui/compare-dialog.ts:52 · rhwp-studio/src/ui/history-dialog.ts:61 — 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 (40 lines × 3 locations) rhwp-chrome/sw/thumbnail-decompression.js:4— rhwp-chrome/sw/thumbnail-decompression.js:4 · rhwp-firefox/sw/thumbnail-decompression.js:4 · rhwp-shared/sw/thumbnail-decompression.js:4 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. 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.
R10 · Code Duplication· Duplicated block with local edits (38 matched lines × 2 locations) · ×1
Duplicated block with local edits (38 matched lines × 2 locations) scripts/font_typesetting_risk_publish.mjs:351— scripts/font_typesetting_risk_publish.mjs:351 · scripts/font_typesetting_risk_rank.mjs:1037 — the two spans are one implementation copied and then locally edited — 309 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.
Complex function onKeyDown (cyclomatic 293, cognitive 481) rhwp-studio/src/engine/input-handler-keyboard.ts:709— onKeyDown has cyclomatic complexity 293 and cognitive complexity 481; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 onClick (cyclomatic 251, cognitive 529) rhwp-studio/src/engine/input-handler-mouse.ts:299— onClick has cyclomatic complexity 251 and cognitive complexity 529; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 renderTextRun (cyclomatic 145, cognitive 163) rhwp-studio/src/view/canvaskit-renderer.ts:3142— renderTextRun has cyclomatic complexity 145 and cognitive complexity 163; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 populateFromProps (cyclomatic 143, cognitive 256) rhwp-studio/src/ui/picture-props-dialog.ts:2151— populateFromProps has cyclomatic complexity 143 and cognitive complexity 256; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 renderEquationBox (cyclomatic 134, cognitive 122) rhwp-studio/src/view/canvaskit-renderer.ts:4891— renderEquationBox has cyclomatic complexity 134 and cognitive complexity 122; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 inspectRun (cyclomatic 111, cognitive 161) rhwp-chrome/e2e/report.mjs:35— inspectRun has cyclomatic complexity 111 and cognitive complexity 161; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 comparePngBuffers (cyclomatic 104, cognitive 172) rhwp-studio/e2e/helpers.mjs:420— comparePngBuffers has cyclomatic complexity 104 and cognitive complexity 172; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 parseStaticSvgFragmentLayers (cyclomatic 97, cognitive 139) rhwp-studio/src/view/static-svg-path-layers.ts:86— parseStaticSvgFragmentLayers has cyclomatic complexity 97 and cognitive complexity 139; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 collectMods (cyclomatic 95, cognitive 95) rhwp-studio/src/ui/para-shape-dialog.ts:779— collectMods has cyclomatic complexity 95 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function evaluateTrustedPostMergeReuse (cyclomatic 94, cognitive 96) scripts/verify-trusted-postmerge-ci-reuse.mjs:515— evaluateTrustedPostMergeReuse has cyclomatic complexity 94 and cognitive complexity 96; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 replayStatus (cyclomatic 93, cognitive 86) rhwp-studio/src/view/canvaskit/glyph-run-fonts.ts:159— replayStatus has cyclomatic complexity 93 and cognitive complexity 86; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 validateTypesettingRiskContract (cyclomatic 92, cognitive 78) scripts/font_typesetting_risk_rank.mjs:81— validateTypesettingRiskContract has cyclomatic complexity 92 and cognitive complexity 78; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 collectMods (cyclomatic 85, cognitive 84) rhwp-studio/src/ui/char-shape-dialog.ts:946— collectMods has cyclomatic complexity 85 and cognitive complexity 84; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fillSnapshotFromWasm (cyclomatic 84, cognitive 117) rhwp-studio/src/compare/diff-engine.ts:929— fillSnapshotFromWasm has cyclomatic complexity 84 and cognitive complexity 117; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 buildGranularControlDiffs (cyclomatic 82, cognitive 62) rhwp-studio/src/compare/diff-engine.ts:709— buildGranularControlDiffs has cyclomatic complexity 82 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function validateRegistry (cyclomatic 77, cognitive 100) scripts/font_rule_registry.mjs:472— validateRegistry has cyclomatic complexity 77 and cognitive complexity 100; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function Run (cyclomatic 76, cognitive 118) · ×1
Complex function Run (cyclomatic 76, cognitive 118) npm/hwpctrl-ocx/src/index.mjs:2344— Run has cyclomatic complexity 76 and cognitive complexity 118; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 onMouseMove (cyclomatic 74, cognitive 140) rhwp-studio/src/engine/input-handler-mouse.ts:1572— onMouseMove has cyclomatic complexity 74 and cognitive complexity 140; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 parseSupportedCssColor (cyclomatic 74, cognitive 102) rhwp-studio/src/view/canvaskit/css-color.ts:173— parseSupportedCssColor has cyclomatic complexity 74 and cognitive complexity 102; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 73, cognitive 18) rhwp-studio/src/view/glyph-outline-payload-status.ts:195— (anonymous) has cyclomatic complexity 73 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 (anonymous) (cyclomatic 68, cognitive 70) scripts/tests/pdf-import-wasm.test.mjs:109— (anonymous) has cyclomatic complexity 68 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 validateOracleProfile (cyclomatic 66, cognitive 95) scripts/oracle_profile_contract.mjs:473— validateOracleProfile has cyclomatic complexity 66 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function isCompletePng (cyclomatic 65, cognitive 80) rhwp-chrome/e2e/png-integrity.mjs:18— isCompletePng has cyclomatic complexity 65 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 normalizeFontFaceData (cyclomatic 61, cognitive 66) rhwp-studio/src/core/sfnt-face.ts:15— normalizeFontFaceData has cyclomatic complexity 61 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 drawImage (cyclomatic 58, cognitive 59) rhwp-studio/src/view/canvaskit-renderer.ts:2857— drawImage has cyclomatic complexity 58 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 auditReviewReuse (cyclomatic 58, cognitive 38) scripts/ci-impact-policy.cjs:911— auditReviewReuse has cyclomatic complexity 58 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 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 selectLayerTextVariantsForLeaf (cyclomatic 56, cognitive 109) rhwp-studio/src/view/canvaskit/text-variant-selection.ts:23— selectLayerTextVariantsForLeaf has cyclomatic complexity 56 and cognitive complexity 109; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 validateCoverageContract (cyclomatic 56, cognitive 68) scripts/font_metric_coverage_contract.mjs:87— validateCoverageContract has cyclomatic complexity 56 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 routeEmbedRequest (cyclomatic 55, cognitive 37) rhwp-studio/src/embed/rpc-router.ts:122— routeEmbedRequest has cyclomatic complexity 55 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 validateLineageManifest (cyclomatic 54, cognitive 84) scripts/font_metric_lineage.mjs:1071— validateLineageManifest has cyclomatic complexity 54 and cognitive complexity 84; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 drawStaticControlText (cyclomatic 54, cognitive 77) rhwp-studio/src/view/canvaskit-renderer.ts:5239— drawStaticControlText has cyclomatic complexity 54 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function MovePos (cyclomatic 54, cognitive 45) npm/hwpctrl-ocx/src/index.mjs:2088— MovePos has cyclomatic complexity 54 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function run (cyclomatic 53, cognitive 94) · ×1
Complex function run (cyclomatic 53, cognitive 94) rhwp-studio/e2e/responsive.test.mjs:73— run has cyclomatic complexity 53 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 isStaticSvgAttributeSupported (cyclomatic 53, cognitive 44) rhwp-studio/src/view/static-svg-path-layers.ts:711— isStaticSvgAttributeSupported has cyclomatic complexity 53 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 52, cognitive 181) rhwp-studio/e2e/layer-export-issue536.test.mjs:46— (anonymous) has cyclomatic complexity 52 and cognitive complexity 181; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 validateOracleProfileContract (cyclomatic 52, cognitive 41) scripts/oracle_profile_contract.mjs:223— validateOracleProfileContract has cyclomatic complexity 52 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 52, cognitive 39) rhwp-studio/e2e/header-footer-selection-issue4121.test.mjs:53— (anonymous) has cyclomatic complexity 52 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 imageForOp (cyclomatic 51, cognitive 59) rhwp-studio/src/view/canvaskit-renderer.ts:5901— imageForOp has cyclomatic complexity 51 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 51, cognitive 41) rhwp-studio/e2e/renderer-baseline.mjs:303— (anonymous) has cyclomatic complexity 51 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 onInput (cyclomatic 50, cognitive 81) rhwp-studio/src/engine/input-handler-text.ts:566— onInput has cyclomatic complexity 50 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.
R3 · Large Files· rhwp-studio/src/view/canvaskit-renderer.ts · ×1
rhwp-studio/src/view/canvaskit-renderer.ts: 6146 lines of code rhwp-studio/src/view/canvaskit-renderer.ts:1— rhwp-studio/src/view/canvaskit-renderer.ts has 6146 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· rhwp-studio/src/engine/input-handler.ts · ×1
rhwp-studio/src/engine/input-handler.ts: 6138 lines of code rhwp-studio/src/engine/input-handler.ts:1— rhwp-studio/src/engine/input-handler.ts has 6138 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· rhwp-studio/src/core/wasm-bridge.ts · ×1
rhwp-studio/src/core/wasm-bridge.ts: 3706 lines of code rhwp-studio/src/core/wasm-bridge.ts:1— rhwp-studio/src/core/wasm-bridge.ts has 3706 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· npm/hwpctrl-ocx/src/index.mjs · ×1
npm/hwpctrl-ocx/src/index.mjs: 3516 lines of code npm/hwpctrl-ocx/src/index.mjs:1— npm/hwpctrl-ocx/src/index.mjs has 3516 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· rhwp-studio/src/engine/command.ts · ×1
rhwp-studio/src/engine/command.ts: 2950 lines of code rhwp-studio/src/engine/command.ts:1— rhwp-studio/src/engine/command.ts has 2950 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· rhwp-studio/src/compare/diff-engine.ts · ×1
rhwp-studio/src/compare/diff-engine.ts: 2907 lines of code rhwp-studio/src/compare/diff-engine.ts:1— rhwp-studio/src/compare/diff-engine.ts has 2907 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· rhwp-studio/src/engine/cursor.ts · ×1
rhwp-studio/src/engine/cursor.ts: 2460 lines of code rhwp-studio/src/engine/cursor.ts:1— rhwp-studio/src/engine/cursor.ts has 2460 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· rhwp-studio/src/ui/picture-props-dialog.ts · ×1
rhwp-studio/src/ui/picture-props-dialog.ts: 2421 lines of code rhwp-studio/src/ui/picture-props-dialog.ts:1— rhwp-studio/src/ui/picture-props-dialog.ts has 2421 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· rhwp-studio/src/engine/input-handler-keyboard.ts · ×1
rhwp-studio/src/engine/input-handler-keyboard.ts: 2331 lines of code rhwp-studio/src/engine/input-handler-keyboard.ts:1— rhwp-studio/src/engine/input-handler-keyboard.ts has 2331 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· rhwp-studio/src/view/canvas-view.ts · ×1
rhwp-studio/src/view/canvas-view.ts: 2318 lines of code rhwp-studio/src/view/canvas-view.ts:1— rhwp-studio/src/view/canvas-view.ts has 2318 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
rhwp-studio/src/main.ts: 2229 lines of code rhwp-studio/src/main.ts:1— rhwp-studio/src/main.ts has 2229 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· rhwp-studio/src/ai/tools/write-tools.ts · ×1
rhwp-studio/src/ai/tools/write-tools.ts: 2080 lines of code rhwp-studio/src/ai/tools/write-tools.ts:1— rhwp-studio/src/ai/tools/write-tools.ts has 2080 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· rhwp-studio/src/engine/input-handler-mouse.ts · ×1
rhwp-studio/src/engine/input-handler-mouse.ts: 2043 lines of code rhwp-studio/src/engine/input-handler-mouse.ts:1— rhwp-studio/src/engine/input-handler-mouse.ts has 2043 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· rhwp-studio/src/view/page-renderer.ts · ×1
rhwp-studio/src/view/page-renderer.ts: 1550 lines of code rhwp-studio/src/view/page-renderer.ts:1— rhwp-studio/src/view/page-renderer.ts has 1550 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· rhwp-studio/src/ui/table-cell-props-dialog.ts · ×1
rhwp-studio/src/ui/table-cell-props-dialog.ts: 1421 lines of code rhwp-studio/src/ui/table-cell-props-dialog.ts:1— rhwp-studio/src/ui/table-cell-props-dialog.ts has 1421 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· rhwp-studio/src/core/local-fonts.ts · ×1
rhwp-studio/src/core/local-fonts.ts: 1270 lines of code rhwp-studio/src/core/local-fonts.ts:1— rhwp-studio/src/core/local-fonts.ts has 1270 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· rhwp-vscode/src/webview/viewer.ts · ×1
rhwp-vscode/src/webview/viewer.ts: 1243 lines of code rhwp-vscode/src/webview/viewer.ts:1— rhwp-vscode/src/webview/viewer.ts has 1243 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· rhwp-studio/src/view/static-svg-path-layers.ts · ×1
rhwp-studio/src/view/static-svg-path-layers.ts: 1229 lines of code rhwp-studio/src/view/static-svg-path-layers.ts:1— rhwp-studio/src/view/static-svg-path-layers.ts has 1229 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· rhwp-studio/src/engine/input-handler-picture.ts · ×1
rhwp-studio/src/engine/input-handler-picture.ts: 1208 lines of code rhwp-studio/src/engine/input-handler-picture.ts:1— rhwp-studio/src/engine/input-handler-picture.ts has 1208 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· rhwp-studio/src/command/commands/table.ts · ×1
rhwp-studio/src/command/commands/table.ts: 1120 lines of code rhwp-studio/src/command/commands/table.ts:1— rhwp-studio/src/command/commands/table.ts has 1120 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· rhwp-studio/src/ui/cell-border-bg-dialog.ts · ×1
rhwp-studio/src/ui/cell-border-bg-dialog.ts: 1040 lines of code rhwp-studio/src/ui/cell-border-bg-dialog.ts:1— rhwp-studio/src/ui/cell-border-bg-dialog.ts has 1040 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· rhwp-studio/src/ui/char-shape-dialog.ts · ×1
rhwp-studio/src/ui/char-shape-dialog.ts: 1022 lines of code rhwp-studio/src/ui/char-shape-dialog.ts:1— rhwp-studio/src/ui/char-shape-dialog.ts has 1022 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
rhwp-desk/ui/js/main.js: 964 lines of code rhwp-desk/ui/js/main.js:1— rhwp-desk/ui/js/main.js has 964 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
gym/tools/from_e2e.mjs: 928 lines of code gym/tools/from_e2e.mjs:1— gym/tools/from_e2e.mjs has 928 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· rhwp-studio/src/engine/input-handler-text.ts · ×1
rhwp-studio/src/engine/input-handler-text.ts: 872 lines of code rhwp-studio/src/engine/input-handler-text.ts:1— rhwp-studio/src/engine/input-handler-text.ts has 872 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· rhwp-studio/src/ui/toolbar.ts · ×1
rhwp-studio/src/ui/toolbar.ts: 870 lines of code rhwp-studio/src/ui/toolbar.ts:1— rhwp-studio/src/ui/toolbar.ts has 870 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· rhwp-studio/src/engine/input-handler-table.ts · ×1
rhwp-studio/src/engine/input-handler-table.ts: 863 lines of code rhwp-studio/src/engine/input-handler-table.ts:1— rhwp-studio/src/engine/input-handler-table.ts has 863 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· rhwp-studio/src/command/commands/file.ts · ×1
rhwp-studio/src/command/commands/file.ts: 856 lines of code rhwp-studio/src/command/commands/file.ts:1— rhwp-studio/src/command/commands/file.ts has 856 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· rhwp-studio/src/ui/para-shape-dialog.ts · ×1
rhwp-studio/src/ui/para-shape-dialog.ts: 852 lines of code rhwp-studio/src/ui/para-shape-dialog.ts:1— rhwp-studio/src/ui/para-shape-dialog.ts has 852 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· rhwp-studio/src/document-agent/controller.ts · ×1
rhwp-studio/src/document-agent/controller.ts: 837 lines of code rhwp-studio/src/document-agent/controller.ts:1— rhwp-studio/src/document-agent/controller.ts has 837 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· rhwp-studio/src/command/commands/insert.ts · ×1
rhwp-studio/src/command/commands/insert.ts: 825 lines of code rhwp-studio/src/command/commands/insert.ts:1— rhwp-studio/src/command/commands/insert.ts has 825 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rhwp-studio/src/view/ruler.ts · ×1
rhwp-studio/src/view/ruler.ts: 806 lines of code rhwp-studio/src/view/ruler.ts:1— rhwp-studio/src/view/ruler.ts has 806 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· rhwp-studio/src/ui/endnote-shape-dialog.ts · ×1
rhwp-studio/src/ui/endnote-shape-dialog.ts: 756 lines of code rhwp-studio/src/ui/endnote-shape-dialog.ts:1— rhwp-studio/src/ui/endnote-shape-dialog.ts has 756 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· rhwp-studio/src/ui/equation-editor-dialog.ts · ×1
rhwp-studio/src/ui/equation-editor-dialog.ts: 702 lines of code rhwp-studio/src/ui/equation-editor-dialog.ts:1— rhwp-studio/src/ui/equation-editor-dialog.ts has 702 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· rhwp-studio/src/view/virtual-scroll.ts · ×1
rhwp-studio/src/view/virtual-scroll.ts: 678 lines of code rhwp-studio/src/view/virtual-scroll.ts:1— rhwp-studio/src/view/virtual-scroll.ts has 678 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· rhwp-vscode/src/hwp-editor-provider.ts · ×1
rhwp-vscode/src/hwp-editor-provider.ts: 626 lines of code rhwp-vscode/src/hwp-editor-provider.ts:1— rhwp-vscode/src/hwp-editor-provider.ts has 626 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· rhwp-studio/src/command/commands/page.ts · ×1
rhwp-studio/src/command/commands/page.ts: 625 lines of code rhwp-studio/src/command/commands/page.ts:1— rhwp-studio/src/command/commands/page.ts has 625 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· rhwp-studio/src/ui/para-shape-tab-builders.ts · ×1
rhwp-studio/src/ui/para-shape-tab-builders.ts: 624 lines of code rhwp-studio/src/ui/para-shape-tab-builders.ts:1— rhwp-studio/src/ui/para-shape-tab-builders.ts has 624 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· rhwp-studio/src/view/canvaskit/css-color.ts · ×1
rhwp-studio/src/view/canvaskit/css-color.ts: 616 lines of code rhwp-studio/src/view/canvaskit/css-color.ts:1— rhwp-studio/src/view/canvaskit/css-color.ts has 616 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· rhwp-studio/src/view/glyph-outline-payload-status.ts · ×1
rhwp-studio/src/view/glyph-outline-payload-status.ts: 602 lines of code rhwp-studio/src/view/glyph-outline-payload-status.ts:1— rhwp-studio/src/view/glyph-outline-payload-status.ts has 602 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~183 LoC) mydocs/tech/investigations/issue-8403/validation/browser-verify.mjs— no import path from any entry point (472 application, 113 tooling, 709 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 (~104 LoC) mydocs/tech/investigations/issue-3587/probes/template-contract.mjs— no import path from any entry point (472 application, 113 tooling, 709 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 (~99 LoC) rhwp-shared/security/filename-sanitizer.js— no import path from any entry point (472 application, 113 tooling, 709 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 (~98 LoC) mydocs/tech/investigations/issue-3587/probes/import-wasm-contract.mjs— no import path from any entry point (472 application, 113 tooling, 709 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 (~70 LoC) rhwp-shared/security/constants.js— no import path from any entry point (472 application, 113 tooling, 709 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 (~64 LoC) rhwp-shared/security/security-log.js— no import path from any entry point (472 application, 113 tooling, 709 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 (~61 LoC) rhwp-shared/security/sender-validator.js— no import path from any entry point (472 application, 113 tooling, 709 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 (~56 LoC) mydocs/tech/investigations/issue-3587/probes/import-plan-recipe.mjs— no import path from any entry point (472 application, 113 tooling, 709 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 (~11 LoC) rhwp-shared/sw/document-filename.js— no import path from any entry point (472 application, 113 tooling, 709 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
Third-party script without Subresource Integrity mydocs/metrics/2026-07-04-r1/dashboard.html:7— `https://cdn.jsdelivr.net/npm/chart.js@4.4.7/dist/chart.umd.min.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. 21 such include(s) across the repository's markup.
SC1 · Supply-chain hygiene· JavaScript dependencies are not locked · ×1
JavaScript dependencies are not locked vendor/npm/ajv/package.json:41— vendor/npm/ajv/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.
README/code drift CONTRIBUTING.md:115— CONTRIBUTING.md links to `mydocs/tech/typesetting_architecture.md`, but `mydocs/tech/typesetting_architecture.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift CONTRIBUTING.md:340— CONTRIBUTING.md links to `mydocs/tech/chart_ole_v1_boundary.md`, but `mydocs/tech/chart_ole_v1_boundary.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift CONTRIBUTING.md:786— CONTRIBUTING.md links to `rhwp-studio/e2e/MANIFEST.md`, but `rhwp-studio/e2e/MANIFEST.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift README.md:49— README.md links to `mydocs/release/release_notes_v0.9.0.md`, but `mydocs/release/release_notes_v0.9.0.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift README.md:53— README.md links to `packaging/crates-io/README_PACKAGE.md`, but `packaging/crates-io/README_PACKAGE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift README_EN.md:51— README_EN.md links to `mydocs/release/release_notes_v0.9.0_EN.md`, but `mydocs/release/release_notes_v0.9.0_EN.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift README_EN.md:54— README_EN.md links to `packaging/crates-io/README_PACKAGE.md`, but `packaging/crates-io/README_PACKAGE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift fuzz/README.md:161— fuzz/README.md links to `../src/serializer/hwpx/roundtrip.rs`, but `src/serializer/hwpx/roundtrip.rs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:11— mydocs/README.md links to `tech/README.md`, but `mydocs/tech/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:79— mydocs/README.md links to `tech/hwp_spec_errata.md`, but `mydocs/tech/hwp_spec_errata.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:80— mydocs/README.md links to `tech/한글문서파일형식_5.0_revision1.3.md`, but `mydocs/tech/한글문서파일형식_5.0_revision1.3.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:81— mydocs/README.md links to `tech/document_ir_lineseg_standard.md`, but `mydocs/tech/document_ir_lineseg_standard.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:82— mydocs/README.md links to `tech/rendering_engine_design.md`, but `mydocs/tech/rendering_engine_design.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:83— mydocs/README.md links to `tech/text-ir-v2.md`, but `mydocs/tech/text-ir-v2.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:85— mydocs/README.md links to `tech/table_layout_rules.md`, but `mydocs/tech/table_layout_rules.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:86— mydocs/README.md links to `tech/typesetting_architecture.md`, but `mydocs/tech/typesetting_architecture.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:87— mydocs/README.md links to `tech/font_fallback_strategy.md`, but `mydocs/tech/font_fallback_strategy.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:88— mydocs/README.md links to `tech/edit_action_undo_redo_architecture.md`, but `mydocs/tech/edit_action_undo_redo_architecture.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:89— mydocs/README.md links to `tech/parser_architecture.md`, but `mydocs/tech/parser_architecture.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:90— mydocs/README.md links to `tech/thorvg_decision.md`, but `mydocs/tech/thorvg_decision.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:91— mydocs/README.md links to `tech/archive/dev_roadmap_v1_backup.md`, but `mydocs/tech/archive/dev_roadmap_v1_backup.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:92— mydocs/README.md links to `tech/investigations/README.md`, but `mydocs/tech/investigations/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift mydocs/README.md:93— mydocs/README.md links to `troubleshootings/README.md`, but `mydocs/troubleshootings/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift gym/tools/README.md:23— gym/tools/README.md links to `../../scripts/tests/test_gym_authority_ledger.py`, but `scripts/tests/test_gym_authority_ledger.py` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift gym/tools/README.md:25— gym/tools/README.md links to `../../scripts/tests/test_gym_oracle_probe.py`, but `scripts/tests/test_gym_oracle_probe.py` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Duplicated predicate rhwp-studio/src/view/canvaskit-renderer.ts:6192— `!Number.isFinite(determinant) || determinant === 0` appears character-identically in 2 files — rhwp-studio/src/view/canvaskit-renderer.ts, rhwp-studio/src/view/canvaskit/raster-stroke.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 mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:73— `!Number.isInteger(info.pageCount) || info.pageCount < 1` appears character-identically in 3 files — mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs, scripts/export-wasm-for-sweep.mjs, scripts/export-wasm-png-for-sweep.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 rhwp-chrome/sw/thumbnail-decompression.js:6— `!Number.isSafeInteger(declaredSize) || declaredSize <= 0 || !Number.isSafeInteger(maxBytes) || maxBytes <= 0 || declaredSize > maxBytes` appears character-identically in 3 files — rhwp-chrome/sw/thumbnail-decompression.js, rhwp-firefox/sw/thumbnail-decompression.js, rhwp-shared/sw/thumbnail-decompression.js. 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/font_metric_coverage_checkpoint_finalizer.mjs:319— `!allowed.has(option) || value === undefined` appears character-identically in 6 files — scripts/font_metric_coverage_checkpoint_finalizer.mjs, scripts/font_metric_coverage_checkpoint_runner.mjs, scripts/font_metric_coverage_full_manifest.mjs, scripts/font_typesetting_risk_evidence.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 rhwp-studio/src/engine/input-handler-text.ts:125— `!fi.inField || fi.fieldType !== 'clickhere'` appears character-identically in 2 files — rhwp-studio/src/engine/input-handler-text.ts, rhwp-studio/src/engine/input-handler.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 rhwp-safari/src/background.js:108— `!filename || typeof filename !== 'string'` appears character-identically in 2 files — rhwp-safari/src/background.js, rhwp-shared/security/filename-sanitizer.js. 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 rhwp-chrome/sw/fetch-security.js:135— `!host.includes('.') && !host.includes(':')` appears character-identically in 2 files — rhwp-chrome/sw/fetch-security.js, rhwp-firefox/sw/fetch-security.js. 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/kerning_q1_baseline.mjs:110— `!key.startsWith('--') || !(key.slice(2) in options)` appears character-identically in 2 files — scripts/kerning_q1_baseline.mjs, scripts/kerning_q2_fixture_baseline.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/refresh-nextest-target-duration-policy.mjs:84— `!name || !Number.isFinite(seconds) || seconds <= 0` appears character-identically in 2 files — scripts/refresh-nextest-target-duration-policy.mjs, scripts/select-nextest-archive-targets.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/font_rank1_runtime_boundary.mjs:175— `!option?.startsWith('--') || value === undefined` appears character-identically in 3 files — scripts/font_rank1_runtime_boundary.mjs, scripts/font_rank7_runtime_boundary.mjs, scripts/font_rank8_trace_baseline.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 rhwp-chrome/sw/document-url-resolver.js:55— `!owner || !repo || marker !== 'blob' || !ref || pathParts.length === 0` appears character-identically in 3 files — rhwp-chrome/sw/document-url-resolver.js, rhwp-firefox/sw/document-url-resolver.js, rhwp-shared/sw/document-url-resolver.js. 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 rhwp-chrome/sw/download-observer-state.js:95— `!previousState || isDownloadStateExpired(previousState, now, options.stateTtlMs)` appears character-identically in 3 files — rhwp-chrome/sw/download-observer-state.js, rhwp-firefox/sw/download-observer-state.js, rhwp-shared/sw/download-observer-state.js. 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 rhwp-chrome/sw/fetch-security.js:32— `!senderUrl || !runtimeApi?.runtime?.getURL` appears character-identically in 2 files — rhwp-chrome/sw/fetch-security.js, rhwp-firefox/sw/fetch-security.js. 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 rhwp-studio/src/core/metafile-font-session.ts:39— `!state || state.generation !== generation` appears character-identically in 2 files — rhwp-studio/src/core/metafile-font-session.ts, rhwp-studio/src/core/native-pua-font-session.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 mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs:87— `!tree.type || !tree.bbox || !result.svg.includes('<svg')` appears character-identically in 2 files — mydocs/pr/assets/semanticist21-20261005/pr7504/registered-font-replay.mjs, scripts/export-wasm-for-sweep.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 rhwp-safari/src/background.js:71— `!urlString || typeof urlString !== 'string'` appears character-identically in 2 files — rhwp-safari/src/background.js, rhwp-shared/security/url-validator.js. 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 rhwp-studio/src/core/text-v2-normalizer.ts:16— `!value || typeof value !== 'object' || Array.isArray(value)` appears character-identically in 3 files — rhwp-studio/src/core/text-v2-normalizer.ts, scripts/font_metric_coverage_checkpoint_finalizer.mjs, scripts/font_rule_registry.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 rhwp-studio/src/view/canvaskit-renderer.ts:3121— `(codePoint >= 0x1100 && codePoint <= 0x11ff) || (codePoint >= 0xa960 && codePoint <= 0xa97f) || (codePoint >= 0xd7b0 && codePoint <= 0xd7ff)` appears character-identically in 2 files — rhwp-studio/src/view/canvaskit-renderer.ts, rhwp-studio/src/view/canvaskit/nominal-text-replay.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 rhwp-studio/src/engine/input-handler-table.ts:567— `(inCell || inTextBox) && hit.parentParaIndex !== undefined` appears character-identically in 2 files — rhwp-studio/src/engine/input-handler-table.ts, rhwp-studio/src/engine/input-handler.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 rhwp-studio/src/engine/input-handler.ts:1828— `(nearLeft && inVertRange) || (nearRight && inVertRange) || (nearTop && inHorzRange) || (nearBottom && inHorzRange)` appears character-identically in 2 files — rhwp-studio/src/engine/input-handler.ts, rhwp-studio/src/engine/table-border-hit.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 rhwp-studio/src/engine/input-handler-table.ts:663— `(result as any).error || '삽입 위치 또는 이미지 정보를 확인할 수 없습니다.'` appears character-identically in 2 files — rhwp-studio/src/engine/input-handler-table.ts, rhwp-studio/src/engine/input-handler.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 rhwp-studio/src/core/layer-resource-store.ts:54— `Number.isInteger(byte) && byte >= 0 && byte <= 255` appears character-identically in 2 files — rhwp-studio/src/core/layer-resource-store.ts, rhwp-studio/src/view/canvaskit-renderer.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/oracle_profile_contract.mjs:63— `Number.isSafeInteger(value) && value > 0` appears character-identically in 2 files — scripts/oracle_profile_contract.mjs, scripts/verify-trusted-postmerge-ci-reuse.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/font_metric_coverage_checkpoint_finalizer.mjs:62— `Number.isSafeInteger(value) && value >= 0` appears character-identically in 6 files — scripts/font_metric_coverage_checkpoint_finalizer.mjs, scripts/font_metric_coverage_checkpoint_runner.mjs, scripts/font_metric_coverage_contract.mjs, scripts/font_metric_coverage_full_manifest.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 rhwp-chrome/sw/fetch-security.js:151— `a === 0 || a === 10 || a === 127 || (a === 100 && b >= 64 && b <= 127) || (a === 169 && b === 254) || (a === 172 && b >= 16 && b <= 31) || (…` appears character-identically in 4 files — rhwp-chrome/sw/fetch-security.js, rhwp-firefox/sw/fetch-security.js, rhwp-safari/src/background.js, rhwp-shared/security/url-validator.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
+ 15 more in this group — see findings.md.
P2 · Observability· Console output used as the logging channel · ×39
Console output used as the logging channel rhwp-studio/cdp_screenshot.cjs:7— `rhwp-studio/cdp_screenshot.cjs` reports through `console.*` at line 7 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/cdp_screenshot.cjs:8— `rhwp-studio/cdp_screenshot.cjs` reports through `console.*` at line 8 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/cdp_screenshot.cjs:11— `rhwp-studio/cdp_screenshot.cjs` reports through `console.*` at line 11 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/cdp_screenshot.cjs:18— `rhwp-studio/cdp_screenshot.cjs` reports through `console.*` at line 18 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/cdp_screenshot.cjs:20— `rhwp-studio/cdp_screenshot.cjs` reports through `console.*` at line 20 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/view/canvaskit-renderer.ts:589— `rhwp-studio/src/view/canvaskit-renderer.ts` reports through `console.*` at line 589 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/view/canvaskit-renderer.ts:605— `rhwp-studio/src/view/canvaskit-renderer.ts` reports through `console.*` at line 605 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/view/canvaskit-renderer.ts:623— `rhwp-studio/src/view/canvaskit-renderer.ts` reports through `console.*` at line 623 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/view/canvaskit-renderer.ts:644— `rhwp-studio/src/view/canvaskit-renderer.ts` reports through `console.*` at line 644 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/view/canvaskit-renderer.ts:679— `rhwp-studio/src/view/canvaskit-renderer.ts` reports through `console.*` at line 679 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/view/canvaskit-renderer.ts:873— `rhwp-studio/src/view/canvaskit-renderer.ts` reports through `console.*` at line 873 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/view/canvaskit-renderer.ts:935— `rhwp-studio/src/view/canvaskit-renderer.ts` reports through `console.*` at line 935 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/ui/dialog-apply.ts:40— `rhwp-studio/src/ui/dialog-apply.ts` reports through `console.*` at line 40 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/ui/dialog-apply.ts:83— `rhwp-studio/src/ui/dialog-apply.ts` reports through `console.*` at line 83 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/recent/recent-open.ts:70— `rhwp-studio/src/recent/recent-open.ts` reports through `console.*` at line 70 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/plugin/host.ts:313— `rhwp-studio/src/plugin/host.ts` reports through `console.*` at line 313 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/plugin/host.ts:399— `rhwp-studio/src/plugin/host.ts` reports through `console.*` at line 399 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/plugin/host.ts:425— `rhwp-studio/src/plugin/host.ts` reports through `console.*` at line 425 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/hwpctl/action.ts:89— `rhwp-studio/src/hwpctl/action.ts` reports through `console.*` at line 89 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/hwpctl/action.ts:103— `rhwp-studio/src/hwpctl/action.ts` reports through `console.*` at line 103 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/hwpctl/action.ts:113— `rhwp-studio/src/hwpctl/action.ts` reports through `console.*` at line 113 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/hwpctl/actions/clipboard.ts:16— `rhwp-studio/src/hwpctl/actions/clipboard.ts` reports through `console.*` at line 16 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/hwpctl/actions/clipboard.ts:29— `rhwp-studio/src/hwpctl/actions/clipboard.ts` reports through `console.*` at line 29 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/hwpctl/actions/clipboard.ts:45— `rhwp-studio/src/hwpctl/actions/clipboard.ts` reports through `console.*` at line 45 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel rhwp-studio/src/hwpctl/actions/clipboard.ts:57— `rhwp-studio/src/hwpctl/actions/clipboard.ts` reports through `console.*` at line 57 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Subsumed condition operand tests/issue_1949_giant_cell_render_perf.rs:48— `svg.starts_with("<svg")` can never decide this `||` — every value satisfying `svg.starts_with("<svg")` also satisfies `svg.contains("<svg")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_bug_hunter_skill_contract.rs:49— `text.contains("gym 이 아니고")` can never decide this `||` — every value satisfying `text.contains("gym 이 아니고")` also satisfies `text.contains("gym")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_chief_skill_contract.rs:69— `text.contains("gym 이 아니다")` can never decide this `||` — every value satisfying `text.contains("gym 이 아니다")` also satisfies `text.contains("gym")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_cli_save_contract.rs:71— `text.contains("자기 직렬화")` can never decide this `||` — every value satisfying `text.contains("자기 직렬화")` also satisfies `text.contains("자기")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_cli_save_contract.rs:71— `text.contains("자기 round")` can never decide this `||` — every value satisfying `text.contains("자기 round")` also satisfies `text.contains("자기")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_codex_skill_contract.rs:258— `dict.contains("§2-2")` can never decide this `||` — every value satisfying `dict.contains("§2-2")` also satisfies `dict.contains("2-2")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_codex_skill_contract.rs:375— `text.contains("#5318")` can never decide this `||` — every value satisfying `text.contains("#5318")` also satisfies `text.contains("5318")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_contributor_skill_contract.rs:326— `text.contains("#5322")` can never decide this `||` — every value satisfying `text.contains("#5322")` also satisfies `text.contains("5322")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_doc_triage_anti_dump.rs:30— `text.contains("export-text 무제한")` can never decide this `||` — every value satisfying `text.contains("export-text 무제한")` also satisfies `text.contains("무제한")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_doc_triage_intent_matrix.rs:128— `text.contains("gym 없음")` can never decide this `||` — every value satisfying `text.contains("gym 없음")` also satisfies `text.contains("gym")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_doc_triage_skill_contract.rs:100— `text.contains("gym 이 아니고")` can never decide this `||` — every value satisfying `text.contains("gym 이 아니고")` also satisfies `text.contains("gym")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_fde_skill_contract.rs:49— `text.contains("gym 이 아니고")` can never decide this `||` — every value satisfying `text.contains("gym 이 아니고")` also satisfies `text.contains("gym")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_fidelity_compare_skill_contract.rs:47— `text.contains("gym 이 아니고")` can never decide this `||` — every value satisfying `text.contains("gym 이 아니고")` also satisfies `text.contains("gym")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_form_fill_skill_contract.rs:70— `text.contains("gym 이 아니고")` can never decide this `||` — every value satisfying `text.contains("gym 이 아니고")` also satisfies `text.contains("gym")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_handoff_skill_contract.rs:431— `text.contains("#5339")` can never decide this `||` — every value satisfying `text.contains("#5339")` also satisfies `text.contains("5339")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_knowledge_map_skill_contract.rs:48— `text.contains("gym 이 아니고")` can never decide this `||` — every value satisfying `text.contains("gym 이 아니고")` also satisfies `text.contains("gym")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_provenance_skill_contract.rs:381— `text.contains("#5295")` can never decide this `||` — every value satisfying `text.contains("#5295")` also satisfies `text.contains("5295")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_recipes_skill_contract.rs:54— `text.contains("gym 이 아니고")` can never decide this `||` — every value satisfying `text.contains("gym 이 아니고")` also satisfies `text.contains("gym")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_security_sweep_no_raw.rs:77— `text.contains("findings[].raw")` can never decide this `||` — every value satisfying `text.contains("findings[].raw")` also satisfies `text.contains("raw")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_strategist_skill_contract.rs:366— `text.contains("#5335")` can never decide this `||` — every value satisfying `text.contains("#5335")` also satisfies `text.contains("5335")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_visual_regression_skill_contract.rs:69— `text.contains("gym 이 아니고")` can never decide this `||` — every value satisfying `text.contains("gym 이 아니고")` also satisfies `text.contains("gym")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/agent_work_receipt_skill_contract.rs:318— `text.contains("#5308")` can never decide this `||` — every value satisfying `text.contains("#5308")` also satisfies `text.contains("5308")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand tests/cases/issue_6299_same_vpos_seg_is_one_row.rs:63— `summary.contains("overlap: 0")` can never decide this `&&` — every value satisfying `summary.contains("text-overlap: 0")` also satisfies `summary.contains("overlap: 0")`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src/document_core/commands/html_import/inline_content.rs:291— `css_lower.contains("text-decoration: line-through")` can never decide this `||` — every value satisfying `css_lower.contains("text-decoration: line-through")` also satisfies `css_lower.contains("line-through")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand rhwp-desk/src/planner.rs:151— `d.contains("connection")` can never decide this `||` — every value satisfying `d.contains("connection")` also satisfies `d.contains("connect")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Orphaned file src/doclang/adapter/geometry_pass.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/doclang/writer/otsl.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/doclang/adapter/table.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/doclang/writer/custom.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/doclang/mod.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/doclang/resources.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/doclang/adapter/mod.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/serializer/hml/head.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/doclang/ir/prov.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file rhwp-studio/src/history/idb-store.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/doclang/writer/inline.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/doclang/ir/block.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/doclang/loss/report.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file rhwp-studio/src/core/hml-save-capability.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/serializer/hwpx/static_assets.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/atomic_file.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/parser/hml/encoding.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file rhwp-studio/src/ui/hml-save-format-dialog.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file tools/verify_hwpx.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file rhwp-studio/src/command/save-target.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/doclang/options.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file bindings/swift/Sources/Rhwp/RhwpDocumentTextView.swift:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Silent fallback default on parse failure bindings/Native/examples/native_accessibility.py:306— `text` (in `ensure_qt_accessibility_factory`) returns `''` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure gym/tools/differential.py:272— `normalize_timeout` returns `0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure gym/tools/differential.py:281— `normalize_limit` returns `0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure gym/tools/differential.py:677— `select_pairs` returns `[]` when `TypeError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure gym/tools/fuzz_corpus.py:725— `normalize_limit` returns `0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure gym/tools/fuzz_corpus.py:734— `normalize_timeout` returns `0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure gym/tools/fuzz_corpus.py:743— `normalize_workers` returns `1` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure gym/tools/release_diff.py:267— `normalize_timeout` returns `0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure gym/tools/robustness.py:597— `normalize_limit` returns `0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure gym/tools/robustness.py:606— `normalize_timeout` returns `0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure tools/gen_agent_codex.py:241— `provenance_map` returns `{}` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure tools/hwp_generator_probe.py:39— `hwp5_generator` returns `'(olefile 미설치)'` when `ImportError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure tools/hwpctrl_compat/run_gate.py:99— `stored_oracle_status` returns `'INVALID_ORACLE'` when `(OSError, json.JSONDecodeError, AttributeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure tools/hwpctrl_compat/run_gate.py:171— `validate_rhwp_output` returns `'INVALID_OUTPUT'` when `(OSError, json.JSONDecodeError, AttributeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure tools/oracle_page_count/regenerate.py:78— `pick_oracles` returns `[]` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch gym/core/runner.py:235— `truncate_head` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch gym/core/runner.py:424— `find_bin` swallows every exception into `return 'rhwp'` — 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 gym/core/runner.py:480— `decode_cli_stdout` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch gym/tools/differential.py:257— `truncate_head` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch gym/tools/fuzz_corpus.py:1562— `_mutants_per_sample_hint` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch gym/tools/release_diff.py:252— `truncate_head` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch gym/tools/trajectory.py:382— `truncate_head` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch tools/hangul_rotation_oracle/oracle.py:121— `hangul_version` swallows every exception into `return 'unknown'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch tools/hwp_generator_probe.py:32— `hwpx_lastsaveby` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch tools/object_visual_regression.py:69— `git_head` swallows every exception into `return '?'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch tools/scale_ladder_real.py:169— `_git` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch tools/verify_hangul_pages.py:39— `git_head` swallows every exception into `return 'unknown'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch tools/verify_pi_page_roundtrip.py:54— `git_head` swallows every exception into `return 'unknown'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch tools/verify_pi_page_vs_hangul.py:64— `git_head` swallows every exception into `return '?'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on Err src/document_core/queries/field_query.rs:1491— `get_field_info_at_by_path` turns every `Err` into `r#"{"inField":false}"#.to_string()` — 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 src/parser/mod.rs:2006— `resolved_len` turns every `Err` into `0` — 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 src/wasm_api.rs:4526— `get_external_image_references` turns every `Err` into `"[]".to_string()` — 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 src/wasm_api.rs:4547— `get_external_image_basenames` turns every `Err` into `"[]".to_string()` — 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 src/wasm_api.rs:6513— `get_field_info_at_by_path_api` turns every `Err` into `r#"{"inField":false}"#.to_string()` — 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 src/wasm_api.rs:7180— `rename_field_api` turns every `Err` into `r#"{"ok":false,"renamed":0}"#.to_string()` — 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 src/document_core/helpers.rs:1372— `parse_css_dimension_pt` turns every `Err` into `0.0` — 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 src/document_core/helpers.rs:1462— `parse_single_dimension_pt` turns every `Err` into `0.0` — 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 src/parser/hwpx/section.rs:3585— `parse_picture_transparency_attr` turns every `Err` into `0` — 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 src/parser/hwpx/utils.rs:70— `parse_u8` turns every `Err` into `0` — 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 src/parser/hwpx/utils.rs:74— `parse_i8` turns every `Err` into `0` — 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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 119 significant file(s) lose their only recent owner: src/tools/font_metric_gen.rs, gym/tools/evidence_report.py, src/renderer/shaping_paragraph.rs, scripts/font_rank8_private_qualification.py, src/renderer/shaping_vertical.rs, src/cli/commands/edit/header_footer_content.rs, src/renderer/shaping_context.rs, src/cli/queries/security_inspection.rs (+111 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 88 significant file(s) lose their only recent owner: scripts/visual_sweep.py, tools/fidelity_compare/fidelity_compare.py, src/renderer/typeset/controls/stored_tac.rs, src/renderer/font_environment.rs, src/paint/paper_viewport.rs, src/ole_chart/legacy_presentation.rs, src/renderer/layout/table_layout/stored_ordinary_row_frame.rs, scripts/oracle_comparability.py (+80 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 56 significant file(s) lose their only recent owner: src/eps.rs, src/parser/pdf/recognition.rs, tools/hwpctrl_compat/classify_remaining.py, tools/verify_pi_page_vs_hangul.py, tools/hwpctrl_compat/build_ledger.py, tools/verify_hangul_pages.py, tools/hwpctrl_compat/sweep_actions.py, src/document_core/commands/bin_data_prune.rs (+48 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 46 significant file(s) lose their only recent owner: gym/tools/competitive_bench.py, tools/agent_onboarding/rhwp_doctor.py, gym/tools/agent_session.py, gym/core/runner.py, gym/tools/leaderboard.py, gym/tools/differential.py, src/document_core/queries/stego_scan.rs, src/rag/chunker.rs (+38 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 41 significant file(s) lose their only recent owner: bindings/Native/src/session.rs, rhwp-studio/src/view/static-svg-path-layers.ts, src/renderer/skia/glyph_replay.rs, src/native_host/runtime.rs, src/native_host/editor.rs, rhwp-studio/src/view/glyph-outline-payload-status.ts, src/native_host/accessibility.rs, src/paint/text_v2_export.rs (+33 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 17 significant file(s) lose their only recent owner: rhwp-studio/src/dev/page-scroll-probe.ts, rhwp-studio/src/view/page-render-scheduler.ts, rhwp-studio/src/ui/icon-toolbar-scroller.ts, src/cli/commands/caption_validation.rs, rhwp-studio/src/view/render-surface-budget.ts, rhwp-studio/src/ui/style-toolbar-overflow.ts, rhwp-studio/src/dev/scroll-observation.ts, rhwp-studio/src/engine/input-handler-hyperlink.ts (+9 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 11 significant file(s) lose their only recent owner: crates/rhwp-ooxml-chart/src/patch.rs, rhwp-studio/src/ui/chart-data-dialog.ts, rhwp-studio/src/core/chart-data-target.ts, src/document_core/queries/chart_csv.rs, rhwp-studio/src/core/chart-grid-model.ts, src/serializer/ole_container.rs, mydocs/tech/investigations/issue-595/probes/inspect_595_regression.rs, mydocs/tech/investigations/issue-7441/probes/repro_7441_reporter_geometry.rs (+3 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #8 — If anonymized user #8 becomes unavailable, 5 significant file(s) lose their only recent owner: tools/hangul_rotation_oracle/oracle.py, rhwp-studio/src/hwpctl/action.ts, rhwp-studio/src/ui/dialog-apply.ts, rhwp-studio/src/engine/line-start-affinity.ts, rhwp-studio/src/hwpctl/actions/clipboard.ts. Pair on, review, or document these before any departure.
R7 · Dead Code· Unused module-local declaration 'arg' · ×2
Unused module-local declaration 'arg' gym/tools/from_e2e.mjs:187— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
Unused module-local declaration 'arg' rhwp-studio/e2e/probe-image-repaint-issue3315.mjs:42— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'cancelPassword' · ×2
Unused module-local declaration 'cancelPassword' mydocs/pr/assets/issue8174/v2-s04/reproduce/browser-recovery-open-races.mjs:22— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
Unused module-local declaration 'cancelPassword' mydocs/pr/assets/issue8174/v2-s04/reproduce/browser-recovery-races.mjs:22— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'text' · ×2
Unused module-local declaration 'text' mydocs/pr/assets/issue8174/v2-s04/reproduce/browser-recovery-open-races.mjs:23— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
Unused module-local declaration 'text' mydocs/pr/assets/issue8174/v2-s04/reproduce/browser-recovery-races.mjs:23— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'stub' · ×2
Unused module-local declaration 'stub' rhwp-studio/src/command/commands/page.ts:12— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
Unused module-local declaration 'stub' rhwp-studio/src/command/commands/table.ts:118— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 4 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (389 single-owned of 2038 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2038 of the 2715 production source files in this repository met that bar). They are anonymized user #9 (2 file(s)), anonymized user #10 (2 file(s)), anonymized user #11 (1 file(s)), anonymized user #12 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: rhwp-studio/src/compare/diff-engine.ts, rhwp-studio/src/compare/types.ts, rhwp-studio/src/view/ruler-pin-geometry.ts, rhwp-studio/src/core/event-bus.ts, tools/fixture_generators/build_issue_505_fixture.rs, rhwp-studio/src/command/field-insert-params.ts.
D21 · Naming Consistency· `ActID` spells `ID` where 207 names in the project spell it `Id` · ×1
`ActID` spells `ID` where 207 names in the project spell it `Id` rhwp-studio/src/hwpctl/action.ts:58— 207 of 209 names in project repository spell the token `Id` (207 of 209; unit: names in project repository containing `Id`). Peers: AgentLoopOptions.executeTool(boundaryId) (rhwp-studio/src/ai/agent/agent-loop.ts:66); AgentLoopOptions.createBoundaryId (rhwp-studio/src/ai/agent/agent-loop.ts:68); ChatController.executeCommandTool(boundaryId) (rhwp-studio/src/ai/agent/chat-controller.ts:153); ChatController.executeWrite(boundaryId) (rhwp-studio/src/ai/agent/chat-controller.ts:167); rhwp-studio.src.ai.provider.models.AiProviderId (rhwp-studio/src/ai/provider/models.ts:6). Rename to `ActId`. [rule N6]
D21 · Naming Consistency· `SetID` spells `ID` where 207 names in the project spell it `Id` · ×1
`SetID` spells `ID` where 207 names in the project spell it `Id` rhwp-studio/src/hwpctl/action.ts:59— 207 of 209 names in project repository spell the token `Id` (207 of 209; unit: names in project repository containing `Id`). Peers: AgentLoopOptions.executeTool(boundaryId) (rhwp-studio/src/ai/agent/agent-loop.ts:66); AgentLoopOptions.createBoundaryId (rhwp-studio/src/ai/agent/agent-loop.ts:68); ChatController.executeCommandTool(boundaryId) (rhwp-studio/src/ai/agent/chat-controller.ts:153); ChatController.executeWrite(boundaryId) (rhwp-studio/src/ai/agent/chat-controller.ts:167); rhwp-studio.src.ai.provider.models.AiProviderId (rhwp-studio/src/ai/provider/models.ts:6). Rename to `SetId`. [rule N6]
D21 · Naming Consistency· `createObjectURL` spells `URL` where 23 names in the project spell it `Url` · ×1
`createObjectURL` spells `URL` where 23 names in the project spell it `Url` rhwp-studio/src/view/canvaskit/browser-image-decoder.ts:6— 23 of 25 names in project repository spell the token `Url` (23 of 25; unit: names in project repository containing `Url`). Peers: gemini.geminiStreamUrl (rhwp-studio/src/ai/provider/gemini.ts:160); print-surface.resolvePrintSurfaceUrl (rhwp-studio/src/command/print-surface.ts:38); print-surface.resolvePrintSurfaceUrl(baseUrl) (rhwp-studio/src/command/print-surface.ts:38); CanvasKitFontPlanOptions.localFontBaseUrl (rhwp-studio/src/core/font-loader.ts:32); FontResource.cssUrl (rhwp-studio/src/core/font-loader.ts:79). Rename to `createObjectUrl`. [rule N6]
D21 · Naming Consistency· `revokeObjectURL` spells `URL` where 23 names in the project spell it `Url` · ×1
`revokeObjectURL` spells `URL` where 23 names in the project spell it `Url` rhwp-studio/src/view/canvaskit/browser-image-decoder.ts:7— 23 of 25 names in project repository spell the token `Url` (23 of 25; unit: names in project repository containing `Url`). Peers: gemini.geminiStreamUrl (rhwp-studio/src/ai/provider/gemini.ts:160); print-surface.resolvePrintSurfaceUrl (rhwp-studio/src/command/print-surface.ts:38); print-surface.resolvePrintSurfaceUrl(baseUrl) (rhwp-studio/src/command/print-surface.ts:38); CanvasKitFontPlanOptions.localFontBaseUrl (rhwp-studio/src/core/font-loader.ts:32); FontResource.cssUrl (rhwp-studio/src/core/font-loader.ts:79). Rename to `revokeObjectUrl`. [rule N6]
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 22 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: src/doclang/writer/otsl.rs, src/doclang/writer/custom.rs, src/doclang/adapter/geometry_pass.rs, src/doclang/mod.rs, src/doclang/resources.rs, src/doclang/adapter/table.rs, src/serializer/hml/head.rs, src/doclang/ir/prov.rs (and 14 more) (25 orphaned of 2038 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2038 of the 2715 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
Logging is not universal — Only 3/6 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `rhwp-desk`.
P3 · Security & performance tooling· Dependabot does not watch pip · ×1
Dependabot does not watch pip .github/dependabot.yml:2— `.github/dependabot.yml` schedules updates, but no `package-ecosystem` entry covers `pip`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list.
R7 · Dead Code· Unused export 'DEFAULT_STATE_TTL_MS' · ×1
Unused export 'DEFAULT_STATE_TTL_MS' rhwp-shared/sw/download-observer-state.js:7— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'isTerminalDelta' · ×1
Unused export 'isTerminalDelta' rhwp-shared/sw/download-observer-state.js:15— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'PBKDF2_ITERATIONS' · ×1
Unused export 'PBKDF2_ITERATIONS' rhwp-studio/src/ai/settings/key-store.ts:16— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'collectMarkupCommandIds' · ×1
Unused export 'collectMarkupCommandIds' rhwp-studio/src/automation/menu-dom.ts:119— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'AutomationErrorCode' · ×1
Unused export 'AutomationErrorCode' rhwp-studio/src/automation/types.ts:105— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'imagePixelSize' · ×1
Unused export 'imagePixelSize' rhwp-studio/src/engine/office-clipboard-images.ts:161— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'isPluginError' · ×1
Unused export 'isPluginError' rhwp-studio/src/plugin/types.ts:234— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'localStorageWidthStore' · ×1
Unused export 'localStorageWidthStore' rhwp-studio/src/view/side-panel-host.ts:35— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'ZOOM_INPUT_QUIET_MS' · ×1
Unused export 'ZOOM_INPUT_QUIET_MS' rhwp-studio/src/view/zoom-input-settle.ts:2— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused module-local declaration 'restart' · ×1
Unused module-local declaration 'restart' mydocs/pr/assets/issue8174/v2-s04/reproduce/browser-recovery-races.mjs:20— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'restore' · ×1
Unused module-local declaration 'restore' mydocs/pr/assets/issue8174/v2-s04/reproduce/browser-recovery-races.mjs:21— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Write-only private field '#fieldViewOption' · ×1
Write-only private field '#fieldViewOption' npm/hwpctrl-ocx/src/index.mjs:1003— This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code· Unused private method '#selectObject' · ×1
Unused private method '#selectObject' npm/hwpctrl-ocx/src/index.mjs:2970— Nothing in its class calls or references this private method — no member access, no string key, no decorator, and no test reaches it by name. A private member cannot be called from outside its class, so this is the whole search: remove it, or call it where it was meant to be used.
R7 · Dead Code· Unused module-local declaration 'inTableOrCellSelection' · ×1
Unused module-local declaration 'inTableOrCellSelection' rhwp-studio/src/command/commands/table.ts:26— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'PX_TO_MM' · ×1
Unused module-local declaration 'PX_TO_MM' rhwp-studio/src/command/commands/view.ts:28— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'selectTableObject' · ×1
Unused module-local declaration 'selectTableObject' rhwp-studio/src/engine/input-handler-mouse.ts:69— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'findSingleCellResizeNeighbor' · ×1
Unused module-local declaration 'findSingleCellResizeNeighbor' rhwp-studio/src/engine/input-handler-table.ts:130— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Write-only private field 'commandPalette' · ×1
Write-only private field 'commandPalette' rhwp-studio/src/engine/input-handler.ts:353— This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code· Write-only private field 'cellSelectionDragState' · ×1
Write-only private field 'cellSelectionDragState' rhwp-studio/src/engine/input-handler.ts:375— This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code· Write-only private field 'cellSelectionDragCandidate' · ×1
Write-only private field 'cellSelectionDragCandidate' rhwp-studio/src/engine/input-handler.ts:386— This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code· Write-only private field 'protectedCellHitCache' · ×1
Write-only private field 'protectedCellHitCache' rhwp-studio/src/engine/input-handler.ts:406— This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code· Unused private field 'resizeDragState' · ×1
Unused private field 'resizeDragState' rhwp-studio/src/engine/input-handler.ts:418— 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.
R8 · Dependency Hygiene· Test-only dependency 'pixelmatch' in production deps · ×1
Test-only dependency 'pixelmatch' in production deps rhwp-studio/package.json:126— Only test files import it (first: rhwp-studio/e2e/helpers.mjs:14) — move it to devDependencies.
R8 · Dependency Hygiene· Test-only dependency 'pngjs' in production deps · ×1
Test-only dependency 'pngjs' in production deps rhwp-studio/package.json:127— Only test files import it (first: rhwp-studio/e2e/helpers.mjs:18) — move it to devDependencies.
Nullable reference types not enabled everywhere — 0/1 C# file(s) are in a nullable-enabled context. This repository commits no project file, so nothing sets <Nullable>enable</Nullable> for it: a file is enabled only by its own `#nullable enable`, by a Unity `csc.rsp` with `-nullable:enable` for its assembly, or as a file-based app (`#:` directives) whose `#:property Nullable` does not turn it off. NRTs catch a whole class of null-deref bugs at compile time.
Outdated: aes — `aes` is locked at 0.9.3 but 0.9.4 is the current stable release on crates.io, and it already satisfies the `"0.9"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aes` and commit the updated REDACTED.
Outdated: clap — `clap` is locked at 4.6.7 but 4.6.8 is the current stable release on crates.io, and it already satisfies the `"4.4"` requirement declared in tools/batch-convert/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
Outdated: crc32fast — `crc32fast` is locked at 1.5.3 but 1.5.5 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crc32fast` and commit the updated REDACTED.
Outdated: encoding_rs — `encoding_rs` is locked at 0.8.42 but 0.8.44 is the current stable release on crates.io, and it already satisfies the `"0.8.35"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p encoding_rs` and commit the updated REDACTED.
Outdated: flate2 — `flate2` is locked at 1.1.10 but 1.1.11 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
Outdated: js-sys — `js-sys` is locked at 0.3.104 but 0.3.107 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p js-sys` and commit the updated REDACTED.
Outdated: log — `log` is locked at 0.4.34 but 0.4.35 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in tools/batch-convert/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p log` and commit the updated REDACTED.
Outdated: ml-dsa — `ml-dsa` is locked at 0.1.1 but 0.1.2 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ml-dsa` and commit the updated REDACTED.
Outdated: ml-kem — `ml-kem` is locked at 0.3.3 but 0.3.4 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ml-kem` and commit the updated REDACTED.
Outdated: svgtypes — `svgtypes` is locked at 0.16.1 but 0.16.2 is the current stable release on crates.io, and it already satisfies the `"0.16"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p svgtypes` and commit the updated REDACTED.
Outdated: unicode-properties — `unicode-properties` is locked at 0.1.4 but 0.1.5 is the current stable release on crates.io, and it already satisfies the `"0.1.4"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p unicode-properties` and commit the updated REDACTED.
Outdated: ureq — `ureq` is locked at 3.4.0 but 3.5.2 is the current stable release on crates.io, and it already satisfies the `"3.3.0"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ureq` and commit the updated REDACTED.
Outdated: wasm-bindgen — `wasm-bindgen` is locked at 0.2.127 but 0.2.130 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p wasm-bindgen` and commit the updated REDACTED.
Outdated: web-sys — `web-sys` is locked at 0.3.104 but 0.3.107 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p web-sys` and commit the updated REDACTED.
Outdated: wuff — `wuff` is locked at 0.2.9 but 0.2.10 is the current stable release on crates.io, and it already satisfies the `"0.2.9"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p wuff` and commit the updated REDACTED.
Outdated: zip — `zip` is locked at 9.1.3 but 9.6.1 is the current stable release on crates.io, and it already satisfies the `"9.0"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p zip` and commit the updated REDACTED.
Skipped (documented): IME 종료 후 예약 탐색은 본문·머리말/꼬리말·각주의 키보드 소유자를 따른다 rhwp-studio/tests/composition-pending-navigation.test.ts:6— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): 조합 replace 거부 재정박은 머리말/꼬리말·각주 모드에서 stale 본문 offset 대신 hf/fnCharOffset 을 쓴다 rhwp-studio/tests/composition-replace-reanchor.test.ts:54— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): 실제 WASM: 메모 기준 글자 삭제·선택 삭제 undo/redo 와 HWP/HWPX 왕복 rhwp-studio/tests/memo-delete-undo.test.ts:188— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): #6788 실제 WASM + Studio 혼합 모양 적용/Undo/Redo rhwp-studio/tests/mixed-char-format.test.ts:7— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): 굵게/색/캐럿 대기 서식이 실제 문서에 반영된다 (자식 프로세스 + wasm 왕복) rhwp-studio/tests/pending-char-shape.test.ts:36— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): 커맨드 클래스 execute/undo 행위 (자식 프로세스 로드) rhwp-studio/tests/undo-drag-command-behaviour.test.ts:27— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Off the main sequence: rhwp-contracts — rhwp-contracts: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
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 01a1e83e-a6dd-7fb2-871d-f95eeafb92a7 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 136 · Warnings: 8795 · Recommendations: 260 · Info: 23 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 06:43 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.