Public report of DanielCardonaRojas/codemark, published 16 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, 16 November 2026, 22:20 UTC · Survey ID cd_e597fa63a6474ef78a76211ff67ca844
DanielCardonaRojas/codemark
Measured 16 November 2026, 22:19 UTC, at code version db2e737
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 medium codebase: 72,463 lines of product code in 5 projects, tests not counted · Estimated rebuild effort: about 0.5 person-years · Weakest lens: Production Readiness, 43.1
Findings by how serious they are
43 critical463 serious42 minor
15 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
16 November 2026, 22:19 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 ▸
46of 46 dimensions measured by tools.
515of 548 findings point to an exact file and line, so you can open each one in the code. The other 33 concern the repository as a whole, such as missing documentation.
46dimensions across 9 lenses, read from 72,463 lines of product code in 5 projects.
DanielCardonaRojas/codemark is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 53.7 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.
Production Readiness, at 43.1, is the weakest lens and counts most in the score. The best first step is planning backups and recovery, worth about 5.6 points. Turning on missing-value checks comes next, worth about 4.3 points. Raising Production Readiness to 62 would lift the score to about 59.7.
Thirty-one pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Five known security holes in the packages the code depends on can be used by attackers, and three pipeline steps run downloads nobody checks. Pinning each tool to an exact version, updating the vulnerable packages and checking each download against a checksum would close these risks. Passing outside input through environment variables would fix the pipeline step that puts outside input straight into a shell command, and the pipeline step that installs packages without pinning their versions needs the packages it installs pinned to exact versions. Saving the change and the message together would take care of the place where data is saved and a message sent separately.
The product code is 72,463 lines, about €78,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 43.1 to 62, the lowest score rated Strong, the score would rise from 53.7 to about 59.7.
Code composition: what the lines of code are
Product code 91%Tests 9%
Rebuild cost: about €78,000 · Estimate
Cost to rebuild
€26,000 to €130,000, for 432 to 1,370 hours of work, about 0.5 person-years for 1 to 2 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 54. 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
Medium: 72,463 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 finding(s) in DR & Backup.
Raises the score by about 5.6 points · Medium effort · DR & Backup
2
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
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 €78,000 to build again, about 0.5 person-years of work. Its weakest lens is Production Readiness, at 43.1 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 finding(s) in DR & Backup. Of all the actions in this report, it raises the score most for the work it takes: about 5.6 points for medium effort, because it clears the 1 DR & Backup 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 6.3 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 9% on every change. The history of the code shows how much it changes: about 31,861 lines over the last 90 days, which is about 129,214 lines a year. At that pace, the extra work comes to an estimated 13.3 to 80 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.
132 modules, with 220 dependencies between them. 3 loops run through 6 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 92 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.
codemark_core.config uses codemark_core.embeddings.config, so a change to codemark_core.embeddings.config can break codemark_core.config, while a change to codemark_core.config can't break codemark_core.embeddings.config.
Position
Below the diagonal: codemark_core.config uses a module listed above it, which is the healthy direction.
7→9 codemark_core.parser.profile uses codemark_core.parser.languagespart of a loop✕
Connections
1 pair of types, where a type in codemark_core.parser.profile uses a type in codemark_core.parser.languages.
codemark_core.parser.profile uses codemark_core.parser.languages, so a change to codemark_core.parser.languages can break codemark_core.parser.profile, while a change to codemark_core.parser.profile can't break codemark_core.parser.languages.
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.
codemark_core.grammar.registry_source uses codemark_core.error, so a change to codemark_core.error can break codemark_core.grammar.registry_source, while a change to codemark_core.grammar.registry_source can't break codemark_core.error.
Position
Below the diagonal: codemark_core.grammar.registry_source uses a module listed above it, which is the healthy direction.
codemark_core.grammar.registry_source uses codemark_core.config, so a change to codemark_core.config can break codemark_core.grammar.registry_source, while a change to codemark_core.grammar.registry_source can't break codemark_core.config.
Position
Below the diagonal: codemark_core.grammar.registry_source uses a module listed above it, which is the healthy direction.
codemark_core.parser.languages uses codemark_core.parser.profile, so a change to codemark_core.parser.profile can break codemark_core.parser.languages, while a change to codemark_core.parser.languages can't break codemark_core.parser.profile.
Position
Below the diagonal: codemark_core.parser.languages uses a module listed above it, which is the healthy direction.
codemark_core.engine.comment_anchor uses codemark_core.parser.profile, so a change to codemark_core.parser.profile can break codemark_core.engine.comment_anchor, while a change to codemark_core.engine.comment_anchor can't break codemark_core.parser.profile.
Position
Below the diagonal: codemark_core.engine.comment_anchor uses a module listed above it, which is the healthy direction.
codemark_core.engine.comment_anchor uses codemark_core.parser.languages, so a change to codemark_core.parser.languages can break codemark_core.engine.comment_anchor, while a change to codemark_core.engine.comment_anchor can't break codemark_core.parser.languages.
Position
Below the diagonal: codemark_core.engine.comment_anchor uses a module listed above it, which is the healthy direction.
codemark_core.query.generator uses codemark_core.parser.profile, so a change to codemark_core.parser.profile can break codemark_core.query.generator, while a change to codemark_core.query.generator can't break codemark_core.parser.profile.
Position
Below the diagonal: codemark_core.query.generator uses a module listed above it, which is the healthy direction.
codemark_core.query.generator uses codemark_core.parser.languages, so a change to codemark_core.parser.languages can break codemark_core.query.generator, while a change to codemark_core.query.generator can't break codemark_core.parser.languages.
Position
Below the diagonal: codemark_core.query.generator uses a module listed above it, which is the healthy direction.
codemark_core.engine.bookmark uses codemark_core.sort, so a change to codemark_core.sort can break codemark_core.engine.bookmark, while a change to codemark_core.engine.bookmark can't break codemark_core.sort.
Position
Below the diagonal: codemark_core.engine.bookmark uses a module listed above it, which is the healthy direction.
codemark_core.engine.bookmark uses codemark_core.parser.languages, so a change to codemark_core.parser.languages can break codemark_core.engine.bookmark, while a change to codemark_core.engine.bookmark can't break codemark_core.parser.languages.
Position
Below the diagonal: codemark_core.engine.bookmark uses a module listed above it, which is the healthy direction.
codemark_core.engine.bookmark uses codemark_core.engine.comment_anchor, so a change to codemark_core.engine.comment_anchor can break codemark_core.engine.bookmark, while a change to codemark_core.engine.bookmark can't break codemark_core.engine.comment_anchor.
Position
Below the diagonal: codemark_core.engine.bookmark uses a module listed above it, which is the healthy direction.
codemark_cli.cli.output uses codemark_core.engine.bookmark, so a change to codemark_core.engine.bookmark can break codemark_cli.cli.output, while a change to codemark_cli.cli.output can't break codemark_core.engine.bookmark.
Position
Below the diagonal: codemark_cli.cli.output uses a module listed above it, which is the healthy direction.
codemark_core.engine.resolution uses codemark_core.parser.languages, so a change to codemark_core.parser.languages can break codemark_core.engine.resolution, while a change to codemark_core.engine.resolution can't break codemark_core.parser.languages.
Position
Below the diagonal: codemark_core.engine.resolution uses a module listed above it, which is the healthy direction.
codemark_core.engine.resolution uses codemark_core.engine.bookmark, so a change to codemark_core.engine.bookmark can break codemark_core.engine.resolution, while a change to codemark_core.engine.resolution can't break codemark_core.engine.bookmark.
Position
Below the diagonal: codemark_core.engine.resolution uses a module listed above it, which is the healthy direction.
codemark_core.storage.db uses codemark_core.engine.comment_anchor, so a change to codemark_core.engine.comment_anchor can break codemark_core.storage.db, while a change to codemark_core.storage.db can't break codemark_core.engine.comment_anchor.
Position
Below the diagonal: codemark_core.storage.db uses a module listed above it, which is the healthy direction.
codemark_core.storage.db uses codemark_core.engine.bookmark, so a change to codemark_core.engine.bookmark can break codemark_core.storage.db, while a change to codemark_core.storage.db can't break codemark_core.engine.bookmark.
Position
Below the diagonal: codemark_core.storage.db uses a module listed above it, which is the healthy direction.
codemark_core.storage.semantic_repo uses codemark_core.embeddings.config, so a change to codemark_core.embeddings.config can break codemark_core.storage.semantic_repo, while a change to codemark_core.storage.semantic_repo can't break codemark_core.embeddings.config.
Position
Below the diagonal: codemark_core.storage.semantic_repo uses a module listed above it, which is the healthy direction.
codemark_core.storage.semantic_repo uses codemark_core.engine.bookmark, so a change to codemark_core.engine.bookmark can break codemark_core.storage.semantic_repo, while a change to codemark_core.storage.semantic_repo can't break codemark_core.engine.bookmark.
Position
Below the diagonal: codemark_core.storage.semantic_repo uses a module listed above it, which is the healthy direction.
codemark_tui.event uses codemark_core.engine.bookmark, so a change to codemark_core.engine.bookmark can break codemark_tui.event, while a change to codemark_tui.event can't break codemark_core.engine.bookmark.
Position
Below the diagonal: codemark_tui.event uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers uses codemark_cli.cli, so a change to codemark_cli.cli can break codemark_cli.cli.handlers, while a change to codemark_cli.cli.handlers can't break codemark_cli.cli.
Position
Below the diagonal: codemark_cli.cli.handlers uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers uses codemark_core.config, so a change to codemark_core.config can break codemark_cli.cli.handlers, while a change to codemark_cli.cli.handlers can't break codemark_core.config.
Position
Below the diagonal: codemark_cli.cli.handlers uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers uses codemark_core.parser.languages, so a change to codemark_core.parser.languages can break codemark_cli.cli.handlers, while a change to codemark_cli.cli.handlers can't break codemark_core.parser.languages.
Position
Below the diagonal: codemark_cli.cli.handlers uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers uses codemark_core.engine.bookmark, so a change to codemark_core.engine.bookmark can break codemark_cli.cli.handlers, while a change to codemark_cli.cli.handlers can't break codemark_core.engine.bookmark.
Position
Below the diagonal: codemark_cli.cli.handlers uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers uses codemark_cli.cli.output, so a change to codemark_cli.cli.output can break codemark_cli.cli.handlers, while a change to codemark_cli.cli.handlers can't break codemark_cli.cli.output.
Position
Below the diagonal: codemark_cli.cli.handlers uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers uses codemark_core.engine.resolution, so a change to codemark_core.engine.resolution can break codemark_cli.cli.handlers, while a change to codemark_cli.cli.handlers can't break codemark_core.engine.resolution.
Position
Below the diagonal: codemark_cli.cli.handlers uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers uses codemark_core.storage.db, so a change to codemark_core.storage.db can break codemark_cli.cli.handlers, while a change to codemark_cli.cli.handlers can't break codemark_core.storage.db.
Position
Below the diagonal: codemark_cli.cli.handlers uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers.bookmark uses codemark_cli.cli, so a change to codemark_cli.cli can break codemark_cli.cli.handlers.bookmark, while a change to codemark_cli.cli.handlers.bookmark can't break codemark_cli.cli.
Position
Below the diagonal: codemark_cli.cli.handlers.bookmark uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers.bookmark uses codemark_core.query.generator, so a change to codemark_core.query.generator can break codemark_cli.cli.handlers.bookmark, while a change to codemark_cli.cli.handlers.bookmark can't break codemark_core.query.generator.
Position
Below the diagonal: codemark_cli.cli.handlers.bookmark uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers.bookmark uses codemark_core.engine.bookmark, so a change to codemark_core.engine.bookmark can break codemark_cli.cli.handlers.bookmark, while a change to codemark_cli.cli.handlers.bookmark can't break codemark_core.engine.bookmark.
Position
Below the diagonal: codemark_cli.cli.handlers.bookmark uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers.bookmark uses codemark_cli.cli.output, so a change to codemark_cli.cli.output can break codemark_cli.cli.handlers.bookmark, while a change to codemark_cli.cli.handlers.bookmark can't break codemark_cli.cli.output.
Position
Below the diagonal: codemark_cli.cli.handlers.bookmark uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers.comment uses codemark_cli.cli, so a change to codemark_cli.cli can break codemark_cli.cli.handlers.comment, while a change to codemark_cli.cli.handlers.comment can't break codemark_cli.cli.
Position
Below the diagonal: codemark_cli.cli.handlers.comment uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers.comment uses codemark_core.parser.languages, so a change to codemark_core.parser.languages can break codemark_cli.cli.handlers.comment, while a change to codemark_cli.cli.handlers.comment can't break codemark_core.parser.languages.
Position
Below the diagonal: codemark_cli.cli.handlers.comment uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers.comment uses codemark_core.engine.comment_anchor, so a change to codemark_core.engine.comment_anchor can break codemark_cli.cli.handlers.comment, while a change to codemark_cli.cli.handlers.comment can't break codemark_core.engine.comment_anchor.
Position
Below the diagonal: codemark_cli.cli.handlers.comment uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers.comment uses codemark_core.engine.bookmark, so a change to codemark_core.engine.bookmark can break codemark_cli.cli.handlers.comment, while a change to codemark_cli.cli.handlers.comment can't break codemark_core.engine.bookmark.
Position
Below the diagonal: codemark_cli.cli.handlers.comment uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers.comment uses codemark_cli.cli.output, so a change to codemark_cli.cli.output can break codemark_cli.cli.handlers.comment, while a change to codemark_cli.cli.handlers.comment can't break codemark_cli.cli.output.
Position
Below the diagonal: codemark_cli.cli.handlers.comment uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers.comment uses codemark_core.storage.db, so a change to codemark_core.storage.db can break codemark_cli.cli.handlers.comment, while a change to codemark_cli.cli.handlers.comment can't break codemark_core.storage.db.
Position
Below the diagonal: codemark_cli.cli.handlers.comment uses a module listed above it, which is the healthy direction.
codemark_core.engine.snapshot uses codemark_core.config, so a change to codemark_core.config can break codemark_core.engine.snapshot, while a change to codemark_core.engine.snapshot can't break codemark_core.config.
Position
Below the diagonal: codemark_core.engine.snapshot uses a module listed above it, which is the healthy direction.
codemark_core.engine.snapshot uses codemark_core.engine.bookmark, so a change to codemark_core.engine.bookmark can break codemark_core.engine.snapshot, while a change to codemark_core.engine.snapshot can't break codemark_core.engine.bookmark.
Position
Below the diagonal: codemark_core.engine.snapshot uses a module listed above it, which is the healthy direction.
codemark_core.engine.snapshot uses codemark_core.storage.db, so a change to codemark_core.storage.db can break codemark_core.engine.snapshot, while a change to codemark_core.engine.snapshot can't break codemark_core.storage.db.
Position
Below the diagonal: codemark_core.engine.snapshot uses a module listed above it, which is the healthy direction.
codemark_core.engine.transfer uses codemark_core.error, so a change to codemark_core.error can break codemark_core.engine.transfer, while a change to codemark_core.engine.transfer can't break codemark_core.error.
Position
Below the diagonal: codemark_core.engine.transfer uses a module listed above it, which is the healthy direction.
codemark_core.engine.transfer uses codemark_core.engine.bookmark, so a change to codemark_core.engine.bookmark can break codemark_core.engine.transfer, while a change to codemark_core.engine.transfer can't break codemark_core.engine.bookmark.
Position
Below the diagonal: codemark_core.engine.transfer uses a module listed above it, which is the healthy direction.
codemark_core.engine.transfer uses codemark_core.storage.db, so a change to codemark_core.storage.db can break codemark_core.engine.transfer, while a change to codemark_core.engine.transfer can't break codemark_core.storage.db.
Position
Below the diagonal: codemark_core.engine.transfer uses a module listed above it, which is the healthy direction.
codemark_core.sync uses codemark_core.config, so a change to codemark_core.config can break codemark_core.sync, while a change to codemark_core.sync can't break codemark_core.config.
Position
Below the diagonal: codemark_core.sync uses a module listed above it, which is the healthy direction.
codemark_core.sync uses codemark_core.storage.db, so a change to codemark_core.storage.db can break codemark_core.sync, while a change to codemark_core.sync can't break codemark_core.storage.db.
Position
Below the diagonal: codemark_core.sync uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in codemark_tui.app uses a type in codemark_tui.event.
The types involved
codemark_tui.app.App → codemark_tui.event.Event
Direction
codemark_tui.app uses codemark_tui.event, so a change to codemark_tui.event can break codemark_tui.app, while a change to codemark_tui.app can't break codemark_tui.event.
Position
Below the diagonal: codemark_tui.app uses a module listed above it, which is the healthy direction.
codemark_tui.component.panel.health uses codemark_core.error, so a change to codemark_core.error can break codemark_tui.component.panel.health, while a change to codemark_tui.component.panel.health can't break codemark_core.error.
Position
Below the diagonal: codemark_tui.component.panel.health uses a module listed above it, which is the healthy direction.
codemark_tui.component.panel.health uses codemark_core.engine.resolution, so a change to codemark_core.engine.resolution can break codemark_tui.component.panel.health, while a change to codemark_tui.component.panel.health can't break codemark_core.engine.resolution.
Position
Below the diagonal: codemark_tui.component.panel.health uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers.transfer uses codemark_cli.cli, so a change to codemark_cli.cli can break codemark_cli.cli.handlers.transfer, while a change to codemark_cli.cli.handlers.transfer can't break codemark_cli.cli.
Position
Below the diagonal: codemark_cli.cli.handlers.transfer uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers.transfer uses codemark_cli.cli.output, so a change to codemark_cli.cli.output can break codemark_cli.cli.handlers.transfer, while a change to codemark_cli.cli.handlers.transfer can't break codemark_cli.cli.output.
Position
Below the diagonal: codemark_cli.cli.handlers.transfer uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers.transfer uses codemark_core.storage.db, so a change to codemark_core.storage.db can break codemark_cli.cli.handlers.transfer, while a change to codemark_cli.cli.handlers.transfer can't break codemark_core.storage.db.
Position
Below the diagonal: codemark_cli.cli.handlers.transfer uses a module listed above it, which is the healthy direction.
codemark_cli.cli.handlers.transfer uses codemark_core.engine.transfer, so a change to codemark_core.engine.transfer can break codemark_cli.cli.handlers.transfer, while a change to codemark_cli.cli.handlers.transfer can't break codemark_core.engine.transfer.
Position
Below the diagonal: codemark_cli.cli.handlers.transfer uses a module listed above it, which is the healthy direction.
codemark_tui.browser.tabs uses codemark_core.sort, so a change to codemark_core.sort can break codemark_tui.browser.tabs, while a change to codemark_tui.browser.tabs can't break codemark_core.sort.
Position
Below the diagonal: codemark_tui.browser.tabs uses a module listed above it, which is the healthy direction.
codemark_tui.browser.tabs uses codemark_core.config, so a change to codemark_core.config can break codemark_tui.browser.tabs, while a change to codemark_tui.browser.tabs can't break codemark_core.config.
Position
Below the diagonal: codemark_tui.browser.tabs uses a module listed above it, which is the healthy direction.
codemark_tui.browser.tabs uses codemark_tui.component.panel.health, so a change to codemark_tui.component.panel.health can break codemark_tui.browser.tabs, while a change to codemark_tui.browser.tabs can't break codemark_tui.component.panel.health.
Position
Below the diagonal: codemark_tui.browser.tabs uses a module listed above it, which is the healthy direction.
codemark_tui.browser.transfer uses codemark_core.engine.transfer, so a change to codemark_core.engine.transfer can break codemark_tui.browser.transfer, while a change to codemark_tui.browser.transfer can't break codemark_core.engine.transfer.
Position
Below the diagonal: codemark_tui.browser.transfer uses a module listed above it, which is the healthy direction.
codemark_tui.browser.types uses codemark_core.engine.bookmark, so a change to codemark_core.engine.bookmark can break codemark_tui.browser.types, while a change to codemark_tui.browser.types can't break codemark_core.engine.bookmark.
Position
Below the diagonal: codemark_tui.browser.types uses a module listed above it, which is the healthy direction.
codemark_tui.browser.types uses codemark_tui.event, so a change to codemark_tui.event can break codemark_tui.browser.types, while a change to codemark_tui.browser.types can't break codemark_tui.event.
Position
Below the diagonal: codemark_tui.browser.types uses a module listed above it, which is the healthy direction.
codemark_tui.browser.types uses codemark_tui.component.panel.health, so a change to codemark_tui.component.panel.health can break codemark_tui.browser.types, while a change to codemark_tui.browser.types can't break codemark_tui.component.panel.health.
Position
Below the diagonal: codemark_tui.browser.types uses a module listed above it, which is the healthy direction.
codemark_tui.component uses codemark_tui.event, so a change to codemark_tui.event can break codemark_tui.component, while a change to codemark_tui.component can't break codemark_tui.event.
Position
Below the diagonal: codemark_tui.component uses a module listed above it, which is the healthy direction.
codemark_tui.component uses codemark_tui.component.panel.health, so a change to codemark_tui.component.panel.health can break codemark_tui.component, while a change to codemark_tui.component can't break codemark_tui.component.panel.health.
Position
Below the diagonal: codemark_tui.component uses a module listed above it, which is the healthy direction.
codemark_tui.component.panel.item uses codemark_core.sort, so a change to codemark_core.sort can break codemark_tui.component.panel.item, while a change to codemark_tui.component.panel.item can't break codemark_core.sort.
Position
Below the diagonal: codemark_tui.component.panel.item uses a module listed above it, which is the healthy direction.
codemark_tui.component.panel.item uses codemark_tui.component.panel.health, so a change to codemark_tui.component.panel.health can break codemark_tui.component.panel.item, while a change to codemark_tui.component.panel.item can't break codemark_tui.component.panel.health.
Position
Below the diagonal: codemark_tui.component.panel.item uses a module listed above it, which is the healthy direction.
codemark_tui.browser.search uses codemark_tui.event, so a change to codemark_tui.event can break codemark_tui.browser.search, while a change to codemark_tui.browser.search can't break codemark_tui.event.
Position
Below the diagonal: codemark_tui.browser.search uses a module listed above it, which is the healthy direction.
codemark_tui.browser.search uses codemark_tui.component, so a change to codemark_tui.component can break codemark_tui.browser.search, while a change to codemark_tui.browser.search can't break codemark_tui.component.
Position
Below the diagonal: codemark_tui.browser.search uses a module listed above it, which is the healthy direction.
codemark_tui.component.code_preview uses codemark_tui.event, so a change to codemark_tui.event can break codemark_tui.component.code_preview, while a change to codemark_tui.component.code_preview can't break codemark_tui.event.
Position
Below the diagonal: codemark_tui.component.code_preview uses a module listed above it, which is the healthy direction.
codemark_tui.component.code_preview uses codemark_tui.component, so a change to codemark_tui.component can break codemark_tui.component.code_preview, while a change to codemark_tui.component.code_preview can't break codemark_tui.component.
Position
Below the diagonal: codemark_tui.component.code_preview uses a module listed above it, which is the healthy direction.
codemark_tui.component.markdown_panel uses codemark_tui.event, so a change to codemark_tui.event can break codemark_tui.component.markdown_panel, while a change to codemark_tui.component.markdown_panel can't break codemark_tui.event.
Position
Below the diagonal: codemark_tui.component.markdown_panel uses a module listed above it, which is the healthy direction.
codemark_tui.component.markdown_panel uses codemark_tui.component, so a change to codemark_tui.component can break codemark_tui.component.markdown_panel, while a change to codemark_tui.component.markdown_panel can't break codemark_tui.component.
Position
Below the diagonal: codemark_tui.component.markdown_panel uses a module listed above it, which is the healthy direction.
codemark_tui.component.panel uses codemark_core.sort, so a change to codemark_core.sort can break codemark_tui.component.panel, while a change to codemark_tui.component.panel can't break codemark_core.sort.
Position
Below the diagonal: codemark_tui.component.panel uses a module listed above it, which is the healthy direction.
codemark_tui.component.panel uses codemark_tui.event, so a change to codemark_tui.event can break codemark_tui.component.panel, while a change to codemark_tui.component.panel can't break codemark_tui.event.
Position
Below the diagonal: codemark_tui.component.panel uses a module listed above it, which is the healthy direction.
codemark_tui.component.panel uses codemark_tui.component.panel.health, so a change to codemark_tui.component.panel.health can break codemark_tui.component.panel, while a change to codemark_tui.component.panel can't break codemark_tui.component.panel.health.
Position
Below the diagonal: codemark_tui.component.panel uses a module listed above it, which is the healthy direction.
codemark_tui.component.panel uses codemark_tui.component, so a change to codemark_tui.component can break codemark_tui.component.panel, while a change to codemark_tui.component.panel can't break codemark_tui.component.
Position
Below the diagonal: codemark_tui.component.panel uses a module listed above it, which is the healthy direction.
codemark_tui.component.panel uses codemark_tui.component.panel.item, so a change to codemark_tui.component.panel.item can break codemark_tui.component.panel, while a change to codemark_tui.component.panel can't break codemark_tui.component.panel.item.
Position
Below the diagonal: codemark_tui.component.panel uses a module listed above it, which is the healthy direction.
codemark_tui.languages_tab uses codemark_core.grammar.registry_source, so a change to codemark_core.grammar.registry_source can break codemark_tui.languages_tab, while a change to codemark_tui.languages_tab can't break codemark_core.grammar.registry_source.
Position
Below the diagonal: codemark_tui.languages_tab uses a module listed above it, which is the healthy direction.
codemark_tui.languages_tab uses codemark_tui.browser.transfer, so a change to codemark_tui.browser.transfer can break codemark_tui.languages_tab, while a change to codemark_tui.languages_tab can't break codemark_tui.browser.transfer.
Position
Below the diagonal: codemark_tui.languages_tab uses a module listed above it, which is the healthy direction.
codemark_tui.browser.tabbed_panel uses codemark_core.sort, so a change to codemark_core.sort can break codemark_tui.browser.tabbed_panel, while a change to codemark_tui.browser.tabbed_panel can't break codemark_core.sort.
Position
Below the diagonal: codemark_tui.browser.tabbed_panel uses a module listed above it, which is the healthy direction.
codemark_tui.browser.tabbed_panel uses codemark_core.engine.bookmark, so a change to codemark_core.engine.bookmark can break codemark_tui.browser.tabbed_panel, while a change to codemark_tui.browser.tabbed_panel can't break codemark_core.engine.bookmark.
Position
Below the diagonal: codemark_tui.browser.tabbed_panel uses a module listed above it, which is the healthy direction.
codemark_tui.browser.tabbed_panel uses codemark_core.storage.db, so a change to codemark_core.storage.db can break codemark_tui.browser.tabbed_panel, while a change to codemark_tui.browser.tabbed_panel can't break codemark_core.storage.db.
Position
Below the diagonal: codemark_tui.browser.tabbed_panel uses a module listed above it, which is the healthy direction.
codemark_tui.browser.tabbed_panel uses codemark_tui.event, so a change to codemark_tui.event can break codemark_tui.browser.tabbed_panel, while a change to codemark_tui.browser.tabbed_panel can't break codemark_tui.event.
Position
Below the diagonal: codemark_tui.browser.tabbed_panel uses a module listed above it, which is the healthy direction.
codemark_tui.browser.tabbed_panel uses codemark_tui.component.panel.health, so a change to codemark_tui.component.panel.health can break codemark_tui.browser.tabbed_panel, while a change to codemark_tui.browser.tabbed_panel can't break codemark_tui.component.panel.health.
Position
Below the diagonal: codemark_tui.browser.tabbed_panel uses a module listed above it, which is the healthy direction.
codemark_tui.browser.tabbed_panel uses codemark_tui.browser.tabs, so a change to codemark_tui.browser.tabs can break codemark_tui.browser.tabbed_panel, while a change to codemark_tui.browser.tabbed_panel can't break codemark_tui.browser.tabs.
Position
Below the diagonal: codemark_tui.browser.tabbed_panel uses a module listed above it, which is the healthy direction.
codemark_tui.browser.tabbed_panel uses codemark_tui.browser.types, so a change to codemark_tui.browser.types can break codemark_tui.browser.tabbed_panel, while a change to codemark_tui.browser.tabbed_panel can't break codemark_tui.browser.types.
Position
Below the diagonal: codemark_tui.browser.tabbed_panel uses a module listed above it, which is the healthy direction.
codemark_tui.browser.tabbed_panel uses codemark_tui.component.panel.item, so a change to codemark_tui.component.panel.item can break codemark_tui.browser.tabbed_panel, while a change to codemark_tui.browser.tabbed_panel can't break codemark_tui.component.panel.item.
Position
Below the diagonal: codemark_tui.browser.tabbed_panel uses a module listed above it, which is the healthy direction.
codemark_tui.browser.tabbed_panel uses codemark_tui.component.code_preview, so a change to codemark_tui.component.code_preview can break codemark_tui.browser.tabbed_panel, while a change to codemark_tui.browser.tabbed_panel can't break codemark_tui.component.code_preview.
Position
Below the diagonal: codemark_tui.browser.tabbed_panel uses a module listed above it, which is the healthy direction.
codemark_tui.browser.tabbed_panel uses codemark_tui.component.markdown_panel, so a change to codemark_tui.component.markdown_panel can break codemark_tui.browser.tabbed_panel, while a change to codemark_tui.browser.tabbed_panel can't break codemark_tui.component.markdown_panel.
Position
Below the diagonal: codemark_tui.browser.tabbed_panel uses a module listed above it, which is the healthy direction.
codemark_tui.browser.tabbed_panel uses codemark_tui.component.panel, so a change to codemark_tui.component.panel can break codemark_tui.browser.tabbed_panel, while a change to codemark_tui.browser.tabbed_panel can't break codemark_tui.component.panel.
Position
Below the diagonal: codemark_tui.browser.tabbed_panel uses a module listed above it, which is the healthy direction.
codemark_tui.browser.left_pane uses codemark_core.storage.db, so a change to codemark_core.storage.db can break codemark_tui.browser.left_pane, while a change to codemark_tui.browser.left_pane can't break codemark_core.storage.db.
Position
Below the diagonal: codemark_tui.browser.left_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.left_pane uses codemark_tui.event, so a change to codemark_tui.event can break codemark_tui.browser.left_pane, while a change to codemark_tui.browser.left_pane can't break codemark_tui.event.
Position
Below the diagonal: codemark_tui.browser.left_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.left_pane uses codemark_tui.browser.tabs, so a change to codemark_tui.browser.tabs can break codemark_tui.browser.left_pane, while a change to codemark_tui.browser.left_pane can't break codemark_tui.browser.tabs.
Position
Below the diagonal: codemark_tui.browser.left_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.left_pane uses codemark_tui.browser.types, so a change to codemark_tui.browser.types can break codemark_tui.browser.left_pane, while a change to codemark_tui.browser.left_pane can't break codemark_tui.browser.types.
Position
Below the diagonal: codemark_tui.browser.left_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.left_pane uses codemark_tui.browser.search, so a change to codemark_tui.browser.search can break codemark_tui.browser.left_pane, while a change to codemark_tui.browser.left_pane can't break codemark_tui.browser.search.
Position
Below the diagonal: codemark_tui.browser.left_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.left_pane uses codemark_tui.browser.tabbed_panel, so a change to codemark_tui.browser.tabbed_panel can break codemark_tui.browser.left_pane, while a change to codemark_tui.browser.left_pane can't break codemark_tui.browser.tabbed_panel.
Position
Below the diagonal: codemark_tui.browser.left_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.right_pane uses codemark_core.engine.bookmark, so a change to codemark_core.engine.bookmark can break codemark_tui.browser.right_pane, while a change to codemark_tui.browser.right_pane can't break codemark_core.engine.bookmark.
Position
Below the diagonal: codemark_tui.browser.right_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.right_pane uses codemark_core.engine.resolution, so a change to codemark_core.engine.resolution can break codemark_tui.browser.right_pane, while a change to codemark_tui.browser.right_pane can't break codemark_core.engine.resolution.
Position
Below the diagonal: codemark_tui.browser.right_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.right_pane uses codemark_core.storage.db, so a change to codemark_core.storage.db can break codemark_tui.browser.right_pane, while a change to codemark_tui.browser.right_pane can't break codemark_core.storage.db.
Position
Below the diagonal: codemark_tui.browser.right_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.right_pane uses codemark_tui.event, so a change to codemark_tui.event can break codemark_tui.browser.right_pane, while a change to codemark_tui.browser.right_pane can't break codemark_tui.event.
Position
Below the diagonal: codemark_tui.browser.right_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.right_pane uses codemark_core.sync, so a change to codemark_core.sync can break codemark_tui.browser.right_pane, while a change to codemark_tui.browser.right_pane can't break codemark_core.sync.
Position
Below the diagonal: codemark_tui.browser.right_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.right_pane uses codemark_tui.component.panel.health, so a change to codemark_tui.component.panel.health can break codemark_tui.browser.right_pane, while a change to codemark_tui.browser.right_pane can't break codemark_tui.component.panel.health.
Position
Below the diagonal: codemark_tui.browser.right_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.right_pane uses codemark_tui.browser.types, so a change to codemark_tui.browser.types can break codemark_tui.browser.right_pane, while a change to codemark_tui.browser.right_pane can't break codemark_tui.browser.types.
Position
Below the diagonal: codemark_tui.browser.right_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.right_pane uses codemark_tui.component.code_preview, so a change to codemark_tui.component.code_preview can break codemark_tui.browser.right_pane, while a change to codemark_tui.browser.right_pane can't break codemark_tui.component.code_preview.
Position
Below the diagonal: codemark_tui.browser.right_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.right_pane uses codemark_tui.component.markdown_panel, so a change to codemark_tui.component.markdown_panel can break codemark_tui.browser.right_pane, while a change to codemark_tui.browser.right_pane can't break codemark_tui.component.markdown_panel.
Position
Below the diagonal: codemark_tui.browser.right_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser.right_pane uses codemark_tui.browser.tabbed_panel, so a change to codemark_tui.browser.tabbed_panel can break codemark_tui.browser.right_pane, while a change to codemark_tui.browser.right_pane can't break codemark_tui.browser.tabbed_panel.
Position
Below the diagonal: codemark_tui.browser.right_pane uses a module listed above it, which is the healthy direction.
codemark_tui.browser uses codemark_core.engine.bookmark, so a change to codemark_core.engine.bookmark can break codemark_tui.browser, while a change to codemark_tui.browser can't break codemark_core.engine.bookmark.
Position
Below the diagonal: codemark_tui.browser uses a module listed above it, which is the healthy direction.
codemark_tui.browser uses codemark_core.storage.db, so a change to codemark_core.storage.db can break codemark_tui.browser, while a change to codemark_tui.browser can't break codemark_core.storage.db.
Position
Below the diagonal: codemark_tui.browser uses a module listed above it, which is the healthy direction.
codemark_tui.browser uses codemark_tui.event, so a change to codemark_tui.event can break codemark_tui.browser, while a change to codemark_tui.browser can't break codemark_tui.event.
Position
Below the diagonal: codemark_tui.browser uses a module listed above it, which is the healthy direction.
codemark_tui.browser uses codemark_core.engine.transfer, so a change to codemark_core.engine.transfer can break codemark_tui.browser, while a change to codemark_tui.browser can't break codemark_core.engine.transfer.
Position
Below the diagonal: codemark_tui.browser uses a module listed above it, which is the healthy direction.
codemark_tui.browser uses codemark_core.sync, so a change to codemark_core.sync can break codemark_tui.browser, while a change to codemark_tui.browser can't break codemark_core.sync.
Position
Below the diagonal: codemark_tui.browser uses a module listed above it, which is the healthy direction.
codemark_tui.browser uses codemark_tui.component.panel.health, so a change to codemark_tui.component.panel.health can break codemark_tui.browser, while a change to codemark_tui.browser can't break codemark_tui.component.panel.health.
Position
Below the diagonal: codemark_tui.browser uses a module listed above it, which is the healthy direction.
codemark_tui.browser uses codemark_tui.browser.tabs, so a change to codemark_tui.browser.tabs can break codemark_tui.browser, while a change to codemark_tui.browser can't break codemark_tui.browser.tabs.
Position
Below the diagonal: codemark_tui.browser uses a module listed above it, which is the healthy direction.
codemark_tui.browser uses codemark_tui.browser.transfer, so a change to codemark_tui.browser.transfer can break codemark_tui.browser, while a change to codemark_tui.browser can't break codemark_tui.browser.transfer.
Position
Below the diagonal: codemark_tui.browser uses a module listed above it, which is the healthy direction.
codemark_tui.browser uses codemark_tui.browser.types, so a change to codemark_tui.browser.types can break codemark_tui.browser, while a change to codemark_tui.browser can't break codemark_tui.browser.types.
Position
Below the diagonal: codemark_tui.browser uses a module listed above it, which is the healthy direction.
codemark_tui.browser uses codemark_tui.component, so a change to codemark_tui.component can break codemark_tui.browser, while a change to codemark_tui.browser can't break codemark_tui.component.
Position
Below the diagonal: codemark_tui.browser uses a module listed above it, which is the healthy direction.
codemark_tui.browser uses codemark_tui.component.panel.item, so a change to codemark_tui.component.panel.item can break codemark_tui.browser, while a change to codemark_tui.browser can't break codemark_tui.component.panel.item.
Position
Below the diagonal: codemark_tui.browser uses a module listed above it, which is the healthy direction.
codemark_tui.browser uses codemark_tui.browser.search, so a change to codemark_tui.browser.search can break codemark_tui.browser, while a change to codemark_tui.browser can't break codemark_tui.browser.search.
Position
Below the diagonal: codemark_tui.browser uses a module listed above it, which is the healthy direction.
codemark_tui.browser uses codemark_tui.browser.left_pane, so a change to codemark_tui.browser.left_pane can break codemark_tui.browser, while a change to codemark_tui.browser can't break codemark_tui.browser.left_pane.
Position
Below the diagonal: codemark_tui.browser uses a module listed above it, which is the healthy direction.
codemark_tui.browser uses codemark_tui.browser.right_pane, so a change to codemark_tui.browser.right_pane can break codemark_tui.browser, while a change to codemark_tui.browser can't break codemark_tui.browser.right_pane.
Position
Below the diagonal: codemark_tui.browser uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 52.1 · Adequate · gated by 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
49
High / Critical
A05:2025 — Injection
39
High / Critical
A02:2025 — Security Misconfiguration
4
Medium
Roadmap
Top priorities: Resolve the 1 finding(s) in DR & Backup; Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`; Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Bring the 5 bodies over 60 down to 60 or less in Cognitive Complexity — start with codemark_tui::entry::run_app (cognitive 176), MarkdownPanel::parse_to_text (cognitive 123), codemark_cli::cli::handlers::languages::handle_validate (cognitive 67).
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 — 43
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 — 463
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 — 42
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 15
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 46 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 — 46 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, 515 of 548 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: the Rust half could not be measured — the Cargo suite in repository root did not build, so it was never run. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.rs) and this repository declares a Cargo test suite (repository root, 93 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
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.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (3 contributor(s) across 436 commit(s) sampled, automation and bot accounts excluded). One of them holds 100% of the history; the other 2 hold 0% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
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.
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.
D24 Comment Value — 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. 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.
D44 Platform End-of-Life — 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 dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a REDACTED) is simply not read here yet.
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 (REDACTED). compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.caddy.environment.[]: required variable DOMAIN is missing a value: DOMAIN must be set to your public hostname; 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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.
X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
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.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
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.
47 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was codemark_cli::cli::handlers::merge_globals at 93. A further 5 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being codemark_cli::cli::handlers::dispatch at 34 — they are counted neither in the figure above nor in this dimension's score. 2 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: crates/codemark-core/src/query/classifier.rs (codemark_core::query::classifier::classify_node_type_global at 24), crates/codemark-core/src/templates.rs (codemark_core::templates::escape_markdown at 20). 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.
+ 12 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 7 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with codemark_cli::cli::handlers::merge_globals (cyclomatic 93), codemark_tui::entry::run_app (cyclomatic 82), MarkdownPanel::parse_to_text (cyclomatic 67). — 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 7 together lifts Cyclomatic Complexity from 6.0 to about 7.2/10, projected with the scoring formula itself and assuming each lands exactly at 30; 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.
+ 20 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 5 bodies over 60 down to 60 or less in Cognitive Complexity — start with codemark_tui::entry::run_app (cognitive 176), MarkdownPanel::parse_to_text (cognitive 123), codemark_cli::cli::handlers::languages::handle_validate (cognitive 67). — 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 5 together lifts Cognitive Complexity from 2.1 to about 4.7/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 Classes8.0 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 20 FunctionTooLong finding(s) in God Classes — start with bookmark.rs (4), handlers.rs (2), search.rs (2). — One of this dimension's main actionable groups (20 warning-level).
Resolve the 17 FileTooLong finding(s) in God Classes — start with mod.rs (3), handlers.rs, right_pane.rs. — One of this dimension's main actionable groups (17 warning-level).
Resolve the 7 TooManyMethods finding(s) in God Classes — start with mod.rs (2), db.rs, code_preview.rs. — One of this dimension's main actionable groups (7 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.
131 duplicated block group(s) detected. 6.2 % of the production lines (4,490 of 72,463) are in a reported copy. A further 52 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
+ 93 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 13 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with handlers.rs (3), mod.rs (2), github.rs (2). — One of this dimension's main actionable groups (13 warning-level).
Resolve the 8 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with search.rs, resolution.rs, reader.rs. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 8 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with search.rs, collection_repo.rs, sync.rs. — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.0 / 10Strong✓ 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.
4 production modules (Cargo), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence.
Off the main sequence: codemark-core
What to do
Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 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.
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.
21 outdated, 0 yanked direct Cargo dependencies. 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: anyhow · ×21
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 587 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json, and 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.
Resolve the 14 Hotspot finding(s) in Churn × Complexity Hotspots — start with handlers.rs, events.rs, entry.rs. — One of this dimension's main actionable groups (14 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
3 deducted task-comment markers across 72463 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 3 TodoComment finding(s) in Explicit Debt — start with config.rs, bookmark_repo.rs, cli_integration.rs. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 23 document(s) read across 2 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with fly.toml. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
2 of 5 build units (Cargo) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion · ×2crates/codemark-core/Cargo.toml:1
What to do
Resolve the 2 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with Cargo.toml (2). — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
39 finding(s): 0 critical, 37 high, 2 medium, 0 low. 31 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 3 file(s) — `crates/codemark-core/src/storage/db.rs` (line 406), `screenshots/seed-fixture.sh` (line 40), `scripts/bump-version.sh` (line 17) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
No action in Static Analysis (SAST) — all 31 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (31 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 18 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED (18). — One of this dimension's main actionable groups (18 warning-level).
Resolve the 3 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 2 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 3 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 121 of the 153 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
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.
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
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.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other · Event-Driven — Whether state changes and message publishes are atomic (a transactional outbox) rather than a crash-unsafe dual write.
Method: Roslyn semantic scan (event-driven gated): event-handler methods scanned for DB-save plus bus-publish without a transactional outbox reference. Deterministic, semantic-resolved.
`maintenance$module.handle_import` performs two independent DURABLE writes — a durable state write (`db.insert_bookmark`, :378) and a second independent durable store write — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox). — crates/codemark-cli/src/cli/handlers/maintenance.rs:358
What to do
Adopt the transactional outbox pattern so DB writes and message publishes commit atomically — no lost or phantom events on a crash.
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.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability7.4 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
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.
`docs/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — docs/package.json:10
What to do
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
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 · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×7) — crates/codemark-cli/src/cli/handlers/tour.rs:96, crates/codetours-server/src/github.rs:187, crates/codetours-server/src/github.rs:255, …
What to do
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.
Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.
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.
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 NRT-eligible project(s) enable <Nullable>enable</Nullable> (projects targeting a pre-C#-8 framework are excluded — NRTs aren't available there). NRTs catch a whole class of null-deref bugs at compile time.
What to do
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 77 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.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
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 0% of this repository's production lines — rust (72,394 lines), lua (328 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
AX8 Test isolation — no test/production split to check
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.caddy.environment.[]: required variable DOMAIN is missing a value: DOMAIN must be set to your public hostname; 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.
D10 Test Quality — ~7097 lines of test source are present (.rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — N/A — too few peers to establish a naming convention (6219 declarations, no unit with a dominant convention).
D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Rust surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .rs source were not judged.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
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.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — Rust suite
DM1 Aggregate boundaries — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM6 Domain ↔ infrastructure boundary — this Rust crate maps no type to a persistence framework (diesel/sea-orm/sqlx), so DM6's domain↔infrastructure fusion read has no population to be taken over
DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
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)
ES1 Fold determinism — not applicable — the code was read and holds no event-replay fold, so there is nothing for this check to judge
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — 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.
S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X12 Unreachable branch — X12 reached only 0% of this repository's production lines — rust (72,394 lines), lua (328 lines), typescript (69 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 — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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 — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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 analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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 analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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.
Dual write (no outbox): maintenance$module.handle_import crates/codemark-cli/src/cli/handlers/maintenance.rs:358— `maintenance$module.handle_import` performs two independent DURABLE writes — a durable state write (`db.insert_bookmark`, :378) and a second independent durable store write — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox).
codemark_cli::cli::handlers::languages::handle_validate (cognitive 67) crates/codemark-cli/src/cli/handlers/languages.rs:381— codemark_cli::cli::handlers::languages::handle_validate has cognitive complexity 67 (threshold 15). Drivers by points: if/else 14 (33 pts), match/switch 5 (19 pts), loops 4 (14 pts), boolean chains 1 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::handlers::collection::handle_collection_list (cognitive 59) crates/codemark-cli/src/cli/handlers/collection.rs:328— codemark_cli::cli::handlers::collection::handle_collection_list has cognitive complexity 59 (threshold 15). Drivers by points: loops 11 (33 pts), if/else 11 (21 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 34). 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.
codemark_cli::cli::handlers::search::handle_semantic_search (cognitive 47) crates/codemark-cli/src/cli/handlers/search.rs:168— codemark_cli::cli::handlers::search::handle_semantic_search has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 4 (10 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::handlers::bookmark::handle_add (cognitive 40) crates/codemark-cli/src/cli/handlers/bookmark.rs:42— codemark_cli::cli::handlers::bookmark::handle_add has cognitive complexity 40 (threshold 15). Drivers by points: if/else 23 (32 pts), match/switch 4, boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::handlers::bookmark::handle_add_from_snippet (cognitive 38) crates/codemark-cli/src/cli/handlers/bookmark.rs:303— codemark_cli::cli::handlers::bookmark::handle_add_from_snippet has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (30 pts), match/switch 4, boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (codemark_cli::cli::handlers::bookmark::handle_add_from_query) 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.
codemark_cli::cli::handlers::bookmark::handle_add_from_query (cognitive 38) crates/codemark-cli/src/cli/handlers/bookmark.rs:559— codemark_cli::cli::handlers::bookmark::handle_add_from_query has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (30 pts), match/switch 4, boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (codemark_cli::cli::handlers::bookmark::handle_add_from_snippet) 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.
codemark_cli::cli::handlers::search::handle_search (cognitive 35) crates/codemark-cli/src/cli/handlers/search.rs:23— codemark_cli::cli::handlers::search::handle_search has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 4 (11 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::handlers::transfer::report (cognitive 34) crates/codemark-cli/src/cli/handlers/transfer.rs:163— codemark_cli::cli::handlers::transfer::report has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 3, match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 16). 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.
codemark_cli::cli::handlers::search::handle_collection_search (cognitive 33) crates/codemark-cli/src/cli/handlers/search.rs:360— codemark_cli::cli::handlers::search::handle_collection_search has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (10 pts), match/switch 2 (5 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.
codemark_cli::cli::handlers::merge_globals (cognitive 31) crates/codemark-cli/src/cli/handlers.rs:88— codemark_cli::cli::handlers::merge_globals has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 14 (28 pts), if/else 3 (nesting depth added 14). 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.
codemark_cli::cli::handlers::bookmark::handle_annotate (cognitive 31) crates/codemark-cli/src/cli/handlers/bookmark.rs:1133— codemark_cli::cli::handlers::bookmark::handle_annotate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::handlers::handle_preview (cognitive 30) crates/codemark-cli/src/cli/handlers.rs:1788— codemark_cli::cli::handlers::handle_preview has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2 (6 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::handlers::bookmark::handle_show (cognitive 28) crates/codemark-cli/src/cli/handlers/bookmark.rs:979— codemark_cli::cli::handlers::bookmark::handle_show has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 2 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::output::write_bookmark_markdown_fallback (cognitive 24) crates/codemark-cli/src/cli/output.rs:623— codemark_cli::cli::output::write_bookmark_markdown_fallback has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 5 (9 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.
codemark_cli::cli::handlers::search::collection_semantic_search (cognitive 22) crates/codemark-cli/src/cli/handlers/search.rs:453— codemark_cli::cli::handlers::search::collection_semantic_search has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::handlers::resolve_batch (cognitive 21) crates/codemark-cli/src/cli/handlers.rs:1385— codemark_cli::cli::handlers::resolve_batch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::handlers::handle_list (cognitive 21) crates/codemark-cli/src/cli/handlers.rs:1670— codemark_cli::cli::handlers::handle_list has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::handlers::maintenance::handle_diff (cognitive 21) crates/codemark-cli/src/cli/handlers/maintenance.rs:193— codemark_cli::cli::handlers::maintenance::handle_diff has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::handlers::bookmark::handle_resolve (cognitive 20) crates/codemark-cli/src/cli/handlers/bookmark.rs:867— codemark_cli::cli::handlers::bookmark::handle_resolve has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::output::write_annotated_bookmarks (cognitive 19) crates/codemark-cli/src/cli/output.rs:482— codemark_cli::cli::output::write_annotated_bookmarks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 9). 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.
codemark_cli::cli::handlers::search::write_collection_results (cognitive 18) crates/codemark-cli/src/cli/handlers/search.rs:545— codemark_cli::cli::handlers::search::write_collection_results has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
codemark_cli::cli::handlers::skill::scan_installs (cognitive 18) crates/codemark-cli/src/cli/handlers/skill.rs:352— codemark_cli::cli::handlers::skill::scan_installs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 2 (8 pts), loops 3 (6 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::handlers::auth::handle_device_login (cognitive 17) crates/codemark-cli/src/cli/handlers/auth.rs:79— codemark_cli::cli::handlers::auth::handle_device_login has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::handlers::comment::build_threads (cognitive 17) crates/codemark-cli/src/cli/handlers/comment.rs:290— codemark_cli::cli::handlers::comment::build_threads has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_cli::cli::handlers::search::handle_reindex (cognitive 17) crates/codemark-cli/src/cli/handlers/search.rs:640— codemark_cli::cli::handlers::search::handle_reindex has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 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.
FunctionTooLong: codetours_server::handlers::tours::create::handler crates/codetours-server/src/handlers/tours/create.rs:51— FunctionTooLong — codetours_server::handlers::tours::create::handler runs 518 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 418 over it, 5.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: codemark_tui::entry::run_app crates/codemark-tui/src/entry.rs:164— FunctionTooLong — codemark_tui::entry::run_app runs 320 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 220 over it, 3.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemark_cli::cli::handlers::bookmark::handle_add crates/codemark-cli/src/cli/handlers/bookmark.rs:42— FunctionTooLong — codemark_cli::cli::handlers::bookmark::handle_add runs 180 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 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemark_cli::cli::handlers::bookmark::handle_add_from_snippet crates/codemark-cli/src/cli/handlers/bookmark.rs:303— FunctionTooLong — codemark_cli::cli::handlers::bookmark::handle_add_from_snippet runs 180 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 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemark_cli::cli::handlers::bookmark::handle_add_from_query crates/codemark-cli/src/cli/handlers/bookmark.rs:559— FunctionTooLong — codemark_cli::cli::handlers::bookmark::handle_add_from_query runs 180 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 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemark_cli::cli::handlers::collection::handle_collection_list crates/codemark-cli/src/cli/handlers/collection.rs:328— FunctionTooLong — codemark_cli::cli::handlers::collection::handle_collection_list runs 157 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 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codetours_server::handlers::tours::list::handler crates/codetours-server/src/handlers/tours/list.rs:116— FunctionTooLong — codetours_server::handlers::tours::list::handler runs 149 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemark_core::query::generator::build_tier1_query crates/codemark-core/src/query/generator.rs:1393— FunctionTooLong — codemark_core::query::generator::build_tier1_query runs 141 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codetours_server::handlers::tours::get::handler crates/codetours-server/src/handlers/tours/get.rs:118— FunctionTooLong — codetours_server::handlers::tours::get::handler runs 135 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 35 over it, 1.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemark_core::engine::heal::heal_bookmark crates/codemark-core/src/engine/heal.rs:81— FunctionTooLong — codemark_core::engine::heal::heal_bookmark runs 127 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 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemark_cli::cli::handlers::merge_globals crates/codemark-cli/src/cli/handlers.rs:88— FunctionTooLong — codemark_cli::cli::handlers::merge_globals runs 125 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 25 over it, 1.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: codemark_cli::cli::handlers::search::handle_semantic_search crates/codemark-cli/src/cli/handlers/search.rs:168— FunctionTooLong — codemark_cli::cli::handlers::search::handle_semantic_search runs 125 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 25 over it, 1.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: codemark_cli::cli::handlers::handle_preview crates/codemark-cli/src/cli/handlers.rs:1788— FunctionTooLong — codemark_cli::cli::handlers::handle_preview runs 112 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 12 over it, 1.12× 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: codemark_cli::cli::handlers::bookmark::handle_annotate crates/codemark-cli/src/cli/handlers/bookmark.rs:1133— FunctionTooLong — codemark_cli::cli::handlers::bookmark::handle_annotate runs 111 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 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemark_core::sync::import_pack crates/codemark-core/src/sync.rs:291— FunctionTooLong — codemark_core::sync::import_pack runs 110 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 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemark_core::engine::snapshot::build_snapshot crates/codemark-core/src/engine/snapshot.rs:28— FunctionTooLong — codemark_core::engine::snapshot::build_snapshot runs 109 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 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemark_core::engine::transfer::plan_transfer crates/codemark-core/src/engine/transfer.rs:302— FunctionTooLong — codemark_core::engine::transfer::plan_transfer runs 109 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 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemark_core::engine::transfer::apply_in_txn crates/codemark-core/src/engine/transfer.rs:591— FunctionTooLong — codemark_core::engine::transfer::apply_in_txn runs 104 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 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemark_cli::cli::handlers::auth::handle_device_login crates/codemark-cli/src/cli/handlers/auth.rs:79— FunctionTooLong — codemark_cli::cli::handlers::auth::handle_device_login runs 103 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 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemark_cli::cli::handlers::search::handle_search crates/codemark-cli/src/cli/handlers/search.rs:23— FunctionTooLong — codemark_cli::cli::handlers::search::handle_search runs 101 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 1 over it, 1.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×18
BrowserLayout::handle_app_event (cognitive 61) crates/codemark-tui/src/browser/events.rs:333— BrowserLayout::handle_app_event has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (40 pts), loops 4 (10 pts), boolean chains 7, match/switch 2 (4 pts) (nesting depth added 31). 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.
BrowserLayout::update_tours_collections (cognitive 44) crates/codemark-tui/src/browser/mod.rs:2684— BrowserLayout::update_tours_collections has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (31 pts), boolean chains 6, loops 3 (5 pts), match/switch 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowserLayout::refresh_all_panels_inner (cognitive 32) crates/codemark-tui/src/browser/mod.rs:2053— BrowserLayout::refresh_all_panels_inner has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (24 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowserLayout::handle_mouse_focus (cognitive 31) crates/codemark-tui/src/browser/events.rs:1256— BrowserLayout::handle_mouse_focus has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 6 (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.
BrowserLayout::handle_key_event (cognitive 29) crates/codemark-tui/src/browser/events.rs:1317— BrowserLayout::handle_key_event has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 18, if/else 5 (10 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.
BrowserLayout::get_help_bindings (cognitive 28) crates/codemark-tui/src/browser/bindings.rs:15— BrowserLayout::get_help_bindings has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 3 (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.
BrowserLayout::get_context_bindings (cognitive 26) crates/codemark-tui/src/browser/bindings.rs:182— BrowserLayout::get_context_bindings has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 3 (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.
BrowserLayout::handle_delegation (cognitive 25) crates/codemark-tui/src/browser/events.rs:1997— BrowserLayout::handle_delegation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 3, match/switch 2 (3 pts) (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.
BrowserLayout::handle_o_key (cognitive 24) crates/codemark-tui/src/browser/events.rs:1741— BrowserLayout::handle_o_key has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 3 (9 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.
BrowserLayout::handle_resize (cognitive 23) crates/codemark-tui/src/browser/events.rs:1930— BrowserLayout::handle_resize has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowserLayout::execute_collection_search (cognitive 23) crates/codemark-tui/src/browser/mod.rs:1126— BrowserLayout::execute_collection_search has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 4 (6 pts), loops 2 (5 pts) (nesting depth added 13). 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.
BrowserLayout::spawn_collection_health_task_for (cognitive 22) crates/codemark-tui/src/browser/events.rs:954— BrowserLayout::spawn_collection_health_task_for has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 4 (7 pts), loops 2 (3 pts) (nesting depth added 11). 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.
BrowserLayout::execute_bookmark_search (cognitive 22) crates/codemark-tui/src/browser/mod.rs:1001— BrowserLayout::execute_bookmark_search has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (5 pts), match/switch 3 (5 pts) (nesting depth added 13). 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.
BrowserLayout::rebuild_tours_panel (cognitive 20) crates/codemark-tui/src/browser/mod.rs:1753— BrowserLayout::rebuild_tours_panel has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowserLayout::start_heal_selection (cognitive 19) crates/codemark-tui/src/browser/mod.rs:1333— BrowserLayout::start_heal_selection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 4 (9 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.
BrowserLayout::start_push_collection (cognitive 18) crates/codemark-tui/src/browser/mod.rs:1459— BrowserLayout::start_push_collection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 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.
BrowserLayout::handle_event (cognitive 17) crates/codemark-tui/src/browser/events.rs:22— BrowserLayout::handle_event has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, match/switch 1 (2 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.
FileTooLong: browser/mod.rs crates/codemark-tui/src/browser/mod.rs— FileTooLong — 1736 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 94% of them inside a single declaration: BrowserLayout (4 blocks, 138-3244). The bar is 500 significant lines; this is 1236 over it, 3.47× 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: cli/handlers.rs crates/codemark-cli/src/cli/handlers.rs— FileTooLong — 1418 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 51 free functions. The bar is 500 significant lines; this is 918 over it, 2.84× 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: browser/right_pane.rs crates/codemark-tui/src/browser/right_pane.rs— FileTooLong — 1270 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 94% of them inside a single declaration: RightPane (2 blocks, 76-2291). The bar is 500 significant lines; this is 770 over it, 2.54× 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: browser/events.rs crates/codemark-tui/src/browser/events.rs— FileTooLong — 1128 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: BrowserLayout (20-2089). The bar is 500 significant lines; this is 628 over it, 2.26× 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: component/code_preview.rs crates/codemark-tui/src/component/code_preview.rs— FileTooLong — 1006 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 90% of them inside a single declaration: CodePreview (3 blocks, 95-1710). The bar is 500 significant lines; this is 506 over it, 2.01× 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: cli/mod.rs crates/codemark-cli/src/cli/mod.rs— FileTooLong — 967 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 467 over it, 1.93× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: handlers/bookmark.rs crates/codemark-cli/src/cli/handlers/bookmark.rs— FileTooLong — 921 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 421 over it, 1.84× 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: query/generator.rs crates/codemark-core/src/query/generator.rs— FileTooLong — 870 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 36 free functions. The bar is 500 significant lines; this is 370 over it, 1.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/templates.rs crates/codemark-core/src/templates.rs— FileTooLong — 665 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 165 over it, 1.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: handlers/collection.rs crates/codemark-cli/src/cli/handlers/collection.rs— FileTooLong — 659 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 159 over it, 1.32× 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: browser/tabbed_panel.rs crates/codemark-tui/src/browser/tabbed_panel.rs— FileTooLong — 647 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 81% of them inside a single declaration: TabbedPanel (2 blocks, 22-1142). The bar is 500 significant lines; this is 147 over it, 1.29× 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: cli/output.rs crates/codemark-cli/src/cli/output.rs— FileTooLong — 597 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 97 over it, 1.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: tours/create.rs crates/codetours-server/src/handlers/tours/create.rs— FileTooLong — 548 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 48 over it, 1.10× 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: panel/mod.rs crates/codemark-tui/src/component/panel/mod.rs— FileTooLong — 529 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: Panel (3 blocks, 36-962). The bar is 500 significant lines; this is 29 over it, 1.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.
FileTooLong: engine/transfer.rs crates/codemark-core/src/engine/transfer.rs— FileTooLong — 516 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 16 over it, 1.03× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: storage/registry.rs crates/codemark-core/src/storage/registry.rs— FileTooLong — 516 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 31 free functions. The bar is 500 significant lines; this is 16 over it, 1.03× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: storage/bookmark_repo.rs crates/codemark-core/src/storage/bookmark_repo.rs— FileTooLong — 505 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: Database (15-694). The bar is 500 significant lines; this is 5 over it, 1.01× 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.
codemark_core::query::generator::build_tier1_query::build_node (cognitive 55) crates/codemark-core/src/query/generator.rs:1403— codemark_core::query::generator::build_tier1_query::build_node has cognitive complexity 55 (threshold 15). Drivers by points: if/else 25 (41 pts), match/switch 3 (9 pts), loops 1 (3 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.
codemark_core::engine::heal::heal_bookmark (cognitive 37) crates/codemark-core/src/engine/heal.rs:81— codemark_core::engine::heal::heal_bookmark has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (25 pts), match/switch 2 (6 pts), boolean chains 4, 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.
codemark_core::parser::profile::lint (cognitive 37) crates/codemark-core/src/parser/profile.rs:100— codemark_core::parser::profile::lint has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 4 (7 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_core::query::generator::extract_name_info_direct_toward (cognitive 36) crates/codemark-core/src/query/generator.rs:1178— codemark_core::query::generator::extract_name_info_direct_toward has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 3 (6 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_core::engine::transfer::plan_transfer (cognitive 29) crates/codemark-core/src/engine/transfer.rs:302— codemark_core::engine::transfer::plan_transfer has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 5 (11 pts), boolean chains 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_core::query::generator::build_structural_path (cognitive 27) crates/codemark-core/src/query/generator.rs:720— codemark_core::query::generator::build_structural_path has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_core::query::summarizer::compact_identifier (cognitive 21) crates/codemark-core/src/query/summarizer.rs:292— codemark_core::query::summarizer::compact_identifier has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_core::engine::resolution::resolve (cognitive 20) crates/codemark-core/src/engine/resolution.rs:144— codemark_core::engine::resolution::resolve has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 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.
codemark_core::query::generator::find_tightest_node (cognitive 20) crates/codemark-core/src/query/generator.rs:359— codemark_core::query::generator::find_tightest_node has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 5 (8 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.
codemark_core::query::generator::disambiguate_query_in (cognitive 20) crates/codemark-core/src/query/generator.rs:593— codemark_core::query::generator::disambiguate_query_in has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4, 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.
codemark_core::engine::hash::normalize_for_hash (cognitive 19) crates/codemark-core/src/engine/hash.rs:5— codemark_core::engine::hash::normalize_for_hash has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_core::grammar::profile_gen::collect (cognitive 19) crates/codemark-core/src/grammar/profile_gen.rs:273— codemark_core::grammar::profile_gen::collect 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.
codemark_core::grammar::profile_gen::label_for (cognitive 19) crates/codemark-core/src/grammar/profile_gen.rs:481— codemark_core::grammar::profile_gen::label_for has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 3, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_core::engine::transfer::apply_in_txn (cognitive 18) crates/codemark-core/src/engine/transfer.rs:591— codemark_core::engine::transfer::apply_in_txn has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 5 (8 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.
codemark_core::git::remote::parse_remote_url (cognitive 17) crates/codemark-core/src/git/remote.rs:15— codemark_core::git::remote::parse_remote_url has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
codemark_core::sync::import_pack (cognitive 17) crates/codemark-core/src/sync.rs:291— codemark_core::sync::import_pack has cognitive complexity 17 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 4 (6 pts), match/switch 1 (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.
Hotspot: crates/codemark-cli/src/cli/handlers.rs crates/codemark-cli/src/cli/handlers.rs:88— crates/codemark-cli/src/cli/handlers.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 93 in codemark_cli::cli::handlers::merge_globals at line 88. 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-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 22:33:58 -05:00' --until='2026-11-15 22:33:58 -05:00' --full-history --no-merges -- crates/codemark-cli/src/cli/handlers.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: crates/codemark-tui/src/browser/events.rs crates/codemark-tui/src/browser/events.rs:1317— crates/codemark-tui/src/browser/events.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in BrowserLayout::handle_key_event at line 1317. 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-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 22:33:58 -05:00' --until='2026-11-15 22:33:58 -05:00' --full-history --no-merges -- crates/codemark-tui/src/browser/events.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: crates/codemark-tui/src/entry.rs crates/codemark-tui/src/entry.rs:164— crates/codemark-tui/src/entry.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in codemark_tui::entry::run_app at line 164. 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-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 22:33:58 -05:00' --until='2026-11-15 22:33:58 -05:00' --full-history --no-merges -- crates/codemark-tui/src/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: crates/codemark-tui/src/browser/right_pane.rs crates/codemark-tui/src/browser/right_pane.rs:2003— crates/codemark-tui/src/browser/right_pane.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in RightPane::route_event at line 2003. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 22:33:58 -05:00' --until='2026-11-15 22:33:58 -05:00' --full-history --no-merges -- crates/codemark-tui/src/browser/right_pane.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: crates/codemark-tui/src/browser/mod.rs crates/codemark-tui/src/browser/mod.rs:2053— crates/codemark-tui/src/browser/mod.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in BrowserLayout::refresh_all_panels_inner at line 2053. 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-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 22:33:58 -05:00' --until='2026-11-15 22:33:58 -05:00' --full-history --no-merges -- crates/codemark-tui/src/browser/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: crates/codemark-core/src/query/generator.rs crates/codemark-core/src/query/generator.rs:1393— crates/codemark-core/src/query/generator.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in codemark_core::query::generator::build_tier1_query at line 1393. 1 of those changes was a fix/bug commit, and the other 8 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-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 22:33:58 -05:00' --until='2026-11-15 22:33:58 -05:00' --full-history --no-merges -- crates/codemark-core/src/query/generator.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: crates/codemark-tui/src/component/code_preview.rs crates/codemark-tui/src/component/code_preview.rs:1481— crates/codemark-tui/src/component/code_preview.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in CodePreview::render at line 1481. 1 of those changes was a fix/bug commit, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 22:33:58 -05:00' --until='2026-11-15 22:33:58 -05:00' --full-history --no-merges -- crates/codemark-tui/src/component/code_preview.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: crates/codetours-server/src/handlers/tours/create.rs crates/codetours-server/src/handlers/tours/create.rs:51— crates/codetours-server/src/handlers/tours/create.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in codetours_server::handlers::tours::create::handler at line 51. 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-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 22:33:58 -05:00' --until='2026-11-15 22:33:58 -05:00' --full-history --no-merges -- crates/codetours-server/src/handlers/tours/create.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: crates/codemark-tui/src/browser/bindings.rs crates/codemark-tui/src/browser/bindings.rs:15— crates/codemark-tui/src/browser/bindings.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in BrowserLayout::get_help_bindings at line 15. 1 of those changes was a fix/bug commit, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 22:33:58 -05:00' --until='2026-11-15 22:33:58 -05:00' --full-history --no-merges -- crates/codemark-tui/src/browser/bindings.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: crates/codemark-cli/src/cli/handlers/bookmark.rs crates/codemark-cli/src/cli/handlers/bookmark.rs:42— crates/codemark-cli/src/cli/handlers/bookmark.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in codemark_cli::cli::handlers::bookmark::handle_add at line 42. 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-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 22:33:58 -05:00' --until='2026-11-15 22:33:58 -05:00' --full-history --no-merges -- crates/codemark-cli/src/cli/handlers/bookmark.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: crates/codemark-core/src/parser/profile.rs crates/codemark-core/src/parser/profile.rs:100— crates/codemark-core/src/parser/profile.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in codemark_core::parser::profile::lint at line 100. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 22:33:58 -05:00' --until='2026-11-15 22:33:58 -05:00' --full-history --no-merges -- crates/codemark-core/src/parser/profile.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: crates/codemark-core/src/storage/bookmark_repo.rs crates/codemark-core/src/storage/bookmark_repo.rs:325— crates/codemark-core/src/storage/bookmark_repo.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in Database::list_bookmarks at line 325. 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-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 22:33:58 -05:00' --until='2026-11-15 22:33:58 -05:00' --full-history --no-merges -- crates/codemark-core/src/storage/bookmark_repo.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: crates/codemark-core/src/engine/heal.rs crates/codemark-core/src/engine/heal.rs:81— crates/codemark-core/src/engine/heal.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in codemark_core::engine::heal::heal_bookmark at line 81. 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-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 22:33:58 -05:00' --until='2026-11-15 22:33:58 -05:00' --full-history --no-merges -- crates/codemark-core/src/engine/heal.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: crates/codemark-core/src/config.rs crates/codemark-core/src/config.rs:751— crates/codemark-core/src/config.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in Config::merge at line 751. 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-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 22:33:58 -05:00' --until='2026-11-15 22:33:58 -05:00' --full-history --no-merges -- crates/codemark-core/src/config.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.
codemark_cli::cli::handlers::merge_globals (cyclomatic 93) crates/codemark-cli/src/cli/handlers.rs:88— codemark_cli::cli::handlers::merge_globals has cyclomatic complexity 93 (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.
codemark_cli::cli::handlers::bookmark::handle_add (cyclomatic 25) crates/codemark-cli/src/cli/handlers/bookmark.rs:42— codemark_cli::cli::handlers::bookmark::handle_add 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.
codemark_cli::cli::handlers::collection::handle_collection_list (cyclomatic 25) crates/codemark-cli/src/cli/handlers/collection.rs:328— codemark_cli::cli::handlers::collection::handle_collection_list has cyclomatic complexity 25 (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.
codemark_cli::cli::handlers::languages::handle_validate (cyclomatic 25) crates/codemark-cli/src/cli/handlers/languages.rs:381— codemark_cli::cli::handlers::languages::handle_validate 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.
codemark_cli::cli::handlers::bookmark::handle_add_from_snippet (cyclomatic 24) crates/codemark-cli/src/cli/handlers/bookmark.rs:303— codemark_cli::cli::handlers::bookmark::handle_add_from_snippet 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 (codemark_cli::cli::handlers::bookmark::handle_add_from_query) 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.
codemark_cli::cli::handlers::bookmark::handle_add_from_query (cyclomatic 24) crates/codemark-cli/src/cli/handlers/bookmark.rs:559— codemark_cli::cli::handlers::bookmark::handle_add_from_query 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 (codemark_cli::cli::handlers::bookmark::handle_add_from_snippet) 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.
codemark_cli::cli::handlers::search::handle_semantic_search (cyclomatic 22) crates/codemark-cli/src/cli/handlers/search.rs:168— codemark_cli::cli::handlers::search::handle_semantic_search has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
codemark_cli::cli::handlers::bookmark::handle_annotate (cyclomatic 21) crates/codemark-cli/src/cli/handlers/bookmark.rs:1133— codemark_cli::cli::handlers::bookmark::handle_annotate 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.
codemark_cli::cli::handlers::handle_preview (cyclomatic 19) crates/codemark-cli/src/cli/handlers.rs:1788— codemark_cli::cli::handlers::handle_preview has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: codemark_cli::cli::handlers::dispatch (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 function is counted neither in this dimension's figures nor in its score.
codemark_cli::cli::handlers::transfer::report (cyclomatic 18) crates/codemark-cli/src/cli/handlers/transfer.rs:163— codemark_cli::cli::handlers::transfer::report 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.
codemark_cli::cli::handlers::bookmark::handle_show (cyclomatic 17) crates/codemark-cli/src/cli/handlers/bookmark.rs:979— codemark_cli::cli::handlers::bookmark::handle_show 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.
codemark_cli::cli::handlers::search::handle_search (cyclomatic 17) crates/codemark-cli/src/cli/handlers/search.rs:23— codemark_cli::cli::handlers::search::handle_search 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.
codemark_cli::cli::output::write_bookmark_markdown_fallback (cyclomatic 17) crates/codemark-cli/src/cli/output.rs:623— codemark_cli::cli::output::write_bookmark_markdown_fallback has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: codemark_cli::cli::output::escape_markdown (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
Duplicated block (9 lines × 2) crates/codemark-cli/src/cli/handlers.rs:389— crates/codemark-cli/src/cli/handlers.rs:389-397 | crates/codemark-cli/src/cli/handlers.rs:411-419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-cli/src/cli/handlers.rs:389` 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, `crates/codemark-cli/src/cli/handlers.rs:410` calls `clone` and `crates/codemark-cli/src/cli/handlers.rs:388` 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 (9 lines × 2) crates/codemark-cli/src/cli/handlers.rs:671— crates/codemark-cli/src/cli/handlers.rs:671-679 | crates/codemark-cli/src/cli/handlers.rs:685-693 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/codemark-cli/src/cli/handlers.rs:1451— crates/codemark-cli/src/cli/handlers.rs:1451-1459 | crates/codemark-cli/src/cli/handlers/bookmark.rs:928-936 — 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 `crates/codemark-cli/src/cli/handlers.rs:1451` it does not close everything it opens, so those exact lines 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) crates/codemark-cli/src/cli/handlers/repo.rs:168— crates/codemark-cli/src/cli/handlers/repo.rs:168-176 | crates/codemark-cli/src/cli/handlers/repo.rs:236-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-cli/src/cli/handlers/repo.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 (9 lines × 2) crates/codemark-core/src/git/context.rs:37— crates/codemark-core/src/git/context.rs:37-45 | crates/codemark-core/src/git/context.rs:56-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-core/src/git/context.rs:37` it begins part-way through the construct above it, so those exact lines 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) crates/codemark-core/src/storage/bookmark_repo.rs:617— crates/codemark-core/src/storage/bookmark_repo.rs:617-625 | crates/codetours-server/src/storage/repos/tag.rs:22-30 — 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 `crates/codemark-core/src/storage/bookmark_repo.rs:617` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `bookmark_id` to `&str` in one and `String` 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) crates/codemark-core/src/sync.rs:214— crates/codemark-core/src/sync.rs:214-222 | crates/codemark-core/src/sync.rs:510-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/codemark-core/src/sync.rs:212` calls `status` and `crates/codemark-core/src/sync.rs:508` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) crates/codemark-tui/src/browser/mod.rs:738— crates/codemark-tui/src/browser/mod.rs:738-746 | crates/codemark-tui/src/browser/mod.rs:770-778 — both copies are in the same file, so extract the 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, `crates/codemark-tui/src/browser/mod.rs:731` calls `is_loading`, `finish_loading` and `crates/codemark-tui/src/browser/mod.rs:768` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) crates/codetours-server/src/github.rs:299— crates/codetours-server/src/github.rs:299-308 | crates/codetours-server/src/github.rs:430-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 `crates/codetours-server/src/github.rs:299` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/codetours-server/src/github.rs:446— crates/codetours-server/src/github.rs:446-454 | crates/codetours-server/src/github.rs:467-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 `crates/codetours-server/src/github.rs:446` 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) crates/codetours-server/src/storage/repos/collection.rs:24— crates/codetours-server/src/storage/repos/collection.rs:24-32 | crates/codetours-server/src/storage/repos/resolution.rs:28-36 — 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 `crates/codetours-server/src/storage/repos/collection.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 (9 lines × 2) crates/codemark-core/src/storage/collection_repo.rs:37— crates/codemark-core/src/storage/collection_repo.rs:37-45 | crates/codemark-core/src/storage/collection_repo.rs:70-78 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-core/src/storage/collection_repo.rs:37` 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) crates/codemark-tui/src/browser/mod.rs:1554— crates/codemark-tui/src/browser/mod.rs:1554-1562 | crates/codemark-tui/src/browser/mod.rs:1724-1732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-tui/src/browser/mod.rs:1554` 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.
codemark_tui::entry::run_app (cognitive 176) crates/codemark-tui/src/entry.rs:164— codemark_tui::entry::run_app has cognitive complexity 176 (threshold 15). Drivers by points: if/else 32 (104 pts), match/switch 11 (48 pts), boolean chains 13, loops 4 (11 pts) (nesting depth added 116). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_tui::event::event_loop_with_sender (cognitive 30) crates/codemark-tui/src/event.rs:380— codemark_tui::event::event_loop_with_sender has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_tui::browser::transfer::render_picker (cognitive 27) crates/codemark-tui/src/browser/transfer.rs:558— codemark_tui::browser::transfer::render_picker has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3 (5 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.
codemark_tui::component::panel::path::shorten_path (cognitive 26) crates/codemark-tui/src/component/panel/path.rs:9— codemark_tui::component::panel::path::shorten_path has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_tui::browser::data::perform_heal (cognitive 23) crates/codemark-tui/src/browser/data.rs:12— codemark_tui::browser::data::perform_heal has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 4 (10 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.
codemark_tui::component::inline_comments::wrap (cognitive 21) crates/codemark-tui/src/component/inline_comments.rs:240— codemark_tui::component::inline_comments::wrap has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_tui::browser::shorten_path (cognitive 19) crates/codemark-tui/src/browser/mod.rs:84— codemark_tui::browser::shorten_path has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 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.
codemark_tui::theme::load_schemes (cognitive 17) crates/codemark-tui/src/theme.rs:238— codemark_tui::theme::load_schemes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codemark_tui::ui::render_confirmation (cognitive 16) crates/codemark-tui/src/ui/mod.rs:299— codemark_tui::ui::render_confirmation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×9
BrowserLayout::handle_key_event (cyclomatic 47) crates/codemark-tui/src/browser/events.rs:1317— BrowserLayout::handle_key_event has cyclomatic complexity 47 (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.
BrowserLayout::handle_app_event (cyclomatic 46) crates/codemark-tui/src/browser/events.rs:333— BrowserLayout::handle_app_event 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.
BrowserLayout::get_help_bindings (cyclomatic 23) crates/codemark-tui/src/browser/bindings.rs:15— BrowserLayout::get_help_bindings 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.
BrowserLayout::get_context_bindings (cyclomatic 23) crates/codemark-tui/src/browser/bindings.rs:182— BrowserLayout::get_context_bindings 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.
BrowserLayout::update_tours_collections (cyclomatic 21) crates/codemark-tui/src/browser/mod.rs:2684— BrowserLayout::update_tours_collections 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.
BrowserLayout::refresh_all_panels_inner (cyclomatic 20) crates/codemark-tui/src/browser/mod.rs:2053— BrowserLayout::refresh_all_panels_inner 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.
BrowserLayout::handle_delegation (cyclomatic 19) crates/codemark-tui/src/browser/events.rs:1997— BrowserLayout::handle_delegation 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.
BrowserLayout::handle_event (cyclomatic 16) crates/codemark-tui/src/browser/events.rs:22— BrowserLayout::handle_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.
Duplicated block (8 lines × 2) crates/codemark-cli/src/cli/handlers/search.rs:65— crates/codemark-cli/src/cli/handlers/search.rs:65-72 | crates/codemark-cli/src/cli/handlers/search.rs:104-111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-cli/src/cli/handlers/search.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.
Duplicated block (8 lines × 2) crates/codemark-core/src/engine/resolution.rs:173— crates/codemark-core/src/engine/resolution.rs:173-180 | crates/codemark-core/src/engine/resolution.rs:184-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-core/src/engine/resolution.rs:173` it begins part-way through the construct above it, so those exact lines 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) crates/codemark-core/src/storage/pack/reader.rs:172— crates/codemark-core/src/storage/pack/reader.rs:172-179 | crates/codetours-server/src/storage/repos/bookmark.rs:122-129 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-core/src/storage/pack/reader.rs:172` 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 × 2) crates/codemark-tui/src/browser/mod.rs:1510— crates/codemark-tui/src/browser/mod.rs:1510-1517 | crates/codemark-tui/src/browser/mod.rs:1675-1682 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/codetours-server/src/handlers/tours/get.rs:191— crates/codetours-server/src/handlers/tours/get.rs:191-199 | crates/codetours-server/src/handlers/tours/list.rs:234-241 — 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, `crates/codetours-server/src/handlers/tours/get.rs:203` calls `clone` and `crates/codetours-server/src/handlers/tours/list.rs:243` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) crates/codetours-server/src/storage/repos/collection.rs:15— crates/codetours-server/src/storage/repos/collection.rs:15-22 | crates/codetours-server/src/storage/repos/collection.rs:35-42 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codetours-server/src/storage/repos/collection.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 × 2) crates/codemark-core/src/storage/bookmark_repo.rs:591— crates/codemark-core/src/storage/bookmark_repo.rs:591-598 | crates/codemark-core/src/storage/collection_repo.rs:194-201 — 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) crates/codemark-core/src/storage/repo_repo.rs:46— crates/codemark-core/src/storage/repo_repo.rs:46-53 | crates/codemark-core/src/storage/repo_repo.rs:70-77 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-core/src/storage/repo_repo.rs:46` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/codemark-cli/src/cli/handlers/search.rs:238— crates/codemark-cli/src/cli/handlers/search.rs:238-244 | crates/codemark-cli/src/cli/handlers/search.rs:530-536 — both copies are in the same file, so extract the 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) crates/codemark-core/src/storage/collection_repo.rs:142— crates/codemark-core/src/storage/collection_repo.rs:142-148 | crates/codemark-core/src/storage/collection_repo.rs:206-212 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-core/src/storage/collection_repo.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 (7 lines × 2) crates/codemark-core/src/sync.rs:433— crates/codemark-core/src/sync.rs:433-439 | crates/codetours-server/src/storage/repos/comment.rs:30-36 — 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 `crates/codemark-core/src/sync.rs:433` 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) crates/codetours-server/src/storage/manager.rs:44— crates/codetours-server/src/storage/manager.rs:44-50 | crates/codetours-server/src/storage/registry.rs:54-60 — 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 `crates/codetours-server/src/storage/manager.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 (7 lines × 2) crates/codemark-core/src/storage/bookmark_repo.rs:366— crates/codemark-core/src/storage/bookmark_repo.rs:366-372 | crates/codemark-core/src/storage/bookmark_repo.rs:563-569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-core/src/storage/bookmark_repo.rs:366` it begins part-way through the construct above it, so those exact lines 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) crates/codemark-core/src/engine/projection.rs:229— crates/codemark-core/src/engine/projection.rs:229-235 | crates/codemark-tui/src/browser/tabbed_panel.rs:75-81 — 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) crates/codemark-core/src/git/context.rs:273— crates/codemark-core/src/git/context.rs:273-279 | crates/codemark-core/src/git/context.rs:311-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 `crates/codemark-core/src/git/context.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.
Duplicated block (7 lines × 2) crates/codemark-core/src/config.rs:695— crates/codemark-core/src/config.rs:695-701 | crates/codemark-core/src/config.rs:741-747 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-core/src/config.rs:695` 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: BrowserLayout crates/codemark-tui/src/browser/mod.rs:138— TooManyMethods — 140 methods, declared across 7 files: browser/mod.rs (74), browser/events.rs (35), browser/comment_draft.rs (11), browser/transfer.rs (9), +3 more file(s). The bar is 30 methods; this is 110 over it, 4.67× 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: Database crates/codemark-core/src/storage/db.rs:67— TooManyMethods — 91 methods, declared across 8 files: storage/bookmark_repo.rs (23), storage/collection_repo.rs (21), storage/db.rs (17), storage/comment_repo.rs (9), +4 more file(s). The bar is 30 methods; this is 61 over it, 3.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: CodePreview crates/codemark-tui/src/component/code_preview.rs:95— TooManyMethods — 80 methods. The bar is 30 methods; this is 50 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RightPane crates/codemark-tui/src/browser/right_pane.rs:76— TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Panel crates/codemark-tui/src/component/panel/mod.rs:36— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TabbedPanel crates/codemark-tui/src/browser/tabbed_panel.rs:22— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PanelItem crates/codemark-tui/src/component/panel/item.rs:16— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
MethodTooLong: MarkdownPanel.parse_to_text crates/codemark-tui/src/component/markdown_panel.rs:133— MethodTooLong — parse_to_text runs 147 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 47 over it, 1.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: CodePreview.render crates/codemark-tui/src/component/code_preview.rs:1481— MethodTooLong — render runs 131 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 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BrowserLayout.handle_app_event crates/codemark-tui/src/browser/events.rs:333— MethodTooLong — handle_app_event runs 127 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 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BrowserLayout.update_tours_collections crates/codemark-tui/src/browser/mod.rs:2684— MethodTooLong — update_tours_collections runs 120 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 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Packer.insert_snapshot_data crates/codemark-core/src/storage/pack/writer.rs:74— MethodTooLong — insert_snapshot_data runs 113 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 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BrowserLayout.get_help_bindings crates/codemark-tui/src/browser/bindings.rs:15— MethodTooLong — get_help_bindings runs 109 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 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BrowserLayout.handle_key_event crates/codemark-tui/src/browser/events.rs:1317— MethodTooLong — handle_key_event runs 103 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 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (11 lines × 2) crates/codemark-core/src/embeddings/local.rs:319— crates/codemark-core/src/embeddings/local.rs:319-329 | crates/codemark-core/src/embeddings/local.rs:339-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.
Duplicated block (11 lines × 2) crates/codemark-tui/src/browser/right_pane.rs:357— crates/codemark-tui/src/browser/right_pane.rs:357-367 | crates/codemark-tui/src/browser/right_pane.rs:1371-1381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/codemark-tui/src/state.rs:337— crates/codemark-tui/src/state.rs:337-347 | crates/codemark-tui/src/state.rs:358-368 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-tui/src/state.rs:337` it does not close everything it opens, so those exact lines 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) crates/codetours-server/src/handlers/tours/create.rs:700— crates/codetours-server/src/handlers/tours/create.rs:700-710 | crates/codetours-server/src/handlers/tours/create.rs:713-723 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codetours-server/src/handlers/tours/create.rs:700` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) crates/codemark-cli/src/cli/handlers/collection.rs:390— crates/codemark-cli/src/cli/handlers/collection.rs:390-400 | crates/codemark-cli/src/cli/handlers/collection.rs:477-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-cli/src/cli/handlers/collection.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 (11 lines × 2) crates/codetours-server/src/storage/repos/resolution.rs:15— crates/codetours-server/src/storage/repos/resolution.rs:15-26 | crates/codetours-server/src/storage/repos/resolution.rs:39-49 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codetours-server/src/storage/repos/resolution.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 (11 lines × 2) crates/codetours-server/src/handlers/tours/create.rs:219— crates/codetours-server/src/handlers/tours/create.rs:219-229 | crates/codetours-server/src/handlers/tours/create.rs:347-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codetours-server/src/handlers/tours/create.rs:219` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Outbound HTTP without resilience crates/codemark-cli/src/cli/handlers/tour.rs:96— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/codetours-server/src/github.rs:187— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/codetours-server/src/github.rs:255— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/codetours-server/src/github.rs:369— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/codetours-server/src/handlers/auth.rs:67— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/codetours-server/src/handlers/auth.rs:198— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/codetours-server/src/handlers/auth.rs:229— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
codemark_core::engine::projection::project_resolution_status (cyclomatic 27) crates/codemark-core/src/engine/projection.rs:89— codemark_core::engine::projection::project_resolution_status 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.
codemark_core::query::generator::build_tier1_query::build_node (cyclomatic 26) crates/codemark-core/src/query/generator.rs:1403— codemark_core::query::generator::build_tier1_query::build_node 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.
codemark_core::query::generator::extract_name_info_direct_toward (cyclomatic 22) crates/codemark-core/src/query/generator.rs:1178— codemark_core::query::generator::extract_name_info_direct_toward 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.
codemark_core::engine::heal::heal_bookmark (cyclomatic 20) crates/codemark-core/src/engine/heal.rs:81— codemark_core::engine::heal::heal_bookmark 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.
codemark_core::parser::profile::lint (cyclomatic 20) crates/codemark-core/src/parser/profile.rs:100— codemark_core::parser::profile::lint 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.
codemark_core::query::generator::disambiguate_query_in (cyclomatic 16) crates/codemark-core/src/query/generator.rs:593— codemark_core::query::generator::disambiguate_query_in 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.
Duplicated block (13 lines × 2) crates/codemark-tui/src/app.rs:196— crates/codemark-tui/src/app.rs:196-208 | crates/codemark-tui/src/entry.rs:247-259 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) crates/codemark-tui/src/browser/mod.rs:104— crates/codemark-tui/src/browser/mod.rs:104-116 | crates/codemark-tui/src/component/panel/path.rs:32-44 — 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 `crates/codemark-tui/src/browser/mod.rs:104` it begins part-way through the construct above it, so those exact lines 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) crates/codemark-tui/src/browser/tabbed_panel.rs:970— crates/codemark-tui/src/browser/tabbed_panel.rs:970-982 | crates/codemark-tui/src/component/panel/mod.rs:824-836 — 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 `crates/codemark-tui/src/browser/tabbed_panel.rs:970` it begins part-way through the construct above it, so those exact lines 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) crates/codemark-tui/src/component/panel/mod.rs:858— crates/codemark-tui/src/component/panel/mod.rs:858-870 | crates/codemark-tui/src/component/panel/mod.rs:921-933 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-tui/src/component/panel/mod.rs:858` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/codemark-tui/src/layout/mod.rs:269— crates/codemark-tui/src/layout/mod.rs:269-281 | crates/codemark-tui/src/layout/mod.rs:384-396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) crates/codemark-tui/src/browser/tabbed_panel.rs:479— crates/codemark-tui/src/browser/tabbed_panel.rs:479-491 | crates/codemark-tui/src/browser/tabbed_panel.rs:501-513 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-tui/src/browser/tabbed_panel.rs:479` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
ClassTooLong: BrowserLayout crates/codemark-tui/src/browser/mod.rs:138— ClassTooLong — 1639 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 140 methods, 4 blocks, lines 138-3244. The bar is 400 significant lines; this is 1239 over it, 4.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.
ClassTooLong: RightPane crates/codemark-tui/src/browser/right_pane.rs:76— ClassTooLong — 1200 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 71 methods, 2 blocks, lines 76-2291. The bar is 400 significant lines; this is 800 over it, 3.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CodePreview crates/codemark-tui/src/component/code_preview.rs:95— ClassTooLong — 910 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 80 methods, 3 blocks, lines 95-1710. The bar is 400 significant lines; this is 510 over it, 2.28× 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: TabbedPanel crates/codemark-tui/src/browser/tabbed_panel.rs:22— ClassTooLong — 522 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 38 methods, 2 blocks, lines 22-1142. The bar is 400 significant lines; this is 122 over it, 1.31× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Panel crates/codemark-tui/src/component/panel/mod.rs:36— ClassTooLong — 512 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 46 methods, 3 blocks, lines 36-962. The bar is 400 significant lines; this is 112 over it, 1.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×5
Duplicated block (10 lines × 2) crates/codemark-cli/src/cli/handlers.rs:1465— crates/codemark-cli/src/cli/handlers.rs:1465-1474 | crates/codemark-cli/src/cli/handlers/bookmark.rs:942-951 — 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 `crates/codemark-cli/src/cli/handlers.rs:1465` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) crates/codemark-cli/src/cli/handlers/collection.rs:368— crates/codemark-cli/src/cli/handlers/collection.rs:368-377 | crates/codemark-cli/src/cli/handlers/collection.rs:453-462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-cli/src/cli/handlers/collection.rs:368` it does not close everything it opens, so those exact lines 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) crates/codemark-core/src/git/mod.rs:29— crates/codemark-core/src/git/mod.rs:29-38 | crates/codemark-core/src/git/mod.rs:66-75 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-core/src/git/mod.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 (10 lines × 2) crates/codemark-tui/src/browser/mod.rs:1497— crates/codemark-tui/src/browser/mod.rs:1497-1506 | crates/codemark-tui/src/browser/mod.rs:1664-1673 — both copies are in the same file, so extract the 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, `crates/codemark-tui/src/browser/mod.rs:1507` calls `parent`, `unwrap_or`, `to_path_buf` and `crates/codemark-tui/src/browser/mod.rs:1675` 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 (10 lines × 2) crates/codetours-server/src/github.rs:160— crates/codetours-server/src/github.rs:160-169 | crates/codetours-server/src/github.rs:344-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 `crates/codetours-server/src/github.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/codetours-server/src/github.rs:343` calls `clone` and `crates/codetours-server/src/github.rs:159` 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 (9–10 lines × 2) crates/codemark-cli/src/cli/handlers/maintenance.rs:228— crates/codemark-cli/src/cli/handlers/maintenance.rs:228-236 | crates/codemark-cli/src/cli/handlers/maintenance.rs:258-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 `crates/codemark-cli/src/cli/handlers/maintenance.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–10 lines × 2) crates/codemark-core/src/engine/resolution.rs:230— crates/codemark-core/src/engine/resolution.rs:230-239 | crates/codemark-core/src/engine/resolution.rs:251-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 `crates/codemark-core/src/engine/resolution.rs:230` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–10 lines × 2) crates/codemark-core/src/storage/registry.rs:431— crates/codemark-core/src/storage/registry.rs:431-439 | crates/codemark-core/src/storage/registry.rs:446-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-core/src/storage/registry.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 (9–10 lines × 2) crates/codemark-tui/src/browser/tabbed_panel.rs:958— crates/codemark-tui/src/browser/tabbed_panel.rs:958-966 | crates/codemark-tui/src/component/panel/mod.rs:811-820 — 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 `crates/codemark-tui/src/browser/tabbed_panel.rs:958` it does not close everything it opens, so those exact lines 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) crates/codemark-tui/src/component/code_preview.rs:639— crates/codemark-tui/src/component/code_preview.rs:639-648 | crates/codemark-tui/src/component/panel/mod.rs:885-893 — 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 `crates/codemark-tui/src/component/code_preview.rs:639` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 × 2) crates/codemark-cli/src/cli/handlers.rs:1753— crates/codemark-cli/src/cli/handlers.rs:1753-1757 | crates/codemark-cli/src/cli/handlers/search.rs:129-135 — 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 `crates/codemark-cli/src/cli/handlers.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/codemark-cli/src/cli/handlers/search.rs:126` calls `needs_line`, `as_deref`, `is_some_and` and `crates/codemark-cli/src/cli/handlers.rs:1751` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) crates/codemark-core/src/git/mod.rs:40— crates/codemark-core/src/git/mod.rs:40-44 | crates/codemark-core/src/git/mod.rs:77-81 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-core/src/git/mod.rs:40` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 × 2) crates/codemark-cli/src/cli/handlers.rs:144— crates/codemark-cli/src/cli/handlers.rs:144-148 | crates/codemark-cli/src/cli/handlers.rs:178-182 — both copies are in the same file, so extract the 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/codemark-cli/src/cli/handlers.rs:183` calls `Annotate`, `g_global` and `crates/codemark-cli/src/cli/handlers.rs:149` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) crates/codemark-cli/src/cli/handlers.rs:1675— crates/codemark-cli/src/cli/handlers.rs:1675-1679 | crates/codemark-cli/src/cli/handlers/search.rs:56-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&ListArgs` in one and `&SearchArgs` 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) crates/codemark-tui/src/browser/comment_draft.rs:204— crates/codemark-tui/src/browser/comment_draft.rs:204-208 | crates/codemark-tui/src/browser/comment_draft.rs:226-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `&mut` in one and `super) fn confirm_delete_thread(&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.
CodePreview::render (cognitive 56) crates/codemark-tui/src/component/code_preview.rs:1481— CodePreview::render has cognitive complexity 56 (threshold 15). Drivers by points: if/else 21 (39 pts), loops 5 (7 pts), boolean chains 5, match/switch 2 (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.
CodePreview::handle_input (cognitive 33) crates/codemark-tui/src/component/code_preview.rs:560— CodePreview::handle_input has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (26 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 15). 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.
CodePreview::line_motion (cognitive 25) crates/codemark-tui/src/component/code_preview.rs:705— CodePreview::line_motion has cognitive complexity 25 (threshold 15). Drivers by points: loops 6 (13 pts), boolean chains 7, if/else 3 (4 pts), match/switch 1 (nesting depth added 8). 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.
CodePreview::render_rail (cognitive 18) crates/codemark-tui/src/component/code_preview.rs:1016— CodePreview::render_rail has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RightPane::route_event (cognitive 31) crates/codemark-tui/src/browser/right_pane.rs:2003— RightPane::route_event has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 6, match/switch 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RightPane::load_tour (cognitive 20) crates/codemark-tui/src/browser/right_pane.rs:1433— RightPane::load_tour has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 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.
RightPane::render (cognitive 19) crates/codemark-tui/src/browser/right_pane.rs:1560— RightPane::render has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RightPane::load_bookmark (cognitive 17) crates/codemark-tui/src/browser/right_pane.rs:738— RightPane::load_bookmark has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (17 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Duplicated block (12 lines × 2) crates/codemark-core/src/storage/semantic_repo.rs:134— crates/codemark-core/src/storage/semantic_repo.rs:134-145 | crates/codemark-core/src/storage/semantic_repo.rs:337-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-core/src/storage/semantic_repo.rs:134` 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) crates/codemark-tui/src/browser/mod.rs:650— crates/codemark-tui/src/browser/mod.rs:650-661 | crates/codemark-tui/src/browser/mod.rs:689-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 `crates/codemark-tui/src/browser/mod.rs:650` 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 `self` to `super) fn preview_content_item(&mut` in one and `super) fn on_content_selection_changed(&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 × 2) crates/codemark-tui/src/layout/mod.rs:254— crates/codemark-tui/src/layout/mod.rs:254-265 | crates/codemark-tui/src/layout/mod.rs:369-380 — both copies are in the same file, so extract the 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 (12 lines × 2) crates/codetours-server/src/handlers/tours/create.rs:205— crates/codetours-server/src/handlers/tours/create.rs:205-216 | crates/codetours-server/src/handlers/tours/create.rs:268-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 `crates/codetours-server/src/handlers/tours/create.rs:205` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/codetours-server/src/handlers/tours/create.rs:219` calls `remove_file` and `crates/codetours-server/src/handlers/tours/create.rs:282` 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.
codetours_server::handlers::tours::create::handler (cyclomatic 49) crates/codetours-server/src/handlers/tours/create.rs:51— codetours_server::handlers::tours::create::handler has cyclomatic complexity 49 (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.
codetours_server::handlers::tours::list::handler (cyclomatic 20) crates/codetours-server/src/handlers/tours/list.rs:116— codetours_server::handlers::tours::list::handler 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.
codetours_server::handlers::tours::get::handler (cyclomatic 18) crates/codetours-server/src/handlers/tours/get.rs:118— codetours_server::handlers::tours::get::handler 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.
CodePreview::render (cyclomatic 31) crates/codemark-tui/src/component/code_preview.rs:1481— CodePreview::render 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.
CodePreview::handle_input (cyclomatic 28) crates/codemark-tui/src/component/code_preview.rs:560— CodePreview::handle_input 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.
CodePreview::line_motion (cyclomatic 23) crates/codemark-tui/src/component/code_preview.rs:705— CodePreview::line_motion 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.
TodoComment crates/codemark-core/src/config.rs:405— /// TODO: Implement freshness checking in web UI / list commands (Phase 12) — 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 crates/codemark-core/src/storage/bookmark_repo.rs:1668— // TODO: This insert should fail with a constraint violation — 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 crates/codemark-cli/tests/cli_integration.rs:3285— // TODO: Implement proper check: compare bookmark's commit_hash with target commit — 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.
codetours_server::handlers::tours::create::handler (cognitive 63) crates/codetours-server/src/handlers/tours/create.rs:51— codetours_server::handlers::tours::create::handler has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (37 pts), match/switch 16 (24 pts), boolean chains 1, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codetours_server::handlers::tours::get::handler (cognitive 24) crates/codetours-server/src/handlers/tours/get.rs:118— codetours_server::handlers::tours::get::handler has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 7 (11 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.
codetours_server::handlers::tours::list::handler (cognitive 20) crates/codetours-server/src/handlers/tours/list.rs:116— codetours_server::handlers::tours::list::handler has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 8 (12 pts), if/else 6, loops 1 (2 pts) (nesting depth added 5). 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.
Panel::handle_event (cognitive 56) crates/codemark-tui/src/component/panel/mod.rs:838— Panel::handle_event has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (50 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 35). 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.
Panel::render (cognitive 35) crates/codemark-tui/src/component/panel/mod.rs:689— Panel::render has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (30 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Panel::activate_selected (cognitive 21) crates/codemark-tui/src/component/panel/mod.rs:398— Panel::activate_selected has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 1 (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.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×3
Edited copy of a member (16 corresponding lines) crates/codemark-core/src/embeddings/local.rs:318— crates/codemark-core/src/embeddings/local.rs:318-336 | crates/codemark-core/src/embeddings/local.rs:338-353 — 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) crates/codemark-tui/src/browser/mod.rs:3025— crates/codemark-tui/src/browser/mod.rs:3025-3040 | crates/codemark-tui/src/browser/mod.rs:3043-3058 — 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) crates/codemark-tui/src/browser/mod.rs:953— crates/codemark-tui/src/browser/mod.rs:953-968 | crates/codemark-tui/src/browser/mod.rs:977-994 — 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 (9 corresponding lines) · ×3
Edited copy of a member (9 corresponding lines) crates/codemark-tui/src/component/panel/mod.rs:501— crates/codemark-tui/src/component/panel/mod.rs:501-509 | crates/codemark-tui/src/component/panel/mod.rs:514-526 — 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) crates/codemark-core/src/storage/semantic_repo.rs:176— crates/codemark-core/src/storage/semantic_repo.rs:176-184 | crates/codemark-core/src/storage/semantic_repo.rs:193-201 — 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) crates/codemark-core/src/storage/semantic_repo.rs:62— crates/codemark-core/src/storage/semantic_repo.rs:62-71 | crates/codemark-core/src/storage/semantic_repo.rs:298-306 — 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.
Duplicated block (23 lines × 2) crates/codemark-cli/src/cli/handlers/search.rs:76— crates/codemark-cli/src/cli/handlers/search.rs:76-98 | crates/codemark-cli/src/cli/handlers/search.rs:283-305 — both copies are in the same file, so extract the 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) crates/codetours-server/src/handlers/tours/get.rs:145— crates/codetours-server/src/handlers/tours/get.rs:145-167 | crates/codetours-server/src/handlers/tours/get.rs:204-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/codetours-server/src/handlers/tours/get.rs:203` calls `clone` and `crates/codetours-server/src/handlers/tours/get.rs:142` 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 (23 lines × 2) crates/codemark-cli/src/cli/handlers/collection.rs:80— crates/codemark-cli/src/cli/handlers/collection.rs:80-102 | crates/codemark-cli/src/cli/handlers/collection.rs:210-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-cli/src/cli/handlers/collection.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&CollectionCreateArgs` in one and `&CollectionAddArgs` 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 (17 lines × 2) crates/codemark-cli/src/cli/handlers.rs:1293— crates/codemark-cli/src/cli/handlers.rs:1293-1309 | crates/codemark-cli/src/cli/handlers/collection.rs:187-203 — 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 `crates/codemark-cli/src/cli/handlers.rs:1293` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) crates/codemark-core/src/query/generator.rs:1554— crates/codemark-core/src/query/generator.rs:1554-1570 | crates/codemark-core/src/query/generator.rs:1596-1612 — both copies are in the same file, so extract the 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) crates/codemark-tui/src/layout/mod.rs:234— crates/codemark-tui/src/layout/mod.rs:234-250 | crates/codemark-tui/src/layout/mod.rs:349-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. 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) crates/codemark-tui/src/browser/tabbed_panel.rs:133— crates/codemark-tui/src/browser/tabbed_panel.rs:133-146 | crates/codemark-tui/src/browser/tabbed_panel.rs:176-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-tui/src/browser/tabbed_panel.rs:133` 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) crates/codemark-core/src/storage/bookmark_repo.rs:404— crates/codemark-core/src/storage/bookmark_repo.rs:404-417 | crates/codemark-core/src/storage/bookmark_repo.rs:598-611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-core/src/storage/bookmark_repo.rs:404` 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) crates/codemark-tui/src/browser/mod.rs:2539— crates/codemark-tui/src/browser/mod.rs:2539-2552 | crates/codemark-tui/src/browser/mod.rs:2626-2639 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-tui/src/browser/mod.rs:2539` 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 × 3) crates/codemark-cli/src/cli/handlers/bookmark.rs:278— crates/codemark-cli/src/cli/handlers/bookmark.rs:278-288 | crates/codemark-cli/src/cli/handlers/bookmark.rs:536-546 | crates/codemark-cli/src/cli/handlers/bookmark.rs:796-806 — 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 `crates/codemark-cli/src/cli/handlers/bookmark.rs:278` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) crates/codetours-server/src/handlers/tours/create.rs:106— crates/codetours-server/src/handlers/tours/create.rs:106-116 | crates/codetours-server/src/handlers/tours/create.rs:135-146 | crates/codetours-server/src/handlers/tours/create.rs:430-440 — 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 `crates/codetours-server/src/handlers/tours/create.rs:106` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 3) crates/codetours-server/src/handlers/tours/create.rs:281— crates/codetours-server/src/handlers/tours/create.rs:281-291 | crates/codetours-server/src/handlers/tours/create.rs:700-710 | crates/codetours-server/src/handlers/tours/create.rs:713-723 — 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 `crates/codetours-server/src/handlers/tours/create.rs:281` it begins part-way through the construct above it, so those 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) crates/codemark-cli/src/cli/handlers/collection.rs:98— crates/codemark-cli/src/cli/handlers/collection.rs:98-106 | crates/codemark-cli/src/cli/handlers/collection.rs:228-236 | crates/codemark-cli/src/cli/handlers/collection.rs:869-877 — 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 `crates/codemark-cli/src/cli/handlers/collection.rs:98` it does not close everything it opens, so those 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 `args` to `&CollectionCreateArgs` in one and `&CollectionAddArgs` 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, `crates/codemark-cli/src/cli/handlers/collection.rs:97` calls `now_iso` and `crates/codemark-cli/src/cli/handlers/collection.rs:868` 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 (9 lines × 3) crates/codemark-tui/src/browser/right_pane.rs:1883— crates/codemark-tui/src/browser/right_pane.rs:1883-1891 | crates/codemark-tui/src/browser/right_pane.rs:1959-1967 | crates/codemark-tui/src/browser/tabbed_panel.rs:915-923 — 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/codemark-tui/src/browser/right_pane.rs:1883` it begins part-way through the construct above it, so those exact lines 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) crates/codemark-tui/src/component/code_preview.rs:639— crates/codemark-tui/src/component/code_preview.rs:639-647 | crates/codemark-tui/src/component/markdown_panel.rs:576-584 | crates/codemark-tui/src/component/panel/mod.rs:885-893 — 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 `crates/codemark-tui/src/component/code_preview.rs:639` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) crates/codemark-core/src/storage/bookmark_repo.rs:732— crates/codemark-core/src/storage/bookmark_repo.rs:732-738 | crates/codetours-server/src/storage/repos/annotation.rs:27-32 — 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 `crates/codemark-core/src/storage/bookmark_repo.rs:732` 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 lines × 2) crates/codemark-core/src/storage/db.rs:184— crates/codemark-core/src/storage/db.rs:184-189 | crates/codemark-core/src/storage/db.rs:262-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 `crates/codemark-core/src/storage/db.rs:184` it does not close everything it opens, so those exact lines 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) crates/codemark-tui/src/browser/right_pane.rs:1635— crates/codemark-tui/src/browser/right_pane.rs:1635-1640 | crates/codemark-tui/src/browser/right_pane.rs:1690-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.
Panel::handle_event (cyclomatic 26) crates/codemark-tui/src/component/panel/mod.rs:838— Panel::handle_event has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Panel::render (cyclomatic 18) crates/codemark-tui/src/component/panel/mod.rs:689— Panel::render 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.
LanguagesTab::render (cyclomatic 18) crates/codemark-tui/src/languages_tab.rs:423— LanguagesTab::render 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.
LanguagesTab::handle_key (cyclomatic 16) crates/codemark-tui/src/languages_tab.rs:356— LanguagesTab::handle_key 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.
TabbedPanel::handle_event (cognitive 32) crates/codemark-tui/src/browser/tabbed_panel.rs:986— TabbedPanel::handle_event has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 3 (7 pts), boolean chains 6 (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.
TabbedPanel::build_tags_branches_items (cognitive 19) crates/codemark-tui/src/browser/tabbed_panel.rs:453— TabbedPanel::build_tags_branches_items has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 6, boolean chains 2, loops 1 (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.
LanguagesTab::render (cognitive 25) crates/codemark-tui/src/languages_tab.rs:423— LanguagesTab::render has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 4 (8 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.
LanguagesTab::handle_key (cognitive 20) crates/codemark-tui/src/languages_tab.rs:356— LanguagesTab::handle_key has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyFields: BrowserLayout crates/codemark-tui/src/browser/mod.rs:138— TooManyFields — 41 stored fields beside 140 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: RightPane crates/codemark-tui/src/browser/right_pane.rs:76— TooManyFields — 34 stored fields beside 71 methods. The bar is 30 stored fields; this is 4 over it, 1.13× 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 (8 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (8 members, 50+ identical tokens) crates/codemark-cli/src/cli/handlers.rs:547— crates/codemark-cli/src/cli/handlers.rs:547-586 | crates/codemark-cli/src/cli/handlers.rs:613-641 | crates/codemark-cli/src/cli/handlers/maintenance.rs:358-438 | crates/codemark-cli/src/cli/handlers/search.rs:173-357 | crates/codemark-cli/src/cli/handlers/search.rs:457-539 | crates/codemark-cli/src/cli/handlers/search.rs:640-716 | crates/codemark-tui/src/browser/mod.rs:1001-1105 | crates/codemark-tui/src/browser/mod.rs:1126-1252 — 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) crates/codetours-server/src/storage/repos/annotation.rs:14— crates/codetours-server/src/storage/repos/annotation.rs:14-40 | crates/codetours-server/src/storage/repos/bookmark.rs:37-58 | crates/codetours-server/src/storage/repos/collection.rs:34-49 | crates/codetours-server/src/storage/repos/collection.rs:51-70 | crates/codetours-server/src/storage/repos/collection_bookmark.rs:24-47 | crates/codetours-server/src/storage/repos/comment.rs:14-43 | crates/codetours-server/src/storage/repos/resolution.rs:38-56 | crates/codetours-server/src/storage/repos/tag.rs:14-37 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/codemark-cli/src/cli/handlers/collection.rs:142— crates/codemark-cli/src/cli/handlers/collection.rs:142-167 | crates/codemark-cli/src/cli/handlers/collection.rs:283-299 | crates/codemark-cli/src/cli/handlers/collection.rs:306-325 | crates/codemark-cli/src/cli/handlers/collection.rs:539-579 | crates/codemark-cli/src/cli/handlers/collection.rs:586-606 — 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) crates/codemark-tui/src/browser/tabbed_panel.rs:579— crates/codemark-tui/src/browser/tabbed_panel.rs:579-626 | crates/codemark-tui/src/browser/tabbed_panel.rs:629-653 | crates/codemark-tui/src/browser/tabbed_panel.rs:676-727 | crates/codemark-tui/src/browser/tabbed_panel.rs:730-757 | crates/codemark-tui/src/browser/tabbed_panel.rs:760-777 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Edited copy of a member (83 corresponding lines) · ×2
Edited copy of a member (83 corresponding lines) crates/codetours-server/src/github.rs:140— crates/codetours-server/src/github.rs:140-222 | crates/codetours-server/src/github.rs:323-421 — 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.
Edited copy of a member (83 corresponding lines) crates/codetours-server/src/handlers/auth.rs:57— crates/codetours-server/src/handlers/auth.rs:57-142 | crates/codetours-server/src/handlers/auth.rs:224-306 — 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 (34 corresponding lines) · ×2
Edited copy of a member (34 corresponding lines) crates/codemark-core/src/git/mod.rs:23— crates/codemark-core/src/git/mod.rs:23-56 | crates/codemark-core/src/git/mod.rs:58-94 — 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) crates/codemark-core/src/storage/pack/reader.rs:146— crates/codemark-core/src/storage/pack/reader.rs:146-179 | crates/codetours-server/src/storage/repos/bookmark.rs:75-129 — 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 (17 corresponding lines) · ×2
Edited copy of a member (17 corresponding lines) crates/codemark-core/src/git/context.rs:32— crates/codemark-core/src/git/context.rs:32-48 | crates/codemark-core/src/git/context.rs:51-67 — 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) crates/codemark-tui/src/layout/mod.rs:212— crates/codemark-tui/src/layout/mod.rs:212-228 | crates/codemark-tui/src/layout/mod.rs:324-345 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×2
Edited copy of a member (21 corresponding lines) crates/codemark-core/src/storage/db.rs:349— crates/codemark-core/src/storage/db.rs:349-369 | crates/codemark-core/src/storage/db.rs:375-398 — 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) crates/codemark-cli/src/cli/handlers.rs:908— crates/codemark-cli/src/cli/handlers.rs:908-928 | crates/codemark-cli/src/cli/handlers.rs:937-960 — 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 (14 corresponding lines) · ×2
Edited copy of a member (14 corresponding lines) crates/codemark-core/src/storage/db.rs:404— crates/codemark-core/src/storage/db.rs:404-419 | crates/codetours-server/src/storage/registry.rs:148-161 — 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/codemark-core/src/query/generator.rs:156— crates/codemark-core/src/query/generator.rs:156-169 | crates/codemark-core/src/query/generator.rs:179-192 — 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) · ×2
Edited copy of a member (10 corresponding lines) crates/codemark-core/src/config.rs:692— crates/codemark-core/src/config.rs:692-701 | crates/codemark-core/src/config.rs:734-747 — 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) crates/codetours-server/src/storage/registry.rs:274— crates/codetours-server/src/storage/registry.rs:274-283 | crates/codetours-server/src/storage/registry.rs:329-338 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×2
Edited copy of a member (8 corresponding lines) crates/codemark-core/src/grammar/registry_source.rs:595— crates/codemark-core/src/grammar/registry_source.rs:595-602 | crates/codemark-core/src/templates.rs:706-716 — 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) crates/codemark-core/src/storage/bookmark_repo.rs:674— crates/codemark-core/src/storage/bookmark_repo.rs:674-681 | crates/codemark-core/src/storage/collection_repo.rs:287-297 — 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 (22 lines × 2) crates/codemark-cli/src/cli/handlers/auth_resolve.rs:101— crates/codemark-cli/src/cli/handlers/auth_resolve.rs:101-122 | crates/codemark-core/src/sync.rs:85-106 — 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 (22 lines × 2) crates/codemark-core/src/storage/collection_repo.rs:488— crates/codemark-core/src/storage/collection_repo.rs:488-509 | crates/codetours-server/src/storage/repos/collection.rs:99-120 — before extracting anything, compare `crates/codemark-core/src/storage/collection_repo.rs` and `crates/codetours-server/src/storage/repos/collection.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. 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 (18 lines × 2) crates/codemark-cli/src/cli/handlers/collection.rs:231— crates/codemark-cli/src/cli/handlers/collection.rs:231-248 | crates/codemark-cli/src/cli/handlers/collection.rs:872-889 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-cli/src/cli/handlers/collection.rs:231` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/codemark-cli/src/cli/handlers/collection.rs:227` calls `now_iso` and `crates/codemark-cli/src/cli/handlers/collection.rs:868` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2) crates/codemark-cli/src/cli/output.rs:516— crates/codemark-cli/src/cli/output.rs:516-533 | crates/codemark-cli/src/cli/output.rs:563-580 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-cli/src/cli/output.rs:516` 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) crates/codemark-cli/src/cli/handlers.rs:740— crates/codemark-cli/src/cli/handlers.rs:740-754 | crates/codemark-cli/src/cli/handlers.rs:778-792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-cli/src/cli/handlers.rs:740` it begins part-way through the construct above it, so those 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 (15 lines × 2) crates/codemark-cli/src/cli/handlers/collection.rs:212— crates/codemark-cli/src/cli/handlers/collection.rs:212-226 | crates/codemark-cli/src/cli/handlers/collection.rs:854-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 `crates/codemark-cli/src/cli/handlers/collection.rs:212` it begins part-way through the construct above it, so those 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 `args` to `&CollectionAddArgs` in one and `&CollectionAnnotateArgs` 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, `crates/codemark-cli/src/cli/handlers/collection.rs:227` calls `now_iso` and `crates/codemark-cli/src/cli/handlers/collection.rs:869` 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–14 lines × 2) crates/codemark-tui/src/component/panel/mod.rs:399— crates/codemark-tui/src/component/panel/mod.rs:399-412 | crates/codemark-tui/src/component/panel/mod.rs:461-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-tui/src/component/panel/mod.rs:399` it does not close everything it opens, so those exact lines 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) crates/codetours-server/src/github.rs:147— crates/codetours-server/src/github.rs:147-160 | crates/codetours-server/src/github.rs:330-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codetours-server/src/github.rs:147` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/codetours-server/src/github.rs:343` calls `clone` and `crates/codetours-server/src/github.rs:160` 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–12 lines × 2) crates/codemark-tui/src/browser/right_pane.rs:1061— crates/codemark-tui/src/browser/right_pane.rs:1061-1072 | crates/codemark-tui/src/browser/right_pane.rs:1506-1516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-tui/src/browser/right_pane.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 (11–12 lines × 2) crates/codetours-server/src/handlers/auth.rs:90— crates/codetours-server/src/handlers/auth.rs:90-101 | crates/codetours-server/src/handlers/auth.rs:266-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 `crates/codetours-server/src/handlers/auth.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 after the matched lines, `crates/codetours-server/src/handlers/auth.rs:103` calls `clone` and `crates/codetours-server/src/handlers/auth.rs:279` 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) crates/codemark-tui/src/component/code_preview.rs:806— crates/codemark-tui/src/component/code_preview.rs:806-812 | crates/codemark-tui/src/component/code_preview.rs:1403-1410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) crates/codemark-tui/src/component/panel/mod.rs:590— crates/codemark-tui/src/component/panel/mod.rs:590-597 | crates/codemark-tui/src/component/panel/mod.rs:604-610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-tui/src/component/panel/mod.rs:590` it does not close everything it opens, so those exact lines 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) crates/codemark-cli/src/cli/handlers/bookmark.rs:159— crates/codemark-cli/src/cli/handlers/bookmark.rs:159-165 | crates/codemark-cli/src/cli/handlers/bookmark.rs:420-426 | crates/codemark-cli/src/cli/handlers/bookmark.rs:682-688 | crates/codemark-cli/src/cli/handlers/bookmark.rs:1158-1164 — 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 `crates/codemark-cli/src/cli/handlers/bookmark.rs:159` it does not close everything it opens, so those 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 `args` to `&AddArgsOriginal` in one and `&AddFromSnippetArgs` 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 lines × 4) crates/codetours-server/src/storage/repos/annotation.rs:45— crates/codetours-server/src/storage/repos/annotation.rs:45-51 | crates/codetours-server/src/storage/repos/collection.rs:75-81 | crates/codetours-server/src/storage/repos/comment.rs:74-80 | crates/codetours-server/src/storage/repos/tag.rs:42-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codetours-server/src/storage/repos/annotation.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 (4–5 lines × 3) crates/codemark-cli/src/cli/handlers.rs:1460— crates/codemark-cli/src/cli/handlers.rs:1460-1464 | crates/codemark-cli/src/cli/handlers/bookmark.rs:938-941 | crates/codemark-core/src/engine/snapshot.rs:91-95 — 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 (4–5 lines × 3) crates/codemark-core/src/storage/collection_repo.rs:118— crates/codemark-core/src/storage/collection_repo.rs:118-121 | crates/codemark-core/src/storage/collection_repo.rs:488-492 | crates/codetours-server/src/storage/repos/collection.rs:99-103 — before extracting anything, compare `crates/codemark-core/src/storage/collection_repo.rs` and `crates/codetours-server/src/storage/repos/collection.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. 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/codemark-core/src/storage/collection_repo.rs:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
codemark_tui::entry::run_app (cyclomatic 82) crates/codemark-tui/src/entry.rs:164— codemark_tui::entry::run_app has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MarkdownPanel::parse_to_text (cyclomatic 67) crates/codemark-tui/src/component/markdown_panel.rs:133— MarkdownPanel::parse_to_text 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.
Config::merge (cyclomatic 28) crates/codemark-core/src/config.rs:751— Config::merge has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SettingsOverlay::handle_key (cyclomatic 27) crates/codemark-tui/src/settings.rs:306— SettingsOverlay::handle_key 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.
RightPane::route_event (cyclomatic 26) crates/codemark-tui/src/browser/right_pane.rs:2003— RightPane::route_event has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SearchBar::handle_event (cyclomatic 24) crates/codemark-tui/src/browser/search.rs:300— SearchBar::handle_event 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.
TabbedPanel::handle_event (cyclomatic 21) crates/codemark-tui/src/browser/tabbed_panel.rs:986— TabbedPanel::handle_event 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.
AppState::handle_event (cyclomatic 21) crates/codemark-tui/src/state.rs:248— AppState::handle_event 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.
PanelItem::to_line (cyclomatic 20) crates/codemark-tui/src/component/panel/item.rs:303— PanelItem::to_line has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Database::list_bookmarks (cyclomatic 17) crates/codemark-core/src/storage/bookmark_repo.rs:325— Database::list_bookmarks 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.
MarkdownPanel::parse_to_text (cognitive 123) crates/codemark-tui/src/component/markdown_panel.rs:133— MarkdownPanel::parse_to_text has cognitive complexity 123 (threshold 15). Drivers by points: if/else 31 (100 pts), match/switch 4 (12 pts), boolean chains 9, loops 2 (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.
AppState::handle_event (cognitive 47) crates/codemark-tui/src/state.rs:248— AppState::handle_event has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (40 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 27). 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.
SettingsOverlay::handle_key (cognitive 40) crates/codemark-tui/src/settings.rs:306— SettingsOverlay::handle_key has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (37 pts), boolean chains 2, match/switch 1 (nesting depth added 19). 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.
SearchBar::handle_event (cognitive 34) crates/codemark-tui/src/browser/search.rs:300— SearchBar::handle_event has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (29 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Config::merge (cognitive 31) crates/codemark-core/src/config.rs:751— Config::merge has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24 (27 pts), loops 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Workspace::open_all (cognitive 31) crates/codemark-core/src/storage/workspace.rs:153— Workspace::open_all has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LanguageRegistry::discover_in (cognitive 30) crates/codemark-core/src/parser/registry.rs:75— LanguageRegistry::discover_in has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PanelItem::to_line (cognitive 25) crates/codemark-tui/src/component/panel/item.rs:303— PanelItem::to_line has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (17 pts), match/switch 2 (5 pts), boolean chains 3 (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.
LayoutManager::split_area (cognitive 21) crates/codemark-tui/src/layout/mod.rs:165— LayoutManager::split_area has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Database::list_bookmarks (cognitive 19) crates/codemark-core/src/storage/bookmark_repo.rs:325— Database::list_bookmarks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, loops 3 (5 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
App::run (cognitive 18) crates/codemark-tui/src/app.rs:122— App::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pager::render (cognitive 18) crates/codemark-tui/src/component/mod.rs:194— Pager::render has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FocusManager::remove (cognitive 17) crates/codemark-tui/src/state.rs:472— FocusManager::remove has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (17 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AuthContext::from_request_parts (cognitive 17) crates/codetours-server/src/auth/extractor.rs:119— AuthContext::from_request_parts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (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.
StartupOptions::parse (cognitive 16) crates/codemark-tui/src/startup.rs:101— StartupOptions::parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), match/switch 3 (7 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.
Near-duplicate member pair (68 shared lines) crates/codemark-cli/src/cli/handlers/search.rs:23— crates/codemark-cli/src/cli/handlers/search.rs:23-164 | crates/codemark-cli/src/cli/handlers/search.rs:173-357 — 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 (27 shared lines) crates/codemark-tui/src/browser/mod.rs:1459— crates/codemark-tui/src/browser/mod.rs:1459-1562 | crates/codemark-tui/src/browser/mod.rs:1645-1732 — These two members are variants of one another: 27 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/codemark-cli/src/cli/handlers/bookmark.rs:42— crates/codemark-cli/src/cli/handlers/bookmark.rs:42-300 | crates/codemark-cli/src/cli/handlers/bookmark.rs:307-556 | crates/codemark-cli/src/cli/handlers/bookmark.rs:563-817 | crates/codemark-cli/src/cli/handlers/bookmark.rs:1133-1304 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (68 corresponding lines) · ×1
Edited copy of a member (68 corresponding lines) crates/codemark-tui/src/browser/right_pane.rs:743— crates/codemark-tui/src/browser/right_pane.rs:743-810 | crates/codemark-tui/src/browser/right_pane.rs:1433-1522 — 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 (36 corresponding lines) · ×1
Edited copy of a member (36 corresponding lines) crates/codemark-cli/src/cli/output.rs:385— crates/codemark-cli/src/cli/output.rs:385-420 | crates/codemark-cli/src/cli/output.rs:441-479 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×1
Edited copy of a member (38 corresponding lines) crates/codemark-core/src/grammar/mod.rs:103— crates/codemark-core/src/grammar/mod.rs:103-140 | crates/codemark-core/src/grammar/mod.rs:174-222 — 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 copy of a member (49 corresponding lines) · ×1
Edited copy of a member (49 corresponding lines) crates/codemark-tui/src/browser/mod.rs:84— crates/codemark-tui/src/browser/mod.rs:84-132 | crates/codemark-tui/src/component/panel/path.rs:9-69 — 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 (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) crates/codemark-core/src/grammar/registry_source.rs:656— crates/codemark-core/src/grammar/registry_source.rs:656-683 | crates/codemark-core/src/grammar/source.rs:113-152 — 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) · ×1
Edited copy of a member (27 corresponding lines) crates/codemark-cli/src/cli/output.rs:830— crates/codemark-cli/src/cli/output.rs:830-859 | crates/codemark-core/src/templates.rs:527-553 — 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 (30 corresponding lines) · ×1
Edited copy of a member (30 corresponding lines) crates/codemark-tui/src/browser/tabbed_panel.rs:113— crates/codemark-tui/src/browser/tabbed_panel.rs:113-146 | crates/codemark-tui/src/browser/tabbed_panel.rs:160-189 — 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 (32 corresponding lines) · ×1
Edited copy of a member (32 corresponding lines) crates/codemark-core/src/storage/semantic_repo.rs:114— crates/codemark-core/src/storage/semantic_repo.rs:114-145 | crates/codemark-core/src/storage/semantic_repo.rs:316-348 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) crates/codemark-core/src/storage/bookmark_repo.rs:231— crates/codemark-core/src/storage/bookmark_repo.rs:231-258 | crates/codemark-core/src/storage/collection_repo.rs:81-103 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) crates/codetours-server/src/storage/repos/bookmark.rs:14— crates/codetours-server/src/storage/repos/bookmark.rs:14-35 | crates/codetours-server/src/storage/repos/collection.rs:14-32 — 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 (22 corresponding lines) · ×1
Edited copy of a member (22 corresponding lines) crates/codemark-core/src/storage/bookmark_repo.rs:461— crates/codemark-core/src/storage/bookmark_repo.rs:461-482 | crates/codemark-core/src/storage/registry.rs:686-710 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×1
Edited copy of a member (13 corresponding lines) crates/codemark-tui/src/component/panel/mod.rs:365— crates/codemark-tui/src/component/panel/mod.rs:365-377 | crates/codemark-tui/src/component/panel/mod.rs:381-395 — 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 (18 corresponding lines) · ×1
Edited copy of a member (18 corresponding lines) crates/codemark-tui/src/component/panel/mod.rs:539— crates/codemark-tui/src/component/panel/mod.rs:539-557 | crates/codemark-tui/src/component/panel/mod.rs:561-578 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×1
Edited copy of a member (11 corresponding lines) crates/codemark-cli/src/cli/output.rs:803— crates/codemark-cli/src/cli/output.rs:803-813 | crates/codemark-cli/src/cli/output.rs:815-827 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) crates/codemark-core/src/templates.rs:567— crates/codemark-core/src/templates.rs:567-576 | crates/codemark-core/src/templates.rs:612-621 | crates/codemark-core/src/templates.rs:636-645 — 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 (6 members, 10+ corresponding lines) · ×1
Edited copies of one member (6 members, 10+ corresponding lines) crates/codetours-server/src/storage/repos/annotation.rs:42— crates/codetours-server/src/storage/repos/annotation.rs:42-51 | crates/codetours-server/src/storage/repos/collection.rs:72-81 | crates/codetours-server/src/storage/repos/collection.rs:83-95 | crates/codetours-server/src/storage/repos/collection_bookmark.rs:49-61 | crates/codetours-server/src/storage/repos/comment.rs:71-80 | crates/codetours-server/src/storage/repos/tag.rs:39-48 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×1
Edited copies of one member (3 members, 11+ corresponding lines) crates/codetours-server/src/github.rs:428— crates/codetours-server/src/github.rs:428-438 | crates/codetours-server/src/github.rs:444-454 | crates/codetours-server/src/github.rs:465-475 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×1
Edited copy of a member (12 corresponding lines) crates/codemark-core/src/storage/bookmark_repo.rs:166— crates/codemark-core/src/storage/bookmark_repo.rs:166-185 | crates/codemark-core/src/storage/bookmark_repo.rs:198-209 — 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 (6 corresponding lines) · ×1
Edited copy of a member (6 corresponding lines) crates/codemark-cli/src/cli/handlers.rs:968— crates/codemark-cli/src/cli/handlers.rs:968-973 | crates/codemark-cli/src/cli/handlers.rs:982-988 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 8+ corresponding lines) · ×1
Edited copies of one member (5 members, 8+ corresponding lines) crates/codemark-core/src/storage/collection_repo.rs:35— crates/codemark-core/src/storage/collection_repo.rs:35-45 | crates/codemark-core/src/storage/collection_repo.rs:68-78 | crates/codemark-core/src/storage/repo_repo.rs:44-53 | crates/codemark-core/src/storage/repo_repo.rs:57-64 | crates/codemark-core/src/storage/repo_repo.rs:68-77 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×1
Edited copies of one member (3 members, 8+ corresponding lines) crates/codemark-core/src/storage/collection_repo.rs:392— crates/codemark-core/src/storage/collection_repo.rs:392-404 | crates/codemark-core/src/storage/collection_repo.rs:462-469 | crates/codemark-core/src/storage/repo_repo.rs:80-88 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×1
Edited copy of a member (7 corresponding lines) crates/codemark-cli/src/cli/output.rs:210— crates/codemark-cli/src/cli/output.rs:210-216 | crates/codemark-cli/src/cli/output.rs:227-234 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) crates/codemark-core/src/storage/registry.rs:256— crates/codemark-core/src/storage/registry.rs:256-279 | crates/codemark-core/src/storage/registry.rs:462-494 — 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 (5 members, 10+ corresponding lines) · ×1
Edited copies of one member (5 members, 10+ corresponding lines) crates/codemark-core/src/storage/bookmark_repo.rs:684— crates/codemark-core/src/storage/bookmark_repo.rs:684-693 | crates/codemark-core/src/storage/collection_repo.rs:472-484 | crates/codemark-core/src/storage/pack/reader.rs:73-88 | crates/codemark-core/src/storage/pack/reader.rs:90-108 | crates/codemark-core/src/storage/registry.rs:670-679 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×1
Edited copy of a member (3 corresponding lines) crates/codemark-tui/src/browser/mod.rs:308— crates/codemark-tui/src/browser/mod.rs:308-310 | crates/codemark-tui/src/browser/right_pane.rs:1299-1301 — 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 (118 lines × 3) crates/codemark-cli/src/cli/handlers/bookmark.rs:94— crates/codemark-cli/src/cli/handlers/bookmark.rs:94-211 | crates/codemark-cli/src/cli/handlers/bookmark.rs:355-472 | crates/codemark-cli/src/cli/handlers/bookmark.rs:617-734 — 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 `crates/codemark-cli/src/cli/handlers/bookmark.rs:94` it begins part-way through the construct above it, so those 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 `args` to `&AddArgsOriginal` in one and `&AddFromSnippetArgs` 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, `crates/codemark-cli/src/cli/handlers/bookmark.rs:214` calls `load_config` and `crates/codemark-cli/src/cli/handlers/bookmark.rs:476` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (40–44 lines × 2) crates/codemark-tui/src/browser/mod.rs:1023— crates/codemark-tui/src/browser/mod.rs:1023-1066 | crates/codemark-tui/src/browser/mod.rs:1167-1206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-tui/src/browser/mod.rs:1023` it does not close everything it opens, so those exact lines 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–31 lines × 2) crates/codemark-cli/src/cli/handlers/search.rs:135— crates/codemark-cli/src/cli/handlers/search.rs:135-164 | crates/codemark-cli/src/cli/handlers/search.rs:327-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-cli/src/cli/handlers/search.rs:135` 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 (3–30 lines × 3) crates/codemark-cli/src/cli/handlers/search.rs:375— crates/codemark-cli/src/cli/handlers/search.rs:375-404 | crates/codemark-cli/src/cli/handlers/search.rs:411-440 | crates/codemark-cli/src/cli/handlers/search.rs:466-468 — 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 `crates/codemark-cli/src/cli/handlers/search.rs:375` it begins part-way through the construct above it, so those 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 lines × 2) crates/codemark-cli/src/cli/output.rs:834— crates/codemark-cli/src/cli/output.rs:834-859 | crates/codemark-core/src/templates.rs:528-553 — 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 (23–24 lines × 2) crates/codemark-tui/src/browser/right_pane.rs:1872— crates/codemark-tui/src/browser/right_pane.rs:1872-1894 | crates/codemark-tui/src/browser/right_pane.rs:1947-1970 — both copies are in the same file, so extract the 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 × 3) crates/codemark-cli/src/cli/handlers/bookmark.rs:224— crates/codemark-cli/src/cli/handlers/bookmark.rs:224-245 | crates/codemark-cli/src/cli/handlers/bookmark.rs:484-505 | crates/codemark-cli/src/cli/handlers/bookmark.rs:745-766 — 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 `crates/codemark-cli/src/cli/handlers/bookmark.rs:224` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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–22 lines × 2) crates/codetours-server/src/handlers/auth.rs:106— crates/codetours-server/src/handlers/auth.rs:106-127 | crates/codetours-server/src/handlers/auth.rs:279-297 — both copies are in the same file, so extract the 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, `crates/codetours-server/src/handlers/auth.rs:103` calls `clone` and `crates/codetours-server/src/handlers/auth.rs:277` 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 × 3) crates/codemark-cli/src/cli/handlers/bookmark.rs:253— crates/codemark-cli/src/cli/handlers/bookmark.rs:253-272 | crates/codemark-cli/src/cli/handlers/bookmark.rs:513-532 | crates/codemark-cli/src/cli/handlers/bookmark.rs:774-793 — 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 `crates/codemark-cli/src/cli/handlers/bookmark.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 (17–19 lines × 2) crates/codemark-cli/src/cli/output.rs:396— crates/codemark-cli/src/cli/output.rs:396-412 | crates/codemark-cli/src/cli/output.rs:453-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 `crates/codemark-cli/src/cli/output.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 (16–17 lines × 2) crates/codemark-cli/src/cli/handlers/comment.rs:173— crates/codemark-cli/src/cli/handlers/comment.rs:173-188 | crates/codemark-tui/src/browser/inline_threads.rs:123-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. 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–16 lines × 2) crates/codemark-cli/src/cli/handlers.rs:757— crates/codemark-cli/src/cli/handlers.rs:757-772 | crates/codemark-cli/src/cli/handlers.rs:781-792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-cli/src/cli/handlers.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. 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 (33–35 lines × 2) crates/codemark-tui/src/browser/right_pane.rs:745— crates/codemark-tui/src/browser/right_pane.rs:745-777 | crates/codemark-tui/src/browser/right_pane.rs:1449-1483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-tui/src/browser/right_pane.rs:745` it does not close everything it opens, so those exact lines 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) crates/codetours-server/src/github.rs:187— crates/codetours-server/src/github.rs:187-199 | crates/codetours-server/src/github.rs:366-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codetours-server/src/github.rs:366` it begins part-way through the construct above it, so those exact lines 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 × 3) crates/codemark-cli/src/cli/handlers.rs:553— crates/codemark-cli/src/cli/handlers.rs:553-567 | crates/codemark-cli/src/cli/handlers.rs:619-633 | crates/codemark-cli/src/cli/handlers/maintenance.rs:416-429 — before extracting anything, compare `crates/codemark-cli/src/cli/handlers.rs` and `crates/codemark-cli/src/cli/handlers/maintenance.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. 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) crates/codemark-cli/src/cli/handlers/search.rs:119— crates/codemark-cli/src/cli/handlers/search.rs:119-133 | crates/codemark-cli/src/cli/handlers/search.rs:312-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-cli/src/cli/handlers/search.rs:119` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12–14 lines × 2) crates/codemark-tui/src/layout/mod.rs:215— crates/codemark-tui/src/layout/mod.rs:215-228 | crates/codemark-tui/src/layout/mod.rs:334-345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/codemark-tui/src/layout/mod.rs:215` 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–13 lines × 5) crates/codemark-cli/src/cli/handlers/search.rs:182— crates/codemark-cli/src/cli/handlers/search.rs:182-194 | crates/codemark-cli/src/cli/handlers/search.rs:473-481 | crates/codemark-cli/src/cli/handlers/search.rs:651-663 | crates/codemark-tui/src/browser/mod.rs:1044-1052 | crates/codemark-tui/src/browser/mod.rs:1184-1192 — 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 `crates/codemark-cli/src/cli/handlers/search.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code 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) crates/codetours-server/src/handlers/tours/delete.rs:19— crates/codetours-server/src/handlers/tours/delete.rs:19-30 | crates/codetours-server/src/handlers/tours/get.rs:133-145 — 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 (20–21 lines × 2) crates/codemark-core/src/grammar/mod.rs:104— crates/codemark-core/src/grammar/mod.rs:104-124 | crates/codemark-core/src/grammar/mod.rs:184-203 — both copies are in the same file, so extract the 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–12 lines × 2) crates/codemark-tui/src/browser/comment_draft.rs:383— crates/codemark-tui/src/browser/comment_draft.rs:383-391 | crates/codemark-tui/src/ui/mod.rs:386-397 — 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–11 lines × 8) crates/codemark-cli/src/cli/handlers.rs:556— crates/codemark-cli/src/cli/handlers.rs:556-565 | crates/codemark-cli/src/cli/handlers.rs:622-631 | crates/codemark-cli/src/cli/handlers/maintenance.rs:418-428 | crates/codemark-cli/src/cli/handlers/search.rs:180-189 | crates/codemark-cli/src/cli/handlers/search.rs:471-478 | crates/codemark-cli/src/cli/handlers/search.rs:649-658 | crates/codemark-tui/src/browser/mod.rs:1042-1049 | crates/codemark-tui/src/browser/mod.rs:1182-1189 — before extracting anything, compare `crates/codemark-cli/src/cli/handlers.rs` and `crates/codemark-cli/src/cli/handlers/maintenance.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. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `&Config` in one and `&codemark_core::config::Config` 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, `crates/codemark-tui/src/browser/mod.rs:1049` calls `effective_threshold`, `get_models_dir` and `crates/codemark-cli/src/cli/handlers/maintenance.rs:428` 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–11 lines × 2) crates/codemark-tui/src/browser/right_pane.rs:1032— crates/codemark-tui/src/browser/right_pane.rs:1032-1040 | crates/codemark-tui/src/browser/right_pane.rs:1434-1444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–10 lines × 3) crates/codemark-core/src/storage/bookmark_repo.rs:699— crates/codemark-core/src/storage/bookmark_repo.rs:699-708 | crates/codemark-core/src/storage/pack/reader.rs:153-161 | crates/codetours-server/src/storage/repos/bookmark.rs:102-111 — 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 `crates/codemark-core/src/storage/bookmark_repo.rs:699` it does not close everything it opens, so those 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, `crates/codemark-core/src/storage/pack/reader.rs:150` calls `and_then`, `parse`, `ok` and `crates/codemark-core/src/storage/bookmark_repo.rs:698` 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) crates/codetours-server/src/handlers/tours/delete.rs:22— crates/codetours-server/src/handlers/tours/delete.rs:22-31 | crates/codetours-server/src/handlers/tours/get.rs:136-146 | crates/codetours-server/src/handlers/tours/list.rs:235-244 — 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 `crates/codetours-server/src/handlers/tours/delete.rs:22` it does not close everything it opens, so those exact lines 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) crates/codemark-tui/src/browser/tabbed_panel.rs:618— crates/codemark-tui/src/browser/tabbed_panel.rs:618-626 | crates/codemark-tui/src/browser/tabbed_panel.rs:645-653 | crates/codemark-tui/src/browser/tabbed_panel.rs:719-727 | crates/codemark-tui/src/browser/tabbed_panel.rs:749-757 | crates/codemark-tui/src/browser/tabbed_panel.rs:769-777 — 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 `crates/codemark-tui/src/browser/tabbed_panel.rs:618` 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–9 lines × 2) crates/codemark-tui/src/browser/right_pane.rs:1858— crates/codemark-tui/src/browser/right_pane.rs:1858-1865 | crates/codemark-tui/src/browser/right_pane.rs:1932-1940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/codemark-tui/src/browser/right_pane.rs:1858` it does not close everything it opens, so those exact lines 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) crates/codemark-cli/src/cli/handlers.rs:1412— crates/codemark-cli/src/cli/handlers.rs:1412-1419 | crates/codemark-cli/src/cli/handlers/maintenance.rs:234-241 | crates/codemark-cli/src/cli/handlers/maintenance.rs:265-272 | crates/codemark-core/src/engine/heal.rs:161-168 — before extracting anything, compare `crates/codemark-cli/src/cli/handlers.rs` and `crates/codemark-cli/src/cli/handlers/maintenance.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. 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) crates/codemark-cli/src/cli/handlers.rs:390— crates/codemark-cli/src/cli/handlers.rs:390-397 | crates/codemark-cli/src/cli/handlers.rs:412-419 | crates/codemark-cli/src/cli/handlers.rs:432-439 — 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 `crates/codemark-cli/src/cli/handlers.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/codemark-cli/src/cli/handlers.rs:410` calls `clone` and `crates/codemark-cli/src/cli/handlers.rs:388` 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 (4–8 lines × 3) crates/codemark-cli/src/cli/handlers/bookmark.rs:44— crates/codemark-cli/src/cli/handlers/bookmark.rs:44-53 | crates/codemark-cli/src/cli/handlers/bookmark.rs:319-322 | crates/codemark-cli/src/cli/handlers/bookmark.rs:565-572 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&AddArgsOriginal` in one and `&AddFromQueryArgs` 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 (17–19 lines × 3) crates/codemark-tui/src/browser/right_pane.rs:756— crates/codemark-tui/src/browser/right_pane.rs:756-773 | crates/codemark-tui/src/browser/right_pane.rs:1115-1131 | crates/codemark-tui/src/browser/right_pane.rs:1460-1478 — 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, `crates/codemark-tui/src/browser/right_pane.rs:753` calls `list_resolutions`, `unwrap_or_default` and `crates/codemark-tui/src/browser/right_pane.rs:1113` 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 × 8) crates/codetours-server/src/storage/repos/annotation.rs:35— crates/codetours-server/src/storage/repos/annotation.rs:35-40 | crates/codetours-server/src/storage/repos/bookmark.rs:53-58 | crates/codetours-server/src/storage/repos/collection.rs:44-49 | crates/codetours-server/src/storage/repos/collection.rs:65-70 | crates/codetours-server/src/storage/repos/collection_bookmark.rs:42-47 | crates/codetours-server/src/storage/repos/comment.rs:38-43 | crates/codetours-server/src/storage/repos/resolution.rs:51-56 | crates/codetours-server/src/storage/repos/tag.rs:32-37 — there are 8 copies across 7 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 `crates/codetours-server/src/storage/repos/annotation.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 (6 lines × 5) crates/codemark-cli/src/cli/handlers/collection.rs:145— crates/codemark-cli/src/cli/handlers/collection.rs:145-150 | crates/codemark-cli/src/cli/handlers/collection.rs:286-291 | crates/codemark-cli/src/cli/handlers/collection.rs:309-314 | crates/codemark-cli/src/cli/handlers/collection.rs:542-547 | crates/codemark-cli/src/cli/handlers/collection.rs:589-594 — 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 `args` to `&CollectionDeleteArgs` in one and `&CollectionReorderArgs` 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 × 3) crates/codemark-core/src/storage/collection_repo.rs:126— crates/codemark-core/src/storage/collection_repo.rs:126-132 | crates/codemark-core/src/storage/collection_repo.rs:494-499 | crates/codetours-server/src/storage/repos/collection.rs:105-110 — before extracting anything, compare `crates/codemark-core/src/storage/collection_repo.rs` and `crates/codetours-server/src/storage/repos/collection.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. 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/codemark-core/src/storage/collection_repo.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 (5 lines × 3) crates/codemark-cli/src/cli/handlers.rs:1465— crates/codemark-cli/src/cli/handlers.rs:1465-1469 | crates/codemark-cli/src/cli/handlers/bookmark.rs:942-946 | crates/codemark-core/src/engine/heal.rs:211-215 — 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 (11 lines × 4) crates/codetours-server/src/handlers/tours/create.rs:106— crates/codetours-server/src/handlers/tours/create.rs:106-116 | crates/codetours-server/src/handlers/tours/create.rs:135-145 | crates/codetours-server/src/handlers/tours/create.rs:150-160 | crates/codetours-server/src/handlers/tours/create.rs:430-440 — 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 `crates/codetours-server/src/handlers/tours/create.rs:106` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Off the main sequence: codemark-core — codemark-core: abstractness 0.04, instability 0.00, distance 0.96 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Low cohesion: PanelItem (LCOM4 4) crates/codemark-tui/src/component/panel/item.rs:16— PanelItem'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.
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.
Silent fallback default on Err crates/codemark-cli/src/cli/handlers.rs:1159— `parse_hunk` turns every `Err` into `1` — 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 crates/codemark-core/src/engine/health.rs:33— `days_since_resolution` 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 crates/codemark-core/src/templates.rs:720— `read_template_stamps` turns every `Err` into `HashMap::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/codemark-tui/src/browser/tabbed_panel.rs:391— `build_repo_items` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/codemark-tui/src/browser/tabbed_panel.rs:411— `build_owner_items` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×2
Projects may be oversized for their cohesion crates/codemark-core/Cargo.toml:1— `crates/codemark-core` (29225 LoC, 170 module-visible types across 9 directories) overshoots its size bounds. 2 of 5 build unit(s) (Cargo) overshoot their size bounds, lowering Project Cohesion to 2.2/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion crates/codemark-cli/Cargo.toml:1— `crates/codemark-cli` (11146 LoC, 126 module-visible types across 3 directories) overshoots its size bounds. 2 of 5 build unit(s) (Cargo) overshoot their size bounds, lowering Project Cohesion to 2.2/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Duplicated predicate crates/codemark-tui/src/browser/mod.rs:2743— `is_published || c.imported_from_url.is_some()` appears character-identically in 2 files — crates/codemark-tui/src/browser/mod.rs, crates/codemark-tui/src/browser/tabbed_panel.rs. 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 crates/codemark-cli/src/cli/handlers/transfer.rs:111— `on_unmatched == OnUnmatched::Fail && plan.has_unmatched()` appears character-identically in 2 files — crates/codemark-cli/src/cli/handlers/transfer.rs, crates/codemark-core/src/engine/transfer.rs. 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.
No ADRs found fly.toml:1— No ADRs found. The recognised ADR directories in this tree were read — `proposals` — and none of their files is a decision record (a README, index or template page does not count). What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `fly.toml` makes this repository a deployable product (line 1).
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Logging is not universal — Only 4/5 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.
No dependency-update automation docs/package.json:10— `docs/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
Nullable reference types not enabled everywhere — 0/1 NRT-eligible project(s) enable <Nullable>enable</Nullable> (projects targeting a pre-C#-8 framework are excluded — NRTs aren't available there). NRTs catch a whole class of null-deref bugs at compile time.
Subsumed condition operand crates/codemark-cli/src/cli/handlers.rs:2257— `url.contains("git@github.com:")` can never decide this `||` — every value satisfying `url.contains("git@github.com:")` also satisfies `url.contains("git@")`, 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.
Outdated: anyhow — `anyhow` is locked at 1.0.102 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/codemark-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
Outdated: chrono — `chrono` is locked at 0.4.44 but 0.4.45 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in crates/codemark-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p chrono` and commit the updated REDACTED.
Outdated: clap — `clap` is locked at 4.6.0 but 4.6.7 is the current stable release on crates.io, and it already satisfies the `"4"` requirement declared in crates/codemark-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
Outdated: clap_complete — `clap_complete` is locked at 4.6.0 but 4.6.11 is the current stable release on crates.io, and it already satisfies the `"4"` requirement declared in crates/codemark-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap_complete` and commit the updated REDACTED.
Outdated: futures — `futures` is locked at 0.3.32 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in crates/codemark-tui/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures` and commit the updated REDACTED.
Outdated: futures-util — `futures-util` is locked at 0.3.32 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in crates/codetours-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures-util` and commit the updated REDACTED.
Outdated: handlebars — `handlebars` is locked at 6.4.0 but 6.4.4 is the current stable release on crates.io, and it already satisfies the `"6"` requirement declared in crates/codemark-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p handlebars` and commit the updated REDACTED.
Outdated: libc — `libc` is locked at 0.2.184 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in crates/codemark-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
Outdated: open — `open` is locked at 5.3.5 but 5.4.5 is the current stable release on crates.io, and it already satisfies the `"5.3.5"` requirement declared in crates/codemark-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p open` and commit the updated REDACTED.
Outdated: pulldown-cmark — `pulldown-cmark` is locked at 0.13.4 but 0.13.6 is the current stable release on crates.io, and it already satisfies the `"0.13"` requirement declared in crates/codemark-tui/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p pulldown-cmark` and commit the updated REDACTED.
Outdated: regex — `regex` is locked at 1.12.3 but 1.13.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/codemark-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p regex` and commit the updated REDACTED.
Outdated: serde — `serde` is locked at 1.0.228 but 1.0.229 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/codemark-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde` and commit the updated REDACTED.
Outdated: serde_json — `serde_json` is locked at 1.0.149 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/codemark-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
Outdated: thiserror — `thiserror` is locked at 2.0.18 but 2.0.21 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in crates/codemark-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p thiserror` and commit the updated REDACTED.
Outdated: tokio — `tokio` is locked at 1.51.0 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/codemark-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
Outdated: tokio-util — `tokio-util` is locked at 0.7.18 but 0.7.20 is the current stable release on crates.io, and it already satisfies the `"0.7"` requirement declared in crates/codemark-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio-util` and commit the updated REDACTED.
Outdated: unicode-segmentation — `unicode-segmentation` is locked at 1.13.2 but 1.13.3 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/codemark-tui/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p unicode-segmentation` and commit the updated REDACTED.
Outdated: unicode-width — `unicode-width` is locked at 0.2.0 but 0.2.3 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in crates/codemark-tui/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p unicode-width` and commit the updated REDACTED.
Outdated: uuid — `uuid` is locked at 1.23.0 but 1.29.2 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/codemark-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p uuid` and commit the updated REDACTED.
Outdated: webbrowser — `webbrowser` is locked at 1.2.1 but 1.2.7 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/codemark-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p webbrowser` and commit the updated REDACTED.
Outdated: zerocopy — `zerocopy` is locked at 0.8.48 but 0.8.63 is the current stable release on crates.io, and it already satisfies the `"0.8"` requirement declared in crates/codemark-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p zerocopy` and commit the updated REDACTED.
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.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1e671-ed07-713b-b6ad-da7640c7bdbe · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 43 · Warnings: 463 · Recommendations: 21 · Info: 21 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 16-11-2026 @ 22:19 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.