Public report of jj-vcs/jj, published 14 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, 14 November 2026, 05:10 UTC · Survey ID cd_482076ef797444e1b2f41296ffa6b297
jj-vcs/jj
Measured 14 November 2026, 05:05 UTC, at code version 4725494
CAI scoreStrong
CriticalWeakAdequateStrongExemplary
No change since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 145,156 lines of product code in 12 projects, tests not counted · Estimated rebuild effort: about 2.2 person-years · Weakest lens: Code Health, 54
Findings by how serious they are
4 critical993 serious56 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
14 November 2026, 05:05 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
49of 49 dimensions measured by tools.
1029of 1053 findings point to an exact file and line, so you can open each one in the code. The other 24 concern the repository as a whole, such as missing documentation.
49dimensions across 8 lenses, read from 145,156 lines of product code in 12 projects.
jj-vcs/jj meets our standard for a preview release. It scores 66 out of 100 and is rated Strong, and one of its four critical findings is a security problem in its code.
Code Health, at 54, is the weakest lens and counts most in the score. The best first step is turning on missing-value checks, worth about 8 points. Writing log messages as searchable templates comes next, worth about 4 points. Raising Code Health to 67 would lift the score to about 72.
One weakness in the code could be used by an attacker. Fixing the weaknesses the scanner points to would close this risk. Calling the work with await instead of starting a new runner would take care of the three second task runners started inside asynchronous code.
The product code is 145,156 lines, about €320,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 Code Health rose from 54 to 67, the lowest score rated Strong, the score would rise from 66 to about 72.
Code composition: what the lines of code are
Product code 55%Tests 45%
New since the last survey: 252 findings
These 252 critical or serious findings weren't in the previous survey, on 25 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · MethodTooLong: EvaluationContext.evaluate default-index/src/revset_engine.rs
God Classes · FileTooLong: src/git_backend.rs git-backend/src/git_backend.rs
God Classes · FileTooLong: src/revset_engine.rs default-index/src/revset_engine.rs
God Classes · ClassTooLong: GitBackend git-backend/src/git_backend.rs
God Classes · FileTooLong: src/conflicts.rs core/src/conflicts.rs
God Classes · FileTooLong: src/readonly.rs default-index/src/readonly.rs
God Classes · FunctionTooLong: jj_default_index::revset_engine::build_predicate_fn default-index/src/revset_engine.rs
God Classes · FileTooLong: src/composite.rs default-index/src/composite.rs
Code Duplication · Near-duplicate member pair (118 shared lines) cli/src/template_builder.rs
Code Duplication · Near-duplicate member pair (43 shared lines) cli/src/commands/bookmark/list.rs
Code Duplication · Near-duplicate member pair (30 shared lines) cli/src/commands/bookmark/track.rs
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) cli/src/template_builder.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) cli/src/commands/abandon.rs
Code Duplication · Edited copy of a member (88 corresponding lines) cli/src/commands/sign.rs
Code Duplication · Edited copy of a member (78 corresponding lines) cli/src/commands/bookmark/create.rs
Code Duplication · Edited copy of a member (44 corresponding lines) cli/src/commit_templater.rs
Code Duplication · Edited copy of a member (73 corresponding lines) cli/src/commit_templater.rs
Code Duplication · Edited copy of a member (62 corresponding lines) cli/src/commands/git/colocation.rs
Code Duplication · Edited copy of a member (24 corresponding lines) cli/src/template_builder.rs
Code Duplication · Edited copy of a member (54 corresponding lines) default-index/src/changed_path.rs
Code Duplication · Edited copy of a member (25 corresponding lines) dsl/src/fileset_parser.rs
Code Duplication · Edited copy of a member (41 corresponding lines) cli/src/commands/git/push.rs
Code Duplication · Edited copy of a member (28 corresponding lines) core/src/dag_walk.rs
Code Duplication · Edited copy of a member (38 corresponding lines) cli/src/commit_templater.rs
Code Duplication · Edited copy of a member (28 corresponding lines) cli/src/commands/bookmark/delete.rs
Code Duplication · Edited copy of a member (35 corresponding lines) lib/src/git.rs
Code Duplication · Edited copy of a member (31 corresponding lines) lib/src/local_working_copy.rs
Code Duplication · Edited copy of a member (31 corresponding lines) cli/src/text_util.rs
Code Duplication · Edited copy of a member (32 corresponding lines) cli/src/commit_templater.rs
Code Duplication · Edited copy of a member (31 corresponding lines) cli/src/commands/debug/init_simple.rs
Code Duplication · Edited copy of a member (28 corresponding lines) cli/src/commands/git/push.rs
Code Duplication · Edited copy of a member (26 corresponding lines) cli/src/commands/bookmark/mod.rs
Code Duplication · Edited copy of a member (29 corresponding lines) cli/src/commit_templater.rs
Code Duplication · Edited copy of a member (24 corresponding lines) core/src/dag_walk.rs
Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) default-index/src/revset_engine.rs
Code Duplication · Edited copy of a member (22 corresponding lines) lib/src/local_working_copy.rs
Code Duplication · Edited copy of a member (20 corresponding lines) cli/src/text_util.rs
Code Duplication · Edited copy of a member (21 corresponding lines) lib/src/git.rs
Code Duplication · Edited copy of a member (21 corresponding lines) cli/src/commands/git/fetch.rs
Code Duplication · Edited copy of a member (20 corresponding lines) cli/src/template_builder.rs
Code Duplication · Edited copy of a member (21 corresponding lines) lib/src/simple_op_store.rs
Code Duplication · Edited copy of a member (34 corresponding lines) lib/src/workspace.rs
Code Duplication · Edited copy of a member (27 corresponding lines) cli/src/commands/git/mod.rs
Code Duplication · Edited copy of a member (14 corresponding lines) lib/src/simple_op_store.rs
Code Duplication · Edited copy of a member (18 corresponding lines) lib/src/revset.rs
Code Duplication · Edited copy of a member (9 corresponding lines) core/src/merged_tree.rs
Code Duplication · Edited copy of a member (15 corresponding lines) core/src/merged_tree.rs
Code Duplication · Edited copy of a member (17 corresponding lines) core/src/merged_tree.rs
Code Duplication · Edited copy of a member (22 corresponding lines) cli/src/template_builder.rs
Code Duplication · Edited copy of a member (15 corresponding lines) cli/src/commit_templater.rs
Code Duplication · Edited copy of a member (9 corresponding lines) default-index/src/changed_path.rs
Code Duplication · Edited copy of a member (10 corresponding lines) core/src/tree_merge.rs
Code Duplication · Edited copy of a member (14 corresponding lines) lib/src/converge.rs
Code Duplication · Edited copy of a member (14 corresponding lines) core/src/view.rs
Code Duplication · Edited copy of a member (15 corresponding lines) core/src/fileset_backend.rs
Code Duplication · Edited copy of a member (13 corresponding lines) cli/src/commands/git/remote/remove.rs
Code Duplication · Edited copy of a member (13 corresponding lines) cli/src/commit_templater.rs
Code Duplication · Edited copy of a member (8 corresponding lines) cli/src/operation_templater.rs
Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) cli/src/complete.rs
Code Duplication · Edited copy of a member (13 corresponding lines) lib/src/gpg_signing.rs
Code Duplication · Edited copy of a member (16 corresponding lines) lib/src/eol.rs
Code Duplication · Edited copy of a member (24 corresponding lines) lib/src/id_prefix.rs
Code Duplication · Edited copy of a member (19 corresponding lines) core/src/view.rs
Code Duplication · Edited copy of a member (11 corresponding lines) cli/src/commands/bookmark/mod.rs
Code Duplication · Edited copy of a member (14 corresponding lines) lib/src/local_working_copy.rs
Code Duplication · Edited copy of a member (17 corresponding lines) cli/src/revset_util.rs
Code Duplication · Edited copies of one member (4 members, 15+ corresponding lines) cli/src/commands/bookmark/mod.rs
Code Duplication · Edited copy of a member (11 corresponding lines) default-index/src/mutable.rs
Code Duplication · Edited copy of a member (22 corresponding lines) lib/testutils/src/lib.rs
Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) dsl/src/fileset_parser.rs
Code Duplication · Edited copy of a member (13 corresponding lines) cli/src/diff_util.rs
Code Duplication · Edited copy of a member (13 corresponding lines) core/src/view.rs
Code Duplication · Edited copy of a member (11 corresponding lines) git-backend/src/git_backend.rs
Code Duplication · Edited copy of a member (14 corresponding lines) lib/src/gpg_signing.rs
Code Duplication · Edited copy of a member (9 corresponding lines) cli/src/cli_util.rs
Code Duplication · Edited copy of a member (8 corresponding lines) default-index/src/revset_engine.rs
Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) dsl/src/fileset_parser.rs
Code Duplication · Edited copy of a member (12 corresponding lines) core/src/matchers.rs
Code Duplication · Edited copy of a member (16 corresponding lines) default-index/src/rev_walk.rs
Code Duplication · Edited copy of a member (19 corresponding lines) core/src/conflicts.rs
Code Duplication · Edited copy of a member (13 corresponding lines) default-index/src/composite.rs
Code Duplication · Edited copy of a member (12 corresponding lines) git-backend/src/secret_backend.rs
Code Duplication · Edited copy of a member (10 corresponding lines) cli/src/cli_util.rs
Code Duplication · Edited copy of a member (20 corresponding lines) cli/src/commit_templater.rs
Code Duplication · Edited copy of a member (11 corresponding lines) default-index/src/composite.rs
Code Duplication · Edited copy of a member (10 corresponding lines) core/src/merge.rs
Code Duplication · Edited copy of a member (11 corresponding lines) lib/src/git_subprocess.rs
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 136 findings
These 136 critical or serious findings were in the previous survey, on 25 October 2026, and are gone from this one. The first 100 are listed here.
€110,000 to €530,000, for 1,759 to 5,581 hours of work, about 2.2 person-years for 1 to 5 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.9 at a score of 66. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 145,156 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
The findings name the configuration each number was taken from and, for the assertions, the files that hold them.
Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
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 €320,000 to build again, about 2.2 person-years of work. Its weakest lens is Code Health, at 54 (Adequate). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Of all the actions in this report, it raises the score most for the work it takes: about 8 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
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.
306 modules, with 972 dependencies between them. 6 loops run through 38 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 266 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.
jj_cli.formatter uses jj_lib.config, so a change to jj_lib.config can break jj_cli.formatter, while a change to jj_cli.formatter can't break jj_lib.config.
Position
Below the diagonal: jj_cli.formatter uses a module listed above it, which is the healthy direction.
jj_core.merged_tree uses jj_core.repo_path, so a change to jj_core.repo_path can break jj_core.merged_tree, while a change to jj_core.merged_tree can't break jj_core.repo_path.
Position
Below the diagonal: jj_core.merged_tree uses a module listed above it, which is the healthy direction.
8→11 jj_core.merged_tree uses jj_core.storepart of a loop✕
Connections
5 pairs of types, where a type in jj_core.merged_tree uses a type in jj_core.store.
jj_core.merged_tree uses jj_core.store, so a change to jj_core.store can break jj_core.merged_tree, while a change to jj_core.merged_tree can't break jj_core.store.
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.
8→13 jj_core.merged_tree uses jj_core.mergepart of a loop✕
Connections
2 pairs of types, where a type in jj_core.merged_tree uses a type in jj_core.merge.
jj_core.merged_tree uses jj_core.merge, so a change to jj_core.merge can break jj_core.merged_tree, while a change to jj_core.merged_tree can't break jj_core.merge.
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.
jj_cli.config uses jj_cli.formatter, so a change to jj_cli.formatter can break jj_cli.config, while a change to jj_cli.config can't break jj_cli.formatter.
Position
Below the diagonal: jj_cli.config uses a module listed above it, which is the healthy direction.
jj_cli.templater uses jj_cli.formatter, so a change to jj_cli.formatter can break jj_cli.templater, while a change to jj_cli.templater can't break jj_cli.formatter.
Position
Below the diagonal: jj_cli.templater uses a module listed above it, which is the healthy direction.
jj_core.store uses jj_core.repo_path, so a change to jj_core.repo_path can break jj_core.store, while a change to jj_core.store can't break jj_core.repo_path.
Position
Below the diagonal: jj_core.store uses a module listed above it, which is the healthy direction.
jj_core.store uses jj_core.merged_tree, so a change to jj_core.merged_tree can break jj_core.store, while a change to jj_core.store can't break jj_core.merged_tree.
Position
Below the diagonal: jj_core.store uses a module listed above it, which is the healthy direction.
11→13 jj_core.store uses jj_core.mergepart of a loop✕
Connections
1 pair of types, where a type in jj_core.store uses a type in jj_core.merge.
The types involved
jj_core.store.Store → jj_core.merge.Merge
Direction
jj_core.store uses jj_core.merge, so a change to jj_core.merge can break jj_core.store, while a change to jj_core.store can't break jj_core.merge.
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.
11→14 jj_core.store uses jj_core.backendpart of a loop✕
Connections
2 pairs of types, where a type in jj_core.store uses a type in jj_core.backend.
The types involved
jj_core.store.Store → jj_core.backend.Commit
jj_core.store.Store → jj_core.backend.Tree
Direction
jj_core.store uses jj_core.backend, so a change to jj_core.backend can break jj_core.store, while a change to jj_core.store can't break jj_core.backend.
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.
jj_core.merge uses jj_core.repo_path, so a change to jj_core.repo_path can break jj_core.merge, while a change to jj_core.merge can't break jj_core.repo_path.
Position
Below the diagonal: jj_core.merge uses a module listed above it, which is the healthy direction.
jj_core.merge uses jj_core.backend, so a change to jj_core.backend can break jj_core.merge, while a change to jj_core.merge can't break jj_core.backend.
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.
jj_core.backend uses jj_core.repo_path, so a change to jj_core.repo_path can break jj_core.backend, while a change to jj_core.backend can't break jj_core.repo_path.
Position
Below the diagonal: jj_core.backend uses a module listed above it, which is the healthy direction.
jj_core.backend uses jj_core.merge, so a change to jj_core.merge can break jj_core.backend, while a change to jj_core.backend can't break jj_core.merge.
Position
Below the diagonal: jj_core.backend uses a module listed above it, which is the healthy direction.
jj_core.conflicts uses jj_core.repo_path, so a change to jj_core.repo_path can break jj_core.conflicts, while a change to jj_core.conflicts can't break jj_core.repo_path.
Position
Below the diagonal: jj_core.conflicts uses a module listed above it, which is the healthy direction.
jj_core.conflicts uses jj_core.store, so a change to jj_core.store can break jj_core.conflicts, while a change to jj_core.conflicts can't break jj_core.store.
Position
Below the diagonal: jj_core.conflicts uses a module listed above it, which is the healthy direction.
jj_core.conflicts uses jj_core.merge, so a change to jj_core.merge can break jj_core.conflicts, while a change to jj_core.conflicts can't break jj_core.merge.
Position
Below the diagonal: jj_core.conflicts uses a module listed above it, which is the healthy direction.
jj_lib.ui_path uses jj_core.repo_path, so a change to jj_core.repo_path can break jj_lib.ui_path, while a change to jj_lib.ui_path can't break jj_core.repo_path.
Position
Below the diagonal: jj_lib.ui_path uses a module listed above it, which is the healthy direction.
jj_core.op_store uses jj_core.object_id, so a change to jj_core.object_id can break jj_core.op_store, while a change to jj_core.op_store can't break jj_core.object_id.
Position
Below the diagonal: jj_core.op_store uses a module listed above it, which is the healthy direction.
jj_core.op_store uses jj_core.ref_name, so a change to jj_core.ref_name can break jj_core.op_store, while a change to jj_core.op_store can't break jj_core.ref_name.
Position
Below the diagonal: jj_core.op_store uses a module listed above it, which is the healthy direction.
jj_core.op_store uses jj_core.backend, so a change to jj_core.backend can break jj_core.op_store, while a change to jj_core.op_store can't break jj_core.backend.
Position
Below the diagonal: jj_core.op_store uses a module listed above it, which is the healthy direction.
jj_default_index.revset_engine uses jj_core.repo_path, so a change to jj_core.repo_path can break jj_default_index.revset_engine, while a change to jj_default_index.revset_engine can't break jj_core.repo_path.
Position
Below the diagonal: jj_default_index.revset_engine uses a module listed above it, which is the healthy direction.
jj_default_index.revset_engine uses jj_core.str_util, so a change to jj_core.str_util can break jj_default_index.revset_engine, while a change to jj_default_index.revset_engine can't break jj_core.str_util.
Position
Below the diagonal: jj_default_index.revset_engine uses a module listed above it, which is the healthy direction.
jj_default_index.revset_engine uses jj_core.store, so a change to jj_core.store can break jj_default_index.revset_engine, while a change to jj_default_index.revset_engine can't break jj_core.store.
Position
Below the diagonal: jj_default_index.revset_engine uses a module listed above it, which is the healthy direction.
jj_default_index.revset_engine uses jj_core.merge, so a change to jj_core.merge can break jj_default_index.revset_engine, while a change to jj_default_index.revset_engine can't break jj_core.merge.
Position
Below the diagonal: jj_default_index.revset_engine uses a module listed above it, which is the healthy direction.
jj_default_index.revset_engine uses jj_core.backend, so a change to jj_core.backend can break jj_default_index.revset_engine, while a change to jj_default_index.revset_engine can't break jj_core.backend.
Position
Below the diagonal: jj_default_index.revset_engine uses a module listed above it, which is the healthy direction.
jj_default_index.revset_engine uses jj_core.conflicts, so a change to jj_core.conflicts can break jj_default_index.revset_engine, while a change to jj_default_index.revset_engine can't break jj_core.conflicts.
Position
Below the diagonal: jj_default_index.revset_engine uses a module listed above it, which is the healthy direction.
18→32 jj_default_index.revset_engine uses jj_default_index.compositepart of a loop✕
Connections
3 pairs of types, where a type in jj_default_index.revset_engine uses a type in jj_default_index.composite.
jj_default_index.revset_engine uses jj_default_index.composite, so a change to jj_default_index.composite can break jj_default_index.revset_engine, while a change to jj_default_index.revset_engine can't break jj_default_index.composite.
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.
jj_lib.settings uses jj_lib.config, so a change to jj_lib.config can break jj_lib.settings, while a change to jj_lib.settings can't break jj_lib.config.
Position
Below the diagonal: jj_lib.settings uses a module listed above it, which is the healthy direction.
jj_lib.settings uses jj_core.backend, so a change to jj_core.backend can break jj_lib.settings, while a change to jj_lib.settings can't break jj_core.backend.
Position
Below the diagonal: jj_lib.settings uses a module listed above it, which is the healthy direction.
jj_cli.description_util uses jj_cli.config, so a change to jj_cli.config can break jj_cli.description_util, while a change to jj_cli.description_util can't break jj_cli.config.
Position
Below the diagonal: jj_cli.description_util uses a module listed above it, which is the healthy direction.
jj_cli.description_util uses jj_cli.templater, so a change to jj_cli.templater can break jj_cli.description_util, while a change to jj_cli.description_util can't break jj_cli.templater.
Position
Below the diagonal: jj_cli.description_util uses a module listed above it, which is the healthy direction.
jj_cli.description_util uses jj_cli.ui, so a change to jj_cli.ui can break jj_cli.description_util, while a change to jj_cli.description_util can't break jj_cli.ui.
Position
Below the diagonal: jj_cli.description_util uses a module listed above it, which is the healthy direction.
jj_cli.description_util uses jj_core.backend, so a change to jj_core.backend can break jj_cli.description_util, while a change to jj_cli.description_util can't break jj_core.backend.
Position
Below the diagonal: jj_cli.description_util uses a module listed above it, which is the healthy direction.
jj_cli.description_util uses jj_lib.settings, so a change to jj_lib.settings can break jj_cli.description_util, while a change to jj_cli.description_util can't break jj_lib.settings.
Position
Below the diagonal: jj_cli.description_util uses a module listed above it, which is the healthy direction.
20→40 jj_cli.description_util uses jj_cli.cli_utilpart of a loop✕
Connections
1 pair of types, where a type in jj_cli.description_util uses a type in jj_cli.cli_util.
jj_cli.description_util uses jj_cli.cli_util, so a change to jj_cli.cli_util can break jj_cli.description_util, while a change to jj_cli.description_util can't break jj_cli.cli_util.
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.
jj_default_index.readonly uses jj_core.object_id, so a change to jj_core.object_id can break jj_default_index.readonly, while a change to jj_default_index.readonly can't break jj_core.object_id.
Position
Below the diagonal: jj_default_index.readonly uses a module listed above it, which is the healthy direction.
jj_default_index.readonly uses jj_core.store, so a change to jj_core.store can break jj_default_index.readonly, while a change to jj_default_index.readonly can't break jj_core.store.
Position
Below the diagonal: jj_default_index.readonly uses a module listed above it, which is the healthy direction.
jj_default_index.readonly uses jj_default_index.revset_engine, so a change to jj_default_index.revset_engine can break jj_default_index.readonly, while a change to jj_default_index.readonly can't break jj_default_index.revset_engine.
Position
Below the diagonal: jj_default_index.readonly uses a module listed above it, which is the healthy direction.
21→24 jj_default_index.readonly uses jj_default_index.mutablepart of a loop✕
Connections
1 pair of types, where a type in jj_default_index.readonly uses a type in jj_default_index.mutable.
jj_default_index.readonly uses jj_default_index.mutable, so a change to jj_default_index.mutable can break jj_default_index.readonly, while a change to jj_default_index.readonly can't break jj_default_index.mutable.
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.
21→32 jj_default_index.readonly uses jj_default_index.compositepart of a loop✕
Connections
4 pairs of types, where a type in jj_default_index.readonly uses a type in jj_default_index.composite.
jj_default_index.readonly uses jj_default_index.composite, so a change to jj_default_index.composite can break jj_default_index.readonly, while a change to jj_default_index.readonly can't break jj_default_index.composite.
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.
jj_lib.repo uses jj_core.object_id, so a change to jj_core.object_id can break jj_lib.repo, while a change to jj_lib.repo can't break jj_core.object_id.
Position
Below the diagonal: jj_lib.repo uses a module listed above it, which is the healthy direction.
jj_lib.repo uses jj_core.merged_tree, so a change to jj_core.merged_tree can break jj_lib.repo, while a change to jj_lib.repo can't break jj_core.merged_tree.
Position
Below the diagonal: jj_lib.repo uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools uses jj_core.repo_path, so a change to jj_core.repo_path can break jj_cli.merge_tools, while a change to jj_cli.merge_tools can't break jj_core.repo_path.
Position
Below the diagonal: jj_cli.merge_tools uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools uses jj_core.merged_tree, so a change to jj_core.merged_tree can break jj_cli.merge_tools, while a change to jj_cli.merge_tools can't break jj_core.merged_tree.
Position
Below the diagonal: jj_cli.merge_tools uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools uses jj_core.store, so a change to jj_core.store can break jj_cli.merge_tools, while a change to jj_cli.merge_tools can't break jj_core.store.
Position
Below the diagonal: jj_cli.merge_tools uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools uses jj_core.merge, so a change to jj_core.merge can break jj_cli.merge_tools, while a change to jj_cli.merge_tools can't break jj_core.merge.
Position
Below the diagonal: jj_cli.merge_tools uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools uses jj_core.conflicts, so a change to jj_core.conflicts can break jj_cli.merge_tools, while a change to jj_cli.merge_tools can't break jj_core.conflicts.
Position
Below the diagonal: jj_cli.merge_tools uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools uses jj_lib.ui_path, so a change to jj_lib.ui_path can break jj_cli.merge_tools, while a change to jj_cli.merge_tools can't break jj_lib.ui_path.
Position
Below the diagonal: jj_cli.merge_tools uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools uses jj_lib.settings, so a change to jj_lib.settings can break jj_cli.merge_tools, while a change to jj_cli.merge_tools can't break jj_lib.settings.
Position
Below the diagonal: jj_cli.merge_tools uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools uses jj_cli.description_util, so a change to jj_cli.description_util can break jj_cli.merge_tools, while a change to jj_cli.merge_tools can't break jj_cli.description_util.
Position
Below the diagonal: jj_cli.merge_tools uses a module listed above it, which is the healthy direction.
23→30 jj_cli.merge_tools uses jj_cli.merge_tools.externalpart of a loop✕
Connections
2 pairs of types, where a type in jj_cli.merge_tools uses a type in jj_cli.merge_tools.external.
jj_cli.merge_tools uses jj_cli.merge_tools.external, so a change to jj_cli.merge_tools.external can break jj_cli.merge_tools, while a change to jj_cli.merge_tools can't break jj_cli.merge_tools.external.
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.
jj_default_index.mutable uses jj_core.object_id, so a change to jj_core.object_id can break jj_default_index.mutable, while a change to jj_default_index.mutable can't break jj_core.object_id.
Position
Below the diagonal: jj_default_index.mutable uses a module listed above it, which is the healthy direction.
jj_default_index.mutable uses jj_core.store, so a change to jj_core.store can break jj_default_index.mutable, while a change to jj_default_index.mutable can't break jj_core.store.
Position
Below the diagonal: jj_default_index.mutable uses a module listed above it, which is the healthy direction.
jj_default_index.mutable uses jj_core.backend, so a change to jj_core.backend can break jj_default_index.mutable, while a change to jj_default_index.mutable can't break jj_core.backend.
Position
Below the diagonal: jj_default_index.mutable uses a module listed above it, which is the healthy direction.
jj_default_index.mutable uses jj_default_index.readonly, so a change to jj_default_index.readonly can break jj_default_index.mutable, while a change to jj_default_index.mutable can't break jj_default_index.readonly.
Position
Below the diagonal: jj_default_index.mutable uses a module listed above it, which is the healthy direction.
24→32 jj_default_index.mutable uses jj_default_index.compositepart of a loop✕
Connections
4 pairs of types, where a type in jj_default_index.mutable uses a type in jj_default_index.composite.
jj_default_index.mutable uses jj_default_index.composite, so a change to jj_default_index.composite can break jj_default_index.mutable, while a change to jj_default_index.mutable can't break jj_default_index.composite.
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.
jj_lib.git uses jj_core.merged_tree, so a change to jj_core.merged_tree can break jj_lib.git, while a change to jj_lib.git can't break jj_core.merged_tree.
Position
Below the diagonal: jj_lib.git uses a module listed above it, which is the healthy direction.
jj_lib.revset uses jj_core.object_id, so a change to jj_core.object_id can break jj_lib.revset, while a change to jj_lib.revset can't break jj_core.object_id.
Position
Below the diagonal: jj_lib.revset uses a module listed above it, which is the healthy direction.
jj_lib.revset uses jj_core.ref_name, so a change to jj_core.ref_name can break jj_lib.revset, while a change to jj_lib.revset can't break jj_core.ref_name.
Position
Below the diagonal: jj_lib.revset uses a module listed above it, which is the healthy direction.
jj_lib.revset uses jj_core.str_util, so a change to jj_core.str_util can break jj_lib.revset, while a change to jj_lib.revset can't break jj_core.str_util.
Position
Below the diagonal: jj_lib.revset uses a module listed above it, which is the healthy direction.
jj_lib.revset uses jj_dsl.dsl_util, so a change to jj_dsl.dsl_util can break jj_lib.revset, while a change to jj_lib.revset can't break jj_dsl.dsl_util.
Position
Below the diagonal: jj_lib.revset uses a module listed above it, which is the healthy direction.
jj_lib.revset uses jj_core.op_store, so a change to jj_core.op_store can break jj_lib.revset, while a change to jj_lib.revset can't break jj_core.op_store.
Position
Below the diagonal: jj_lib.revset uses a module listed above it, which is the healthy direction.
jj_lib.working_copy uses jj_core.ref_name, so a change to jj_core.ref_name can break jj_lib.working_copy, while a change to jj_lib.working_copy can't break jj_core.ref_name.
Position
Below the diagonal: jj_lib.working_copy uses a module listed above it, which is the healthy direction.
jj_lib.working_copy uses jj_core.repo_path, so a change to jj_core.repo_path can break jj_lib.working_copy, while a change to jj_lib.working_copy can't break jj_core.repo_path.
Position
Below the diagonal: jj_lib.working_copy uses a module listed above it, which is the healthy direction.
jj_lib.working_copy uses jj_core.merged_tree, so a change to jj_core.merged_tree can break jj_lib.working_copy, while a change to jj_lib.working_copy can't break jj_core.merged_tree.
Position
Below the diagonal: jj_lib.working_copy uses a module listed above it, which is the healthy direction.
jj_lib.working_copy uses jj_core.store, so a change to jj_core.store can break jj_lib.working_copy, while a change to jj_lib.working_copy can't break jj_core.store.
Position
Below the diagonal: jj_lib.working_copy uses a module listed above it, which is the healthy direction.
jj_lib.working_copy uses jj_core.backend, so a change to jj_core.backend can break jj_lib.working_copy, while a change to jj_lib.working_copy can't break jj_core.backend.
Position
Below the diagonal: jj_lib.working_copy uses a module listed above it, which is the healthy direction.
jj_lib.working_copy uses jj_lib.settings, so a change to jj_lib.settings can break jj_lib.working_copy, while a change to jj_lib.working_copy can't break jj_lib.settings.
Position
Below the diagonal: jj_lib.working_copy uses a module listed above it, which is the healthy direction.
jj_lib.working_copy uses jj_lib.repo, so a change to jj_lib.repo can break jj_lib.working_copy, while a change to jj_lib.working_copy can't break jj_lib.repo.
Position
Below the diagonal: jj_lib.working_copy uses a module listed above it, which is the healthy direction.
jj_lib.workspace uses jj_core.ref_name, so a change to jj_core.ref_name can break jj_lib.workspace, while a change to jj_lib.workspace can't break jj_core.ref_name.
Position
Below the diagonal: jj_lib.workspace uses a module listed above it, which is the healthy direction.
jj_lib.workspace uses jj_core.merged_tree, so a change to jj_core.merged_tree can break jj_lib.workspace, while a change to jj_lib.workspace can't break jj_core.merged_tree.
Position
Below the diagonal: jj_lib.workspace uses a module listed above it, which is the healthy direction.
jj_lib.workspace uses jj_core.backend, so a change to jj_core.backend can break jj_lib.workspace, while a change to jj_lib.workspace can't break jj_core.backend.
Position
Below the diagonal: jj_lib.workspace uses a module listed above it, which is the healthy direction.
jj_lib.workspace uses jj_core.op_store, so a change to jj_core.op_store can break jj_lib.workspace, while a change to jj_lib.workspace can't break jj_core.op_store.
Position
Below the diagonal: jj_lib.workspace uses a module listed above it, which is the healthy direction.
jj_lib.workspace uses jj_lib.settings, so a change to jj_lib.settings can break jj_lib.workspace, while a change to jj_lib.workspace can't break jj_lib.settings.
Position
Below the diagonal: jj_lib.workspace uses a module listed above it, which is the healthy direction.
jj_cli.commands.git.push uses jj_core.ref_name, so a change to jj_core.ref_name can break jj_cli.commands.git.push, while a change to jj_cli.commands.git.push can't break jj_core.ref_name.
Position
Below the diagonal: jj_cli.commands.git.push uses a module listed above it, which is the healthy direction.
jj_cli.commands.git.push uses jj_cli.ui, so a change to jj_cli.ui can break jj_cli.commands.git.push, while a change to jj_cli.commands.git.push can't break jj_cli.ui.
Position
Below the diagonal: jj_cli.commands.git.push uses a module listed above it, which is the healthy direction.
jj_cli.commands.git.push uses jj_core.merge, so a change to jj_core.merge can break jj_cli.commands.git.push, while a change to jj_cli.commands.git.push can't break jj_core.merge.
Position
Below the diagonal: jj_cli.commands.git.push uses a module listed above it, which is the healthy direction.
jj_cli.commands.git.push uses jj_core.backend, so a change to jj_core.backend can break jj_cli.commands.git.push, while a change to jj_cli.commands.git.push can't break jj_core.backend.
Position
Below the diagonal: jj_cli.commands.git.push uses a module listed above it, which is the healthy direction.
jj_cli.commands.git.push uses jj_core.op_store, so a change to jj_core.op_store can break jj_cli.commands.git.push, while a change to jj_cli.commands.git.push can't break jj_core.op_store.
Position
Below the diagonal: jj_cli.commands.git.push uses a module listed above it, which is the healthy direction.
jj_cli.commands.git.push uses jj_lib.git, so a change to jj_lib.git can break jj_cli.commands.git.push, while a change to jj_cli.commands.git.push can't break jj_lib.git.
Position
Below the diagonal: jj_cli.commands.git.push uses a module listed above it, which is the healthy direction.
29→38 jj_cli.commands.git.push uses jj_cli.command_errorpart of a loop✕
Connections
1 pair of types, where a type in jj_cli.commands.git.push uses a type in jj_cli.command_error.
jj_cli.commands.git.push uses jj_cli.command_error, so a change to jj_cli.command_error can break jj_cli.commands.git.push, while a change to jj_cli.commands.git.push can't break jj_cli.command_error.
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.
29→40 jj_cli.commands.git.push uses jj_cli.cli_utilpart of a loop✕
Connections
6 pairs of types, where a type in jj_cli.commands.git.push uses a type in jj_cli.cli_util.
jj_cli.commands.git.push uses jj_cli.cli_util, so a change to jj_cli.cli_util can break jj_cli.commands.git.push, while a change to jj_cli.commands.git.push can't break jj_cli.cli_util.
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.
jj_cli.merge_tools.external uses jj_core.merged_tree, so a change to jj_core.merged_tree can break jj_cli.merge_tools.external, while a change to jj_cli.merge_tools.external can't break jj_core.merged_tree.
Position
Below the diagonal: jj_cli.merge_tools.external uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools.external uses jj_cli.config, so a change to jj_cli.config can break jj_cli.merge_tools.external, while a change to jj_cli.merge_tools.external can't break jj_cli.config.
Position
Below the diagonal: jj_cli.merge_tools.external uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools.external uses jj_core.store, so a change to jj_core.store can break jj_cli.merge_tools.external, while a change to jj_cli.merge_tools.external can't break jj_core.store.
Position
Below the diagonal: jj_cli.merge_tools.external uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools.external uses jj_cli.ui, so a change to jj_cli.ui can break jj_cli.merge_tools.external, while a change to jj_cli.merge_tools.external can't break jj_cli.ui.
Position
Below the diagonal: jj_cli.merge_tools.external uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools.external uses jj_core.merge, so a change to jj_core.merge can break jj_cli.merge_tools.external, while a change to jj_cli.merge_tools.external can't break jj_core.merge.
Position
Below the diagonal: jj_cli.merge_tools.external uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools.external uses jj_core.conflicts, so a change to jj_core.conflicts can break jj_cli.merge_tools.external, while a change to jj_cli.merge_tools.external can't break jj_core.conflicts.
Position
Below the diagonal: jj_cli.merge_tools.external uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools.external uses jj_lib.ui_path, so a change to jj_lib.ui_path can break jj_cli.merge_tools.external, while a change to jj_cli.merge_tools.external can't break jj_lib.ui_path.
Position
Below the diagonal: jj_cli.merge_tools.external uses a module listed above it, which is the healthy direction.
jj_cli.merge_tools.external uses jj_cli.merge_tools, so a change to jj_cli.merge_tools can break jj_cli.merge_tools.external, while a change to jj_cli.merge_tools.external can't break jj_cli.merge_tools.
Position
Below the diagonal: jj_cli.merge_tools.external uses a module listed above it, which is the healthy direction.
jj_cli.revset_util uses jj_core.ref_name, so a change to jj_core.ref_name can break jj_cli.revset_util, while a change to jj_cli.revset_util can't break jj_core.ref_name.
Position
Below the diagonal: jj_cli.revset_util uses a module listed above it, which is the healthy direction.
jj_cli.revset_util uses jj_lib.config, so a change to jj_lib.config can break jj_cli.revset_util, while a change to jj_cli.revset_util can't break jj_lib.config.
Position
Below the diagonal: jj_cli.revset_util uses a module listed above it, which is the healthy direction.
jj_cli.revset_util uses jj_cli.templater, so a change to jj_cli.templater can break jj_cli.revset_util, while a change to jj_cli.revset_util can't break jj_cli.templater.
Position
Below the diagonal: jj_cli.revset_util uses a module listed above it, which is the healthy direction.
jj_cli.revset_util uses jj_lib.revset, so a change to jj_lib.revset can break jj_cli.revset_util, while a change to jj_cli.revset_util can't break jj_lib.revset.
Position
Below the diagonal: jj_cli.revset_util uses a module listed above it, which is the healthy direction.
31→38 jj_cli.revset_util uses jj_cli.command_errorpart of a loop✕
Connections
2 pairs of types, where a type in jj_cli.revset_util uses a type in jj_cli.command_error.
jj_cli.revset_util uses jj_cli.command_error, so a change to jj_cli.command_error can break jj_cli.revset_util, while a change to jj_cli.revset_util can't break jj_cli.command_error.
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.
jj_default_index.composite uses jj_core.object_id, so a change to jj_core.object_id can break jj_default_index.composite, while a change to jj_default_index.composite can't break jj_core.object_id.
Position
Below the diagonal: jj_default_index.composite uses a module listed above it, which is the healthy direction.
jj_default_index.composite uses jj_core.store, so a change to jj_core.store can break jj_default_index.composite, while a change to jj_default_index.composite can't break jj_core.store.
Position
Below the diagonal: jj_default_index.composite uses a module listed above it, which is the healthy direction.
jj_default_index.composite uses jj_default_index.readonly, so a change to jj_default_index.readonly can break jj_default_index.composite, while a change to jj_default_index.composite can't break jj_default_index.readonly.
Position
Below the diagonal: jj_default_index.composite uses a module listed above it, which is the healthy direction.
jj_default_index.composite uses jj_default_index.mutable, so a change to jj_default_index.mutable can break jj_default_index.composite, while a change to jj_default_index.composite can't break jj_default_index.mutable.
Position
Below the diagonal: jj_default_index.composite uses a module listed above it, which is the healthy direction.
jj_frontend.runner uses jj_core.ref_name, so a change to jj_core.ref_name can break jj_frontend.runner, while a change to jj_frontend.runner can't break jj_core.ref_name.
Position
Below the diagonal: jj_frontend.runner uses a module listed above it, which is the healthy direction.
jj_frontend.runner uses jj_lib.repo, so a change to jj_lib.repo can break jj_frontend.runner, while a change to jj_frontend.runner can't break jj_lib.repo.
Position
Below the diagonal: jj_frontend.runner uses a module listed above it, which is the healthy direction.
jj_frontend.runner uses jj_lib.git, so a change to jj_lib.git can break jj_frontend.runner, while a change to jj_frontend.runner can't break jj_lib.git.
Position
Below the diagonal: jj_frontend.runner uses a module listed above it, which is the healthy direction.
jj_frontend.runner uses jj_lib.working_copy, so a change to jj_lib.working_copy can break jj_frontend.runner, while a change to jj_frontend.runner can't break jj_lib.working_copy.
Position
Below the diagonal: jj_frontend.runner uses a module listed above it, which is the healthy direction.
jj_lib.local_working_copy uses jj_core.ref_name, so a change to jj_core.ref_name can break jj_lib.local_working_copy, while a change to jj_lib.local_working_copy can't break jj_core.ref_name.
Position
Below the diagonal: jj_lib.local_working_copy uses a module listed above it, which is the healthy direction.
jj_lib.local_working_copy uses jj_core.repo_path, so a change to jj_core.repo_path can break jj_lib.local_working_copy, while a change to jj_lib.local_working_copy can't break jj_core.repo_path.
Position
Below the diagonal: jj_lib.local_working_copy uses a module listed above it, which is the healthy direction.
jj_lib.local_working_copy uses jj_core.merged_tree, so a change to jj_core.merged_tree can break jj_lib.local_working_copy, while a change to jj_lib.local_working_copy can't break jj_core.merged_tree.
Position
Below the diagonal: jj_lib.local_working_copy uses a module listed above it, which is the healthy direction.
jj_lib.local_working_copy uses jj_core.store, so a change to jj_core.store can break jj_lib.local_working_copy, while a change to jj_lib.local_working_copy can't break jj_core.store.
Position
Below the diagonal: jj_lib.local_working_copy uses a module listed above it, which is the healthy direction.
jj_lib.local_working_copy uses jj_core.backend, so a change to jj_core.backend can break jj_lib.local_working_copy, while a change to jj_lib.local_working_copy can't break jj_core.backend.
Position
Below the diagonal: jj_lib.local_working_copy uses a module listed above it, which is the healthy direction.
jj_lib.local_working_copy uses jj_core.conflicts, so a change to jj_core.conflicts can break jj_lib.local_working_copy, while a change to jj_lib.local_working_copy can't break jj_core.conflicts.
Position
Below the diagonal: jj_lib.local_working_copy uses a module listed above it, which is the healthy direction.
jj_lib.local_working_copy uses jj_lib.settings, so a change to jj_lib.settings can break jj_lib.local_working_copy, while a change to jj_lib.local_working_copy can't break jj_lib.settings.
Position
Below the diagonal: jj_lib.local_working_copy uses a module listed above it, which is the healthy direction.
jj_lib.local_working_copy uses jj_lib.working_copy, so a change to jj_lib.working_copy can break jj_lib.local_working_copy, while a change to jj_lib.local_working_copy can't break jj_lib.working_copy.
Position
Below the diagonal: jj_lib.local_working_copy uses a module listed above it, which is the healthy direction.
testutils uses jj_core.merged_tree, so a change to jj_core.merged_tree can break testutils, while a change to testutils can't break jj_core.merged_tree.
Position
Below the diagonal: testutils uses a module listed above it, which is the healthy direction.
testutils uses jj_lib.working_copy, so a change to jj_lib.working_copy can break testutils, while a change to testutils can't break jj_lib.working_copy.
Position
Below the diagonal: testutils uses a module listed above it, which is the healthy direction.
jj_cli.commands.run uses jj_core.repo_path, so a change to jj_core.repo_path can break jj_cli.commands.run, while a change to jj_cli.commands.run can't break jj_core.repo_path.
Position
Below the diagonal: jj_cli.commands.run uses a module listed above it, which is the healthy direction.
jj_cli.commands.run uses jj_cli.formatter, so a change to jj_cli.formatter can break jj_cli.commands.run, while a change to jj_cli.commands.run can't break jj_cli.formatter.
Position
Below the diagonal: jj_cli.commands.run uses a module listed above it, which is the healthy direction.
jj_cli.commands.run uses jj_core.merged_tree, so a change to jj_core.merged_tree can break jj_cli.commands.run, while a change to jj_cli.commands.run can't break jj_core.merged_tree.
Position
Below the diagonal: jj_cli.commands.run uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in jj_cli.commands.run uses a type in jj_cli.ui.
The types involved
jj_cli.commands.run.run$module → jj_cli.ui.Ui
Direction
jj_cli.commands.run uses jj_cli.ui, so a change to jj_cli.ui can break jj_cli.commands.run, while a change to jj_cli.commands.run can't break jj_cli.ui.
Position
Below the diagonal: jj_cli.commands.run uses a module listed above it, which is the healthy direction.
jj_cli.commands.run uses jj_core.backend, so a change to jj_core.backend can break jj_cli.commands.run, while a change to jj_cli.commands.run can't break jj_core.backend.
Position
Below the diagonal: jj_cli.commands.run uses a module listed above it, which is the healthy direction.
jj_cli.commands.run uses jj_core.conflicts, so a change to jj_core.conflicts can break jj_cli.commands.run, while a change to jj_cli.commands.run can't break jj_core.conflicts.
Position
Below the diagonal: jj_cli.commands.run uses a module listed above it, which is the healthy direction.
jj_cli.commands.run uses jj_lib.working_copy, so a change to jj_lib.working_copy can break jj_cli.commands.run, while a change to jj_cli.commands.run can't break jj_lib.working_copy.
Position
Below the diagonal: jj_cli.commands.run uses a module listed above it, which is the healthy direction.
jj_cli.commands.run uses jj_lib.local_working_copy, so a change to jj_lib.local_working_copy can break jj_cli.commands.run, while a change to jj_cli.commands.run can't break jj_lib.local_working_copy.
Position
Below the diagonal: jj_cli.commands.run uses a module listed above it, which is the healthy direction.
36→40 jj_cli.commands.run uses jj_cli.cli_utilpart of a loop✕
Connections
4 pairs of types, where a type in jj_cli.commands.run uses a type in jj_cli.cli_util.
jj_cli.commands.run uses jj_cli.cli_util, so a change to jj_cli.cli_util can break jj_cli.commands.run, while a change to jj_cli.commands.run can't break jj_cli.cli_util.
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.
jj_cli.diff_util uses jj_core.repo_path, so a change to jj_core.repo_path can break jj_cli.diff_util, while a change to jj_cli.diff_util can't break jj_core.repo_path.
Position
Below the diagonal: jj_cli.diff_util uses a module listed above it, which is the healthy direction.
jj_cli.diff_util uses jj_cli.templater, so a change to jj_cli.templater can break jj_cli.diff_util, while a change to jj_cli.diff_util can't break jj_cli.templater.
Position
Below the diagonal: jj_cli.diff_util uses a module listed above it, which is the healthy direction.
jj_cli.diff_util uses jj_core.store, so a change to jj_core.store can break jj_cli.diff_util, while a change to jj_cli.diff_util can't break jj_core.store.
Position
Below the diagonal: jj_cli.diff_util uses a module listed above it, which is the healthy direction.
jj_cli.diff_util uses jj_core.merge, so a change to jj_core.merge can break jj_cli.diff_util, while a change to jj_cli.diff_util can't break jj_core.merge.
Position
Below the diagonal: jj_cli.diff_util uses a module listed above it, which is the healthy direction.
jj_cli.diff_util uses jj_core.backend, so a change to jj_core.backend can break jj_cli.diff_util, while a change to jj_cli.diff_util can't break jj_core.backend.
Position
Below the diagonal: jj_cli.diff_util uses a module listed above it, which is the healthy direction.
jj_cli.diff_util uses jj_core.conflicts, so a change to jj_core.conflicts can break jj_cli.diff_util, while a change to jj_cli.diff_util can't break jj_core.conflicts.
Position
Below the diagonal: jj_cli.diff_util uses a module listed above it, which is the healthy direction.
jj_cli.diff_util uses jj_lib.ui_path, so a change to jj_lib.ui_path can break jj_cli.diff_util, while a change to jj_cli.diff_util can't break jj_lib.ui_path.
Position
Below the diagonal: jj_cli.diff_util uses a module listed above it, which is the healthy direction.
jj_cli.diff_util uses jj_lib.settings, so a change to jj_lib.settings can break jj_cli.diff_util, while a change to jj_cli.diff_util can't break jj_lib.settings.
Position
Below the diagonal: jj_cli.diff_util uses a module listed above it, which is the healthy direction.
jj_cli.diff_util uses jj_cli.merge_tools.external, so a change to jj_cli.merge_tools.external can break jj_cli.diff_util, while a change to jj_cli.diff_util can't break jj_cli.merge_tools.external.
Position
Below the diagonal: jj_cli.diff_util uses a module listed above it, which is the healthy direction.
37→40 jj_cli.diff_util uses jj_cli.cli_utilpart of a loop✕
Connections
1 pair of types, where a type in jj_cli.diff_util uses a type in jj_cli.cli_util.
jj_cli.diff_util uses jj_cli.cli_util, so a change to jj_cli.cli_util can break jj_cli.diff_util, while a change to jj_cli.diff_util can't break jj_cli.cli_util.
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.
jj_cli.command_error uses jj_core.str_util, so a change to jj_core.str_util can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_core.str_util.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_dsl.dsl_util, so a change to jj_dsl.dsl_util can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_dsl.dsl_util.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_lib.config, so a change to jj_lib.config can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_lib.config.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_cli.formatter, so a change to jj_cli.formatter can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_cli.formatter.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_cli.ui, so a change to jj_cli.ui can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_cli.ui.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_core.backend, so a change to jj_core.backend can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_core.backend.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_lib.ui_path, so a change to jj_lib.ui_path can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_lib.ui_path.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_core.op_store, so a change to jj_core.op_store can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_core.op_store.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_cli.description_util, so a change to jj_cli.description_util can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_cli.description_util.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_lib.repo, so a change to jj_lib.repo can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_lib.repo.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_cli.merge_tools, so a change to jj_cli.merge_tools can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_cli.merge_tools.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_lib.git, so a change to jj_lib.git can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_lib.git.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_lib.revset, so a change to jj_lib.revset can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_lib.revset.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_lib.working_copy, so a change to jj_lib.working_copy can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_lib.working_copy.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_lib.workspace, so a change to jj_lib.workspace can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_lib.workspace.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_cli.commands.git.push, so a change to jj_cli.commands.git.push can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_cli.commands.git.push.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_cli.revset_util, so a change to jj_cli.revset_util can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_cli.revset_util.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_frontend.runner, so a change to jj_frontend.runner can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_frontend.runner.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_cli.commands.run, so a change to jj_cli.commands.run can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_cli.commands.run.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.command_error uses jj_cli.diff_util, so a change to jj_cli.diff_util can break jj_cli.command_error, while a change to jj_cli.command_error can't break jj_cli.diff_util.
Position
Below the diagonal: jj_cli.command_error uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_core.ref_name, so a change to jj_core.ref_name can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_core.ref_name.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_core.repo_path, so a change to jj_core.repo_path can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_core.repo_path.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_dsl.dsl_util, so a change to jj_dsl.dsl_util can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_dsl.dsl_util.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_cli.formatter, so a change to jj_cli.formatter can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_cli.formatter.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_core.merged_tree, so a change to jj_core.merged_tree can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_core.merged_tree.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_cli.templater, so a change to jj_cli.templater can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_cli.templater.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_core.merge, so a change to jj_core.merge can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_core.merge.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_core.backend, so a change to jj_core.backend can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_core.backend.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_core.conflicts, so a change to jj_core.conflicts can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_core.conflicts.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_lib.ui_path, so a change to jj_lib.ui_path can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_lib.ui_path.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_core.op_store, so a change to jj_core.op_store can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_core.op_store.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_lib.settings, so a change to jj_lib.settings can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_lib.settings.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_lib.repo, so a change to jj_lib.repo can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_lib.repo.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_lib.revset, so a change to jj_lib.revset can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_lib.revset.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.commit_templater uses jj_cli.diff_util, so a change to jj_cli.diff_util can break jj_cli.commit_templater, while a change to jj_cli.commit_templater can't break jj_cli.diff_util.
Position
Below the diagonal: jj_cli.commit_templater uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_core.ref_name, so a change to jj_core.ref_name can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_core.ref_name.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_core.repo_path, so a change to jj_core.repo_path can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_core.repo_path.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_lib.config, so a change to jj_lib.config can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_lib.config.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_cli.formatter, so a change to jj_cli.formatter can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_cli.formatter.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_core.merged_tree, so a change to jj_core.merged_tree can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_core.merged_tree.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_cli.config, so a change to jj_cli.config can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_cli.config.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_cli.templater, so a change to jj_cli.templater can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_cli.templater.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_core.store, so a change to jj_core.store can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_core.store.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in jj_cli.cli_util uses a type in jj_core.merge.
The types involved
jj_cli.cli_util.DiffSelector → jj_core.merge.Diff
Direction
jj_cli.cli_util uses jj_core.merge, so a change to jj_core.merge can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_core.merge.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_core.backend, so a change to jj_core.backend can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_core.backend.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_core.conflicts, so a change to jj_core.conflicts can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_core.conflicts.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_lib.ui_path, so a change to jj_lib.ui_path can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_lib.ui_path.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_core.op_store, so a change to jj_core.op_store can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_core.op_store.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_lib.settings, so a change to jj_lib.settings can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_lib.settings.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_lib.revset, so a change to jj_lib.revset can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_lib.revset.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_lib.working_copy, so a change to jj_lib.working_copy can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_lib.working_copy.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_lib.workspace, so a change to jj_lib.workspace can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_lib.workspace.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_cli.revset_util, so a change to jj_cli.revset_util can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_cli.revset_util.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_frontend.runner, so a change to jj_frontend.runner can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_frontend.runner.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_cli.diff_util, so a change to jj_cli.diff_util can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_cli.diff_util.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_cli.command_error, so a change to jj_cli.command_error can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_cli.command_error.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
jj_cli.cli_util uses jj_cli.commit_templater, so a change to jj_cli.commit_templater can break jj_cli.cli_util, while a change to jj_cli.cli_util can't break jj_cli.commit_templater.
Position
Below the diagonal: jj_cli.cli_util uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 54% · Adequate · gated by 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
7
Medium
A05:2025 — Injection
1
High / Critical
Roadmap
Top priorities: The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`); Interpolated log message defeats structured logging; Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
Bring the 7 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with jj_cli::commands::git::push::cmd_git_push (cyclomatic 55), EvaluationContext::evaluate (cyclomatic 40), SourceLanguage::is_source_symbol (cyclomatic 36).
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 — 4
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 — 993
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 — 56
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 49 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 — 49 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, 1029 of 1053 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 — evaluation did not complete — Code Coverage not included (check did not complete) — excluded from the score.
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, 205 test files), but it was not re-run: its build outgrew the 12 GB scratch ceiling (12.084 GB measured) and was stopped; its suite was not run. 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 a Python REDACTED/requirements.txt (pip/uv/Poetry), but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Python dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
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 on C# first (docs/plans/deterministic-engine.md, P5): 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.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `web/docs/src/pages/config-schema.json.ts` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AXB2 Runtime readiness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `npm run` found no package.json in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. (rule: no-root-manifest). The renderer reported: the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): `npm run` found no package.json in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. Last output: "npm error code ENOENT / npm error syscall open / npm error path <repo>/package.json / npm error errno -2 / npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '<repo>/package.json' / npm error enoent This is related to npm not being able to find a file. / npm error enoent / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (dev). the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): `npm run` found no package.json in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. Last output: "npm error code ENOENT / npm error syscall open / npm error path <repo>/package.json / npm error errno -2 / npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '<repo>/package.json' / npm error enoent This is related to npm not being able to find a file. / npm error enoent / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
P9 Domain vs controller 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. The self-contained coverage run failed with IOException: No space left on device : '/tmp/codehealth-cargo-cov-5J62og/profiles.txt' before it produced a report, so this card measured nothing. That failure is the analyzer's, not a statement about this repository's tests.
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.
X17 Uncapped recursion over a caller-supplied document — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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 reads C# syntax, and PHP, Java, Kotlin, Python, Ruby, Scala, Dart, Swift, Erlang, Go and JavaScript/TypeScript source only, and no C# was loaded and no PHP, Java, Kotlin, Python, Ruby, Scala, Dart, Swift, Erlang, Go, JavaScript or TypeScript was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations: 3 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
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.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
40 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was jj_cli::commands::git::push::cmd_git_push at 55. A further 25 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 CommitTemplatePropertyKind::try_into_eq at 52 — they are counted neither in the figure above nor in this dimension's score. 6 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: cli/src/commit_templater.rs (CommitTemplatePropertyKind::try_into_eq at 52), cli/src/commands/mod.rs (jj_cli::commands::run_command at 49), lib/src/revset.rs (jj_lib::revset::try_transform_expression::transform_child_rec at 34), cli/src/command_error.rs (CommandError::from at 26), dsl/src/revset_parser.rs (jj_dsl::revset_parser::parse_expression_node at 19), and 1 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 8 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 jj_cli::commands::git::push::cmd_git_push (cyclomatic 55), EvaluationContext::evaluate (cyclomatic 40), SourceLanguage::is_source_symbol (cyclomatic 36). — 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.6 to about 7.3/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.
+ 16 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 60 down to 60 or less in Cognitive Complexity — start with jj_cli::commands::git::push::cmd_git_push (cognitive 109), jj_lib::rewrite::compute_move_commits (cognitive 84), jj_cli::commands::squash::cmd_squash (cognitive 75). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cognitive Complexity from 5.9 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.2 / 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 31 FileTooLong finding(s) in God Classes — start with config.rs (2), diff.rs (2), cli_util.rs. — One of this dimension's main actionable groups (31 warning-level).
Resolve the 31 FunctionTooLong finding(s) in God Classes — start with template_builder.rs (3), commit_templater.rs (2), log.rs (2). — One of this dimension's main actionable groups (31 warning-level).
Resolve the 7 MethodTooLong finding(s) in God Classes — start with local_working_copy.rs (2), revset_engine.rs, commit_templater.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.
175 duplicated block group(s) detected. 4.9 % of the production lines (7,049 of 145,156) are in a reported copy. A further 121 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 5 of the 296 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 107 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 14 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with advance.rs, forget.rs, commit_templater.rs. — One of this dimension's main actionable groups (14 warning-level).
Resolve the 13 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with template_builder.rs (3), squash.rs, complete.rs. — One of this dimension's main actionable groups (13 warning-level).
Resolve the 13 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with commit_templater.rs (4), advance.rs, list.rs. — One of this dimension's main actionable groups (13 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling9.3 / 10Stronggated by 1 serious finding✓ 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.
11 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, with abstractness counted on 9 of the 11 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: jj-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 the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
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.
10 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: interim · ×10
✓ On the Gold path — maintain.
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 482 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares a Python REDACTED/requirements.txt (pip/uv/Poetry), 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 19 Hotspot finding(s) in Churn × Complexity Hotspots — start with run.rs (2), cli_util.rs, push.rs. — One of this dimension's main actionable groups (19 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.5 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
12 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is lib/src/graph_dominators.rs. Counted over 253 of the 308 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×2
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
440 deducted task-comment markers across 145156 LoC (0.3/KLoC) → score 9.4. 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.
TodoComment · ×424local-util/src/file_util.rs:349
FixmeComment · ×14lib/tests/test_git.rs:7326
HackComment · ×2lib/testutils/src/proptest.rs:66
What to do
Resolve the 424 TodoComment finding(s) in Explicit Debt — start with test_merged_tree.rs (24), local_working_copy.rs (16), cli_util.rs (15). — One of this dimension's main actionable groups (424 warning-level).
Resolve the 14 FixmeComment finding(s) in Explicit Debt — start with test_gpg.rs (8), test_git.rs, test_local_working_copy.rs. — One of this dimension's main actionable groups (14 warning-level).
Resolve the 2 HackComment finding(s) in Explicit Debt — start with proptest.rs, repo.rs. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
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.
0 of 9 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.
3 of 12 build units (Cargo, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 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).
1 finding(s): 0 critical, 1 high, 0 medium, 0 low. semgrep hit a parse error in 25 file(s) — `cli/src/cli_util.rs` (line 860, line 3020, line 4077, …), `cli/src/commands/bench/revset.rs` (line 91), `cli/src/commands/file/search.rs` (line 114), `cli/src/commands/git/push.rs` (line 951, line 1019, line 1031), `cli/src/commands/revert.rs` (line 200), … (+20 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 3 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
What to do
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 1 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
3 of 253 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is lib/src/eol.rs. Counted over 253 of the 308 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Orphaned file · ×3lib/src/eol.rs:1
Orphaned files with no living knowledge
✓ On the Gold path — maintain.
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 12 Change coupling finding(s) in Change Coupling — start with track.rs (2), restore.rs (2), next.rs. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 1 Change coupling clique finding(s) in Change Coupling — start with git_backend.rs. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with log.rs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
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 Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
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✓ Tool-verified
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.
1 public type in `jj_core.merged_tree` is marked as implementation by its own namespace, folder or name: `TreeDiffStreamImpl` (core/src/merged_tree.rs:584, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — core/src/merged_tree.rs:584
What to do
Hide `jj_core.merged_tree` (`TreeDiffStreamImpl`) (Rust: `pub(crate)`, or keep the module private): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
Do you agree with this assessment?
P2 · Observability6.6 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 7/8 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `gen-protos`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
`.github/dependabot.yml` schedules updates, but no `package-ecosystem` entry covers `uv`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list. — .github/dependabot.yml:2
What to do
Dependabot is configured but does not watch `uv` — add that `package-ecosystem` entry to .github/dependabot.yml so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`print_updated_working_copy_stats` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — cli/src/cli_util.rs:2937
`cmd_bench_common_ancestors` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — cli/src/commands/bench/common_ancestors.rs:38
`cmd_bench_is_ancestor` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — cli/src/commands/bench/is_ancestor.rs:36
`cmd_bench_resolve_prefix` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — cli/src/commands/bench/resolve_prefix.rs:34
`bench_revset` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — cli/src/commands/bench/revset.rs:78
`cmd_fix` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — cli/src/commands/fix.rs:188
`query_watchman` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — lib/src/local_working_copy.rs:1289
`is_watchman_trigger_registered` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — lib/src/local_working_copy.rs:1320
`process_dir_entry` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — lib/src/local_working_copy.rs:1768
What to do
Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
This runs a future to completion from inside an `async` body, which is already being polled by an executor. tokio's `Runtime::block_on` and `Handle::block_on` panic ("Cannot start a runtime from within a runtime"), and `futures::executor::block_on` parks the worker thread on a future that may need that very thread to make progress — a deadlock. The future can simply be awaited here: `fut.await`. Where a synchronous function in between forces the bridge, make that function `async` too, or run the bridge off the executor with `tokio::task::spawn_blocking(move || handle.block_on(fut)).await`. (×3) — lib/src/local_working_copy.rs:1312, lib/src/local_working_copy.rs:1341, cli/src/cli_util.rs:2953
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`info!` at line 51 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — local-util/src/lock/fallback.rs:51
`info!` at line 62 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — local-util/src/lock/fallback.rs:62
`info!` at line 44 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — local-util/src/lock/unix.rs:44
`info!` at line 98 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — local-util/src/lock/unix.rs:98
`info!` at line 57 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — local-util/src/lock/windows.rs:57
`info!` at line 87 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — local-util/src/lock/windows.rs:87
`debug!` at line 647 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — lib/src/git_subprocess.rs:647
`info!` at line 284 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — cli/src/merge_tools/external.rs:284
`debug!` at line 538 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — cli/src/commands/run.rs:538
`debug!` at line 579 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — cli/src/commands/run.rs:579
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
0/1 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
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 — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 14 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 73 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 — Not applicable: Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one.
AX2 Stateful singletons — Not applicable: Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
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 — no exported interface declares behaviour
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 — the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): `npm run` found no package.json in the folder where our sandbox ran it. This is a limit of our sandbox, not of your repository. Last output: "npm error code ENOENT / npm error syscall open / npm error path <repo>/package.json / npm error errno -2 / npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '<repo>/package.json' / npm error enoent This is related to npm not being able to find a file. / npm error enoent / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository starts no server another machine can reach (no actix-web HttpServer, axum::serve, Rocket launch, warp::serve, poem or salvo Server, tonic Server::builder, hyper or tiny_http server outside examples and tests, none bound beyond loopback). Access control is therefore N/A here — a crate is authorized by the application that serves it, 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 a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D10 Test Quality — ~117398 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
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 (13829 declarations, no unit with a dominant convention).
D22 Internal API Consistency — API consistency is measured on C# 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 — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D8 Code Coverage — Code Coverage not included (check did not complete)
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
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
M4 Documentation accuracy — Not applicable: the 101 current-state document(s) make no claim of a kind M4 checks. 64 claim(s) of kinds M4 does not check were not checked (path 24, command argument 7, environment variable 27, setting 6); M4 checks only links and versions and artefact counts.
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Rust source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage 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
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: 301 Rust file(s) were read for weak hashes and ciphers, key material fixed in the source, disabled TLS certificate validation and obsolete TLS versions, and none was found. This repository serves no HTTP of its own — no HTTP-server crate (actix-web, axum, Rocket, warp, poem, tide, salvo, tonic, a hyper server, …) among its Cargo manifests' run-time dependencies, and no server started in its production source — so HTTPS enforcement, HSTS, cookie flags and input validation are N/A here, as they are for a C# library or worker. If this codebase starts serving HTTP, the dimension reactivates automatically.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X12 Unreachable branch — X12 reached only 0% of this repository's production lines — rust (145,143 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 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
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — no C# was loaded; this repository's Rust was read, and no request in it can be cancelled by a caller — a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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 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
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: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. Rust's compiler refuses the unsynchronised version: a collection shared between a callback's thread and the waiting body must be `Sync`, which a `Vec`, `VecDeque` or `HashMap` is only behind a `Mutex`/`RwLock`, so the race this check looks for cannot be written in safe Rust. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Critical — 4 finding(s)
X1 · Async correctness· `block_on` inside an `async` body · ×3
`block_on` inside an `async` body lib/src/local_working_copy.rs:1312— This runs a future to completion from inside an `async` body, which is already being polled by an executor. tokio's `Runtime::block_on` and `Handle::block_on` panic ("Cannot start a runtime from within a runtime"), and `futures::executor::block_on` parks the worker thread on a future that may need that very thread to make progress — a deadlock. The future can simply be awaited here: `fut.await`. Where a synchronous function in between forces the bridge, make that function `async` too, or run the bridge off the executor with `tokio::task::spawn_blocking(move || handle.block_on(fut)).await`.
`block_on` inside an `async` body lib/src/local_working_copy.rs:1341— This runs a future to completion from inside an `async` body, which is already being polled by an executor. tokio's `Runtime::block_on` and `Handle::block_on` panic ("Cannot start a runtime from within a runtime"), and `futures::executor::block_on` parks the worker thread on a future that may need that very thread to make progress — a deadlock. The future can simply be awaited here: `fut.await`. Where a synchronous function in between forces the bridge, make that function `async` too, or run the bridge off the executor with `tokio::task::spawn_blocking(move || handle.block_on(fut)).await`.
`block_on` inside an `async` body cli/src/cli_util.rs:2953— This runs a future to completion from inside an `async` body, which is already being polled by an executor. tokio's `Runtime::block_on` and `Handle::block_on` panic ("Cannot start a runtime from within a runtime"), and `futures::executor::block_on` parks the worker thread on a future that may need that very thread to make progress — a deadlock. The future can simply be awaited here: `fut.await`. Where a synchronous function in between forces the bridge, make that function `async` too, or run the bridge off the executor with `tokio::task::spawn_blocking(move || handle.block_on(fut)).await`.
TodoComment local-util/src/file_util.rs:349— // TODO: Update mtime to help GC keep this file — 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 local-util/src/file_util.rs:381— // TODO: do not consume file object — 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 local-util/src/file_util.rs:569— // TODO: Use `std::os::wasi::ffi::OsStrExt` when it becomes stable. — 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 local-util/src/stacked_table.rs:324— // TODO: We should probably also squash if the parent file has less than N — 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 default-index/src/mutable.rs:323— // TODO: We should probably also squash if the parent file has less than N — 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 lib/testutils/src/lib.rs:128— // TODO: Consider figuring out a way to make `GitBackend` and `git(1)` calls in — 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 lib/testutils/src/proptest.rs:56— // TODO: Only files are created for now; extend test to include symlinks. — 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 lib/testutils/src/proptest.rs:60— // TODO: Only files are created for now; extend test to include submodules. — 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 lib/tests/test_bisect.rs:197— // TODO: Avoid testing every commit near first skipped commit. Test e.g. 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.
TodoComment lib/tests/test_conflicts.rs:487— // TODO: With options — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment lib/tests/test_converge.rs:792— // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment lib/tests/test_converge.rs:1064— // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cli/tests/test_config_command.rs:1682— // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cli/tests/test_global_opts.rs:1102— // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cli/src/diff_util.rs:635— // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment lib/tests/test_git.rs:3642— // TODO: The bookmarks that we made conflicting changes to should have failed to — 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 lib/tests/test_git.rs:6561— // TODO(ilyagr): More tests for push safety checks were originally planned. We — 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 lib/tests/test_git.rs:6657— // We cannot delete it or move it sideways. (TODO: Moving it backwards is — 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 lib/tests/test_git.rs:7081— // TODO: Fix flaky test on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment lib/tests/test_git_backend.rs:115— // TODO: Better way to disable the test if git command couldn't be executed — 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 lib/tests/test_local_working_copy.rs:2116— // TODO: find a way to trigger the error on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment lib/tests/test_local_working_copy.rs:2611— // TODO: Add more weird patterns? — 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 lib/tests/test_merge_trees.rs:118— // TODO: Add tests for simplification of multi-way conflicts. Both the content — 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 lib/tests/test_merged_tree.rs:3233— // TODO: In the current implementation we don't necessarily visit matching — 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 lib/tests/test_merged_tree.rs:3244— // TODO Verify that the diff contains exactly "m", see above. — 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.
jj_cli::commands::git::push::cmd_git_push (cognitive 109) cli/src/commands/git/push.rs:279— jj_cli::commands::git::push::cmd_git_push has cognitive complexity 109 (threshold 15). Drivers by points: if/else 26 (47 pts), loops 11 (28 pts), match/switch 8 (25 pts), boolean chains 9 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::commands::squash::cmd_squash (cognitive 75) cli/src/commands/squash.rs:193— jj_cli::commands::squash::cmd_squash has cognitive complexity 75 (threshold 15). Drivers by points: if/else 33 (61 pts), boolean chains 6, loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::commands::log::cmd_log (cognitive 59) cli/src/commands/log.rs:135— jj_cli::commands::log::cmd_log has cognitive complexity 59 (threshold 15). Drivers by points: if/else 25 (39 pts), loops 5 (12 pts), match/switch 2 (5 pts), boolean chains 3 (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.
jj_cli::commands::gerrit::upload::cmd_gerrit_upload (cognitive 55) cli/src/commands/gerrit/upload.rs:437— jj_cli::commands::gerrit::upload::cmd_gerrit_upload has cognitive complexity 55 (threshold 15). Drivers by points: if/else 21 (42 pts), boolean chains 6, match/switch 2 (4 pts), loops 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::commands::file::search::cmd_file_search (cognitive 52) cli/src/commands/file/search.rs:88— jj_cli::commands::file::search::cmd_file_search has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (40 pts), loops 2 (5 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::commands::status::cmd_status (cognitive 38) cli/src/commands/status.rs:68— jj_cli::commands::status::cmd_status has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 5 (13 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::diff_util::show_color_words_diff (cognitive 37) cli/src/diff_util.rs:1525— jj_cli::diff_util::show_color_words_diff has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (29 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::commands::git::clone::cmd_git_clone (cognitive 36) cli/src/commands/git/clone.rs:172— jj_cli::commands::git::clone::cmd_git_clone has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (25 pts), match/switch 5 (8 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
jj_cli::commands::operation::diff::show_op_diff (cognitive 36) cli/src/commands/operation/diff.rs:269— jj_cli::commands::operation::diff::show_op_diff has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 7 (16 pts), match/switch 2, boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::commands::duplicate::cmd_duplicate (cognitive 35) cli/src/commands/duplicate.rs:103— jj_cli::commands::duplicate::cmd_duplicate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 5 (12 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::commands::bookmark::rename::cmd_bookmark_rename (cognitive 34) cli/src/commands/bookmark/rename.rs:49— jj_cli::commands::bookmark::rename::cmd_bookmark_rename has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 3 (5 pts), boolean chains 4, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::diff_util::show_git_diff (cognitive 34) cli/src/diff_util.rs:1911— jj_cli::diff_util::show_git_diff has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 4 (10 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::commands::bookmark::set::cmd_bookmark_set (cognitive 32) cli/src/commands/bookmark/set.rs:62— jj_cli::commands::bookmark::set::cmd_bookmark_set has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::testing::fake-formatter::main (cognitive 32) cli/testing/fake-formatter.rs:132— jj_cli::testing::fake-formatter::main has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21 (29 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::commands::metaedit::cmd_metaedit (cognitive 30) cli/src/commands/metaedit.rs:135— jj_cli::commands::metaedit::cmd_metaedit has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 5, 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.
jj_cli::commands::bisect::run::cmd_bisect_run (cognitive 28) cli/src/commands/bisect/run.rs:131— jj_cli::commands::bisect::run::cmd_bisect_run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 4 (8 pts), match/switch 3 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::commands::bookmark::track::cmd_bookmark_track (cognitive 27) cli/src/commands/bookmark/track.rs:74— jj_cli::commands::bookmark::track::cmd_bookmark_track has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 5 (9 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::commands::describe::cmd_describe (cognitive 27) cli/src/commands/describe.rs:89— jj_cli::commands::describe::cmd_describe has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 2 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
jj_cli::commands::git::fetch::cmd_git_fetch (cognitive 26) cli/src/commands/git/fetch.rs:130— jj_cli::commands::git::fetch::cmd_git_fetch has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 3 (5 pts), match/switch 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
jj_cli::commands::debug::object::cmd_debug_object (cognitive 25) cli/src/commands/debug/object.rs:116— jj_cli::commands::debug::object::cmd_debug_object has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
jj_cli::commands::git::init::do_init (cognitive 25) cli/src/commands/git/init.rs:199— jj_cli::commands::git::init::do_init has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::commands::new::cmd_new (cognitive 25) cli/src/commands/new.rs:162— jj_cli::commands::new::cmd_new has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 2 (3 pts), boolean chains 2, 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.
jj_cli::commands::operation::log::do_op_log (cognitive 25) cli/src/commands/operation/log.rs:131— jj_cli::commands::operation::log::do_op_log has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::commands::arrange::run_tui (cognitive 24) cli/src/commands/arrange.rs:481— jj_cli::commands::arrange::run_tui has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (4 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_cli::diff_util::show_diff_stats (cognitive 24) cli/src/diff_util.rs:2247— jj_cli::diff_util::show_diff_stats has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 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.
FileTooLong: src/cli_util.rs cli/src/cli_util.rs— FileTooLong — 3327 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 42 free functions. The bar is 500 significant lines; this is 2827 over it, 6.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/commit_templater.rs cli/src/commit_templater.rs— FileTooLong — 2492 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 37 free functions. The bar is 500 significant lines; this is 1992 over it, 4.98× 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/git.rs lib/src/git.rs— FileTooLong — 2413 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 78 free functions. The bar is 500 significant lines; this is 1913 over it, 4.83× 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/template_builder.rs cli/src/template_builder.rs— FileTooLong — 2329 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 47 free functions. The bar is 500 significant lines; this is 1829 over it, 4.66× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/revset.rs lib/src/revset.rs— FileTooLong — 2316 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 39 free functions. The bar is 500 significant lines; this is 1816 over it, 4.63× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/local_working_copy.rs lib/src/local_working_copy.rs— FileTooLong — 2062 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 1562 over it, 4.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/diff_util.rs cli/src/diff_util.rs— FileTooLong — 1825 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 41 free functions. The bar is 500 significant lines; this is 1325 over it, 3.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/repo.rs lib/src/repo.rs— FileTooLong — 1297 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 797 over it, 2.59× 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/git_backend.rs git-backend/src/git_backend.rs— FileTooLong — 1145 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 645 over it, 2.29× 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/revset_engine.rs default-index/src/revset_engine.rs— FileTooLong — 1095 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 595 over it, 2.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: git/push.rs cli/src/commands/git/push.rs— FileTooLong — 1005 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 505 over it, 2.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/complete.rs cli/src/complete.rs— FileTooLong — 959 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 58 free functions. The bar is 500 significant lines; this is 459 over it, 1.92× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/command_error.rs cli/src/command_error.rs— FileTooLong — 875 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 375 over it, 1.75× 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/rewrite.rs lib/src/rewrite.rs— FileTooLong — 865 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 365 over it, 1.73× 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/config.rs cli/src/config.rs— FileTooLong — 781 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 281 over it, 1.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/templater.rs cli/src/templater.rs— FileTooLong — 753 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 253 over it, 1.51× 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/conflicts.rs core/src/conflicts.rs— FileTooLong — 751 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 251 over it, 1.50× 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/lib.rs lib/testutils/src/lib.rs— FileTooLong — 747 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 37 free functions. The bar is 500 significant lines; this is 247 over it, 1.49× 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/template_parser.rs dsl/src/template_parser.rs— FileTooLong — 685 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 185 over it, 1.37× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/simple_op_store.rs lib/src/simple_op_store.rs— FileTooLong — 678 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 178 over it, 1.36× 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: operation/diff.rs cli/src/commands/operation/diff.rs— FileTooLong — 663 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 163 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: src/diff.rs core/src/diff.rs— FileTooLong — 636 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 136 over it, 1.27× 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/dsl_util.rs dsl/src/dsl_util.rs— FileTooLong — 626 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 126 over it, 1.25× 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/revset_parser.rs dsl/src/revset_parser.rs— FileTooLong — 625 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 125 over it, 1.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: commands/run.rs cli/src/commands/run.rs— FileTooLong — 607 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 107 over it, 1.21× 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.
FunctionTooLong: jj_cli::template_builder::builtin_functions cli/src/template_builder.rs:2368— FunctionTooLong — jj_cli::template_builder::builtin_functions runs 280 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 180 over it, 2.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::commit_templater::builtin_commit_methods cli/src/commit_templater.rs:1255— FunctionTooLong — jj_cli::commit_templater::builtin_commit_methods runs 276 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 176 over it, 2.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::commands::operation::diff::show_op_diff cli/src/commands/operation/diff.rs:269— FunctionTooLong — jj_cli::commands::operation::diff::show_op_diff runs 257 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 157 over it, 2.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::commands::git::push::cmd_git_push cli/src/commands/git/push.rs:279— FunctionTooLong — jj_cli::commands::git::push::cmd_git_push runs 256 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 156 over it, 2.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::commands::log::cmd_log cli/src/commands/log.rs:135— FunctionTooLong — jj_cli::commands::log::cmd_log runs 215 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 115 over it, 2.15× 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: jj_cli::commands::squash::cmd_squash cli/src/commands/squash.rs:193— FunctionTooLong — jj_cli::commands::squash::cmd_squash runs 211 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 111 over it, 2.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: jj_lib::rewrite::compute_move_commits lib/src/rewrite.rs:556— FunctionTooLong — jj_lib::rewrite::compute_move_commits runs 191 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 91 over it, 1.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::commands::gerrit::upload::cmd_gerrit_upload cli/src/commands/gerrit/upload.rs:437— FunctionTooLong — jj_cli::commands::gerrit::upload::cmd_gerrit_upload runs 184 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 84 over it, 1.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::template_builder::builtin_string_methods cli/src/template_builder.rs:1327— FunctionTooLong — jj_cli::template_builder::builtin_string_methods runs 166 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 66 over it, 1.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::template_builder::builtin_byte_string_methods cli/src/template_builder.rs:1118— FunctionTooLong — jj_cli::template_builder::builtin_byte_string_methods runs 163 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 63 over it, 1.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::commands::run::cmd_run cli/src/commands/run.rs:766— FunctionTooLong — jj_cli::commands::run::cmd_run runs 162 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 62 over it, 1.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_lib::revset::try_transform_expression lib/src/revset.rs:1561— FunctionTooLong — jj_lib::revset::try_transform_expression runs 156 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 56 over it, 1.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_lib::revset::fold_child_expression_state lib/src/revset.rs:1796— FunctionTooLong — jj_lib::revset::fold_child_expression_state runs 150 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::diff_util::show_color_words_diff cli/src/diff_util.rs:1525— FunctionTooLong — jj_cli::diff_util::show_color_words_diff runs 148 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 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::commands::status::cmd_status cli/src/commands/status.rs:68— FunctionTooLong — jj_cli::commands::status::cmd_status runs 145 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 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::commands::git::clone::cmd_git_clone cli/src/commands/git/clone.rs:172— FunctionTooLong — jj_cli::commands::git::clone::cmd_git_clone runs 139 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::commit_templater::builtin_tree_diff_methods cli/src/commit_templater.rs:2610— FunctionTooLong — jj_cli::commit_templater::builtin_tree_diff_methods runs 139 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::commands::bisect::run::cmd_bisect_run cli/src/commands/bisect/run.rs:131— FunctionTooLong — jj_cli::commands::bisect::run::cmd_bisect_run runs 137 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::commands::operation::log::do_op_log cli/src/commands/operation/log.rs:131— FunctionTooLong — jj_cli::commands::operation::log::do_op_log runs 137 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_lib::fix::fix_files lib/src/fix.rs:181— FunctionTooLong — jj_lib::fix::fix_files runs 126 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 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::commands::workspace::add::cmd_workspace_add cli/src/commands/workspace/add.rs:112— FunctionTooLong — jj_cli::commands::workspace::add::cmd_workspace_add runs 117 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 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::commands::bookmark::rename::cmd_bookmark_rename cli/src/commands/bookmark/rename.rs:49— FunctionTooLong — jj_cli::commands::bookmark::rename::cmd_bookmark_rename runs 116 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 16 over it, 1.16× 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: jj_cli::commands::abandon::cmd_abandon cli/src/commands/abandon.rs:69— FunctionTooLong — jj_cli::commands::abandon::cmd_abandon runs 114 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 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: jj_cli::commands::revert::cmd_revert cli/src/commands/revert.rs:99— FunctionTooLong — jj_cli::commands::revert::cmd_revert 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: jj_default_index::revset_engine::build_predicate_fn default-index/src/revset_engine.rs:1285— FunctionTooLong — jj_default_index::revset_engine::build_predicate_fn runs 108 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 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
jj_cli::commands::git::push::cmd_git_push (cyclomatic 55) cli/src/commands/git/push.rs:279— jj_cli::commands::git::push::cmd_git_push has cyclomatic complexity 55 (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.
jj_cli::commands::squash::cmd_squash (cyclomatic 36) cli/src/commands/squash.rs:193— jj_cli::commands::squash::cmd_squash has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
jj_cli::commands::log::cmd_log (cyclomatic 31) cli/src/commands/log.rs:135— jj_cli::commands::log::cmd_log 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.
jj_cli::commands::gerrit::upload::cmd_gerrit_upload (cyclomatic 28) cli/src/commands/gerrit/upload.rs:437— jj_cli::commands::gerrit::upload::cmd_gerrit_upload 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.
jj_cli::commands::file::search::cmd_file_search (cyclomatic 26) cli/src/commands/file/search.rs:88— jj_cli::commands::file::search::cmd_file_search 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.
jj_cli::commands::git::clone::cmd_git_clone (cyclomatic 24) cli/src/commands/git/clone.rs:172— jj_cli::commands::git::clone::cmd_git_clone has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
jj_cli::commands::bookmark::rename::cmd_bookmark_rename (cyclomatic 23) cli/src/commands/bookmark/rename.rs:49— jj_cli::commands::bookmark::rename::cmd_bookmark_rename 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.
jj_cli::commands::metaedit::cmd_metaedit (cyclomatic 23) cli/src/commands/metaedit.rs:135— jj_cli::commands::metaedit::cmd_metaedit 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.
jj_cli::diff_util::show_color_words_diff (cyclomatic 23) cli/src/diff_util.rs:1525— jj_cli::diff_util::show_color_words_diff 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.
jj_cli::commands::bisect::run::cmd_bisect_run (cyclomatic 20) cli/src/commands/bisect/run.rs:131— jj_cli::commands::bisect::run::cmd_bisect_run has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
jj_cli::commands::operation::diff::show_op_diff (cyclomatic 20) cli/src/commands/operation/diff.rs:269— jj_cli::commands::operation::diff::show_op_diff has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
jj_cli::template_builder::build_binary_operation (cyclomatic 20) cli/src/template_builder.rs:1029— jj_cli::template_builder::build_binary_operation 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. This is NOT this file's highest cyclomatic complexity: CoreTemplatePropertyKind::try_into_eq (cyclomatic 32) 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.
jj_cli::commands::describe::cmd_describe (cyclomatic 19) cli/src/commands/describe.rs:89— jj_cli::commands::describe::cmd_describe has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
jj_cli::commands::duplicate::cmd_duplicate (cyclomatic 19) cli/src/commands/duplicate.rs:103— jj_cli::commands::duplicate::cmd_duplicate 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.
jj_cli::testing::fake-diff-editor::main (cyclomatic 19) cli/testing/fake-diff-editor.rs:59— jj_cli::testing::fake-diff-editor::main has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
jj_cli::commands::bookmark::list::cmd_bookmark_list (cyclomatic 18) cli/src/commands/bookmark/list.rs:124— jj_cli::commands::bookmark::list::cmd_bookmark_list 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.
jj_cli::commands::bookmark::track::cmd_bookmark_track (cyclomatic 18) cli/src/commands/bookmark/track.rs:74— jj_cli::commands::bookmark::track::cmd_bookmark_track 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.
jj_cli::commands::bookmark::set::cmd_bookmark_set (cyclomatic 17) cli/src/commands/bookmark/set.rs:62— jj_cli::commands::bookmark::set::cmd_bookmark_set 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.
jj_cli::commands::git::fetch::cmd_git_fetch (cyclomatic 17) cli/src/commands/git/fetch.rs:130— jj_cli::commands::git::fetch::cmd_git_fetch 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.
jj_cli::commands::new::cmd_new (cyclomatic 17) cli/src/commands/new.rs:162— jj_cli::commands::new::cmd_new 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.
jj_cli::commands::workspace::add::cmd_workspace_add (cyclomatic 17) cli/src/commands/workspace/add.rs:112— jj_cli::commands::workspace::add::cmd_workspace_add 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.
jj_cli::diff_util::show_git_diff (cyclomatic 17) cli/src/diff_util.rs:1911— jj_cli::diff_util::show_git_diff 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.
jj_cli::testing::fake-editor::main (cyclomatic 17) cli/testing/fake-editor.rs:34— jj_cli::testing::fake-editor::main 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.
jj_cli::testing::fake-formatter::main (cyclomatic 17) cli/testing/fake-formatter.rs:132— jj_cli::testing::fake-formatter::main 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.
jj_cli::commands::run::cmd_run (cyclomatic 16) cli/src/commands/run.rs:766— jj_cli::commands::run::cmd_run 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.
Hotspot: cli/src/cli_util.rs cli/src/cli_util.rs:1277— cli/src/cli_util.rs changed 68 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in CliRunnerEventHandler::print_event at line 1277. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/src/cli_util.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: cli/src/commands/git/push.rs cli/src/commands/git/push.rs:279— cli/src/commands/git/push.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in jj_cli::commands::git::push::cmd_git_push at line 279. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/src/commands/git/push.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: lib/src/git.rs lib/src/git.rs:668— lib/src/git.rs changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in jj_lib::git::import_refs_inner at line 668. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- lib/src/git.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: lib/src/local_working_copy.rs lib/src/local_working_copy.rs:2388— lib/src/local_working_copy.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in TreeState::update at line 2388. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- lib/src/local_working_copy.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: cli/src/diff_util.rs cli/src/diff_util.rs:1525— cli/src/diff_util.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in jj_cli::diff_util::show_color_words_diff at line 1525. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/src/diff_util.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: core/src/merged_tree.rs core/src/merged_tree.rs:659— core/src/merged_tree.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in TreeDiffVisitor::visit at line 659. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- core/src/merged_tree.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: cli/src/commands/log.rs cli/src/commands/log.rs:135— cli/src/commands/log.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in jj_cli::commands::log::cmd_log at line 135. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/src/commands/log.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: cli/src/commands/run.rs cli/src/commands/run.rs:209— cli/src/commands/run.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in WorkspacePool::acquire at line 209. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/src/commands/run.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: cli/src/commands/status.rs cli/src/commands/status.rs:68— cli/src/commands/status.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in jj_cli::commands::status::cmd_status at line 68. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/src/commands/status.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: cli/src/commands/git/clone.rs cli/src/commands/git/clone.rs:172— cli/src/commands/git/clone.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in jj_cli::commands::git::clone::cmd_git_clone at line 172. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/src/commands/git/clone.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: cli/src/commands/squash.rs cli/src/commands/squash.rs:193— cli/src/commands/squash.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in jj_cli::commands::squash::cmd_squash at line 193. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/src/commands/squash.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: cli/src/commands/gerrit/upload.rs cli/src/commands/gerrit/upload.rs:437— cli/src/commands/gerrit/upload.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in jj_cli::commands::gerrit::upload::cmd_gerrit_upload at line 437. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/src/commands/gerrit/upload.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: cli/src/commands/file/search.rs cli/src/commands/file/search.rs:88— cli/src/commands/file/search.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in jj_cli::commands::file::search::cmd_file_search 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/src/commands/file/search.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: cli/src/commands/workspace/add.rs cli/src/commands/workspace/add.rs:112— cli/src/commands/workspace/add.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in jj_cli::commands::workspace::add::cmd_workspace_add at line 112. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/src/commands/workspace/add.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: lib/src/fix.rs lib/src/fix.rs:181— lib/src/fix.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in jj_lib::fix::fix_files at line 181. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- lib/src/fix.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: cli/src/commands/git/fetch.rs cli/src/commands/git/fetch.rs:130— cli/src/commands/git/fetch.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in jj_cli::commands::git::fetch::cmd_git_fetch at line 130. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/src/commands/git/fetch.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: cli/src/commands/bisect/run.rs cli/src/commands/bisect/run.rs:131— cli/src/commands/bisect/run.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in jj_cli::commands::bisect::run::cmd_bisect_run at line 131. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/src/commands/bisect/run.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: cli/src/commands/describe.rs cli/src/commands/describe.rs:89— cli/src/commands/describe.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in jj_cli::commands::describe::cmd_describe at line 89. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/src/commands/describe.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: cli/testing/fake-editor.rs cli/testing/fake-editor.rs:34— cli/testing/fake-editor.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in jj_cli::testing::fake-editor::main at line 34. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 01:38:36 +00:00' --until='2026-11-13 01:38:36 +00:00' --full-history --no-merges -- cli/testing/fake-editor.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
jj_lib::rewrite::compute_move_commits (cognitive 84) lib/src/rewrite.rs:556— jj_lib::rewrite::compute_move_commits has cognitive complexity 84 (threshold 15). Drivers by points: if/else 33 (62 pts), loops 9 (20 pts), boolean chains 1, match/switch 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_lib::fix::fix_files (cognitive 39) lib/src/fix.rs:181— jj_lib::fix::fix_files has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 5 (9 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_lib::diff_presentation::unzip_diff_hunks_to_lines (cognitive 26) lib/src/diff_presentation/mod.rs:114— jj_lib::diff_presentation::unzip_diff_hunks_to_lines has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (10 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_lib::git::import_refs_inner (cognitive 26) lib/src/git.rs:668— jj_lib::git::import_refs_inner has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 6 (7 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_lib::absorb::split_file_hunks (cognitive 25) lib/src/absorb.rs:201— jj_lib::absorb::split_file_hunks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_lib::annotate::process_commits (cognitive 25) lib/src/annotate.rs:423— jj_lib::annotate::process_commits has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_lib::git::update_intent_to_add_impl (cognitive 21) lib/src/git.rs:2459— jj_lib::git::update_intent_to_add_impl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_lib::annotate::process_commit (cognitive 20) lib/src/annotate.rs:494— jj_lib::annotate::process_commit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (7 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_lib::git::export_refs_to_git (cognitive 19) lib/src/git.rs:1473— jj_lib::git::export_refs_to_git has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_lib::diff_presentation::unified::unified_diff_hunks (cognitive 18) lib/src/diff_presentation/unified.rs:205— jj_lib::diff_presentation::unified::unified_diff_hunks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_lib::git::record_synthetic_predecessors (cognitive 18) lib/src/git.rs:859— jj_lib::git::record_synthetic_predecessors has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 6 (8 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
jj_lib::git::resolve_git_ref_to_commit_id (cognitive 17) lib/src/git.rs:469— jj_lib::git::resolve_git_ref_to_commit_id has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3 (nesting depth added 8). 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.
jj_lib::git::reset_head (cognitive 17) lib/src/git.rs:2103— jj_lib::git::reset_head has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_lib::git::export_some_refs (cognitive 16) lib/src/git.rs:1388— jj_lib::git::export_some_refs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_lib::rewrite::duplicate_commits (cognitive 16) lib/src/rewrite.rs:949— jj_lib::rewrite::duplicate_commits has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), 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.
FixmeComment lib/tests/test_git.rs:7326— // FIXME: new ancestors should be indexed — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment lib/tests/test_gpg.rs:232— // FIXME — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment lib/tests/test_gpg.rs:260— // FIXME — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment lib/tests/test_gpg.rs:295— // FIXME — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment lib/tests/test_gpg.rs:330— // FIXME — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment lib/tests/test_gpg.rs:356— // FIXME — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment lib/tests/test_gpg.rs:384— // FIXME — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment lib/tests/test_gpg.rs:419— // FIXME — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment lib/tests/test_gpg.rs:457— // FIXME — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment lib/tests/test_local_working_copy.rs:2325— // FIXME — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment lib/src/commit_builder.rs:456— // FIXME: Google's index.has_id() always returns true. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment cli/tests/test_operations.rs:2296— // FIXME: the diff should be empty — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment cli/src/template_builder.rs:2045— // FIXME: This error should probably be reported on the type — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment cli/src/merge_tools/builtin.rs:783— // FIXME: It doesn't make sense to select a new value from the source tree. — 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.
Duplicated block (8 lines × 2) cli/src/commands/bookmark/advance.rs:155— cli/src/commands/bookmark/advance.rs:155-162 | cli/src/commands/bookmark/move.rs:115-122 — before extracting anything, compare `cli/src/commands/bookmark/advance.rs` and `cli/src/commands/bookmark/move.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/advance.rs:155` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) cli/src/commands/workspace/forget.rs:116— cli/src/commands/workspace/forget.rs:116-123 | cli/src/commands/workspace/remove.rs:163-170 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `cli/src/commands/workspace/remove.rs:161` calls `forget`, `iter`, `as_ref` and `cli/src/commands/workspace/forget.rs:114` 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) cli/src/commit_templater.rs:2124— cli/src/commit_templater.rs:2124-2131 | cli/src/commit_templater.rs:2139-2146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:2124` 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) core/src/merged_tree.rs:527— core/src/merged_tree.rs:527-534 | core/src/merged_tree.rs:565-572 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/merged_tree.rs:527` it does not close everything it opens, so those exact lines 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) default-index/src/composite.rs:257— default-index/src/composite.rs:257-264 | default-index/src/composite.rs:285-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `default-index/src/composite.rs:257` it begins part-way through the construct above it, so those exact lines 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) default-index/src/store.rs:417— default-index/src/store.rs:417-425 | default-index/src/store.rs:433-440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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, `default-index/src/store.rs:441` calls `maybe_squash_with_ancestors` and `default-index/src/store.rs:425` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) git-backend/src/git_backend.rs:513— git-backend/src/git_backend.rs:513-520 | git-backend/src/git_backend.rs:1130-1137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `id` to `&FileId` in one and `&SymlinkId` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) lib/src/git.rs:746— lib/src/git.rs:746-753 | lib/src/git.rs:766-773 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/src/git.rs:746` it does not close everything it opens, so those exact lines 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) lib/src/repo.rs:1950— lib/src/repo.rs:1950-1957 | lib/src/repo.rs:1971-1978 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/src/repo.rs:1950` it does not close everything it opens, so those exact lines 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) lib/src/revset.rs:3039— lib/src/revset.rs:3039-3046 | lib/src/revset.rs:3065-3072 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/src/revset.rs:3039` it begins part-way through the construct above it, so those exact lines 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) core/src/fileset_backend.rs:168— core/src/fileset_backend.rs:168-175 | core/src/str_util.rs:422-429 — 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) cli/src/commands/bookmark/track.rs:118— cli/src/commands/bookmark/track.rs:118-128 | cli/src/commands/tag/track.rs:112-119 — `cli/src/commands/bookmark/track.rs` and `cli/src/commands/tag/track.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/track.rs:118` it begins part-way through the construct above it, so those exact lines 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) cli/src/commands/bookmark/delete.rs:64— cli/src/commands/bookmark/delete.rs:64-71 | cli/src/commands/tag/delete.rs:54-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/delete.rs:64` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) git-backend/src/secret_backend.rs:128— git-backend/src/secret_backend.rs:128-135 | git-backend/src/secret_backend.rs:149-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, 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 `id` to `&FileId` in one and `&SymlinkId` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) cli/src/commands/squash.rs:423— cli/src/commands/squash.rs:423-432 | cli/src/commands/squash.rs:438-447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) cli/src/complete.rs:85— cli/src/complete.rs:85-94 | cli/src/complete.rs:267-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 `cli/src/complete.rs:85` it begins part-way through the construct above it, so those exact lines 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) cli/src/diff_util.rs:1575— cli/src/diff_util.rs:1575-1584 | cli/src/diff_util.rs:1674-1683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/diff_util.rs:1575` it begins part-way through the construct above it, so those exact lines 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) cli/src/git_util.rs:501— cli/src/git_util.rs:501-510 | cli/src/git_util.rs:522-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/git_util.rs:501` it begins part-way through the construct above it, so those exact lines 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) cli/src/template_builder.rs:1158— cli/src/template_builder.rs:1158-1167 | cli/src/template_builder.rs:1367-1376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:1158` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) cli/src/template_builder.rs:1169— cli/src/template_builder.rs:1169-1178 | cli/src/template_builder.rs:1378-1387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:1169` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) cli/src/template_builder.rs:2445— cli/src/template_builder.rs:2445-2454 | cli/src/template_builder.rs:2461-2470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:2445` it does not close everything it opens, so those exact lines 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) dsl/src/fileset_parser.rs:437— dsl/src/fileset_parser.rs:437-446 | dsl/src/template_parser.rs:769-778 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/template_parser.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `dsl/src/fileset_parser.rs:437` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `dsl/src/fileset_parser.rs:447` calls `Ok`, `union_nodes` and `dsl/src/template_parser.rs:779` 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 × 2) lib/src/git.rs:1794— lib/src/git.rs:1794-1803 | lib/src/git.rs:1826-1836 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/src/git.rs:1794` it does not close everything it opens, so those exact lines 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) cli/src/commands/git/fetch.rs:264— cli/src/commands/git/fetch.rs:264-273 | cli/src/commands/git/push.rs:1086-1095 — 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 `cli/src/commands/git/fetch.rs:264` it does not close everything it opens, so those exact lines 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) cli/src/commands/bookmark/mod.rs:194— cli/src/commands/bookmark/mod.rs:194-203 | cli/src/commands/tag/mod.rs:128-137 — `cli/src/commands/bookmark/mod.rs` and `cli/src/commands/tag/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/mod.rs:194` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) cli/src/commands/redo.rs:132— cli/src/commands/redo.rs:132-141 | cli/src/commands/undo.rs:120-129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/redo.rs:132` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&RedoArgs` in one and `&UndoArgs` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) lib/testutils/src/test_backend.rs:267— lib/testutils/src/test_backend.rs:267-276 | lib/testutils/src/test_backend.rs:364-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/testutils/src/test_backend.rs:267` 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 `id` to `&SymlinkId` in one and `&TreeId` 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) cli/src/commands/bookmark/advance.rs:165— cli/src/commands/bookmark/advance.rs:165-173 | cli/src/commands/bookmark/move.rs:126-134 — before extracting anything, compare `cli/src/commands/bookmark/advance.rs` and `cli/src/commands/bookmark/move.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/advance.rs:165` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) cli/src/commands/bookmark/list.rs:192— cli/src/commands/bookmark/list.rs:192-200 | cli/src/commands/tag/list.rs:189-197 — `cli/src/commands/bookmark/list.rs` and `cli/src/commands/tag/list.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 44 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) cli/src/commands/bookmark/track.rs:79— cli/src/commands/bookmark/track.rs:79-87 | cli/src/commands/tag/track.rs:73-81 — `cli/src/commands/bookmark/track.rs` and `cli/src/commands/tag/track.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/track.rs:79` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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 `args` to `&BookmarkTrackArgs` in one and `&TagTrackArgs` 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) cli/src/commands/git/clone.rs:205— cli/src/commands/git/clone.rs:205-213 | cli/src/commands/git/fetch.rs:171-179 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&GitCloneArgs` in one and `&GitFetchArgs` 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) cli/src/commands/operation/diff.rs:516— cli/src/commands/operation/diff.rs:516-524 | cli/src/commands/operation/diff.rs:558-566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/operation/diff.rs:516` it begins part-way through the construct above it, so those exact lines 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) cli/src/commit_templater.rs:1699— cli/src/commit_templater.rs:1699-1707 | cli/src/commit_templater.rs:3259-3267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:1699` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) cli/src/template_builder.rs:1243— cli/src/template_builder.rs:1243-1251 | cli/src/template_builder.rs:1453-1461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:1243` it begins part-way through the construct above it, so those exact lines 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) core/src/merged_tree.rs:210— core/src/merged_tree.rs:210-218 | core/src/merged_tree.rs:293-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) cli/src/commit_templater.rs:1922— cli/src/commit_templater.rs:1922-1930 | cli/src/commit_templater.rs:1939-1947 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:1922` it begins part-way through the construct above it, so those exact lines 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) cli/src/commands/bookmark/untrack.rs:121— cli/src/commands/bookmark/untrack.rs:121-132 | cli/src/commands/tag/untrack.rs:118-126 — `cli/src/commands/bookmark/untrack.rs` and `cli/src/commands/tag/untrack.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 44 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/untrack.rs:121` it begins part-way through the construct above it, so those exact lines 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) cli/src/commit_templater.rs:1479— cli/src/commit_templater.rs:1479-1487 | cli/src/template_builder.rs:1891-1899 — 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 `cli/src/commit_templater.rs:1479` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) cli/src/commit_templater.rs:3138— cli/src/commit_templater.rs:3138-3146 | cli/src/commit_templater.rs:3150-3158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:3138` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) cli/src/commands/diffedit.rs:151— cli/src/commands/diffedit.rs:151-159 | cli/src/commands/restore.rs:190-198 — 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 `cli/src/commands/diffedit.rs:151` it begins part-way through the construct above it, so those 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 `&DiffeditArgs` in one and `&RestoreArgs` 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, `cli/src/commands/restore.rs:187` calls `start_transaction` and `cli/src/commands/diffedit.rs:148` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Change coupling: track.rs ↔ untrack.rs cli/src/commands/bookmark/track.rs:1— `cli/src/commands/bookmark/track.rs` and `cli/src/commands/bookmark/untrack.rs` change together 85% of the time (11 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `4211b00f` cli: bookmark: add proper support for track/untrack by <name>@<remote…; `67253467` docs: say "tracked remote bookmarks" in command help; `17a4c2c4` `bookmark track`: basic completion for the --remote argument — run `git show` on any of them.
Change coupling: next.rs ↔ prev.rs cli/src/commands/next.rs:1— `cli/src/commands/next.rs` and `cli/src/commands/prev.rs` change together 78% of the time (18 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 18 shared commits counted here, the most recent 3 are `1240487c` next/prev: delete obsolete help text about inferring --edit; `bb018a54` next/prev: Add config flag to control `prev/next` edit behaviour.; `e2a5c83e` Follow ups on post-submission comments for #4282. — run `git show` on any of them.
Change coupling: create.rs ↔ set.rs cli/src/commands/bookmark/create.rs:1— `cli/src/commands/bookmark/create.rs` and `cli/src/commands/bookmark/set.rs` change together 78% of the time (14 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `86b0b4d7` commit: make is_empty() and is_discardable() take index instead of repo; `6660647f` commit: convert some functions to async; `fc26ec5e` util: use user_error().hinted() in place of user_error_with_hint() — run `git show` on any of them.
Change coupling: clone.rs ↔ add.rs cli/src/commands/git/clone.rs:1— `cli/src/commands/git/clone.rs` and `cli/src/commands/git/remote/add.rs` change together 71% of the time (10 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `42806525` git: remove FetchTagsOverride and --fetch-tags flag; `f7def80c` cli: git-clone: save --branch patterns to jj's config file; `c24c0350` cli,lib: add suport for the push URL in git remote add — run `git show` on any of them.
Change coupling: track.rs ↔ untrack.rs cli/src/commands/file/track.rs:1— `cli/src/commands/file/track.rs` and `cli/src/commands/file/untrack.rs` change together 65% of the time (11 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `fd2fcad6` cli_util: make unchecked_start_working_copy_mutation() async; `1871f4b5` LockedWorkspace: make `LockedWorkspace::finish` async; `beda1381` working_copy: make potentially slow methods async — run `git show` on any of them.
Change coupling: conflicts.rs ↔ tree_merge.rs core/src/conflicts.rs:1— `core/src/conflicts.rs` and `core/src/tree_merge.rs` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `29eda037` files: move MergeOptions from tree_merge to files (at that commit the files were still `lib/src/conflicts.rs` and `lib/src/tree_merge.rs`); `6398bfe4` lib: turn inherent `Merge` impls into extension traits (at that commit the files were still `lib/src/conflicts.rs` and `lib/src/tree_merge.rs`); `d89eca02` lib: move TreeValue-specific Merge impls to backend module (at that commit the files were still `lib/src/conflicts.rs` and `lib/src/tree_merge.rs`) — run `git show` on any of them.
Change coupling: fetch.rs ↔ import.rs cli/src/commands/git/fetch.rs:1— `cli/src/commands/git/fetch.rs` and `cli/src/commands/git/import.rs` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `70845736` git: collect abandoned Commit objects and return them as stats; `b34cd412` git: explain that `jj git fetch/import` may abandon commits; `4741abea` git_util: use get_commit_async() + try_join_all() in print_imported_c… — run `git show` on any of them.
Change coupling: evolog.rs ↔ show.rs cli/src/commands/evolog.rs:1— `cli/src/commands/evolog.rs` and `cli/src/commands/show.rs` change together 52% of the time (12 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `c16d378c` docs: Fix broken links; `d61be4cb` cli: make all DiffRenderer methods async; `6df3e240` cli: add top-level context label to commit templates — run `git show` on any of them.
Change coupling: show.rs ↔ local_working_copy.rs cli/src/commands/file/show.rs:1— `cli/src/commands/file/show.rs` and `lib/src/local_working_copy.rs` change together 52% of the time (17 of the 33 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 17 shared commits counted here, the most recent 3 are `6398bfe4` lib: turn inherent `Merge` impls into extension traits; `a21a6c77` merged_tree: remove sync version of path_value(); `34a1f868` merge: include conflict labels when describing non-file conflicts — run `git show` on any of them.
Change coupling: list.rs ↔ list.rs cli/src/commands/bookmark/list.rs:1— `cli/src/commands/bookmark/list.rs` and `cli/src/commands/tag/list.rs` change together 50% of the time (14 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `c16d378c` docs: Fix broken links; `64d3cea6` cli: Document templates.*_list settings in help texts; `ac7a8671` cli: consistently use singular in flag names — run `git show` on any of them.
Change coupling: restore.rs ↔ squash.rs cli/src/commands/restore.rs:1— `cli/src/commands/restore.rs` and `cli/src/commands/squash.rs` change together 50% of the time (14 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `0b32255d` commit: make parent_tree() take index instead of repo; `7acd15df` merge_tools: make async; `da78bfbc` commit: delete sync version of parents() — run `git show` on any of them.
Change coupling: restore.rs ↔ split.rs cli/src/commands/restore.rs:1— `cli/src/commands/restore.rs` and `cli/src/commands/split.rs` change together 50% of the time (14 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `0b32255d` commit: make parent_tree() take index instead of repo; `7acd15df` merge_tools: make async; `da78bfbc` commit: delete sync version of parents() — run `git show` on any of them.
Duplicated block (12 lines × 2) cli/src/commands/bookmark/create.rs:85— cli/src/commands/bookmark/create.rs:85-96 | cli/src/commands/bookmark/set.rs:92-103 — before extracting anything, compare `cli/src/commands/bookmark/create.rs` and `cli/src/commands/bookmark/set.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/set.rs:92` it does not close everything it opens, so those exact lines 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) cli/src/commands/bookmark/mod.rs:129— cli/src/commands/bookmark/mod.rs:129-140 | cli/src/commands/tag/mod.rs:87-98 — `cli/src/commands/bookmark/mod.rs` and `cli/src/commands/tag/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/mod.rs:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) cli/src/commands/describe.rs:96— cli/src/commands/describe.rs:96-107 | cli/src/commands/metaedit.rs:143-154 — 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 `cli/src/commands/describe.rs:96` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&DescribeArgs` in one and `&MetaeditArgs` 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, `cli/src/commands/describe.rs:108` calls `commits`, `repo`, `store` and `cli/src/commands/metaedit.rs:155` 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 (12 lines × 2) dsl/src/fileset_parser.rs:363— dsl/src/fileset_parser.rs:363-374 | dsl/src/revset_parser.rs:498-509 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/revset_parser.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) lib/src/converge.rs:379— lib/src/converge.rs:379-390 | lib/src/converge.rs:396-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/src/converge.rs:379` 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) lib/src/git.rs:1560— lib/src/git.rs:1560-1571 | lib/src/git.rs:1586-1597 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/src/git.rs:1560` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) cli/src/commands/bookmark/untrack.rs:76— cli/src/commands/bookmark/untrack.rs:76-87 | cli/src/commands/tag/untrack.rs:73-84 — `cli/src/commands/bookmark/untrack.rs` and `cli/src/commands/tag/untrack.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 44 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/untrack.rs:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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 `args` to `&BookmarkUntrackArgs` in one and `&TagUntrackArgs` 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) cli/testing/fake-bisector.rs:51— cli/testing/fake-bisector.rs:51-62 | cli/testing/fake-editor.rs:39-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cli/testing/fake-bisector.rs:51` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) cli/src/commands/bookmark/list.rs:130— cli/src/commands/bookmark/list.rs:130-141 | cli/src/commands/tag/list.rs:134-145 — `cli/src/commands/bookmark/list.rs` and `cli/src/commands/tag/list.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 44 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/list.rs:130` it does not close everything it opens, so those 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 `&BookmarkListArgs` in one and `&TagListArgs` 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, `cli/src/commands/tag/list.rs:133` calls `settings` and `cli/src/commands/bookmark/list.rs:129` 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 (12 lines × 2) dsl/src/fileset_parser.rs:191— dsl/src/fileset_parser.rs:191-202 | dsl/src/template_parser.rs:268-279 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/template_parser.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `kind` to `FilesetParseErrorKind` in one and `TemplateParseErrorKind` 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) cli/src/commands/bookmark/set.rs:132— cli/src/commands/bookmark/set.rs:132-143 | cli/src/commands/tag/set.rs:98-109 — 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 `cli/src/commands/bookmark/set.rs:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) cli/src/commands/bookmark/untrack.rs:109— cli/src/commands/bookmark/untrack.rs:109-119 | cli/src/commands/tag/untrack.rs:106-116 — `cli/src/commands/bookmark/untrack.rs` and `cli/src/commands/tag/untrack.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 44 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/untrack.rs:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) cli/src/commands/git/push.rs:401— cli/src/commands/git/push.rs:401-411 | cli/src/commands/git/push.rs:426-436 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/git/push.rs:401` it begins part-way through the construct above it, so those exact lines 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) cli/src/commands/git/push.rs:1342— cli/src/commands/git/push.rs:1342-1352 | cli/src/commands/git/push.rs:1377-1387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) cli/src/template_builder.rs:1126— cli/src/template_builder.rs:1126-1136 | cli/src/template_builder.rs:1335-1345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:1126` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) default-index/src/revset_engine.rs:776— default-index/src/revset_engine.rs:776-786 | default-index/src/revset_engine.rs:809-819 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `default-index/src/revset_engine.rs:776` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) default-index/src/revset_engine.rs:1444— default-index/src/revset_engine.rs:1444-1454 | default-index/src/revset_engine.rs:1470-1480 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `default-index/src/revset_engine.rs:1444` it does not close everything it opens, so those 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) lib/src/git_subprocess.rs:485— lib/src/git_subprocess.rs:485-495 | lib/src/git_subprocess.rs:724-734 — both copies are in the same file, so extract the 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 `output` to `&Output` in one and `Output` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) cli/src/commands/bookmark/list.rs:172— cli/src/commands/bookmark/list.rs:172-182 | cli/src/commands/tag/list.rs:177-187 — `cli/src/commands/bookmark/list.rs` and `cli/src/commands/tag/list.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 44 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/list.rs:172` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&BookmarkListArgs` in one and `&TagListArgs` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) cli/src/commands/git/push.rs:1355— cli/src/commands/git/push.rs:1355-1365 | cli/src/commands/git/push.rs:1389-1399 — both copies are in the same file, so extract the 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) cli/src/commands/bookmark/mod.rs:219— cli/src/commands/bookmark/mod.rs:219-229 | cli/src/commands/tag/mod.rs:153-163 — `cli/src/commands/bookmark/mod.rs` and `cli/src/commands/tag/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/mod.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.
Duplicated block (11 lines × 2) cli/src/commands/bookmark/create.rs:124— cli/src/commands/bookmark/create.rs:124-134 | cli/src/commands/bookmark/set.rs:141-151 — before extracting anything, compare `cli/src/commands/bookmark/create.rs` and `cli/src/commands/bookmark/set.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/set.rs:141` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) cli/src/commands/bookmark/track.rs:97— cli/src/commands/bookmark/track.rs:97-102 | cli/src/commands/tag/track.rs:91-96 — `cli/src/commands/bookmark/track.rs` and `cli/src/commands/tag/track.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/track.rs:97` it begins part-way through the construct above it, so those 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 `&BookmarkTrackArgs` in one and `&TagTrackArgs` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) cli/src/commands/git/colocation.rs:168— cli/src/commands/git/colocation.rs:168-173 | cli/src/commands/git/colocation.rs:255-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/git/colocation.rs:168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) cli/src/template_builder.rs:1176— cli/src/template_builder.rs:1176-1181 | cli/src/template_builder.rs:1191-1196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:1176` it does not close everything it opens, so those exact lines 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) cli/src/template_builder.rs:1385— cli/src/template_builder.rs:1385-1390 | cli/src/template_builder.rs:1400-1405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:1385` it does not close everything it opens, so those exact lines 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) cli/src/text_util.rs:237— cli/src/text_util.rs:237-242 | cli/src/text_util.rs:280-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/text_util.rs:237` it does not close everything it opens, so those exact lines 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) default-index/src/changed_path.rs:157— default-index/src/changed_path.rs:157-162 | default-index/src/readonly.rs:350-355 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) dsl/src/fileset_parser.rs:442— dsl/src/fileset_parser.rs:442-447 | dsl/src/revset_parser.rs:603-608 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/revset_parser.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `dsl/src/fileset_parser.rs:442` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `dsl/src/revset_parser.rs:609` calls `Err`, `not_infix_op` and `dsl/src/fileset_parser.rs:448` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) lib/src/simple_op_store.rs:307— lib/src/simple_op_store.rs:307-312 | lib/src/simple_op_store.rs:327-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/src/simple_op_store.rs:307` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) lib/src/gpg_signing.rs:108— lib/src/gpg_signing.rs:108-113 | lib/src/ssh_signing.rs:85-90 — 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 `lib/src/gpg_signing.rs:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) cli/src/git_util.rs:460— cli/src/git_util.rs:460-465 | cli/src/git_util.rs:472-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/git_util.rs:460` it begins part-way through the construct above it, so those exact lines 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) lib/src/simple_op_store.rs:165— lib/src/simple_op_store.rs:165-170 | lib/src/simple_op_store.rs:210-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/src/simple_op_store.rs:165` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) cli/src/commands/file/list.rs:65— cli/src/commands/file/list.rs:65-71 | cli/src/commands/file/search.rs:93-99 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&FileListArgs` in one and `&FileSearchArgs` 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 × 2) cli/src/commit_templater.rs:742— cli/src/commit_templater.rs:742-748 | cli/src/commit_templater.rs:787-793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) cli/src/commit_templater.rs:2861— cli/src/commit_templater.rs:2861-2867 | cli/src/commit_templater.rs:3130-3136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:2861` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) cli/src/template_builder.rs:2643— cli/src/template_builder.rs:2643-2649 | cli/src/template_builder.rs:2655-2661 — both copies are in the same file, so extract the 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) lib/src/git.rs:2809— lib/src/git.rs:2809-2815 | lib/src/git.rs:3035-3041 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `git_repo` to `&gix::Repository` in one and `&mut gix::Repository` 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, `lib/src/git.rs:2817` calls `ensure_remote` and `lib/src/git.rs:3043` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) dsl/src/fileset_parser.rs:261— dsl/src/fileset_parser.rs:261-267 | dsl/src/template_parser.rs:389-395 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/template_parser.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) cli/src/commands/config/gc.rs:61— cli/src/commands/config/gc.rs:61-67 | cli/src/commands/config/gc.rs:74-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/config/gc.rs:61` it begins part-way through the construct above it, so those exact lines 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) cli/src/commit_templater.rs:1366— cli/src/commit_templater.rs:1366-1374 | cli/src/commit_templater.rs:1402-1408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:1366` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) cli/src/commands/debug/object.rs:163— cli/src/commands/debug/object.rs:163-169 | cli/src/commands/debug/object.rs:182-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/debug/object.rs:163` 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) cli/src/commit_templater.rs:889— cli/src/commit_templater.rs:889-895 | cli/src/operation_templater.rs:391-397 — before extracting anything, compare `cli/src/commit_templater.rs` and `cli/src/operation_templater.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:889` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×9
Edited copy of a member (13 corresponding lines) cli/src/commands/git/remote/remove.rs:37— cli/src/commands/git/remote/remove.rs:37-49 | cli/src/commands/git/remote/rename.rs:40-59 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) cli/src/commit_templater.rs:1628— cli/src/commit_templater.rs:1628-1640 | lib/src/revset.rs:1274-1289 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) lib/src/gpg_signing.rs:104— lib/src/gpg_signing.rs:104-116 | lib/src/ssh_signing.rs:81-96 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) cli/src/diff_util.rs:2044— cli/src/diff_util.rs:2044-2056 | cli/src/diff_util.rs:2396-2411 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) core/src/view.rs:212— core/src/view.rs:212-224 | core/src/view.rs:426-438 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) default-index/src/composite.rs:394— default-index/src/composite.rs:394-408 | default-index/src/composite.rs:466-478 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) lib/src/fileset.rs:303— lib/src/fileset.rs:303-315 | lib/src/revset.rs:1396-1409 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) lib/src/simple_op_store.rs:827— lib/src/simple_op_store.rs:827-839 | lib/src/simple_op_store.rs:858-870 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) lib/testutils/src/test_backend.rs:242— lib/testutils/src/test_backend.rs:242-255 | lib/testutils/src/test_backend.rs:375-387 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (14 lines × 2) cli/src/commands/bookmark/mod.rs:233— cli/src/commands/bookmark/mod.rs:233-246 | cli/src/commands/tag/mod.rs:167-180 — `cli/src/commands/bookmark/mod.rs` and `cli/src/commands/tag/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) cli/src/commands/bookmark/track.rs:104— cli/src/commands/bookmark/track.rs:104-117 | cli/src/commands/bookmark/untrack.rs:101-114 — before extracting anything, compare `cli/src/commands/bookmark/track.rs` and `cli/src/commands/bookmark/untrack.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/track.rs:104` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) cli/src/commands/debug/init_simple.rs:49— cli/src/commands/debug/init_simple.rs:49-62 | cli/src/commands/git/init.rs:152-165 — 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 `&DebugInitSimpleArgs` in one and `&GitInitArgs` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14 lines × 2) cli/src/commands/git/fetch.rs:151— cli/src/commands/git/fetch.rs:151-164 | cli/src/commands/git/push.rs:305-318 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/git/fetch.rs:151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) cli/src/commands/tag/track.rs:98— cli/src/commands/tag/track.rs:98-111 | cli/src/commands/tag/untrack.rs:98-111 — before extracting anything, compare `cli/src/commands/tag/track.rs` and `cli/src/commands/tag/untrack.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/tag/track.rs:98` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) cli/src/template_builder.rs:1225— cli/src/template_builder.rs:1225-1238 | cli/src/template_builder.rs:1434-1447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:1225` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) dsl/src/fileset_parser.rs:393— dsl/src/fileset_parser.rs:393-406 | dsl/src/revset_parser.rs:630-643 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/revset_parser.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `dsl/src/fileset_parser.rs:393` it does not close everything it opens, so those 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, `dsl/src/revset_parser.rs:645` calls `as_rule` and `dsl/src/fileset_parser.rs:408` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) lib/src/simple_op_store.rs:272— lib/src/simple_op_store.rs:272-285 | local-util/src/stacked_table.rs:596-609 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) cli/src/complete.rs:155— cli/src/complete.rs:155-173 | cli/src/complete.rs:221-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Sync-over-async blocking cli/src/cli_util.rs:2937— `print_updated_working_copy_stats` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
Sync-over-async blocking cli/src/commands/bench/common_ancestors.rs:38— `cmd_bench_common_ancestors` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
Sync-over-async blocking cli/src/commands/bench/is_ancestor.rs:36— `cmd_bench_is_ancestor` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
Sync-over-async blocking cli/src/commands/bench/resolve_prefix.rs:34— `cmd_bench_resolve_prefix` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
Sync-over-async blocking cli/src/commands/bench/revset.rs:78— `bench_revset` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
Sync-over-async blocking cli/src/commands/fix.rs:188— `cmd_fix` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
Sync-over-async blocking lib/src/local_working_copy.rs:1289— `query_watchman` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
Sync-over-async blocking lib/src/local_working_copy.rs:1320— `is_watchman_trigger_registered` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
Sync-over-async blocking lib/src/local_working_copy.rs:1768— `process_dir_entry` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
jj_core::conflicts::parse_conflict (cognitive 39) core/src/conflicts.rs:839— jj_core::conflicts::parse_conflict has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 2 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
jj_core::copies::find_diff_sources_from_copies (cognitive 27) core/src/copies.rs:616— jj_core::copies::find_diff_sources_from_copies has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 6 (12 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.
jj_core::dag_walk_async::topo_order_reverse_ord (cognitive 22) core/src/dag_walk_async.rs:390— jj_core::dag_walk_async::topo_order_reverse_ord has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 5 (8 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_core::diff::find_lcs (cognitive 19) core/src/diff.rs:378— jj_core::diff::find_lcs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_core::conflicts::update_from_content (cognitive 18) core/src/conflicts.rs:1057— jj_core::conflicts::update_from_content has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 3 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
jj_core::dag_walk_async::closest_common_nodes (cognitive 18) core/src/dag_walk_async.rs:522— jj_core::dag_walk_async::closest_common_nodes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_core::conflicts::materialize_conflict_hunks (cognitive 17) core/src/conflicts.rs:503— jj_core::conflicts::materialize_conflict_hunks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (5 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jj_core::merge::trivial_merge (cognitive 16) core/src/merge.rs:126— jj_core::merge::trivial_merge has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×8
Edited copy of a member (9 corresponding lines) core/src/merged_tree.rs:483— core/src/merged_tree.rs:483-495 | core/src/refs.rs:85-93 — 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) default-index/src/changed_path.rs:220— default-index/src/changed_path.rs:220-228 | default-index/src/changed_path.rs:238-246 — 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) cli/src/cli_util.rs:3852— cli/src/cli_util.rs:3852-3860 | cli/src/cli_util.rs:3864-3872 — 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) core/src/repo_path.rs:347— core/src/repo_path.rs:347-357 | core/src/repo_path.rs:364-372 — 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) lib/src/repo.rs:1708— lib/src/repo.rs:1708-1716 | lib/src/repo.rs:1789-1797 — 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) cli/src/template_builder.rs:2998— cli/src/template_builder.rs:2998-3006 | cli/src/template_builder.rs:3014-3022 — 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) dsl/src/revset_parser.rs:288— dsl/src/revset_parser.rs:288-296 | dsl/src/template_parser.rs:322-330 — 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) lib/src/annotate.rs:109— lib/src/annotate.rs:109-119 | core/src/diff.rs:34-42 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×8
Edited copy of a member (10 corresponding lines) core/src/tree_merge.rs:265— core/src/tree_merge.rs:265-274 | core/src/tree_merge.rs:284-293 — 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) cli/src/cli_util.rs:2333— cli/src/cli_util.rs:2333-2342 | cli/src/cli_util.rs:2562-2572 — 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) core/src/merge.rs:222— core/src/merge.rs:222-232 | core/src/merge.rs:639-648 — 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) lib/testutils/src/lib.rs:861— lib/testutils/src/lib.rs:861-870 | lib/testutils/src/lib.rs:876-886 — 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) lib/src/store_factories.rs:198— lib/src/store_factories.rs:198-207 | lib/src/store_factories.rs:250-259 — 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) dsl/src/fileset_parser.rs:579— dsl/src/fileset_parser.rs:579-588 | dsl/src/revset_parser.rs:847-856 — 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) lib/src/git_subprocess.rs:388— lib/src/git_subprocess.rs:388-398 | lib/src/git_subprocess.rs:440-449 — 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) lib/src/gpg_signing.rs:198— lib/src/gpg_signing.rs:198-207 | lib/src/ssh_signing.rs:176-186 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (13 lines × 2) cli/src/commands/operation/log.rs:179— cli/src/commands/operation/log.rs:179-191 | cli/src/commands/operation/show.rs:92-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) cli/src/commands/rebase.rs:447— cli/src/commands/rebase.rs:447-459 | cli/src/commands/rebase.rs:488-500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/rebase.rs:447` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) cli/src/commit_templater.rs:2641— cli/src/commit_templater.rs:2641-2653 | cli/src/commit_templater.rs:2685-2697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:2641` it begins part-way through the construct above it, so those exact lines 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) core/src/dag_walk.rs:125— core/src/dag_walk.rs:125-137 | core/src/dag_walk_async.rs:99-111 — before extracting anything, compare `core/src/dag_walk.rs` and `core/src/dag_walk_async.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/dag_walk.rs:125` 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) lib/src/git.rs:3281— lib/src/git.rs:3281-3293 | lib/src/git.rs:3305-3317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/src/git.rs:3281` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) core/src/dag_walk.rs:111— core/src/dag_walk.rs:111-123 | core/src/dag_walk_async.rs:85-97 — before extracting anything, compare `core/src/dag_walk.rs` and `core/src/dag_walk_async.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/dag_walk.rs:111` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) cli/src/commands/redo.rs:109— cli/src/commands/redo.rs:109-121 | cli/src/commands/redo.rs:162-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/redo.rs:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) cli/src/commands/undo.rs:107— cli/src/commands/undo.rs:107-119 | cli/src/commands/undo.rs:175-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/undo.rs:107` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
MethodTooLong: EvaluationContext.evaluate default-index/src/revset_engine.rs:757— MethodTooLong — evaluate runs 289 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 189 over it, 2.89× 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: CommitTemplateLanguage.build_method cli/src/commit_templater.rs:238— MethodTooLong — build_method runs 158 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 58 over it, 1.58× 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: TreeState.update lib/src/local_working_copy.rs:2388— MethodTooLong — update 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.
MethodTooLong: SourceLanguage.is_source_symbol cli/src/source_symbol.rs:96— MethodTooLong — is_source_symbol runs 136 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 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VisibilityResolutionContext.resolve lib/src/revset.rs:3199— MethodTooLong — resolve runs 122 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 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WorkspacePool.acquire cli/src/commands/run.rs:209— MethodTooLong — acquire 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: TreeState.snapshot lib/src/local_working_copy.rs:1352— MethodTooLong — snapshot runs 108 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 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×7
Edited copy of a member (11 corresponding lines) cli/src/commands/bookmark/mod.rs:152— cli/src/commands/bookmark/mod.rs:152-163 | cli/src/commands/tag/mod.rs:110-120 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) default-index/src/mutable.rs:670— default-index/src/mutable.rs:670-680 | default-index/src/readonly.rs:884-895 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) git-backend/src/git_backend.rs:512— git-backend/src/git_backend.rs:512-522 | git-backend/src/git_backend.rs:1129-1141 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) default-index/src/composite.rs:254— default-index/src/composite.rs:254-264 | default-index/src/composite.rs:282-292 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) lib/src/git_subprocess.rs:315— lib/src/git_subprocess.rs:315-328 | lib/src/git_subprocess.rs:335-345 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) cli/src/config.rs:436— cli/src/config.rs:436-446 | cli/src/config.rs:524-534 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) core/src/repo_path.rs:174— core/src/repo_path.rs:174-184 | core/src/repo_path.rs:188-198 — 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.
TooManyMethods: MutableRepo lib/src/repo.rs:792— 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: WorkspaceCommandHelper cli/src/cli_util.rs:2104— TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.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.
TooManyMethods: View core/src/view.rs:46— TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RevsetExpression lib/src/revset.rs:230— TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Merge core/src/merge.rs:186— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Ui cli/src/ui.rs:215— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×6
Edited copy of a member (14 corresponding lines) lib/src/simple_op_store.rs:135— lib/src/simple_op_store.rs:135-148 | lib/src/simple_op_store.rs:172-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.
Edited copy of a member (14 corresponding lines) lib/src/converge.rs:377— lib/src/converge.rs:377-390 | lib/src/converge.rs:394-407 — 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) core/src/view.rs:281— core/src/view.rs:281-296 | core/src/view.rs:495-508 — 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) lib/src/local_working_copy.rs:754— lib/src/local_working_copy.rs:754-767 | lib/src/local_working_copy.rs:775-788 — 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) lib/src/gpg_signing.rs:227— lib/src/gpg_signing.rs:227-240 | lib/src/gpg_signing.rs:307-322 — 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) dsl/src/template_parser.rs:991— dsl/src/template_parser.rs:991-1004 | dsl/src/template_parser.rs:1011-1025 — 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 (8 corresponding lines) · ×6
Edited copy of a member (8 corresponding lines) cli/src/operation_templater.rs:381— cli/src/operation_templater.rs:381-388 | cli/src/operation_templater.rs:390-399 — 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) default-index/src/revset_engine.rs:160— default-index/src/revset_engine.rs:160-167 | default-index/src/revset_engine.rs:174-181 — 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) default-index/src/readonly.rs:446— default-index/src/readonly.rs:446-455 | default-index/src/readonly.rs:461-468 — 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) dsl/src/fileset_parser.rs:462— dsl/src/fileset_parser.rs:462-469 | dsl/src/revset_parser.rs:512-520 — 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) cli/src/cli_util.rs:3360— cli/src/cli_util.rs:3360-3367 | frontend/src/runner.rs:127-134 — 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) core/src/tree_rewriter.rs:75— core/src/tree_rewriter.rs:75-82 | core/src/tree_walk.rs:54-62 — 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 (15 lines × 2) cli/src/commands/bookmark/track.rs:83— cli/src/commands/bookmark/track.rs:83-97 | cli/src/commands/bookmark/untrack.rs:83-97 — before extracting anything, compare `cli/src/commands/bookmark/track.rs` and `cli/src/commands/bookmark/untrack.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/track.rs:83` it does not close everything it opens, so those 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 `&BookmarkTrackArgs` in one and `&BookmarkUntrackArgs` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 2) cli/src/commands/tag/track.rs:77— cli/src/commands/tag/track.rs:77-91 | cli/src/commands/tag/untrack.rs:80-94 — before extracting anything, compare `cli/src/commands/tag/track.rs` and `cli/src/commands/tag/untrack.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/tag/track.rs:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&TagTrackArgs` in one and `&TagUntrackArgs` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 2) cli/src/commit_templater.rs:2393— cli/src/commit_templater.rs:2393-2407 | cli/src/operation_templater.rs:659-673 — before extracting anything, compare `cli/src/commit_templater.rs` and `cli/src/operation_templater.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:2393` it does not close everything it opens, so those exact lines 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) dsl/src/fileset_parser.rs:304— dsl/src/fileset_parser.rs:304-318 | dsl/src/revset_parser.rs:423-437 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/revset_parser.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `dsl/src/fileset_parser.rs:304` 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) lib/src/local_working_copy.rs:1301— lib/src/local_working_copy.rs:1301-1315 | lib/src/local_working_copy.rs:1330-1344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/src/local_working_copy.rs:1301` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) lib/src/converge.rs:380— lib/src/converge.rs:380-386 | lib/src/converge.rs:397-403 | lib/src/converge.rs:424-430 — 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 `lib/src/converge.rs:380` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) dsl/src/fileset_parser.rs:438— dsl/src/fileset_parser.rs:438-444 | dsl/src/revset_parser.rs:585-591 | dsl/src/template_parser.rs:770-776 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/revset_parser.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `dsl/src/fileset_parser.rs:438` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `dsl/src/fileset_parser.rs:447` calls `Ok`, `union_nodes` and `dsl/src/template_parser.rs:779` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) dsl/src/fileset_parser.rs:252— dsl/src/fileset_parser.rs:252-258 | dsl/src/revset_parser.rs:340-346 | dsl/src/template_parser.rs:380-386 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/revset_parser.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) cli/src/template_builder.rs:2147— cli/src/template_builder.rs:2147-2153 | cli/src/template_builder.rs:2169-2176 | cli/src/template_builder.rs:2179-2186 — 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 `cli/src/template_builder.rs:2147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 3) lib/testutils/src/test_backend.rs:222— lib/testutils/src/test_backend.rs:222-228 | lib/testutils/src/test_backend.rs:265-271 | lib/testutils/src/test_backend.rs:362-368 — 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 `lib/testutils/src/test_backend.rs:222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `id` to `&FileId` in one and `&SymlinkId` 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.
ClassTooLong: MutableRepo lib/src/repo.rs:792— ClassTooLong — 763 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, 3 blocks, lines 792-2059. The bar is 400 significant lines; this is 363 over it, 1.91× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TreeState lib/src/local_working_copy.rs:1014— ClassTooLong — 691 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 25 methods, 4 blocks, lines 1014-2727. The bar is 400 significant lines; this is 291 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GitBackend git-backend/src/git_backend.rs:184— ClassTooLong — 651 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 19 methods, 4 blocks, lines 184-1590. The bar is 400 significant lines; this is 251 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FileSnapshotter lib/src/local_working_copy.rs:1590— ClassTooLong — 439 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 2 blocks, lines 1590-2215. The bar is 400 significant lines; this is 39 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.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×4
Edited copy of a member (22 corresponding lines) lib/src/local_working_copy.rs:1292— lib/src/local_working_copy.rs:1292-1315 | lib/src/local_working_copy.rs:1323-1344 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) cli/src/template_builder.rs:627— cli/src/template_builder.rs:627-648 | cli/src/template_builder.rs:698-719 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) lib/testutils/src/lib.rs:349— lib/testutils/src/lib.rs:349-374 | lib/testutils/src/lib.rs:412-433 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) cli/src/commands/bench/common_ancestors.rs:42— cli/src/commands/bench/common_ancestors.rs:42-63 | cli/src/commands/bench/is_ancestor.rs:40-61 — 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 (12 corresponding lines) · ×4
Edited copy of a member (12 corresponding lines) core/src/matchers.rs:193— core/src/matchers.rs:193-206 | core/src/matchers.rs:257-268 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) git-backend/src/secret_backend.rs:126— git-backend/src/secret_backend.rs:126-137 | git-backend/src/secret_backend.rs:147-158 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) lib/src/fileset.rs:205— lib/src/fileset.rs:205-216 | lib/src/fileset.rs:222-233 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) core/src/view.rs:237— core/src/view.rs:237-248 | core/src/view.rs:451-462 — 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) · ×4
Edited copy of a member (6 corresponding lines) cli/src/commit_templater.rs:637— cli/src/commit_templater.rs:637-643 | cli/src/operation_templater.rs:332-337 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) cli/src/commit_templater.rs:704— cli/src/commit_templater.rs:704-710 | cli/src/operation_templater.rs:353-358 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) cli/src/commit_templater.rs:712— cli/src/commit_templater.rs:712-718 | cli/src/operation_templater.rs:360-365 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) core/src/graph.rs:102— core/src/graph.rs:102-107 | default-index/src/revset_graph_iterator.rs:385-390 — 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.
Duplicated block (5 lines × 2) cli/src/template_builder.rs:2623— cli/src/template_builder.rs:2623-2627 | cli/src/template_builder.rs:2633-2637 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) cli/testing/fake-diff-editor.rs:64— cli/testing/fake-diff-editor.rs:64-68 | cli/testing/fake-editor.rs:47-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cli/testing/fake-diff-editor.rs:64` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) cli/src/template_builder.rs:2414— cli/src/template_builder.rs:2414-2418 | cli/src/template_builder.rs:2425-2431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:2414` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) cli/src/commit_templater.rs:1186— cli/src/commit_templater.rs:1186-1190 | cli/src/template_builder.rs:2682-2686 — 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 `cli/src/commit_templater.rs:1186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
jj_lib::rewrite::compute_move_commits (cyclomatic 33) lib/src/rewrite.rs:556— jj_lib::rewrite::compute_move_commits has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
jj_lib::git::import_refs_inner (cyclomatic 19) lib/src/git.rs:668— jj_lib::git::import_refs_inner 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.
jj_lib::fix::fix_files (cyclomatic 17) lib/src/fix.rs:181— jj_lib::fix::fix_files 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (4 members, 50+ identical tokens) cli/src/commands/abandon.rs:73— cli/src/commands/abandon.rs:73-208 | cli/src/commands/describe.rs:93-239 | cli/src/commands/duplicate.rs:107-227 | cli/src/commands/metaedit.rs:139-257 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) cli/src/commands/diffedit.rs:97— cli/src/commands/diffedit.rs:97-168 | cli/src/commands/file/delete.rs:57-91 | cli/src/commands/file/edit.rs:76-186 | cli/src/commands/restore.rs:110-200 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) cli/src/operation_templater.rs:260— cli/src/operation_templater.rs:260-267 | cli/src/operation_templater.rs:272-279 | cli/src/operation_templater.rs:281-288 | cli/src/operation_templater.rs:293-300 — 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 (24 corresponding lines) · ×3
Edited copy of a member (24 corresponding lines) cli/src/template_builder.rs:399— cli/src/template_builder.rs:399-428 | cli/src/template_builder.rs:430-453 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) core/src/dag_walk.rs:214— core/src/dag_walk.rs:214-239 | core/src/dag_walk_async.rs:491-514 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) lib/src/id_prefix.rs:171— lib/src/id_prefix.rs:171-195 | lib/src/id_prefix.rs:237-260 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×3
Edited copy of a member (28 corresponding lines) core/src/dag_walk.rs:110— core/src/dag_walk.rs:110-137 | core/src/dag_walk_async.rs:84-111 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) cli/src/commands/bookmark/delete.rs:54— cli/src/commands/bookmark/delete.rs:54-91 | cli/src/commands/tag/delete.rs:47-74 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) cli/src/commands/git/push.rs:1337— cli/src/commands/git/push.rs:1337-1365 | cli/src/commands/git/push.rs:1372-1399 — 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 (31 corresponding lines) · ×3
Edited copy of a member (31 corresponding lines) lib/src/local_working_copy.rs:2232— lib/src/local_working_copy.rs:2232-2272 | lib/src/local_working_copy.rs:2316-2346 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) cli/src/text_util.rs:236— cli/src/text_util.rs:236-268 | cli/src/text_util.rs:279-309 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) cli/src/commands/debug/init_simple.rs:48— cli/src/commands/debug/init_simple.rs:48-78 | cli/src/commands/git/init.rs:151-197 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×3
Edited copy of a member (20 corresponding lines) cli/src/text_util.rs:51— cli/src/text_util.rs:51-70 | cli/src/text_util.rs:76-95 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) cli/src/template_builder.rs:2725— cli/src/template_builder.rs:2725-2744 | cli/src/template_builder.rs:2754-2774 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) cli/src/commit_templater.rs:175— cli/src/commit_templater.rs:175-198 | cli/src/operation_templater.rs:88-107 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×3
Edited copy of a member (21 corresponding lines) lib/src/git.rs:1553— lib/src/git.rs:1553-1574 | lib/src/git.rs:1580-1600 — 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) cli/src/commands/git/fetch.rs:262— cli/src/commands/git/fetch.rs:262-282 | cli/src/commands/git/push.rs:1084-1104 — 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) lib/src/simple_op_store.rs:150— lib/src/simple_op_store.rs:150-170 | lib/src/simple_op_store.rs:194-215 — 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 (15 corresponding lines) · ×3
Edited copy of a member (15 corresponding lines) core/src/merged_tree.rs:525— core/src/merged_tree.rs:525-539 | core/src/merged_tree.rs:557-580 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) cli/src/commit_templater.rs:1916— cli/src/commit_templater.rs:1916-1930 | cli/src/commit_templater.rs:1933-1947 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) core/src/fileset_backend.rs:148— core/src/fileset_backend.rs:148-162 | core/src/str_util.rs:402-416 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (6 lines × 3) cli/src/commands/abandon.rs:77— cli/src/commands/abandon.rs:77-82 | cli/src/commands/describe.rs:96-101 | cli/src/commands/metaedit.rs:143-148 — 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 `cli/src/commands/abandon.rs:77` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&AbandonArgs` in one and `&DescribeArgs` 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, `cli/src/commands/abandon.rs:83` calls `intersection`, `visible_heads`, `ancestors` and `cli/src/commands/describe.rs:102` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) cli/src/commands/file/list.rs:65— cli/src/commands/file/list.rs:65-70 | cli/src/commands/file/search.rs:93-98 | cli/src/commands/file/show.rs:87-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&FileListArgs` in one and `&FileSearchArgs` 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) dsl/src/fileset_parser.rs:379— dsl/src/fileset_parser.rs:379-384 | dsl/src/revset_parser.rs:686-691 | dsl/src/template_parser.rs:668-673 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/revset_parser.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) cli/src/template_builder.rs:1133— cli/src/template_builder.rs:1133-1138 | cli/src/template_builder.rs:1154-1158 | cli/src/template_builder.rs:1165-1169 — 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 `cli/src/template_builder.rs:1133` it does not close everything it opens, so those exact lines 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) dsl/src/fileset_parser.rs:630— dsl/src/fileset_parser.rs:630-634 | dsl/src/revset_parser.rs:898-902 | dsl/src/template_parser.rs:981-985 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/revset_parser.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `dsl/src/fileset_parser.rs:630` it begins part-way through the construct above it, so those 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 `err` to `FilesetParseError` in one and `RevsetParseError` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 3) cli/src/commands/operation/restore.rs:62— cli/src/commands/operation/restore.rs:62-66 | cli/src/commands/operation/revert.rs:81-85 | cli/src/commands/redo.rs:185-191 — 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 `cli/src/commands/operation/restore.rs:62` it begins part-way through the construct above it, so those 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.
HackComment lib/testutils/src/proptest.rs:66— // HACK: Forbidding `.` here to avoid `.`/`..` in the path components, which — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment lib/src/repo.rs:1879— // HACK: Don't walk long ranges of commits to find rewrites when using other — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
ColorFormatter::write_new_style (cognitive 50) cli/src/formatter.rs:395— ColorFormatter::write_new_style has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (44 pts), boolean chains 5, match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ColorFormatter::requested_style (cognitive 21) cli/src/formatter.rs:356— ColorFormatter::requested_style has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 4 (10 pts) (nesting depth added 13). 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.
RevsetGraphWalk::edges_from_external_commit (cognitive 43) default-index/src/revset_graph_iterator.rs:203— RevsetGraphWalk::edges_from_external_commit has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (39 pts), loops 2 (4 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RevsetGraphWalk::new_edges_from_internal_commit (cognitive 22) default-index/src/revset_graph_iterator.rs:155— RevsetGraphWalk::new_edges_from_internal_commit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileSnapshotter::process_dir_entry (cognitive 30) lib/src/local_working_copy.rs:1768— FileSnapshotter::process_dir_entry has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 5, loops 1 (2 pts), 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.
FileSnapshotter::get_updated_tree_value (cognitive 16) lib/src/local_working_copy.rs:1994— FileSnapshotter::get_updated_tree_value has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×2
Edited copy of a member (17 corresponding lines) core/src/merged_tree.rs:207— core/src/merged_tree.rs:207-225 | core/src/merged_tree.rs:291-307 — 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) cli/src/revset_util.rs:327— cli/src/revset_util.rs:327-343 | cli/src/revset_util.rs:468-488 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×2
Edited copies of one member (3 members, 20+ corresponding lines) cli/src/complete.rs:75— cli/src/complete.rs:75-94 | cli/src/complete.rs:257-276 | cli/src/complete.rs:573-602 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 20+ corresponding lines) lib/testutils/src/test_backend.rs:213— lib/testutils/src/test_backend.rs:213-236 | lib/testutils/src/test_backend.rs:257-276 | lib/testutils/src/test_backend.rs:351-373 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×2
Edited copy of a member (16 corresponding lines) lib/src/eol.rs:86— lib/src/eol.rs:86-101 | lib/src/eol.rs:106-121 — 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) default-index/src/rev_walk.rs:345— default-index/src/rev_walk.rs:345-360 | default-index/src/rev_walk.rs:368-385 — 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 (19 corresponding lines) · ×2
Edited copy of a member (19 corresponding lines) core/src/view.rs:335— core/src/view.rs:335-355 | core/src/view.rs:544-562 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) core/src/conflicts.rs:456— core/src/conflicts.rs:456-474 | core/src/conflicts.rs:480-501 — 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 copies of one member (3 members, 11+ corresponding lines) · ×2
Edited copies of one member (3 members, 11+ corresponding lines) dsl/src/fileset_parser.rs:596— dsl/src/fileset_parser.rs:596-606 | dsl/src/revset_parser.rs:864-874 | dsl/src/template_parser.rs:947-957 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) dsl/src/fileset_parser.rs:376— dsl/src/fileset_parser.rs:376-387 | dsl/src/revset_parser.rs:683-696 | dsl/src/template_parser.rs:666-676 — 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 (7 corresponding lines) · ×2
Edited copy of a member (7 corresponding lines) lib/src/config_resolver.rs:137— lib/src/config_resolver.rs:137-143 | lib/src/config_resolver.rs:157-167 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) cli/src/commands/config/path.rs:46— cli/src/commands/config/path.rs:46-53 | cli/src/commands/root.rs:34-40 — 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 (5 corresponding lines) · ×2
Edited copy of a member (5 corresponding lines) default-index/src/changed_path.rs:131— default-index/src/changed_path.rs:131-135 | default-index/src/readonly.rs:285-289 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) cli/src/cli_util.rs:464— cli/src/cli_util.rs:464-468 | cli/src/commands/workspace/update_stale.rs:36-41 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (28 lines × 2) cli/src/commands/operation/diff.rs:526— cli/src/commands/operation/diff.rs:526-553 | cli/src/commands/operation/diff.rs:568-595 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/operation/diff.rs:526` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28 lines × 2) dsl/src/fileset_parser.rs:519— dsl/src/fileset_parser.rs:519-546 | dsl/src/revset_parser.rs:762-789 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/revset_parser.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `dsl/src/fileset_parser.rs:519` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) cli/src/commands/revert.rs:201— cli/src/commands/revert.rs:201-223 | lib/src/rewrite.rs:1056-1078 — 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 `cli/src/commands/revert.rs:201` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (23 lines × 2) cli/src/template_builder.rs:1261— cli/src/template_builder.rs:1261-1283 | cli/src/template_builder.rs:1471-1493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:1261` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22 lines × 2) cli/src/commit_templater.rs:2838— cli/src/commit_templater.rs:2838-2859 | cli/src/commit_templater.rs:3107-3128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:2838` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) cli/src/template_builder.rs:493— cli/src/template_builder.rs:493-514 | cli/src/template_builder.rs:530-551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:493` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) cli/src/commands/bookmark/create.rs:97— cli/src/commands/bookmark/create.rs:97-113 | cli/src/commands/bookmark/set.rs:105-121 — before extracting anything, compare `cli/src/commands/bookmark/create.rs` and `cli/src/commands/bookmark/set.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/set.rs:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) cli/src/template_builder.rs:1140— cli/src/template_builder.rs:1140-1156 | cli/src/template_builder.rs:1349-1365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:1140` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14–15 lines × 2) cli/src/commit_templater.rs:1289— cli/src/commit_templater.rs:1289-1302 | cli/src/operation_templater.rs:628-642 — before extracting anything, compare `cli/src/commit_templater.rs` and `cli/src/operation_templater.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:1289` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 2) cli/src/template_builder.rs:2727— cli/src/template_builder.rs:2727-2741 | cli/src/template_builder.rs:2756-2769 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:2727` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) cli/src/commands/file/chmod.rs:72— cli/src/commands/file/chmod.rs:72-81 | cli/src/commands/file/delete.rs:58-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&FileChmodArgs` in one and `&FileDeleteArgs` 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, `cli/src/commands/file/chmod.rs:84` calls `start_transaction` and `cli/src/commands/file/delete.rs:69` 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–10 lines × 2) default-index/src/revset_graph_iterator.rs:185— default-index/src/revset_graph_iterator.rs:185-194 | default-index/src/revset_graph_iterator.rs:253-261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `default-index/src/revset_graph_iterator.rs:185` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–10 lines × 2) cli/src/commands/operation/restore.rs:59— cli/src/commands/operation/restore.rs:59-66 | cli/src/commands/redo.rs:182-191 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/operation/restore.rs:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–10 lines × 2) cli/src/complete.rs:368— cli/src/complete.rs:368-375 | cli/src/complete.rs:473-482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/complete.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 (9 lines × 3) dsl/src/fileset_parser.rs:299— dsl/src/fileset_parser.rs:299-307 | dsl/src/revset_parser.rs:418-426 | dsl/src/template_parser.rs:464-472 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/revset_parser.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) cli/src/commit_templater.rs:1392— cli/src/commit_templater.rs:1392-1400 | cli/src/commit_templater.rs:1402-1410 | cli/src/commit_templater.rs:1412-1420 — 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 `cli/src/commit_templater.rs:1392` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 4) cli/src/operation_templater.rs:261— cli/src/operation_templater.rs:261-267 | cli/src/operation_templater.rs:273-279 | cli/src/operation_templater.rs:282-288 | cli/src/operation_templater.rs:294-300 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 4) cli/src/commands/bookmark/list.rs:151— cli/src/commands/bookmark/list.rs:151-159 | cli/src/commands/file/list.rs:73-79 | cli/src/commands/file/show.rs:96-102 | cli/src/commands/workspace/list.rs:56-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&BookmarkListArgs` in one and `&FileListArgs` 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 × 4) cli/src/commands/abandon.rs:77— cli/src/commands/abandon.rs:77-81 | cli/src/commands/describe.rs:96-100 | cli/src/commands/duplicate.rs:111-115 | cli/src/commands/metaedit.rs:143-147 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/abandon.rs:77` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&AbandonArgs` in one and `&DescribeArgs` 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, `cli/src/commands/abandon.rs:83` calls `intersection`, `visible_heads`, `ancestors` and `cli/src/commands/describe.rs:102` 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 × 4) cli/src/commit_templater.rs:3341— cli/src/commit_templater.rs:3341-3345 | cli/src/template_builder.rs:1342-1347 | cli/src/template_builder.rs:1363-1367 | cli/src/template_builder.rs:1374-1378 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:3341` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
EvaluationContext::evaluate (cyclomatic 40) default-index/src/revset_engine.rs:757— EvaluationContext::evaluate has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SourceLanguage::is_source_symbol (cyclomatic 36) cli/src/source_symbol.rs:96— SourceLanguage::is_source_symbol has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
TreeState::update (cyclomatic 32) lib/src/local_working_copy.rs:2388— TreeState::update has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ColorFormatter::write_new_style (cyclomatic 25) cli/src/formatter.rs:395— ColorFormatter::write_new_style 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.
CliRunnerEventHandler::print_event (cyclomatic 23) cli/src/cli_util.rs:1277— CliRunnerEventHandler::print_event has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
FileSnapshotter::process_dir_entry (cyclomatic 20) lib/src/local_working_copy.rs:1768— FileSnapshotter::process_dir_entry 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.
TreeDiffVisitor::visit (cyclomatic 19) core/src/merged_tree.rs:659— TreeDiffVisitor::visit has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CliRunner::run_internal (cyclomatic 17) cli/src/cli_util.rs:4578— CliRunner::run_internal has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
WorkspacePool::acquire (cyclomatic 17) cli/src/commands/run.rs:209— WorkspacePool::acquire 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.
jj_default_index::revset_engine::build_predicate_fn (cyclomatic 17) default-index/src/revset_engine.rs:1285— jj_default_index::revset_engine::build_predicate_fn has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
RevsetGraphWalk::edges_from_external_commit (cyclomatic 16) default-index/src/revset_graph_iterator.rs:203— RevsetGraphWalk::edges_from_external_commit has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EvaluationContext::evaluate (cognitive 56) default-index/src/revset_engine.rs:757— EvaluationContext::evaluate has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (42 pts), loops 6 (13 pts), match/switch 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.
TreeState::update (cognitive 39) lib/src/local_working_copy.rs:2388— TreeState::update has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 6, loops 3 (5 pts), match/switch 3 (4 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
DiffLineIterator::next (cognitive 32) core/src/files.rs:141— DiffLineIterator::next has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (10 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkspacePool::acquire (cognitive 29) cli/src/commands/run.rs:209— WorkspacePool::acquire has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 3 (6 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TopoGroupedGraph::next_node (cognitive 25) core/src/graph.rs:300— TopoGroupedGraph::next_node has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TreeDiffVisitor::visit (cognitive 25) core/src/merged_tree.rs:659— TreeDiffVisitor::visit has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, if/else 7 (12 pts), loops 1 (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Bisector::next_step (cognitive 23) lib/src/bisect.rs:282— Bisector::next_step has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (7 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.
DominatorFinder::calculate_immediate_dominators (cognitive 23) lib/src/graph_dominators.rs:280— DominatorFinder::calculate_immediate_dominators has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TruncatedEvolutionGraph::new (cognitive 22) lib/src/converge.rs:240— TruncatedEvolutionGraph::new has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (5 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.
ConfigEnv::resolve_file_to_edit (cognitive 20) cli/src/config.rs:690— ConfigEnv::resolve_file_to_edit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TreeRewriter::run (cognitive 20) core/src/tree_rewriter.rs:169— TreeRewriter::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MutableRepo::record_rewrites (cognitive 18) lib/src/repo.rs:1943— MutableRepo::record_rewrites has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 5 (8 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CopyHistoryDiffStream::poll_next (cognitive 16) core/src/copies.rs:405— CopyHistoryDiffStream::poll_next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimpleOpStore::resolve_operation_id_prefix (cognitive 16) lib/src/simple_op_store.rs:217— SimpleOpStore::resolve_operation_id_prefix has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
remark-strip-md-extension.remarkStripMdExtension.<returned closure> (cognitive 16) web/docs/plugins/remark-strip-md-extension.mjs:19— remark-strip-md-extension.remarkStripMdExtension.<returned closure> has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 2). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 32). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
TooManyFunctions: jj_cli::text_util cli/src/text_util.rs:27— TooManyFunctions — 31 free functions. The bar is 30 free functions; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×1
Change coupling clique: git_backend.rs, secret_backend.rs, simple_backend.rs, test_backend.rs git-backend/src/git_backend.rs— 4 files — `git-backend/src/git_backend.rs`, `git-backend/src/secret_backend.rs`, `lib/src/simple_backend.rs`, `lib/testutils/src/test_backend.rs` — all change together with no explicit dependency: a fully-connected co-change clique, not 6 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
Change-coupling hub: log.rs → evolog.rs, log.rs, show.rs cli/src/commands/log.rs— `cli/src/commands/log.rs` changes together with 3 other files — `cli/src/commands/evolog.rs`, `cli/src/commands/operation/log.rs`, `cli/src/commands/show.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Near-duplicate member pair (118 shared lines) cli/src/template_builder.rs:1119— cli/src/template_builder.rs:1119-1325 | cli/src/template_builder.rs:1328-1539 — These two members are variants of one another: 118 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 (52 shared lines) cli/src/commands/bookmark/advance.rs:78— cli/src/commands/bookmark/advance.rs:78-217 | cli/src/commands/bookmark/move.rs:78-175 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (43 shared lines) cli/src/commands/bookmark/list.rs:128— cli/src/commands/bookmark/list.rs:128-249 | cli/src/commands/tag/list.rs:131-201 — These two members are variants of one another: 43 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (41 shared lines) cli/src/commands/bookmark/untrack.rs:75— cli/src/commands/bookmark/untrack.rs:75-148 | cli/src/commands/tag/untrack.rs:72-142 — These two members are variants of one another: 41 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (30 shared lines) cli/src/commands/bookmark/track.rs:78— cli/src/commands/bookmark/track.rs:78-192 | cli/src/commands/tag/track.rs:72-135 — These two members are variants of one another: 30 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×1
Edited copy of a member (30 corresponding lines) dsl/src/fileset_parser.rs:517— dsl/src/fileset_parser.rs:517-555 | dsl/src/revset_parser.rs:760-798 — 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· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) cli/src/template_builder.rs:2209— cli/src/template_builder.rs:2209-2235 | cli/src/template_builder.rs:2252-2267 | cli/src/template_builder.rs:2284-2305 | cli/src/template_builder.rs:2322-2343 | cli/src/template_builder.rs:2368-2715 — 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 (88 corresponding lines) · ×1
Edited copy of a member (88 corresponding lines) cli/src/commands/sign.rs:69— cli/src/commands/sign.rs:69-179 | cli/src/commands/unsign.rs:50-137 — These two members are one piece of code written twice and then edited apart: 88 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (78 corresponding lines) · ×1
Edited copy of a member (78 corresponding lines) cli/src/commands/bookmark/create.rs:57— cli/src/commands/bookmark/create.rs:57-134 | cli/src/commands/bookmark/set.rs:66-151 — These two members are one piece of code written twice and then edited apart: 78 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (44 corresponding lines) · ×1
Edited copy of a member (44 corresponding lines) cli/src/commit_templater.rs:720— cli/src/commit_templater.rs:720-763 | cli/src/commit_templater.rs:765-808 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (73 corresponding lines) · ×1
Edited copy of a member (73 corresponding lines) cli/src/commit_templater.rs:2898— cli/src/commit_templater.rs:2898-2972 | cli/src/commit_templater.rs:3103-3175 — These two members are one piece of code written twice and then edited apart: 73 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (62 corresponding lines) · ×1
Edited copy of a member (62 corresponding lines) cli/src/commands/git/colocation.rs:151— cli/src/commands/git/colocation.rs:151-240 | cli/src/commands/git/colocation.rs:246-307 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (54 corresponding lines) · ×1
Edited copy of a member (54 corresponding lines) default-index/src/changed_path.rs:140— default-index/src/changed_path.rs:140-193 | default-index/src/readonly.rs:340-396 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) dsl/src/fileset_parser.rs:294— dsl/src/fileset_parser.rs:294-318 | dsl/src/revset_parser.rs:408-437 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) cli/src/commands/git/push.rs:1135— cli/src/commands/git/push.rs:1135-1182 | cli/src/commands/git/push.rs:1188-1228 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×1
Edited copy of a member (38 corresponding lines) cli/src/commit_templater.rs:2490— cli/src/commit_templater.rs:2490-2527 | cli/src/template_builder.rs:1787-1828 — 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 (35 corresponding lines) · ×1
Edited copy of a member (35 corresponding lines) lib/src/git.rs:1096— lib/src/git.rs:1096-1130 | lib/src/git.rs:1140-1177 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×1
Edited copy of a member (32 corresponding lines) cli/src/commit_templater.rs:3069— cli/src/commit_templater.rs:3069-3100 | cli/src/commit_templater.rs:3212-3245 — 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 (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) cli/src/commands/bookmark/mod.rs:121— cli/src/commands/bookmark/mod.rs:121-146 | cli/src/commands/tag/mod.rs:79-104 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) cli/src/commit_templater.rs:2300— cli/src/commit_templater.rs:2300-2336 | cli/src/commit_templater.rs:2974-3002 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×1
Edited copies of one member (3 members, 16+ corresponding lines) default-index/src/revset_engine.rs:482— default-index/src/revset_engine.rs:482-497 | default-index/src/revset_engine.rs:570-599 | default-index/src/revset_engine.rs:678-707 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) lib/src/workspace.rs:286— lib/src/workspace.rs:286-319 | lib/src/workspace.rs:331-370 — 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 (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) cli/src/commands/git/mod.rs:201— cli/src/commands/git/mod.rs:201-229 | cli/src/commands/git/mod.rs:236-262 — 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 (18 corresponding lines) · ×1
Edited copy of a member (18 corresponding lines) lib/src/revset.rs:2796— lib/src/revset.rs:2796-2813 | lib/src/revset.rs:2840-2858 — 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 copies of one member (4 members, 15+ corresponding lines) · ×1
Edited copies of one member (4 members, 15+ corresponding lines) cli/src/commands/bookmark/mod.rs:189— cli/src/commands/bookmark/mod.rs:189-203 | cli/src/commands/bookmark/mod.rs:210-229 | cli/src/commands/tag/mod.rs:123-137 | cli/src/commands/tag/mod.rs:144-163 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×1
Edited copies of one member (3 members, 9+ corresponding lines) dsl/src/fileset_parser.rs:230— dsl/src/fileset_parser.rs:230-238 | dsl/src/revset_parser.rs:318-326 | dsl/src/template_parser.rs:358-366 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) core/src/op_store.rs:261— core/src/op_store.rs:261-270 | core/src/view.rs:258-268 | core/src/view.rs:472-482 — 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 (4 members, 14+ corresponding lines) · ×1
Edited copies of one member (4 members, 14+ corresponding lines) lib/testutils/src/git.rs:90— lib/testutils/src/git.rs:90-111 | lib/testutils/src/git.rs:385-398 | lib/testutils/src/git.rs:400-413 | lib/testutils/src/git.rs:415-428 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 11+ corresponding lines) · ×1
Edited copies of one member (4 members, 11+ corresponding lines) lib/src/store_factories.rs:220— lib/src/store_factories.rs:220-237 | lib/src/store_factories.rs:272-282 | lib/src/store_factories.rs:294-304 | lib/src/store_factories.rs:317-328 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×1
Edited copies of one member (3 members, 4+ corresponding lines) dsl/src/fileset_parser.rs:611— dsl/src/fileset_parser.rs:611-614 | dsl/src/revset_parser.rs:879-882 | dsl/src/template_parser.rs:962-965 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (28–30 lines × 2) cli/src/commands/operation/diff.rs:441— cli/src/commands/operation/diff.rs:441-470 | cli/src/commands/operation/diff.rs:478-505 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/operation/diff.rs:441` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (24–26 lines × 2) cli/src/commands/bookmark/advance.rs:192— cli/src/commands/bookmark/advance.rs:192-217 | cli/src/commands/bookmark/move.rs:152-175 — before extracting anything, compare `cli/src/commands/bookmark/advance.rs` and `cli/src/commands/bookmark/move.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/advance.rs:192` 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 `args` to `&BookmarkAdvanceArgs` in one and `&BookmarkMoveArgs` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (24 lines × 2) cli/src/commands/sign.rs:145— cli/src/commands/sign.rs:145-168 | cli/src/commands/unsign.rs:103-126 — 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 `cli/src/commands/sign.rs:145` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (21–22 lines × 2) cli/src/template_builder.rs:1290— cli/src/template_builder.rs:1290-1311 | cli/src/template_builder.rs:1497-1517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:1290` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) core/src/dag_walk.rs:53— core/src/dag_walk.rs:53-72 | core/src/dag_walk_async.rs:47-66 — before extracting anything, compare `core/src/dag_walk.rs` and `core/src/dag_walk_async.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18–19 lines × 2) cli/src/commands/rebase.rs:497— cli/src/commands/rebase.rs:497-515 | cli/src/commands/rebase.rs:559-576 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/rebase.rs:497` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) default-index/src/revset_engine.rs:788— default-index/src/revset_engine.rs:788-803 | default-index/src/revset_engine.rs:922-938 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `default-index/src/revset_engine.rs:788` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 (16 lines × 2) cli/src/commands/redo.rs:169— cli/src/commands/redo.rs:169-184 | cli/src/commands/undo.rs:182-197 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/redo.rs:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–16 lines × 2) core/src/tree.rs:182— core/src/tree.rs:182-197 | core/src/tree.rs:336-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. 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–15 lines × 2) default-index/src/revset_engine.rs:587— default-index/src/revset_engine.rs:587-599 | default-index/src/revset_engine.rs:693-707 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `default-index/src/revset_engine.rs:587` 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, `default-index/src/revset_engine.rs:692` calls `next` and `default-index/src/revset_engine.rs:587` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–14 lines × 2) cli/src/commands/file/delete.rs:76— cli/src/commands/file/delete.rs:76-87 | cli/src/commands/file/edit.rs:164-177 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/file/edit.rs:164` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 `args` to `&FileDeleteArgs` in one and `&FileEditArgs` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13–14 lines × 2) cli/src/operation_templater.rs:548— cli/src/operation_templater.rs:548-561 | cli/src/operation_templater.rs:568-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 `cli/src/operation_templater.rs:548` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12–13 lines × 3) cli/src/template_builder.rs:2213— cli/src/template_builder.rs:2213-2224 | cli/src/template_builder.rs:2288-2300 | cli/src/template_builder.rs:2326-2338 — 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 `cli/src/template_builder.rs:2213` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) cli/src/cli_util.rs:1674— cli/src/cli_util.rs:1674-1685 | cli/src/cli_util.rs:2072-2084 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/cli_util.rs:1674` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 2) cli/src/commands/bookmark/advance.rs:178— cli/src/commands/bookmark/advance.rs:178-190 | cli/src/commands/bookmark/move.rs:140-150 — before extracting anything, compare `cli/src/commands/bookmark/advance.rs` and `cli/src/commands/bookmark/move.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/advance.rs:178` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 5) cli/src/commit_templater.rs:2395— cli/src/commit_templater.rs:2395-2406 | cli/src/commit_templater.rs:2417-2428 | cli/src/commit_templater.rs:2627-2638 | cli/src/commit_templater.rs:2672-2683 | cli/src/operation_templater.rs:661-672 — before extracting anything, compare `cli/src/commit_templater.rs` and `cli/src/operation_templater.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:2395` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) cli/src/commands/bookmark/list.rs:161— cli/src/commands/bookmark/list.rs:161-172 | cli/src/commands/tag/list.rs:152-162 — `cli/src/commands/bookmark/list.rs` and `cli/src/commands/tag/list.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 44 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/bookmark/list.rs:161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&BookmarkListArgs` in one and `&TagListArgs` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10–12 lines × 2) cli/src/commands/sign.rs:85— cli/src/commands/sign.rs:85-96 | cli/src/commands/unsign.rs:55-64 — 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 `cli/src/commands/sign.rs:85` it begins part-way through the construct above it, so those exact lines 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–11 lines × 2) cli/src/commit_templater.rs:1541— cli/src/commit_templater.rs:1541-1551 | cli/src/commit_templater.rs:1729-1737 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:1541` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) lib/src/git_subprocess.rs:585— lib/src/git_subprocess.rs:585-595 | lib/src/git_subprocess.rs:721-730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/src/git_subprocess.rs:585` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8–10 lines × 5) cli/src/template_builder.rs:2211— cli/src/template_builder.rs:2211-2218 | cli/src/template_builder.rs:2254-2261 | cli/src/template_builder.rs:2286-2293 | cli/src/template_builder.rs:2324-2331 | cli/src/template_builder.rs:2522-2531 — 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 `cli/src/template_builder.rs:2211` it does not close everything it opens, so those exact lines 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 × 4) cli/src/template_builder.rs:1123— cli/src/template_builder.rs:1123-1131 | cli/src/template_builder.rs:1332-1340 | cli/src/template_builder.rs:1835-1844 | cli/src/template_builder.rs:2093-2101 — 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 `cli/src/template_builder.rs:1123` it does not close everything it opens, so those exact lines 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–10 lines × 3) cli/src/commands/file/delete.rs:81— cli/src/commands/file/delete.rs:81-87 | cli/src/commands/file/edit.rs:169-178 | cli/src/commands/restore.rs:187-195 — 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 `cli/src/commands/file/edit.rs:169` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&FileDeleteArgs` in one and `&FileEditArgs` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 3) dsl/src/fileset_parser.rs:450— dsl/src/fileset_parser.rs:450-459 | dsl/src/revset_parser.rs:615-624 | dsl/src/template_parser.rs:792-801 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/revset_parser.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `dsl/src/fileset_parser.rs:450` 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, `dsl/src/revset_parser.rs:612` calls `Err`, `not_infix_op` and `dsl/src/template_parser.rs:789` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–9 lines × 3) cli/src/commit_templater.rs:1540— cli/src/commit_templater.rs:1540-1548 | cli/src/commit_templater.rs:1559-1567 | cli/src/commit_templater.rs:1728-1734 — 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 `cli/src/commit_templater.rs:1540` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) cli/src/commands/log.rs:314— cli/src/commands/log.rs:314-321 | cli/src/commands/operation/log.rs:266-272 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commands/log.rs:314` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5–7 lines × 5) cli/src/template_builder.rs:2408— cli/src/template_builder.rs:2408-2412 | cli/src/template_builder.rs:2419-2423 | cli/src/template_builder.rs:2432-2438 | cli/src/template_builder.rs:2448-2454 | cli/src/template_builder.rs:2464-2470 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 4) cli/src/commands/bookmark/track.rs:101— cli/src/commands/bookmark/track.rs:101-109 | cli/src/commands/bookmark/untrack.rs:98-106 | cli/src/commands/tag/track.rs:95-103 | cli/src/commands/tag/untrack.rs:95-103 — before extracting anything, compare `cli/src/commands/bookmark/track.rs` and `cli/src/commands/bookmark/untrack.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&BookmarkTrackArgs` in one and `&BookmarkUntrackArgs` 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, `cli/src/commands/bookmark/track.rs:98` calls `default_ignored_remote_name`, `store`, `filter` and `cli/src/commands/bookmark/untrack.rs:97` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–7 lines × 2) cli/src/commit_templater.rs:1427— cli/src/commit_templater.rs:1427-1432 | cli/src/commit_templater.rs:1454-1460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:1427` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5–6 lines × 3) default-index/src/changed_path.rs:142— default-index/src/changed_path.rs:142-146 | default-index/src/readonly.rs:299-303 | default-index/src/readonly.rs:342-347 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (42 lines × 2) cli/src/commit_templater.rs:845— cli/src/commit_templater.rs:845-886 | cli/src/commit_templater.rs:896-937 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:845` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) dsl/src/fileset_parser.rs:618— dsl/src/fileset_parser.rs:618-625 | dsl/src/revset_parser.rs:886-893 | dsl/src/template_parser.rs:969-976 — before extracting anything, compare `dsl/src/fileset_parser.rs` and `dsl/src/revset_parser.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `dsl/src/fileset_parser.rs:618` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) cli/src/commit_templater.rs:1353— cli/src/commit_templater.rs:1353-1364 | cli/src/commit_templater.rs:1366-1377 | cli/src/commit_templater.rs:1379-1390 — 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 `cli/src/commit_templater.rs:1353` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 6) cli/src/template_builder.rs:1337— cli/src/template_builder.rs:1337-1346 | cli/src/template_builder.rs:1358-1366 | cli/src/template_builder.rs:1369-1377 | cli/src/template_builder.rs:1380-1388 | cli/src/template_builder.rs:1395-1403 | cli/src/template_builder.rs:1856-1863 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/template_builder.rs:1337` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 6) cli/src/commit_templater.rs:1422— cli/src/commit_templater.rs:1422-1430 | cli/src/commit_templater.rs:1436-1444 | cli/src/commit_templater.rs:1449-1457 | cli/src/commit_templater.rs:2102-2110 | cli/src/commit_templater.rs:2114-2122 | cli/src/commit_templater.rs:2129-2137 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cli/src/commit_templater.rs:1422` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Off the main sequence: jj-core — jj-core: abstractness 0.15, instability 0.14, distance 0.70 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Low cohesion: Merge (LCOM4 6) core/src/merge.rs:186— Merge's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Duplicated predicate cli/src/commands/abandon.rs:76— `!args.revisions_pos.is_empty() || !args.revisions_opt.is_empty()` appears character-identically in 4 files — cli/src/commands/abandon.rs, cli/src/commands/describe.rs, cli/src/commands/duplicate.rs, cli/src/commands/metaedit.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 cli/src/commands/bookmark/list.rs:181— `!args.tracked && (args.all_remotes || args.remotes.is_some())` appears character-identically in 2 files — cli/src/commands/bookmark/list.rs, cli/src/commands/tag/list.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 cli/src/commands/bookmark/track.rs:86— `!bookmark_exprs.is_empty() && !remote_symbols.is_empty()` appears character-identically in 2 files — cli/src/commands/bookmark/track.rs, cli/src/commands/bookmark/untrack.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 cli/src/commands/tag/track.rs:80— `!tag_exprs.is_empty() && !remote_symbols.is_empty()` appears character-identically in 2 files — cli/src/commands/tag/track.rs, cli/src/commands/tag/untrack.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 cli/src/commands/git/clone.rs:205— `args.branches.is_some() || args.tags.is_some()` appears character-identically in 2 files — cli/src/commands/git/clone.rs, cli/src/commands/git/fetch.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 cli/src/commands/diff.rs:127— `args.from.is_some() || args.to.is_some()` appears character-identically in 3 files — cli/src/commands/diff.rs, cli/src/commands/diffedit.rs, cli/src/commands/operation/diff.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 cli/src/commands/commit.rs:139— `args.message_paragraphs.is_none() || args.editor` appears character-identically in 2 files — cli/src/commands/commit.rs, cli/src/commands/split.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 cli/src/commands/bookmark/track.rs:90— `args.remotes.is_some() && !remote_symbols.is_empty()` appears character-identically in 4 files — cli/src/commands/bookmark/track.rs, cli/src/commands/bookmark/untrack.rs, cli/src/commands/tag/track.rs, cli/src/commands/tag/untrack.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 cli/src/commands/arrange.rs:98— `args.revisions_pos.is_empty() && args.revisions_opt.is_empty()` appears character-identically in 2 files — cli/src/commands/arrange.rs, cli/src/commands/show.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 cli/src/commands/bookmark/list.rs:180— `args.tracked || args.all_remotes || args.remotes.is_some()` appears character-identically in 2 files — cli/src/commands/bookmark/list.rs, cli/src/commands/tag/list.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 cli/src/commands/git/export.rs:41— `command.is_working_copy_writable() && workspace_command.working_copy_shared_with_git()` appears character-identically in 2 files — cli/src/commands/git/export.rs, cli/src/commands/git/import.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 core/src/dag_walk.rs:222— `frontier.len() > 1 || (!frontier.is_empty() && root_reached)` appears character-identically in 2 files — core/src/dag_walk.rs, core/src/dag_walk_async.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 cli/src/commands/bookmark/advance.rs:197— `matched_bookmarks.len() > 1 && args.names.is_none()` appears character-identically in 2 files — cli/src/commands/bookmark/advance.rs, cli/src/commands/bookmark/move.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 cli/src/cli_util.rs:2962— `ui.status_formatter() && new_commit.has_conflict()` appears character-identically in 2 files — cli/src/cli_util.rs, cli/src/commands/resolve.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.
Interpolated log message defeats structured logging local-util/src/lock/fallback.rs:51— `info!` at line 51 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging local-util/src/lock/fallback.rs:62— `info!` at line 62 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging local-util/src/lock/unix.rs:44— `info!` at line 44 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging local-util/src/lock/unix.rs:98— `info!` at line 98 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging local-util/src/lock/windows.rs:57— `info!` at line 57 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging local-util/src/lock/windows.rs:87— `info!` at line 87 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging lib/src/git_subprocess.rs:647— `debug!` at line 647 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging cli/src/merge_tools/external.rs:284— `info!` at line 284 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging cli/src/commands/run.rs:538— `debug!` at line 538 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging cli/src/commands/run.rs:579— `debug!` at line 579 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Silent fallback default on Err cli/src/complete.rs:300— `template_aliases` turns every `Err` into `Ok(Vec::new())` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err cli/src/complete.rs:814— `leaf_config_key_value` 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 cli/src/complete.rs:836— `config_keys_to_unset` 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 lib/src/git.rs:2780— `try_find_active_remote_inner` turns every `Err` into `true` — 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.
Orphaned file lib/src/eol.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file cli/testing/fake-formatter.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file core/src/union_find.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 7 significant file(s) lose their only recent owner: core/src/dag_walk_async.rs, core/src/tree_walk.rs, core/src/fileset_backend.rs, core/src/revset_backend.rs, core/src/filtered_tree_writer.rs, lib/src/extensions_map.rs, core/src/index_store.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 3 significant file(s) lose their only recent owner: cli/src/commit_ref_list.rs, core/src/ref_name.rs, cli/src/commands/tag/mod.rs. Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (12 single-owned of 253 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 253 of the 308 production source files in this repository met that bar). They are anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: lib/src/graph_dominators.rs, local-util/src/subprocess_util.rs.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 3 of 12 project(s) overshoot their size bounds, lowering Project Cohesion to 5.0/10. The most over is `cli` (62273 LoC, 435 module-visible types across 19 directories). 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.
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 3 of 253 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 253 of the 308 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: lib/src/eol.rs, cli/testing/fake-formatter.rs, core/src/union_find.rs. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
P10 · Library API & versioning· Implementation type on the public API · ×1
Implementation type on the public API core/src/merged_tree.rs:584— 1 public type in `jj_core.merged_tree` is marked as implementation by its own namespace, folder or name: `TreeDiffStreamImpl` (core/src/merged_tree.rs:584, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
Logging is not universal — Only 7/8 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `gen-protos`.
P3 · Security & performance tooling· Dependabot does not watch uv · ×1
Dependabot does not watch uv .github/dependabot.yml:2— `.github/dependabot.yml` schedules updates, but no `package-ecosystem` entry covers `uv`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list.
X5 · Nullable reference types· Strict null checking is not enabled everywhere the repository type-checks · ×1
Strict null checking is not enabled everywhere the repository type-checks — 0/1 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
Outdated: interim — `interim` is locked at 0.2.1 but 0.2.2 is the current stable release on crates.io, and it already satisfies the `"0.2.1"` requirement declared in core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p interim` and commit the updated REDACTED.
Outdated: jiff — `jiff` is locked at 0.2.42 but 0.2.43 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p jiff` and commit the updated REDACTED.
Outdated: pest — `pest` is locked at 2.9.5 but 2.9.6 is the current stable release on crates.io, and it already satisfies the `"2.8.6"` requirement declared in cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p pest` and commit the updated REDACTED.
Outdated: pest_derive — `pest_derive` is locked at 2.9.5 but 2.9.6 is the current stable release on crates.io, and it already satisfies the `"2.8.6"` requirement declared in dsl/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p pest_derive` and commit the updated REDACTED.
Outdated: prost — `prost` is locked at 0.14.4 but 0.14.6 is the current stable release on crates.io, and it already satisfies the `"0.14.3"` requirement declared in default-index/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p prost` and commit the updated REDACTED.
Outdated: prost-build — `prost-build` is locked at 0.14.4 but 0.14.6 is the current stable release on crates.io, and it already satisfies the `"0.14.3"` requirement declared in gen-protos/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p prost-build` and commit the updated REDACTED.
Outdated: rpassword — `rpassword` is locked at 7.5.4 but 7.5.5 is the current stable release on crates.io, and it already satisfies the `"7.5.4"` requirement declared in cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rpassword` and commit the updated REDACTED.
Outdated: smallvec — `smallvec` is locked at 1.16.4 but 1.16.5 is the current stable release on crates.io, and it already satisfies the `"1.15.1"` requirement declared in core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p smallvec` and commit the updated REDACTED.
Outdated: syn — `syn` is locked at 3.0.9 but 3.0.10 is the current stable release on crates.io, and it already satisfies the `"3.0.3"` requirement declared in core/proc-macros/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p syn` and commit the updated REDACTED.
Outdated: toml — `toml` is locked at 1.1.8+spec-1.1.0 but 1.2.1+spec-1.1.0 is the current stable release on crates.io, and it already satisfies the `"1.1.0"` requirement declared in cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p toml` 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.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 1 file(s) — `web/docs/src/pages/config-schema.json.ts` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1d872-255e-706a-9cf7-430f9b96e9bb · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 4 · Warnings: 993 · Recommendations: 46 · Info: 10 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 05:05 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.