Public report of facebook/buck2, published 28 October 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.10.5). 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, 28 October 2026, 16:09 UTC · Survey ID cd_c06b11226acc4acfb57d0c3059530629
facebook/buck2
Measured 28 October 2026, 15:38 UTC, at code version b2ddee9
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
Down 4 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A very large codebase: 831,181 lines of product code in 7 projects, tests not counted · Estimated rebuild effort: about 5.7 person-years · Weakest lens: Security and Compliance, 35
Findings by how serious they are
115 critical3139 serious313 minor
19 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks 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
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
28 October 2026, 15:38 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 Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works 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 ▸
86of 86 dimensions measured by tools.
3511of 3567 findings point to an exact file and line, so you can open each one in the code. The other 56 concern the repository as a whole, such as missing documentation.
86dimensions across 8 lenses, read from 831,181 lines of product code in 7 projects.
facebook/buck2 falls short of our standard for a preview release, held back most by its Security and Compliance lens, the code's security and compliance. It scores 41 out of 100 and is rated Weak, and 62 of its 115 critical findings are security problems.
Security and Compliance, at 35, is the weakest lens and counts most in the score. The best first step is fixing the password or key in the code, worth about 2 points. Signing the build's output would lift Security and Compliance itself, worth about 1 point. Raising Security and Compliance to 68 would lift the score to about 45.
Forty pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Seven weaknesses in the code could be used by an attacker, and fifteen controls can't be used without a mouse. Pinning each tool to an exact version, fixing the weaknesses the scanner points to and making the controls work with a keyboard would close these risks. Updating the vulnerable packages would fix the five packages with a known security hole, and passing outside input through environment variables would deal with the five pipeline steps that put outside input straight into a shell command. The 14 form fields without a label need a label.
The product code is 831,181 lines, about €830,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 Security and Compliance rose from 35 to 68, the lowest score rated Strong, the score would rise from 41 to about 45.
Code composition: what the lines of code are
Product code 85%Tests 15%
New since the last survey: 519 findings
These 519 critical or serious findings weren't in the previous survey, on 14 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
Watchdog compares 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: 522 findings
These 522 critical or serious findings were in the previous survey, on 14 October 2026, and are gone from this one. The first 100 are listed here.
God Classes · TooManyMethods: SmallMap starlark-rust/starlark_map/src/small_map.rs
God Classes · TooManyMethods: SmallSet starlark-rust/starlark_map/src/small_set.rs
God Classes · FileTooLong: attrs/coerced_attr.rs app/buck2_node/src/attrs/coerced_attr.rs
God Classes · FileTooLong: src/small_map.rs starlark-rust/starlark_map/src/small_map.rs
God Classes · ClassTooLong: SmallMap starlark-rust/starlark_map/src/small_map.rs
God Classes · TooManyMethods: Vec2 starlark-rust/starlark_map/src/vec2.rs
God Classes · ClassTooLong: CoercedAttr app/buck2_node/src/attrs/coerced_attr.rs
God Classes · MethodTooLong: KspStepsBuilder.prepareKspProcessorsIfNeeded prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/KspStepsBuilder.java
God Classes · FileTooLong: provider/callable.rs app/buck2_build_api/src/interpreter/rule_defs/provider/callable.rs
God Classes · FileTooLong: paths/forward_rel_path.rs app/buck2_fs/src/paths/forward_rel_path.rs
God Classes · TooManyMethods: VecMap starlark-rust/starlark_map/src/vec_map.rs
God Classes · MethodTooLong: CoercedAttr.configure_inner app/buck2_node/src/attrs/coerced_attr.rs
Code Duplication · Edited copy of a member (54 corresponding lines) prelude/toolchains/conan/conan_generate.py
Code Duplication · Edited copy of a member (40 corresponding lines) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/KotlinMetadataReader.java
Code Duplication · Edited copy of a member (18 corresponding lines) prelude/toolchains/android/src/com/facebook/buck/jvm/cd/workertool/MainUtils.java
Code Duplication · Members sharing a duplicated core (20 members, 50+ identical tokens) prelude/toolchains/android/src/com/facebook/buck/android/AndroidManifestReaderExecutableMain.java
Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) app/buck2_build_api/src/artifact_groups/calculation.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs
€280,000 to €1,400,000, for 4,610 to 14,626 hours of work, about 5.7 person-years for 3 to 11 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 41. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Very large: 831,181 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: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.
Raises the score by about 2 points · Low effort · Secret Scanning
2
Resolve the 9 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (9).
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 €830,000 to build again, about 5.7 person-years of work. Its weakest lens is Security and Compliance, at 35 (Weak). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 2 points for low effort, because it clears the 1 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
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.
2676 modules, with 10946 dependencies between them. 12 loops run through 829 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 2636 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.
allocative.allocative_trait uses allocative.visitor, so a change to allocative.visitor can break allocative.allocative_trait, while a change to allocative.allocative_trait can't break allocative.visitor.
Position
Below the diagonal: allocative.allocative_trait uses a module listed above it, which is the healthy direction.
buck2_error_derive.attr uses buck2_event_observer.span_tracker, so a change to buck2_event_observer.span_tracker can break buck2_error_derive.attr, while a change to buck2_error_derive.attr can't break buck2_event_observer.span_tracker.
Position
Below the diagonal: buck2_error_derive.attr uses a module listed above it, which is the healthy direction.
buck2_server_ctx.partial_result_dispatcher uses dice_futures.cancellation, so a change to dice_futures.cancellation can break buck2_server_ctx.partial_result_dispatcher, while a change to buck2_server_ctx.partial_result_dispatcher can't break dice_futures.cancellation.
Position
Below the diagonal: buck2_server_ctx.partial_result_dispatcher uses a module listed above it, which is the healthy direction.
9→15 starlark.values.layout.heap.freezer uses starlark.values.layout.typedpart of a loop✕
Connections
1 pair of types, where a type in starlark.values.layout.heap.freezer uses a type in starlark.values.layout.typed.
starlark.values.layout.heap.freezer uses starlark.values.layout.typed, so a change to starlark.values.layout.typed can break starlark.values.layout.heap.freezer, while a change to starlark.values.layout.heap.freezer can't break starlark.values.layout.typed.
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.
9→16 starlark.values.layout.heap.freezer uses starlark.values.layout.heap.frozenpart of a loop✕
Connections
1 pair of types, where a type in starlark.values.layout.heap.freezer uses a type in starlark.values.layout.heap.frozen.
starlark.values.layout.heap.freezer uses starlark.values.layout.heap.frozen, so a change to starlark.values.layout.heap.frozen can break starlark.values.layout.heap.freezer, while a change to starlark.values.layout.heap.freezer can't break starlark.values.layout.heap.frozen.
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.
9→19 starlark.values.layout.heap.freezer uses starlark.values.layout.valuepart of a loop✕
Connections
1 pair of types, where a type in starlark.values.layout.heap.freezer uses a type in starlark.values.layout.value.
starlark.values.layout.heap.freezer uses starlark.values.layout.value, so a change to starlark.values.layout.value can break starlark.values.layout.heap.freezer, while a change to starlark.values.layout.heap.freezer can't break starlark.values.layout.value.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10→15 starlark.values.layout.heap.unfrozen uses starlark.values.layout.typedpart of a loop✕
Connections
1 pair of types, where a type in starlark.values.layout.heap.unfrozen uses a type in starlark.values.layout.typed.
starlark.values.layout.heap.unfrozen uses starlark.values.layout.typed, so a change to starlark.values.layout.typed can break starlark.values.layout.heap.unfrozen, while a change to starlark.values.layout.heap.unfrozen can't break starlark.values.layout.typed.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10→16 starlark.values.layout.heap.unfrozen uses starlark.values.layout.heap.frozenpart of a loop✕
Connections
2 pairs of types, where a type in starlark.values.layout.heap.unfrozen uses a type in starlark.values.layout.heap.frozen.
starlark.values.layout.heap.unfrozen uses starlark.values.layout.heap.frozen, so a change to starlark.values.layout.heap.frozen can break starlark.values.layout.heap.unfrozen, while a change to starlark.values.layout.heap.unfrozen can't break starlark.values.layout.heap.frozen.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10→19 starlark.values.layout.heap.unfrozen uses starlark.values.layout.valuepart of a loop✕
Connections
2 pairs of types, where a type in starlark.values.layout.heap.unfrozen uses a type in starlark.values.layout.value.
starlark.values.layout.heap.unfrozen uses starlark.values.layout.value, so a change to starlark.values.layout.value can break starlark.values.layout.heap.unfrozen, while a change to starlark.values.layout.heap.unfrozen can't break starlark.values.layout.value.
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.
buck2_daemon.daemonize uses allocative.visitor, so a change to allocative.visitor can break buck2_daemon.daemonize, while a change to buck2_daemon.daemonize can't break allocative.visitor.
Position
Below the diagonal: buck2_daemon.daemonize uses a module listed above it, which is the healthy direction.
buck2_daemon.daemonize uses allocative.allocative_trait, so a change to allocative.allocative_trait can break buck2_daemon.daemonize, while a change to buck2_daemon.daemonize can't break allocative.allocative_trait.
Position
Below the diagonal: buck2_daemon.daemonize uses a module listed above it, which is the healthy direction.
buck2_daemon.daemonize uses buck2_error_derive.attr, so a change to buck2_error_derive.attr can break buck2_daemon.daemonize, while a change to buck2_daemon.daemonize can't break buck2_error_derive.attr.
Position
Below the diagonal: buck2_daemon.daemonize uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in dice_core.arc uses a type in allocative.visitor.
The types involved
dice_core.arc.Arc → allocative.visitor.Visitor
Direction
dice_core.arc uses allocative.visitor, so a change to allocative.visitor can break dice_core.arc, while a change to dice_core.arc can't break allocative.visitor.
Position
Below the diagonal: dice_core.arc uses a module listed above it, which is the healthy direction.
dice_core.arc uses buck2_event_observer.span_tracker, so a change to buck2_event_observer.span_tracker can break dice_core.arc, while a change to dice_core.arc can't break buck2_event_observer.span_tracker.
Position
Below the diagonal: dice_core.arc uses a module listed above it, which is the healthy direction.
dice_core.arc uses dice_futures.cancellation, so a change to dice_futures.cancellation can break dice_core.arc, while a change to dice_core.arc can't break dice_futures.cancellation.
Position
Below the diagonal: dice_core.arc uses a module listed above it, which is the healthy direction.
dice_core.arc uses allocative.allocative_trait, so a change to allocative.allocative_trait can break dice_core.arc, while a change to dice_core.arc can't break allocative.allocative_trait.
Position
Below the diagonal: dice_core.arc uses a module listed above it, which is the healthy direction.
dice_core.arc uses starlark.values.layout.heap.unfrozen, so a change to starlark.values.layout.heap.unfrozen can break dice_core.arc, while a change to dice_core.arc can't break starlark.values.layout.heap.unfrozen.
Position
Below the diagonal: dice_core.arc uses a module listed above it, which is the healthy direction.
starlark.values.alloc_value uses starlark.values.layout.heap.unfrozen, so a change to starlark.values.layout.heap.unfrozen can break starlark.values.alloc_value, while a change to starlark.values.alloc_value can't break starlark.values.layout.heap.unfrozen.
Position
Below the diagonal: starlark.values.alloc_value uses a module listed above it, which is the healthy direction.
13→16 starlark.values.alloc_value uses starlark.values.layout.heap.frozenpart of a loop✕
Connections
2 pairs of types, where a type in starlark.values.alloc_value uses a type in starlark.values.layout.heap.frozen.
starlark.values.alloc_value uses starlark.values.layout.heap.frozen, so a change to starlark.values.layout.heap.frozen can break starlark.values.alloc_value, while a change to starlark.values.alloc_value can't break starlark.values.layout.heap.frozen.
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.
13→19 starlark.values.alloc_value uses starlark.values.layout.valuepart of a loop✕
Connections
2 pairs of types, where a type in starlark.values.alloc_value uses a type in starlark.values.layout.value.
starlark.values.alloc_value uses starlark.values.layout.value, so a change to starlark.values.layout.value can break starlark.values.alloc_value, while a change to starlark.values.alloc_value can't break starlark.values.layout.value.
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.
starlark_syntax.codemap uses buck2_event_observer.span_tracker, so a change to buck2_event_observer.span_tracker can break starlark_syntax.codemap, while a change to starlark_syntax.codemap can't break buck2_event_observer.span_tracker.
Position
Below the diagonal: starlark_syntax.codemap uses a module listed above it, which is the healthy direction.
starlark_syntax.codemap uses buck2_error_derive.attr, so a change to buck2_error_derive.attr can break starlark_syntax.codemap, while a change to starlark_syntax.codemap can't break buck2_error_derive.attr.
Position
Below the diagonal: starlark_syntax.codemap uses a module listed above it, which is the healthy direction.
14→21 starlark_syntax.codemap uses buck2_node.attrs.coerced.kindspart of a loop✕
Connections
5 pairs of types, where a type in starlark_syntax.codemap uses a type in buck2_node.attrs.coerced.kinds.
starlark_syntax.codemap uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break starlark_syntax.codemap, while a change to starlark_syntax.codemap can't break buck2_node.attrs.coerced.kinds.
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.
starlark.values.layout.typed uses buck2_error_derive.attr, so a change to buck2_error_derive.attr can break starlark.values.layout.typed, while a change to starlark.values.layout.typed can't break buck2_error_derive.attr.
Position
Below the diagonal: starlark.values.layout.typed uses a module listed above it, which is the healthy direction.
starlark.values.layout.typed uses starlark.values.layout.heap.freezer, so a change to starlark.values.layout.heap.freezer can break starlark.values.layout.typed, while a change to starlark.values.layout.typed can't break starlark.values.layout.heap.freezer.
Position
Below the diagonal: starlark.values.layout.typed uses a module listed above it, which is the healthy direction.
starlark.values.layout.typed uses starlark.values.layout.heap.unfrozen, so a change to starlark.values.layout.heap.unfrozen can break starlark.values.layout.typed, while a change to starlark.values.layout.typed can't break starlark.values.layout.heap.unfrozen.
Position
Below the diagonal: starlark.values.layout.typed uses a module listed above it, which is the healthy direction.
starlark.values.layout.typed uses starlark.values.alloc_value, so a change to starlark.values.alloc_value can break starlark.values.layout.typed, while a change to starlark.values.layout.typed can't break starlark.values.alloc_value.
Position
Below the diagonal: starlark.values.layout.typed uses a module listed above it, which is the healthy direction.
15→16 starlark.values.layout.typed uses starlark.values.layout.heap.frozenpart of a loop✕
Connections
1 pair of types, where a type in starlark.values.layout.typed uses a type in starlark.values.layout.heap.frozen.
starlark.values.layout.typed uses starlark.values.layout.heap.frozen, so a change to starlark.values.layout.heap.frozen can break starlark.values.layout.typed, while a change to starlark.values.layout.typed can't break starlark.values.layout.heap.frozen.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
15→19 starlark.values.layout.typed uses starlark.values.layout.valuepart of a loop✕
Connections
2 pairs of types, where a type in starlark.values.layout.typed uses a type in starlark.values.layout.value.
starlark.values.layout.typed uses starlark.values.layout.value, so a change to starlark.values.layout.value can break starlark.values.layout.typed, while a change to starlark.values.layout.typed can't break starlark.values.layout.value.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
15→20 starlark.values.layout.typed uses starlark.typing.typart of a loop✕
Connections
3 pairs of types, where a type in starlark.values.layout.typed uses a type in starlark.typing.ty.
starlark.values.layout.typed uses starlark.typing.ty, so a change to starlark.typing.ty can break starlark.values.layout.typed, while a change to starlark.values.layout.typed can't break starlark.typing.ty.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
15→21 starlark.values.layout.typed uses buck2_node.attrs.coerced.kindspart of a loop✕
Connections
1 pair of types, where a type in starlark.values.layout.typed uses a type in buck2_node.attrs.coerced.kinds.
starlark.values.layout.typed uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break starlark.values.layout.typed, while a change to starlark.values.layout.typed can't break buck2_node.attrs.coerced.kinds.
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.
starlark.values.layout.heap.frozen uses starlark.values.layout.typed, so a change to starlark.values.layout.typed can break starlark.values.layout.heap.frozen, while a change to starlark.values.layout.heap.frozen can't break starlark.values.layout.typed.
Position
Below the diagonal: starlark.values.layout.heap.frozen uses a module listed above it, which is the healthy direction.
16→19 starlark.values.layout.heap.frozen uses starlark.values.layout.valuepart of a loop✕
Connections
1 pair of types, where a type in starlark.values.layout.heap.frozen uses a type in starlark.values.layout.value.
starlark.values.layout.heap.frozen uses starlark.values.layout.value, so a change to starlark.values.layout.value can break starlark.values.layout.heap.frozen, while a change to starlark.values.layout.heap.frozen can't break starlark.values.layout.value.
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.
starlark.environment.globals uses pagable.traits, so a change to pagable.traits can break starlark.environment.globals, while a change to starlark.environment.globals can't break pagable.traits.
Position
Below the diagonal: starlark.environment.globals uses a module listed above it, which is the healthy direction.
starlark.environment.globals uses buck2_error_derive.attr, so a change to buck2_error_derive.attr can break starlark.environment.globals, while a change to starlark.environment.globals can't break buck2_error_derive.attr.
Position
Below the diagonal: starlark.environment.globals uses a module listed above it, which is the healthy direction.
starlark.environment.globals uses starlark.values.layout.heap.frozen, so a change to starlark.values.layout.heap.frozen can break starlark.environment.globals, while a change to starlark.environment.globals can't break starlark.values.layout.heap.frozen.
Position
Below the diagonal: starlark.environment.globals uses a module listed above it, which is the healthy direction.
17→19 starlark.environment.globals uses starlark.values.layout.valuepart of a loop✕
Connections
4 pairs of types, where a type in starlark.environment.globals uses a type in starlark.values.layout.value.
starlark.environment.globals uses starlark.values.layout.value, so a change to starlark.values.layout.value can break starlark.environment.globals, while a change to starlark.environment.globals can't break starlark.values.layout.value.
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.
17→20 starlark.environment.globals uses starlark.typing.typart of a loop✕
Connections
1 pair of types, where a type in starlark.environment.globals uses a type in starlark.typing.ty.
starlark.environment.globals uses starlark.typing.ty, so a change to starlark.typing.ty can break starlark.environment.globals, while a change to starlark.environment.globals can't break starlark.typing.ty.
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.
17→21 starlark.environment.globals uses buck2_node.attrs.coerced.kindspart of a loop✕
Connections
4 pairs of types, where a type in starlark.environment.globals uses a type in buck2_node.attrs.coerced.kinds.
starlark.environment.globals uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break starlark.environment.globals, while a change to starlark.environment.globals can't break buck2_node.attrs.coerced.kinds.
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.
starlark.eval.runtime.evaluator uses starlark.values.layout.heap.unfrozen, so a change to starlark.values.layout.heap.unfrozen can break starlark.eval.runtime.evaluator, while a change to starlark.eval.runtime.evaluator can't break starlark.values.layout.heap.unfrozen.
Position
Below the diagonal: starlark.eval.runtime.evaluator uses a module listed above it, which is the healthy direction.
starlark.eval.runtime.evaluator uses buck2_daemon.daemonize, so a change to buck2_daemon.daemonize can break starlark.eval.runtime.evaluator, while a change to starlark.eval.runtime.evaluator can't break buck2_daemon.daemonize.
Position
Below the diagonal: starlark.eval.runtime.evaluator uses a module listed above it, which is the healthy direction.
starlark.eval.runtime.evaluator uses starlark_syntax.codemap, so a change to starlark_syntax.codemap can break starlark.eval.runtime.evaluator, while a change to starlark.eval.runtime.evaluator can't break starlark_syntax.codemap.
Position
Below the diagonal: starlark.eval.runtime.evaluator uses a module listed above it, which is the healthy direction.
starlark.eval.runtime.evaluator uses starlark.environment.globals, so a change to starlark.environment.globals can break starlark.eval.runtime.evaluator, while a change to starlark.eval.runtime.evaluator can't break starlark.environment.globals.
Position
Below the diagonal: starlark.eval.runtime.evaluator uses a module listed above it, which is the healthy direction.
18→19 starlark.eval.runtime.evaluator uses starlark.values.layout.valuepart of a loop✕
Connections
1 pair of types, where a type in starlark.eval.runtime.evaluator uses a type in starlark.values.layout.value.
starlark.eval.runtime.evaluator uses starlark.values.layout.value, so a change to starlark.values.layout.value can break starlark.eval.runtime.evaluator, while a change to starlark.eval.runtime.evaluator can't break starlark.values.layout.value.
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.
starlark.values.layout.value uses allocative.visitor, so a change to allocative.visitor can break starlark.values.layout.value, while a change to starlark.values.layout.value can't break allocative.visitor.
Position
Below the diagonal: starlark.values.layout.value uses a module listed above it, which is the healthy direction.
starlark.values.layout.value uses pagable.traits, so a change to pagable.traits can break starlark.values.layout.value, while a change to starlark.values.layout.value can't break pagable.traits.
Position
Below the diagonal: starlark.values.layout.value uses a module listed above it, which is the healthy direction.
starlark.values.layout.value uses allocative.allocative_trait, so a change to allocative.allocative_trait can break starlark.values.layout.value, while a change to starlark.values.layout.value can't break allocative.allocative_trait.
Position
Below the diagonal: starlark.values.layout.value uses a module listed above it, which is the healthy direction.
starlark.values.layout.value uses buck2_error_derive.attr, so a change to buck2_error_derive.attr can break starlark.values.layout.value, while a change to starlark.values.layout.value can't break buck2_error_derive.attr.
Position
Below the diagonal: starlark.values.layout.value uses a module listed above it, which is the healthy direction.
starlark.values.layout.value uses starlark.values.layout.heap.freezer, so a change to starlark.values.layout.heap.freezer can break starlark.values.layout.value, while a change to starlark.values.layout.value can't break starlark.values.layout.heap.freezer.
Position
Below the diagonal: starlark.values.layout.value uses a module listed above it, which is the healthy direction.
starlark.values.layout.value uses starlark.values.layout.heap.unfrozen, so a change to starlark.values.layout.heap.unfrozen can break starlark.values.layout.value, while a change to starlark.values.layout.value can't break starlark.values.layout.heap.unfrozen.
Position
Below the diagonal: starlark.values.layout.value uses a module listed above it, which is the healthy direction.
starlark.values.layout.value uses starlark.values.alloc_value, so a change to starlark.values.alloc_value can break starlark.values.layout.value, while a change to starlark.values.layout.value can't break starlark.values.alloc_value.
Position
Below the diagonal: starlark.values.layout.value uses a module listed above it, which is the healthy direction.
starlark.values.layout.value uses starlark.values.layout.typed, so a change to starlark.values.layout.typed can break starlark.values.layout.value, while a change to starlark.values.layout.value can't break starlark.values.layout.typed.
Position
Below the diagonal: starlark.values.layout.value uses a module listed above it, which is the healthy direction.
starlark.values.layout.value uses starlark.values.layout.heap.frozen, so a change to starlark.values.layout.heap.frozen can break starlark.values.layout.value, while a change to starlark.values.layout.value can't break starlark.values.layout.heap.frozen.
Position
Below the diagonal: starlark.values.layout.value uses a module listed above it, which is the healthy direction.
starlark.values.layout.value uses starlark.eval.runtime.evaluator, so a change to starlark.eval.runtime.evaluator can break starlark.values.layout.value, while a change to starlark.values.layout.value can't break starlark.eval.runtime.evaluator.
Position
Below the diagonal: starlark.values.layout.value uses a module listed above it, which is the healthy direction.
19→20 starlark.values.layout.value uses starlark.typing.typart of a loop✕
Connections
1 pair of types, where a type in starlark.values.layout.value uses a type in starlark.typing.ty.
starlark.values.layout.value uses starlark.typing.ty, so a change to starlark.typing.ty can break starlark.values.layout.value, while a change to starlark.values.layout.value can't break starlark.typing.ty.
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.
19→21 starlark.values.layout.value uses buck2_node.attrs.coerced.kindspart of a loop✕
Connections
2 pairs of types, where a type in starlark.values.layout.value uses a type in buck2_node.attrs.coerced.kinds.
starlark.values.layout.value uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break starlark.values.layout.value, while a change to starlark.values.layout.value can't break buck2_node.attrs.coerced.kinds.
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.
starlark.typing.ty uses buck2_error_derive.attr, so a change to buck2_error_derive.attr can break starlark.typing.ty, while a change to starlark.typing.ty can't break buck2_error_derive.attr.
Position
Below the diagonal: starlark.typing.ty uses a module listed above it, which is the healthy direction.
starlark.typing.ty uses starlark.values.layout.value, so a change to starlark.values.layout.value can break starlark.typing.ty, while a change to starlark.typing.ty can't break starlark.values.layout.value.
Position
Below the diagonal: starlark.typing.ty uses a module listed above it, which is the healthy direction.
20→21 starlark.typing.ty uses buck2_node.attrs.coerced.kindspart of a loop✕
Connections
1 pair of types, where a type in starlark.typing.ty uses a type in buck2_node.attrs.coerced.kinds.
starlark.typing.ty uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break starlark.typing.ty, while a change to starlark.typing.ty can't break buck2_node.attrs.coerced.kinds.
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.
buck2_node.attrs.coerced.kinds uses allocative.visitor, so a change to allocative.visitor can break buck2_node.attrs.coerced.kinds, while a change to buck2_node.attrs.coerced.kinds can't break allocative.visitor.
Position
Below the diagonal: buck2_node.attrs.coerced.kinds uses a module listed above it, which is the healthy direction.
buck2_node.attrs.coerced.kinds uses pagable.traits, so a change to pagable.traits can break buck2_node.attrs.coerced.kinds, while a change to buck2_node.attrs.coerced.kinds can't break pagable.traits.
Position
Below the diagonal: buck2_node.attrs.coerced.kinds uses a module listed above it, which is the healthy direction.
buck2_node.attrs.coerced.kinds uses allocative.allocative_trait, so a change to allocative.allocative_trait can break buck2_node.attrs.coerced.kinds, while a change to buck2_node.attrs.coerced.kinds can't break allocative.allocative_trait.
Position
Below the diagonal: buck2_node.attrs.coerced.kinds uses a module listed above it, which is the healthy direction.
buck2_node.attrs.coerced.kinds uses starlark.values.layout.heap.unfrozen, so a change to starlark.values.layout.heap.unfrozen can break buck2_node.attrs.coerced.kinds, while a change to buck2_node.attrs.coerced.kinds can't break starlark.values.layout.heap.unfrozen.
Position
Below the diagonal: buck2_node.attrs.coerced.kinds uses a module listed above it, which is the healthy direction.
buck2_node.attrs.coerced.kinds uses starlark.values.alloc_value, so a change to starlark.values.alloc_value can break buck2_node.attrs.coerced.kinds, while a change to buck2_node.attrs.coerced.kinds can't break starlark.values.alloc_value.
Position
Below the diagonal: buck2_node.attrs.coerced.kinds uses a module listed above it, which is the healthy direction.
buck2_node.attrs.coerced.kinds uses starlark.values.layout.heap.frozen, so a change to starlark.values.layout.heap.frozen can break buck2_node.attrs.coerced.kinds, while a change to buck2_node.attrs.coerced.kinds can't break starlark.values.layout.heap.frozen.
Position
Below the diagonal: buck2_node.attrs.coerced.kinds uses a module listed above it, which is the healthy direction.
buck2_node.attrs.coerced.kinds uses starlark.values.layout.value, so a change to starlark.values.layout.value can break buck2_node.attrs.coerced.kinds, while a change to buck2_node.attrs.coerced.kinds can't break starlark.values.layout.value.
Position
Below the diagonal: buck2_node.attrs.coerced.kinds uses a module listed above it, which is the healthy direction.
buck2_node.attrs.coerced.kinds uses starlark.typing.ty, so a change to starlark.typing.ty can break buck2_node.attrs.coerced.kinds, while a change to buck2_node.attrs.coerced.kinds can't break starlark.typing.ty.
Position
Below the diagonal: buck2_node.attrs.coerced.kinds uses a module listed above it, which is the healthy direction.
buck2_client_ctx.common uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break buck2_client_ctx.common, while a change to buck2_client_ctx.common can't break buck2_node.attrs.coerced.kinds.
Position
Below the diagonal: buck2_client_ctx.common uses a module listed above it, which is the healthy direction.
buck2_core.fs.project_rel_path uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break buck2_core.fs.project_rel_path, while a change to buck2_core.fs.project_rel_path can't break buck2_node.attrs.coerced.kinds.
Position
Below the diagonal: buck2_core.fs.project_rel_path uses a module listed above it, which is the healthy direction.
23→27 buck2_core.fs.project_rel_path uses buck2_fs.paths.forward_rel_pathpart of a loop✕
Connections
4 pairs of types, where a type in buck2_core.fs.project_rel_path uses a type in buck2_fs.paths.forward_rel_path.
buck2_core.fs.project_rel_path uses buck2_fs.paths.forward_rel_path, so a change to buck2_fs.paths.forward_rel_path can break buck2_core.fs.project_rel_path, while a change to buck2_core.fs.project_rel_path can't break buck2_fs.paths.forward_rel_path.
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.
remote_execution.request uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break remote_execution.request, while a change to remote_execution.request can't break buck2_node.attrs.coerced.kinds.
Position
Below the diagonal: remote_execution.request uses a module listed above it, which is the healthy direction.
starlark.environment.methods uses buck2_error_derive.attr, so a change to buck2_error_derive.attr can break starlark.environment.methods, while a change to starlark.environment.methods can't break buck2_error_derive.attr.
Position
Below the diagonal: starlark.environment.methods uses a module listed above it, which is the healthy direction.
starlark.environment.methods uses starlark.values.layout.heap.frozen, so a change to starlark.values.layout.heap.frozen can break starlark.environment.methods, while a change to starlark.environment.methods can't break starlark.values.layout.heap.frozen.
Position
Below the diagonal: starlark.environment.methods uses a module listed above it, which is the healthy direction.
starlark.environment.methods uses starlark.values.layout.value, so a change to starlark.values.layout.value can break starlark.environment.methods, while a change to starlark.environment.methods can't break starlark.values.layout.value.
Position
Below the diagonal: starlark.environment.methods uses a module listed above it, which is the healthy direction.
starlark.environment.methods uses starlark.typing.ty, so a change to starlark.typing.ty can break starlark.environment.methods, while a change to starlark.environment.methods can't break starlark.typing.ty.
Position
Below the diagonal: starlark.environment.methods uses a module listed above it, which is the healthy direction.
starlark.environment.methods uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break starlark.environment.methods, while a change to starlark.environment.methods can't break buck2_node.attrs.coerced.kinds.
Position
Below the diagonal: starlark.environment.methods uses a module listed above it, which is the healthy direction.
buck2_fs.paths.abs_norm_path uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break buck2_fs.paths.abs_norm_path, while a change to buck2_fs.paths.abs_norm_path can't break buck2_node.attrs.coerced.kinds.
Position
Below the diagonal: buck2_fs.paths.abs_norm_path uses a module listed above it, which is the healthy direction.
buck2_fs.paths.abs_norm_path uses remote_execution.request, so a change to remote_execution.request can break buck2_fs.paths.abs_norm_path, while a change to buck2_fs.paths.abs_norm_path can't break remote_execution.request.
Position
Below the diagonal: buck2_fs.paths.abs_norm_path uses a module listed above it, which is the healthy direction.
buck2_fs.paths.forward_rel_path uses buck2_directory.directory.sorted_slice_map, so a change to buck2_directory.directory.sorted_slice_map can break buck2_fs.paths.forward_rel_path, while a change to buck2_fs.paths.forward_rel_path can't break buck2_directory.directory.sorted_slice_map.
Position
Below the diagonal: buck2_fs.paths.forward_rel_path uses a module listed above it, which is the healthy direction.
buck2_fs.paths.forward_rel_path uses pagable.traits, so a change to pagable.traits can break buck2_fs.paths.forward_rel_path, while a change to buck2_fs.paths.forward_rel_path can't break pagable.traits.
Position
Below the diagonal: buck2_fs.paths.forward_rel_path uses a module listed above it, which is the healthy direction.
buck2_fs.paths.forward_rel_path uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break buck2_fs.paths.forward_rel_path, while a change to buck2_fs.paths.forward_rel_path can't break buck2_node.attrs.coerced.kinds.
Position
Below the diagonal: buck2_fs.paths.forward_rel_path uses a module listed above it, which is the healthy direction.
buck2_fs.paths.forward_rel_path uses buck2_core.fs.project_rel_path, so a change to buck2_core.fs.project_rel_path can break buck2_fs.paths.forward_rel_path, while a change to buck2_fs.paths.forward_rel_path can't break buck2_core.fs.project_rel_path.
Position
Below the diagonal: buck2_fs.paths.forward_rel_path uses a module listed above it, which is the healthy direction.
buck2_fs.paths.forward_rel_path uses remote_execution.request, so a change to remote_execution.request can break buck2_fs.paths.forward_rel_path, while a change to buck2_fs.paths.forward_rel_path can't break remote_execution.request.
Position
Below the diagonal: buck2_fs.paths.forward_rel_path uses a module listed above it, which is the healthy direction.
starlark.values.traits uses allocative.allocative_trait, so a change to allocative.allocative_trait can break starlark.values.traits, while a change to starlark.values.traits can't break allocative.allocative_trait.
Position
Below the diagonal: starlark.values.traits uses a module listed above it, which is the healthy direction.
starlark.values.traits uses buck2_error_derive.attr, so a change to buck2_error_derive.attr can break starlark.values.traits, while a change to starlark.values.traits can't break buck2_error_derive.attr.
Position
Below the diagonal: starlark.values.traits uses a module listed above it, which is the healthy direction.
starlark.values.traits uses starlark.values.layout.heap.unfrozen, so a change to starlark.values.layout.heap.unfrozen can break starlark.values.traits, while a change to starlark.values.traits can't break starlark.values.layout.heap.unfrozen.
Position
Below the diagonal: starlark.values.traits uses a module listed above it, which is the healthy direction.
starlark.values.traits uses starlark.eval.runtime.evaluator, so a change to starlark.eval.runtime.evaluator can break starlark.values.traits, while a change to starlark.values.traits can't break starlark.eval.runtime.evaluator.
Position
Below the diagonal: starlark.values.traits uses a module listed above it, which is the healthy direction.
starlark.values.traits uses starlark.values.layout.value, so a change to starlark.values.layout.value can break starlark.values.traits, while a change to starlark.values.traits can't break starlark.values.layout.value.
Position
Below the diagonal: starlark.values.traits uses a module listed above it, which is the healthy direction.
starlark.values.traits uses starlark.typing.ty, so a change to starlark.typing.ty can break starlark.values.traits, while a change to starlark.values.traits can't break starlark.typing.ty.
Position
Below the diagonal: starlark.values.traits uses a module listed above it, which is the healthy direction.
starlark.values.traits uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break starlark.values.traits, while a change to starlark.values.traits can't break buck2_node.attrs.coerced.kinds.
Position
Below the diagonal: starlark.values.traits uses a module listed above it, which is the healthy direction.
starlark.values.traits uses starlark.environment.methods, so a change to starlark.environment.methods can break starlark.values.traits, while a change to starlark.values.traits can't break starlark.environment.methods.
Position
Below the diagonal: starlark.values.traits uses a module listed above it, which is the healthy direction.
buck2_build_api.actions uses dice_futures.cancellation, so a change to dice_futures.cancellation can break buck2_build_api.actions, while a change to buck2_build_api.actions can't break dice_futures.cancellation.
Position
Below the diagonal: buck2_build_api.actions uses a module listed above it, which is the healthy direction.
buck2_build_api.actions uses allocative.allocative_trait, so a change to allocative.allocative_trait can break buck2_build_api.actions, while a change to buck2_build_api.actions can't break allocative.allocative_trait.
Position
Below the diagonal: buck2_build_api.actions uses a module listed above it, which is the healthy direction.
buck2_build_api.actions uses starlark.values.layout.heap.unfrozen, so a change to starlark.values.layout.heap.unfrozen can break buck2_build_api.actions, while a change to buck2_build_api.actions can't break starlark.values.layout.heap.unfrozen.
Position
Below the diagonal: buck2_build_api.actions uses a module listed above it, which is the healthy direction.
buck2_build_api.actions uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break buck2_build_api.actions, while a change to buck2_build_api.actions can't break buck2_node.attrs.coerced.kinds.
Position
Below the diagonal: buck2_build_api.actions uses a module listed above it, which is the healthy direction.
buck2_build_api.actions uses buck2_fs.paths.forward_rel_path, so a change to buck2_fs.paths.forward_rel_path can break buck2_build_api.actions, while a change to buck2_build_api.actions can't break buck2_fs.paths.forward_rel_path.
Position
Below the diagonal: buck2_build_api.actions uses a module listed above it, which is the healthy direction.
buck2_client_ctx.exit_result uses buck2_daemon.daemonize, so a change to buck2_daemon.daemonize can break buck2_client_ctx.exit_result, while a change to buck2_client_ctx.exit_result can't break buck2_daemon.daemonize.
Position
Below the diagonal: buck2_client_ctx.exit_result uses a module listed above it, which is the healthy direction.
buck2_client_ctx.exit_result uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break buck2_client_ctx.exit_result, while a change to buck2_client_ctx.exit_result can't break buck2_node.attrs.coerced.kinds.
Position
Below the diagonal: buck2_client_ctx.exit_result uses a module listed above it, which is the healthy direction.
buck2_client_ctx.exit_result uses buck2_fs.paths.abs_norm_path, so a change to buck2_fs.paths.abs_norm_path can break buck2_client_ctx.exit_result, while a change to buck2_client_ctx.exit_result can't break buck2_fs.paths.abs_norm_path.
Position
Below the diagonal: buck2_client_ctx.exit_result uses a module listed above it, which is the healthy direction.
buck2_core.cells.cell_path uses buck2_fs.paths.forward_rel_path, so a change to buck2_fs.paths.forward_rel_path can break buck2_core.cells.cell_path, while a change to buck2_core.cells.cell_path can't break buck2_fs.paths.forward_rel_path.
Position
Below the diagonal: buck2_core.cells.cell_path uses a module listed above it, which is the healthy direction.
31→34 buck2_core.cells.cell_path uses buck2_core.cellspart of a loop✕
Connections
1 pair of types, where a type in buck2_core.cells.cell_path uses a type in buck2_core.cells.
buck2_core.cells.cell_path uses buck2_core.cells, so a change to buck2_core.cells can break buck2_core.cells.cell_path, while a change to buck2_core.cells.cell_path can't break buck2_core.cells.
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.
buck2_core.fs.project uses buck2_fs.paths.abs_norm_path, so a change to buck2_fs.paths.abs_norm_path can break buck2_core.fs.project, while a change to buck2_core.fs.project can't break buck2_fs.paths.abs_norm_path.
Position
Below the diagonal: buck2_core.fs.project uses a module listed above it, which is the healthy direction.
buck2_client_ctx.events_ctx uses buck2_daemon.daemonize, so a change to buck2_daemon.daemonize can break buck2_client_ctx.events_ctx, while a change to buck2_client_ctx.events_ctx can't break buck2_daemon.daemonize.
Position
Below the diagonal: buck2_client_ctx.events_ctx uses a module listed above it, which is the healthy direction.
buck2_client_ctx.events_ctx uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break buck2_client_ctx.events_ctx, while a change to buck2_client_ctx.events_ctx can't break buck2_node.attrs.coerced.kinds.
Position
Below the diagonal: buck2_client_ctx.events_ctx uses a module listed above it, which is the healthy direction.
buck2_client_ctx.events_ctx uses buck2_fs.paths.abs_norm_path, so a change to buck2_fs.paths.abs_norm_path can break buck2_client_ctx.events_ctx, while a change to buck2_client_ctx.events_ctx can't break buck2_fs.paths.abs_norm_path.
Position
Below the diagonal: buck2_client_ctx.events_ctx uses a module listed above it, which is the healthy direction.
buck2_client_ctx.events_ctx uses buck2_client_ctx.exit_result, so a change to buck2_client_ctx.exit_result can break buck2_client_ctx.events_ctx, while a change to buck2_client_ctx.events_ctx can't break buck2_client_ctx.exit_result.
Position
Below the diagonal: buck2_client_ctx.events_ctx uses a module listed above it, which is the healthy direction.
buck2_core.cells uses buck2_core.cells.cell_path, so a change to buck2_core.cells.cell_path can break buck2_core.cells, while a change to buck2_core.cells can't break buck2_core.cells.cell_path.
Position
Below the diagonal: buck2_core.cells uses a module listed above it, which is the healthy direction.
buck2_core.cells uses buck2_core.fs.project, so a change to buck2_core.fs.project can break buck2_core.cells, while a change to buck2_core.cells can't break buck2_core.fs.project.
Position
Below the diagonal: buck2_core.cells uses a module listed above it, which is the healthy direction.
buck2_core.package uses buck2_fs.paths.forward_rel_path, so a change to buck2_fs.paths.forward_rel_path can break buck2_core.package, while a change to buck2_core.package can't break buck2_fs.paths.forward_rel_path.
Position
Below the diagonal: buck2_core.package uses a module listed above it, which is the healthy direction.
buck2_core.package uses buck2_core.cells.cell_path, so a change to buck2_core.cells.cell_path can break buck2_core.package, while a change to buck2_core.package can't break buck2_core.cells.cell_path.
Position
Below the diagonal: buck2_core.package uses a module listed above it, which is the healthy direction.
buck2_execute_impl.materializers.v2.core uses allocative.visitor, so a change to allocative.visitor can break buck2_execute_impl.materializers.v2.core, while a change to buck2_execute_impl.materializers.v2.core can't break allocative.visitor.
Position
Below the diagonal: buck2_execute_impl.materializers.v2.core uses a module listed above it, which is the healthy direction.
buck2_execute_impl.materializers.v2.core uses dice_futures.cancellation, so a change to dice_futures.cancellation can break buck2_execute_impl.materializers.v2.core, while a change to buck2_execute_impl.materializers.v2.core can't break dice_futures.cancellation.
Position
Below the diagonal: buck2_execute_impl.materializers.v2.core uses a module listed above it, which is the healthy direction.
buck2_execute_impl.materializers.v2.core uses allocative.allocative_trait, so a change to allocative.allocative_trait can break buck2_execute_impl.materializers.v2.core, while a change to buck2_execute_impl.materializers.v2.core can't break allocative.allocative_trait.
Position
Below the diagonal: buck2_execute_impl.materializers.v2.core uses a module listed above it, which is the healthy direction.
buck2_execute_impl.materializers.v2.core uses buck2_error_derive.attr, so a change to buck2_error_derive.attr can break buck2_execute_impl.materializers.v2.core, while a change to buck2_execute_impl.materializers.v2.core can't break buck2_error_derive.attr.
Position
Below the diagonal: buck2_execute_impl.materializers.v2.core uses a module listed above it, which is the healthy direction.
buck2_execute_impl.materializers.v2.core uses buck2_daemon.daemonize, so a change to buck2_daemon.daemonize can break buck2_execute_impl.materializers.v2.core, while a change to buck2_execute_impl.materializers.v2.core can't break buck2_daemon.daemonize.
Position
Below the diagonal: buck2_execute_impl.materializers.v2.core uses a module listed above it, which is the healthy direction.
buck2_execute_impl.materializers.v2.core uses dice_core.arc, so a change to dice_core.arc can break buck2_execute_impl.materializers.v2.core, while a change to buck2_execute_impl.materializers.v2.core can't break dice_core.arc.
Position
Below the diagonal: buck2_execute_impl.materializers.v2.core uses a module listed above it, which is the healthy direction.
buck2_execute_impl.materializers.v2.core uses buck2_core.fs.project_rel_path, so a change to buck2_core.fs.project_rel_path can break buck2_execute_impl.materializers.v2.core, while a change to buck2_execute_impl.materializers.v2.core can't break buck2_core.fs.project_rel_path.
Position
Below the diagonal: buck2_execute_impl.materializers.v2.core uses a module listed above it, which is the healthy direction.
buck2_execute_impl.materializers.v2.core uses buck2_fs.paths.abs_norm_path, so a change to buck2_fs.paths.abs_norm_path can break buck2_execute_impl.materializers.v2.core, while a change to buck2_execute_impl.materializers.v2.core can't break buck2_fs.paths.abs_norm_path.
Position
Below the diagonal: buck2_execute_impl.materializers.v2.core uses a module listed above it, which is the healthy direction.
buck2_execute_impl.materializers.v2.core uses buck2_core.fs.project, so a change to buck2_core.fs.project can break buck2_execute_impl.materializers.v2.core, while a change to buck2_execute_impl.materializers.v2.core can't break buck2_core.fs.project.
Position
Below the diagonal: buck2_execute_impl.materializers.v2.core uses a module listed above it, which is the healthy direction.
buck2_client_ctx.client_ctx uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break buck2_client_ctx.client_ctx, while a change to buck2_client_ctx.client_ctx can't break buck2_node.attrs.coerced.kinds.
Position
Below the diagonal: buck2_client_ctx.client_ctx uses a module listed above it, which is the healthy direction.
buck2_client_ctx.client_ctx uses buck2_client_ctx.common, so a change to buck2_client_ctx.common can break buck2_client_ctx.client_ctx, while a change to buck2_client_ctx.client_ctx can't break buck2_client_ctx.common.
Position
Below the diagonal: buck2_client_ctx.client_ctx uses a module listed above it, which is the healthy direction.
buck2_client_ctx.client_ctx uses buck2_client_ctx.exit_result, so a change to buck2_client_ctx.exit_result can break buck2_client_ctx.client_ctx, while a change to buck2_client_ctx.client_ctx can't break buck2_client_ctx.exit_result.
Position
Below the diagonal: buck2_client_ctx.client_ctx uses a module listed above it, which is the healthy direction.
buck2_client_ctx.client_ctx uses buck2_client_ctx.events_ctx, so a change to buck2_client_ctx.events_ctx can break buck2_client_ctx.client_ctx, while a change to buck2_client_ctx.client_ctx can't break buck2_client_ctx.events_ctx.
Position
Below the diagonal: buck2_client_ctx.client_ctx uses a module listed above it, which is the healthy direction.
buck2_core.provider.label uses allocative.allocative_trait, so a change to allocative.allocative_trait can break buck2_core.provider.label, while a change to buck2_core.provider.label can't break allocative.allocative_trait.
Position
Below the diagonal: buck2_core.provider.label uses a module listed above it, which is the healthy direction.
buck2_core.provider.label uses buck2_error_derive.attr, so a change to buck2_error_derive.attr can break buck2_core.provider.label, while a change to buck2_core.provider.label can't break buck2_error_derive.attr.
Position
Below the diagonal: buck2_core.provider.label uses a module listed above it, which is the healthy direction.
buck2_core.provider.label uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break buck2_core.provider.label, while a change to buck2_core.provider.label can't break buck2_node.attrs.coerced.kinds.
Position
Below the diagonal: buck2_core.provider.label uses a module listed above it, which is the healthy direction.
buck2_core.provider.label uses buck2_core.cells, so a change to buck2_core.cells can break buck2_core.provider.label, while a change to buck2_core.provider.label can't break buck2_core.cells.
Position
Below the diagonal: buck2_core.provider.label uses a module listed above it, which is the healthy direction.
dice.api.computations uses dice_futures.cancellation, so a change to dice_futures.cancellation can break dice.api.computations, while a change to dice.api.computations can't break dice_futures.cancellation.
Position
Below the diagonal: dice.api.computations uses a module listed above it, which is the healthy direction.
dice.api.computations uses dice_core.arc, so a change to dice_core.arc can break dice.api.computations, while a change to dice.api.computations can't break dice_core.arc.
Position
Below the diagonal: dice.api.computations uses a module listed above it, which is the healthy direction.
dice.api.computations uses buck2_core.fs.project_rel_path, so a change to buck2_core.fs.project_rel_path can break dice.api.computations, while a change to dice.api.computations can't break buck2_core.fs.project_rel_path.
Position
Below the diagonal: dice.api.computations uses a module listed above it, which is the healthy direction.
dice.api.computations uses buck2_core.cells.cell_path, so a change to buck2_core.cells.cell_path can break dice.api.computations, while a change to dice.api.computations can't break buck2_core.cells.cell_path.
Position
Below the diagonal: dice.api.computations uses a module listed above it, which is the healthy direction.
dice.api.computations uses buck2_core.package, so a change to buck2_core.package can break dice.api.computations, while a change to dice.api.computations can't break buck2_core.package.
Position
Below the diagonal: dice.api.computations uses a module listed above it, which is the healthy direction.
dice.api.computations uses buck2_core.provider.label, so a change to buck2_core.provider.label can break dice.api.computations, while a change to dice.api.computations can't break buck2_core.provider.label.
Position
Below the diagonal: dice.api.computations uses a module listed above it, which is the healthy direction.
dice.api.transaction uses buck2_node.attrs.coerced.kinds, so a change to buck2_node.attrs.coerced.kinds can break dice.api.transaction, while a change to dice.api.transaction can't break buck2_node.attrs.coerced.kinds.
Position
Below the diagonal: dice.api.transaction uses a module listed above it, which is the healthy direction.
dice.api.transaction uses buck2_core.fs.project_rel_path, so a change to buck2_core.fs.project_rel_path can break dice.api.transaction, while a change to dice.api.transaction can't break buck2_core.fs.project_rel_path.
Position
Below the diagonal: dice.api.transaction uses a module listed above it, which is the healthy direction.
dice.api.transaction uses remote_execution.request, so a change to remote_execution.request can break dice.api.transaction, while a change to dice.api.transaction can't break remote_execution.request.
Position
Below the diagonal: dice.api.transaction uses a module listed above it, which is the healthy direction.
dice.api.transaction uses buck2_core.cells, so a change to buck2_core.cells can break dice.api.transaction, while a change to dice.api.transaction can't break buck2_core.cells.
Position
Below the diagonal: dice.api.transaction uses a module listed above it, which is the healthy direction.
dice.api.transaction uses dice.api.computations, so a change to dice.api.computations can break dice.api.transaction, while a change to dice.api.transaction can't break dice.api.computations.
Position
Below the diagonal: dice.api.transaction uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 37% · Weak · gated by R2, X4, 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
A05:2025 — Injection
72
High / Critical
A03:2025 — Software Supply Chain Failures
32
High / Critical
A07:2025 — Authentication Failures
4
High / Critical
Roadmap
First, eliminate the leaked secret in REDACTED and address the nine medium-severity dependency vulnerabilities in REDACTED to secure the supply chain. Next, refactor the highly complex functions to reduce branching logic and resolve the static analysis findings related to mutable action tags. Finally, enforce nullable reference types by declaring default null-marked packages and systematically resolving nullness suppressions to prevent runtime null pointer exceptions.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.
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 — 115
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 — 3139
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 — 313
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 19
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog 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. 86 of 86 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three 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; ◐ Advisory — an LLM prose judgement. 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; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 86 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, 3511 of 3567 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — 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.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 19 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 1,009 test source file(s) (.rs, .py, .go, .java, .kt) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for app/buck2_trailcam/js/ could not reach the package registry on this run (info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in app/buck2_trailcam/js/ was NOT MEASURED: the dependency install for app/buck2_trailcam/js/ could not reach the package registry on this run (info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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 REDACTED, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D15 Churn × Complexity Hotspots — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A hotspot's complexity is meant to be the worst body its churn actually touched. For app/buck2_node/src/attrs/coerced/kinds.rs that could not be established — the complexity reader for the file reports no body extents, or the history carries no per-line attribution — so the row quotes the file's worst body, which the counted changes may never have touched. The churn count is unaffected.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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.
D21 Naming Consistency — not measured this run — Watchdog 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. D21's deterministic naming 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. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog 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 — Watchdog 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 the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D26 Project Cohesion — not measured this run — Watchdog 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. Project size and spread are measured over build units (a .NET project, a Maven or Gradle module, an npm, Deno or JSR package, a Go module, a Cargo crate, a Python, Composer, Bundler, RubyGems, Mix, rebar3, sbt, SwiftPM or pub package, an OTP application, an Xcode project or XcodeGen spec, or a checkout that declares no build at all) whose source a code model reads. This repository's production source is in a language no model reads, or in units whose build tool D26 does not recognise. That is a gap in this analyzer's language reach — not a finding that the repository's projects are cohesive.
D27 Navigability — not measured this run — Watchdog 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.
D31 IaC & Container Security — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. Starlark-rust/starlark_syntax/testcases/parse/dockerfile_build.star carries no `FROM` instruction, so it declares no build stage and every Dockerfile rule this engine owns — the runtime-hardening, key-material, mutable-clone, no-op-shim, build-context, trust-anchor, install-guard, setuid and world-writable-path rules — is outside its own premise there and returned nothing. That silence is deliberate and correct: with no base image there is no image to reason about. It is reported here because it is NOT the same fact as a clean file, and coverage is stated as 0 of 1 Infrastructure-as-Code manifest(s) fully judged rather than as 100%. The vendor scanners (trivy, checkov) do read these files and their findings above stand; only this engine's own stage-keyed rules are absent. No owner action: a build file with no FROM is a legitimate include fragment.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog 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. `app/buck2_trailcam/js/src/components/invocation/EventLogViewer.tsx`, `app/buck2_trailcam/js/src/lib/action-events.ts`, `app/buck2_trailcam/js/src/lib/analysis-events.ts`, `app/buck2_trailcam/js/src/lib/critical-path.ts`, `app/buck2_trailcam/js/src/lib/event-log-cache.ts`, … (+9 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D44 Platform End-of-Life — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (start). the dev server did not expose a crawlable HTTP endpoint in time — no runtime evidence.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
GD1 Unfinished & placeholder code — not measured this run — Watchdog 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 Erlang, Go, Java, Kotlin, Python, Rust, c, cpp, objectivec is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog 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 Erlang, Go, Kotlin, Python, Rust, c, cpp, objectivec is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 reads a prose claim (a path, a setting, a variable, a route, a version, a project, an install, a bare project name in a command) only in text identified as English: the cues that tell a claim from an absence, the past, a plan or an example are an English lexicon, and on other text they would let a false claim through. Links, image targets, fenced commands with an explicit path or a package-manager script, and env-fence variables are checked in every language. 'und' is text the identifier could not name (too short, mixed script, no function words).
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 329 further occurrence(s) are not listed individually; the score already reflects all 369.
R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 66 further occurrence(s) are not listed individually; the score already reflects all 106.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 204 further occurrence(s) are not listed individually; the score already reflects all 244.
X7 Silent fallback defaults — not measured this run — Watchdog 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. X7 measured the part of this repository it reads (C#, Python, TypeScript/JavaScript, Rust, Go, Java, Kotlin, Scala, PHP, Ruby, Swift and Dart), and its Erlang source is outside the check's reach, so the card covers only part of the product. That is a gap in this analyzer's language reach — not a finding that the unread source is free of silent defaults.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does 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.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
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.
284 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was retrace::gui::panels::show_panels at 117. A further 63 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 buck2_error::classify::tag_metadata at 311 — they are counted neither in the figure above nor in this dimension's score. 32 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: app/buck2_error/src/classify.rs (buck2_error::classify::tag_metadata at 311), app/buck2/src/lib.rs (CommandKind::exec_no_daemon at 41), app/buck2_server/src/snapshot.rs (SnapshotCollector::add_io_metrics at 37), app/buck2_node/src/attrs/coerced/kinds.rs (buck2_node::attrs::coerced::kinds::dispatch at 32), app/buck2_build_api/src/bxl/unconfigured_attribute.rs (buck2_build_api::bxl::unconfigured_attribute::ref_to_value at 29), and 27 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.
+ 182 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 11 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with retrace::gui::panels::show_panels (cyclomatic 117), retrace::export::export (cyclomatic 105), retrace::ingest::scan::scan_input_with_details_cancellable (cyclomatic 103). — 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 11 together lifts Cyclomatic Complexity from 5.8 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
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.
+ 366 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 240 down to 240 or less in Cognitive Complexity — start with retrace::gui::panels::show_panels (cognitive 316), retrace::ingest::scan::scan_input_with_details_cancellable (cognitive 310), retrace::export::export (cognitive 256). — 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 4.8 to about 5.1/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.6 / 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.
TooManyMethods: Value · ×36starlark-rust/starlark/src/values/layout/value.rs:140
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 138 FileTooLong finding(s) in God Classes — start with lib.rs (4), server.rs (3), client.rs (3). — One of this dimension's main actionable groups (138 warning-level).
Resolve the 95 FunctionTooLong finding(s) in God Classes — start with detail_ui.rs (3), analyses.rs (3), parse.rs (3). — One of this dimension's main actionable groups (95 warning-level).
Resolve the 86 MethodTooLong finding(s) in God Classes — start with recorder.rs (4), lib.rs (4), orchestrator.rs (4). — One of this dimension's main actionable groups (86 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
484 duplicated block group(s) detected. A further 15 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 36 of the 499 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.
+ 112 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 41 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with cquery.rs (9), configured.rs (3), IrNonAbiStripper.kt (3). — One of this dimension's main actionable groups (41 warning-level).
Resolve the 41 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with external_runner_test_info.rs (3), target_list_expr.rs (2), attrs_global.rs (2). — One of this dimension's main actionable groups (41 warning-level).
Resolve the 40 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with file_set.rs (2), lazy_uquery_ctx.rs (2), external_runner_test_info.rs (2). — One of this dimension's main actionable groups (40 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
7 production modules (Cargo+npm), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 5 of the 7 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 10 Low cohesion finding(s) in Cohesion (LCOM4) — start with request.rs, computations.rs, bigint.rs. — One of this dimension's main actionable groups (10 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
Resolve the 22 Classify ADR enforcement finding(s) in Architectural Integrity — start with attr-metadata.md, audit_visibility.md, bxl-streaming.md. — One of this dimension's main actionable groups (22 recommendation-level).
Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d7_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution9.4 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
10740 test methods: 10188 unit, 52 integration, 0 BDD, 500 e2e. The JavaScript/TypeScript suite contributes 19 `it`/`test` case(s) across 2 test file(s) declaring at least one beside 1666 .NET test method(s); its tier split is read from package names and paths only. The Rust suite contributes 6125 `#[test]` function(s) across 958 file(s) declaring at least one; its unit/integration split is Cargo's own — 7 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 2872 test function(s) across 466 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only. The Go suite contributes 58 test case(s) across 22 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 0 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 19 tests. Measured on the JavaScript/TypeScript suite only — at least 1,009 test source file(s) (.rs, .py, .go, .java, .kt) went unread, so its test quality is unmeasured and is not in these counts.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
21 outdated, 0 yanked direct Cargo dependencies. 231 of 250 direct crates were graded against crates.io (0 not published there, 19 not resolved by a committed REDACTED). Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.
Outdated: async-compression · ×21
What to do
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
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.
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
1 of 931 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. A further 22 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. This repository publishes itself under MIT OR 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 REDACTED, 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.
Banned license: async-condvar-fair
What to do
Resolve the 1 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (1 issue-level).
Enforce License Compliance in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.
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 98 Hotspot finding(s) in Churn × Complexity Hotspots — start with lib.rs (4), run.rs (2), clean_stale.rs (2). — One of this dimension's main actionable groups (98 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.1 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
211 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is tools/starlark_fmt/lib/autofixes/sort_list_args.rs. Counted over 2366 of the 3805 production source files in this repository: 1438 are under the ~2,400-byte size floor this dimension measures over, and the remaining 1 have no attributable history left to measure.
Off-boarding risk: anonymized user #1 · ×19
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.
1007 deducted task-comment markers across 831181 LoC (0.1/KLoC) → score 9.8. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 836 TodoComment finding(s) in Explicit Debt — start with StubJarTest.java (17), ctx.rs (16), tests.rs (14). — One of this dimension's main actionable groups (836 warning-level).
Resolve the 163 FixmeComment finding(s) in Explicit Debt — start with lib.rs (7), builder.rs (5), file_watcher_symlink_tests.py (4). — One of this dimension's main actionable groups (163 warning-level).
Resolve the 8 HackComment finding(s) in Explicit Debt — start with go_wrapper.py (2), stdlib.go (2), assert_occurrences.py. — One of this dimension's main actionable groups (8 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
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: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
0 of 22 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.
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.
2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 2 High secret finding(s) in Secrets (history) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
72 finding(s): 0 critical, 54 high, 10 medium, 8 low. 25 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 29 file(s) — `app/buck2_client/src/print.rs` (line 104, line 109, line 123, …), `app/buck2_cmd_log_client/src/what_ran.rs` (line 137), `app/buck2_common/src/package_listing/interpreter.rs` (line 457), `app/buck2_configured/src/execution.rs` (line 804, line 828, line 1113), `app/buck2_configured/src/nodes.rs` (line 625, line 718, line 763, …), … (+24 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 7 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 8 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 15 REDACTED finding(s) charged to Static Analysis (SAST) — the other 25 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once. — One of this dimension's main actionable groups (40 issue-level, 15 of them charged here).
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5). — One of this dimension's main actionable groups (5 issue-level).
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 9 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (9). — One of this dimension's main actionable groups (9 warning-level).
Resolve the 5 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 4 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (4 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.
158 of 2367 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is starlark-rust/starlark_lsp/src/definition.rs. Counted over 2367 of the 3805 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 4 Orphaned knowledge finding(s) in Knowledge Freshness — start with definition.rs, sokoban.rs, breakout.rs. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 154 Orphaned file finding(s) in Knowledge Freshness — start with lib.rs (4), globals.rs (3), GraphImpl2.tsx (2). — One of this dimension's main actionable groups (154 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 9 Boundary-crossing change coupling finding(s) in Change Coupling — start with argfiles.rs (3), forkserver.rs (2), select.rs. — One of this dimension's main actionable groups (9 issue-level).
Resolve the 11 Change coupling finding(s) in Change Coupling — start with tests.rs (2), logging.rs, in_memory.rs. — One of this dimension's main actionable groups (11 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored 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. SCORED, not informational.
No dependency in any ecosystem this repository declares is published as malicious.
✓ On the Gold path — maintain.
Detailed fixes: d43_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC2 · Forms & labels5.1 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×8) — app/buck2_explain/js/src/SearchBox.tsx:34, app/buck2_explain/js/src/graph2/GraphImpl2.tsx:271, app/buck2_explain/js/src/graph2/GraphImpl2.tsx:279, …
This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×4) — app/buck2_explain/js/src/graph2/GraphImpl2.tsx:269, app/buck2_explain/js/src/graph2/GraphImpl2.tsx:290, app/buck2_explain/output_format_js/src/graph2/GraphImpl2.tsx:257, …
This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label. (×2) — app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:627, app/buck2_trailcam/js/src/components/invocation/event-log/EventLogToolbar.tsx:131
This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:654
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. — explorer/index.html:11
This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×4) — explorer/index.html:14, explorer/index.html:18, starlark-rust/starlark_js_example/index.html:70, …
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div id="root">, so there is no content here to wrap — render the <main> from the component mounted into it. (×3) — app/buck2_explain/js/index.html:2, app/buck2_explain/output_format_js/index.html:2, app/buck2_trailcam/js/index.html:2
An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label. — REDACTED:124
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — explorer/index.html:2
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×2) — explorer/index.html:2, starlark-rust/starlark_js_example/index.html:2
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×13) — app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:538, app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:588, app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:627, …
This <rect> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. (×2) — app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:93, app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:117
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
<div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — app/buck2_trailcam/js/src/components/invocation/InvocationBar.tsx:221
<input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — app/buck2_trailcam/js/src/ui/Input.tsx:26
<div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — app/buck2_trailcam/js/src/ui/Tabs.tsx:206
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 72 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
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.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
`AndroidDevice` declares 26 abstract methods: `compareInstalledApk`, `deviceStartIntent`, `enableAppLinks`, `getApkManifestDigest`, `getContentHash`, `getDeviceAbis`, `getPackageInfo`, `getProperty`, `getSerialNumber`, `getWindowManagerProperty`, `installApexOnDevice`, `installApkOnDevice`, `installBuildUuidFile`, `installFiles`, `isEmulator`, `isOnline`, `killProcess`, `listDirRecursive`, `mkDirP`, `prepareForApexInstallation`, `rmFiles`, `rmStaleFiles`, `setDebugAppPackageName`, `stopPackage`, `uninstallApkFromDevice`, `uninstallPackage`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — prelude/toolchains/android/src/com/facebook/buck/android/exopackage/AndroidDevice.java:24
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Event Sourcing — Whether the event-sourcing replay fold reconstructs state purely from the event (no wall clock, UUID or randomness) so replay is reproducible.
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 persisted events stay immutable (never rewritten in place).
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
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.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 146 of 160 project(s) that lack one — worth up to 1.8 pts.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability7.8 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 46/50 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `app/buck2_external_cells_bundled`, `app/buck2_grpc`, `app/buck2_miniperf`, `dice/read_dump`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Add OpenTelemetry tracing/metrics (opentelemetry with tracing-opentelemetry) so requests are traceable across the system, not just health-probable.
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.
What to do
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`Client::builder(TokioExecutor` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×9) — app/buck2_http/src/client.rs:1018, app/buck2_http/src/client/builder.rs:267, app/buck2_http/src/client/builder.rs:275, …
`.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — prelude/toolchains/android/src/com/facebook/buck/jvm/java/fatjar/FatJarMain.java:174
What to do
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).
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 the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
What to do
Raise allocation-aware density on the hot paths — currently 120 use(s) across 92,325 production line(s) (~1.3/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Go: on hot paths, reuse buffers and objects through sync.Pool, preallocate slices and maps with make([]T, 0, n) / make(map[K]V, n), size builders with Grow, append with strconv.Append*, and reslice with buf[:0] instead of allocating anew.
Java: on hot paths, work through buffer views (ByteBuffer/LongBuffer slices, MemorySegment) instead of copies, avoid boxing with primitive collections (fastutil, Eclipse Collections, HPPC, Trove), presize collections and StringBuilders, and pool expensive buffers (Netty's pooled allocator, commons-pool).
Kotlin: on hot paths, use primitive arrays (IntArray, LongArray …) and @JvmInline value classes instead of boxed values, primitive collections (androidx.collection, fastutil) instead of boxed ones, and presize collections and StringBuilders.
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 the language 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.
`setup_file_watcher_scm_test` is async and calls subprocess.run, subprocess.check_output — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — tests/core/common/io/file_watcher_scm_tests.py:27
`run_checkout_mergebase_changes_test` is async and calls subprocess.run, subprocess.check_output — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — tests/core/common/io/file_watcher_scm_tests.py:68
`run_checkout_with_mergebase_test` is async and calls subprocess.run — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — tests/core/common/io/file_watcher_scm_tests.py:123
`run_rebase_with_mergebase_test` is async and calls subprocess.run — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — tests/core/common/io/file_watcher_scm_tests.py:140
`run_restack_with_mergebase_test` is async and calls subprocess.run — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — tests/core/common/io/file_watcher_scm_tests.py:162
`setup_file_watcher_test` is async and calls subprocess.run, subprocess.check_output — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — tests/core/common/io/file_watcher_tests.py:25
`run_aba_test` is async and calls subprocess.run — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — tests/core/common/io/file_watcher_tests.py:49
`spawn` 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. — app/buck2_resource_control/src/memory_tracker.rs:175
`compute` is async and calls thread::sleep — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. (×3) — dice/dice_examples/bin/many_cancel.rs:136, dice/dice_examples/bin/many_cancel.rs:183, dice/dice_examples/bin/many_cancel.rs:219
What to do
Python: await the async equivalent (asyncio.sleep, an async HTTP client such as httpx.AsyncClient or aiohttp, asyncio.create_subprocess_exec), or move the blocking call off the loop with `await asyncio.to_thread(...)`; never call asyncio.run inside a coroutine — await the coroutine.
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`.
Do you agree with this assessment?
R1 · Type Safety9.6 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
app/buck2_explain/js/src/graph2/GraphImpl2.tsx:34 · app/buck2_explain/output_format_js/src/graph2/GraphImpl2.tsx:38 — the two spans are one implementation copied and then locally edited — 1251 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — app/buck2_explain/js/src/graph2/GraphImpl2.tsx:34
prelude/nodejs/tools/nodejs_test_adapter.cjs:830 · prelude/nodejs/tools/nodejs_test_adapter.cjs:1098 — the two spans are one implementation copied and then locally edited — 1028 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — prelude/nodejs/tools/nodejs_test_adapter.cjs:830
app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:213 · app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:228 — the two spans are one implementation copied and then locally edited — 891 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:213
app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts:99 · app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts:135 — the two spans are one implementation copied and then locally edited — 1086 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts:99
app/buck2_trailcam/js/src/lib/load-events.ts:274 · app/buck2_trailcam/js/src/lib/treemap-builder.ts:98 — the two spans are one implementation copied and then locally edited — 574 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — app/buck2_trailcam/js/src/lib/load-events.ts:274
app/buck2_trailcam/js/src/lib/proto/bundle.js:16888 · app/buck2_trailcam/js/src/lib/proto/bundle.js:46281 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/lib/proto/bundle.js:16888
app/buck2_trailcam/js/src/lib/proto/bundle.js:12418 · app/buck2_trailcam/js/src/lib/proto/bundle.js:12498 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/lib/proto/bundle.js:12418
app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:93 · app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:117 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:93
app/buck2_trailcam/js/src/components/invocation/ActionTreemap.tsx:34 · app/buck2_trailcam/js/src/components/invocation/AnalysisTreemap.tsx:34 — the two spans are one implementation copied and then locally edited — 288 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — app/buck2_trailcam/js/src/components/invocation/ActionTreemap.tsx:34
app/buck2_explain/js/src/graph2/GraphViz2.tsx:12 · app/buck2_explain/output_format_js/src/graph2/GraphViz2.tsx:12 — these 2 files are line-for-line copies of one another — 52 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — app/buck2_explain/js/src/graph2/GraphViz2.tsx:12
app/buck2_trailcam/js/src/components/invocation/CriticalPathChart.tsx:174 · app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:188 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/components/invocation/CriticalPathChart.tsx:174
app/buck2_trailcam/js/src/lib/proto/bundle.js:11531 · app/buck2_trailcam/js/src/lib/proto/bundle.js:32951 — all 2 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — app/buck2_trailcam/js/src/lib/proto/bundle.js:11531
app/buck2_trailcam/js/src/lib/proto/bundle.js:30039 · app/buck2_trailcam/js/src/lib/proto/bundle.js:32870 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — app/buck2_trailcam/js/src/lib/proto/bundle.js:30039
app/buck2_explain/js/src/App.tsx:26 · app/buck2_explain/output_format_js/src/App.tsx:21 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — app/buck2_explain/js/src/App.tsx:26
app/buck2_trailcam/js/src/components/invocation/AnalysisTreemap.tsx:31 · app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:185 — the two spans are one implementation copied and then locally edited — 223 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — app/buck2_trailcam/js/src/components/invocation/AnalysisTreemap.tsx:31
app/buck2_trailcam/js/src/lib/proto/bundle.js:65103 · app/buck2_trailcam/js/src/lib/proto/bundle.js:65229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — app/buck2_trailcam/js/src/lib/proto/bundle.js:65103
app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts:197 · app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts:270 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts:197
app/buck2_trailcam/js/src/lib/proto/bundle.js:290 · app/buck2_trailcam/js/src/lib/proto/bundle.js:381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — app/buck2_trailcam/js/src/lib/proto/bundle.js:290
app/buck2_trailcam/js/src/lib/proto/bundle.js:22759 · app/buck2_trailcam/js/src/lib/proto/bundle.js:25249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — app/buck2_trailcam/js/src/lib/proto/bundle.js:22759
app/buck2_trailcam/js/src/lib/event-log-decoder.ts:341 · app/buck2_trailcam/js/src/lib/event-log-decoder.ts:452 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/lib/event-log-decoder.ts:341
app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:338 · app/buck2_trailcam/js/src/components/invocation/TestSummaryCard.tsx:112 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:338
app/buck2_trailcam/js/src/lib/event-log-cache.ts:297 · app/buck2_trailcam/js/src/lib/event-log-cache.ts:584 — the two spans are one implementation copied and then locally edited — 204 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — app/buck2_trailcam/js/src/lib/event-log-cache.ts:297
app/buck2_trailcam/js/src/lib/proto/bundle.js:36583 · app/buck2_trailcam/js/src/lib/proto/bundle.js:36718 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/lib/proto/bundle.js:36583
app/buck2_trailcam/js/src/components/invocation/CriticalPathChart.tsx:61 · app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:378 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — app/buck2_trailcam/js/src/components/invocation/CriticalPathChart.tsx:61
app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:189 · app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:232 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:189
app/buck2_trailcam/js/src/lib/action-events.ts:142 · app/buck2_trailcam/js/src/lib/streaming-collectors.ts:241 — the two spans are one implementation copied and then locally edited — 192 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — app/buck2_trailcam/js/src/lib/action-events.ts:142
app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:65 · app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:87 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:65
app/buck2_trailcam/js/src/lib/proto/bundle.js:4457 · app/buck2_trailcam/js/src/lib/proto/bundle.js:4925 · app/buck2_trailcam/js/src/lib/proto/bundle.js:8506 · app/buck2_trailcam/js/src/lib/proto/bundle.js:8654 · +2 more site(s) not listed — 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. — app/buck2_trailcam/js/src/lib/proto/bundle.js:4457
app/buck2_trailcam/js/src/lib/proto/bundle.js:33149 · app/buck2_trailcam/js/src/lib/proto/bundle.js:33173 · app/buck2_trailcam/js/src/lib/proto/bundle.js:33197 · app/buck2_trailcam/js/src/lib/proto/bundle.js:41145 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/lib/proto/bundle.js:33149
app/buck2_trailcam/js/src/lib/proto/bundle.js:12201 · app/buck2_trailcam/js/src/lib/proto/bundle.js:12603 · app/buck2_trailcam/js/src/lib/proto/bundle.js:31678 · app/buck2_trailcam/js/src/lib/proto/bundle.js:31739 · +4 more site(s) not listed — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — app/buck2_trailcam/js/src/lib/proto/bundle.js:12201
app/buck2_trailcam/js/src/lib/proto/bundle.js:10403 · app/buck2_trailcam/js/src/lib/proto/bundle.js:33651 · app/buck2_trailcam/js/src/lib/proto/bundle.js:63565 · app/buck2_trailcam/js/src/lib/proto/bundle.js:64336 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/lib/proto/bundle.js:10403
app/buck2_trailcam/js/src/lib/proto/bundle.js:9285 · app/buck2_trailcam/js/src/lib/proto/bundle.js:14007 · app/buck2_trailcam/js/src/lib/proto/bundle.js:14773 · app/buck2_trailcam/js/src/lib/proto/bundle.js:16025 · +9 more site(s) not listed — all 13 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — app/buck2_trailcam/js/src/lib/proto/bundle.js:9285
app/buck2_trailcam/js/src/lib/proto/bundle.js:34791 · app/buck2_trailcam/js/src/lib/proto/bundle.js:56045 · app/buck2_trailcam/js/src/lib/proto/bundle.js:56119 — 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. — app/buck2_trailcam/js/src/lib/proto/bundle.js:34791
app/buck2_trailcam/js/src/lib/proto/bundle.js:40983 · app/buck2_trailcam/js/src/lib/proto/bundle.js:41129 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/lib/proto/bundle.js:40983
app/buck2_trailcam/js/src/lib/action-events.ts:101 · app/buck2_trailcam/js/src/lib/analysis-events.ts:88 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/lib/action-events.ts:101
app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:401 · app/buck2_trailcam/js/src/components/invocation/TestResultsTab.tsx:98 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:401
app/buck2_trailcam/js/src/lib/event-log-decoder.ts:224 · app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts:157 · app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts:196 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/lib/event-log-decoder.ts:224
app/buck2_trailcam/js/src/lib/proto/bundle.js:1120 · app/buck2_trailcam/js/src/lib/proto/bundle.js:2634 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/lib/proto/bundle.js:1120
app/buck2_trailcam/js/src/lib/proto/bundle.js:11108 · app/buck2_trailcam/js/src/lib/proto/bundle.js:11229 · app/buck2_trailcam/js/src/lib/proto/bundle.js:11907 · app/buck2_trailcam/js/src/lib/proto/bundle.js:13354 · +13 more site(s) not listed — all 17 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/lib/proto/bundle.js:11108
app/buck2_trailcam/js/src/lib/proto/bundle.js:14783 · app/buck2_trailcam/js/src/lib/proto/bundle.js:16058 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — app/buck2_trailcam/js/src/lib/proto/bundle.js:14783
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
toObject has cyclomatic complexity 946 and cognitive complexity 1634; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:50325
toObject has cyclomatic complexity 694 and cognitive complexity 1236; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:19562
fromObject has cyclomatic complexity 640 and cognitive complexity 747; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:48217
fromObject has cyclomatic complexity 576 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:56796
fromObject has cyclomatic complexity 371 and cognitive complexity 437; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:18374
encode has cyclomatic complexity 361 and cognitive complexity 371; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:46431
encode has cyclomatic complexity 249 and cognitive complexity 249; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:17142
decode has cyclomatic complexity 203 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:47406
toObject has cyclomatic complexity 140 and cognitive complexity 185; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:6715
fromObject has cyclomatic complexity 135 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:32868
decode has cyclomatic complexity 132 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:17829
toObject has cyclomatic complexity 131 and cognitive complexity 230; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:15100
toObject has cyclomatic complexity 127 and cognitive complexity 166; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:3718
toObject has cyclomatic complexity 119 and cognitive complexity 157; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:2138
toObject has cyclomatic complexity 113 and cognitive complexity 222; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:27700
toObject has cyclomatic complexity 113 and cognitive complexity 151; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:33235
fromObject has cyclomatic complexity 94 and cognitive complexity 139; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:6265
encode has cyclomatic complexity 94 and cognitive complexity 93; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:5521
fromObject has cyclomatic complexity 87 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:14815
fromObject has cyclomatic complexity 86 and cognitive complexity 127; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — app/buck2_trailcam/js/src/lib/proto/bundle.js:3326
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files5.3 / 10Adequate✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
prelude/nodejs/tools/nodejs_test_adapter.cjs has 1466 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — prelude/nodejs/tools/nodejs_test_adapter.cjs:1
app/buck2_trailcam/js/src/components/invocation/EventLogProvider.tsx has 824 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/buck2_trailcam/js/src/components/invocation/EventLogProvider.tsx:1
app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx has 793 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:1
app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts has 678 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts:1
app/buck2_trailcam/js/src/lib/event-log-cache.ts has 640 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/buck2_trailcam/js/src/lib/event-log-cache.ts:1
app/buck2_trailcam/js/src/lib/event-log-decoder.ts has 625 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/buck2_trailcam/js/src/lib/event-log-decoder.ts:1
app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts has 625 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts:1
app/buck2_trailcam/js/src/components/invocation/BuildHistorySidebar.tsx has 568 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/buck2_trailcam/js/src/components/invocation/BuildHistorySidebar.tsx:1
app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx has 515 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:1
app/buck2_trailcam/js/src/lib/event-summary-store.ts has 494 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/buck2_trailcam/js/src/lib/event-summary-store.ts:1
app/buck2_trailcam/js/src/lib/critical-path.ts has 461 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/buck2_trailcam/js/src/lib/critical-path.ts:1
app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx has 426 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:1
app/buck2_trailcam/js/src/components/invocation/event-log/useEventLogState.ts has 404 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/buck2_trailcam/js/src/components/invocation/event-log/useEventLogState.ts:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage0.2 / 10Critical✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — app/buck2_trailcam/js/src/lib/proto/bundle.js:1, prelude/nodejs/tools/nodejs_test_adapter.cjs:1, app/buck2_trailcam/js/src/components/invocation/EventLogProvider.tsx:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
What to do
Bump outdated dependencies to current versions to limit upgrade debt.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code9.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
1 file(s) (~1520 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package.
13 file(s) (~1384 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: app/buck2_explain/js/src/App.tsx imports './fbs/explain', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here. — app/buck2_explain/js
4 file(s) (~584 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: app/buck2_explain/output_format_js/src/App.tsx imports './fbs/output-format', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here. — app/buck2_explain/output_format_js
Unreachable from the 12 application, 3 tooling and 2 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (12 application, 3 tooling, 2 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×6) — app/buck2_trailcam/js/src/components/invocation/BuildHistorySidebar.tsx, REDACTED, app/buck2_trailcam/js/src/components/invocation/event-log/columns.ts, …
Nothing imports this binding — it is safe to review for removal. (×7) — app/buck2_trailcam/js/src/lib/critical-path.ts:449, app/buck2_trailcam/js/src/lib/event-log-cache.ts:681, app/buck2_trailcam/js/src/lib/format.ts:91, …
Nothing ultimately consumes this binding: its only referrer is the re-export in app/buck2_trailcam/js/src/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in app/buck2_trailcam/js/src/index.ts in the same commit, or the barrel will import a name that no longer exists. — app/buck2_trailcam/js/src/lib/theme.ts:28
Nothing ultimately consumes this binding: its only referrer is the re-export in app/buck2_trailcam/js/src/ui/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in app/buck2_trailcam/js/src/ui/index.ts in the same commit, or the barrel will import a name that no longer exists. (×3) — app/buck2_trailcam/js/src/ui/Card.tsx:47, app/buck2_trailcam/js/src/ui/Card.tsx:67, app/buck2_trailcam/js/src/ui/Switch.tsx:16
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Declared in app/buck2_explain/output_format_js/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Declared in explorer/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
app/buck2_explain/js/src/App.tsx → app/buck2_explain/js/src/Navbar.tsx → app/buck2_explain/js/src/App.tsx (one verified cycle inside a mutually-dependent group of 6 files) — app/buck2_explain/js/src/App.tsx:23
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document3.5 / 10Weak✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`default` is public and takes `o: object` from its caller, and it calls itself at line 100 (`self.default`) with a piece of `o` (and at line 105) — and nowhere in `default` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `default` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — prelude/apple/tools/bundling/incremental_state.py:100
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
`debug` at line 540 is called with an argument built by `installPaths.map { "…" it.value.parent it.key.parent }.distinct().joinToString(separator = "…", prefix = "…", postfix...` (line 546), whose cost grows with the collection it walks. Kotlin evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled` test, no `BuildConfig.DEBUG` flag, no trailing lambda (`logger.debug { … }`) the logger calls only when the level is on. — prelude/toolchains/android/src/com/facebook/buck/android/exopackage/AndroidDeviceImpl.kt:540
What to do
In Kotlin, hand the logger a lambda it calls only when the level is on (`logger.debug { "rows: ${rows.joinToString()}" }` — kotlin-logging and Log4j 2's Kotlin API take one), or put the line behind `if (log.isDebugEnabled)` (`if (BuildConfig.DEBUG)` for a line only a debug build needs). A string template is not the fix on SLF4J or Timber: their message is a `String`, so every `joinToString` or `toJson` inside the `${…}` runs before the call is entered.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a walk over an ETS table leaves the key it stands on alone — Erlang's own lists and maps are values no body can change, but an ETS key traversal asks the table for the key after the current one, so on a `set`, `bag` or `duplicate_bag` that is not fixed with `ets:safe_fixtable/2`, deleting the current key and then calling `ets:next/2` (or `ets:prev/2`) from it raises `badarg` and the rest of the table is never visited. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×8) — prelude/toolchains/android/src/com/facebook/buck/util/io/IoUtil.java:32, prelude/toolchains/android/src/com/facebook/buck/android/AdbHelper.java:636, app/buck2_trailcam/js/src/lib/use-local-storage-state.ts:30, …
`catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×4) — prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/BytecodeTransformer.kt:218, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/BytecodeTransformer.kt:269, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:701, …
`catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×13) — prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/KosabiClassUsageCollector.kt:558, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:459, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:467, …
`catch (RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/KotlinMetadataReader.java:265
`except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — prelude/python/tools/make_par/sitecustomize.py:63
`if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×3) — prelude/go/tools/gen_embedcfg.go:173, prelude/go/tools/gen_embedcfg.go:178, prelude/go/tools/gopackagesdriver/driver/stdlib.go:91
`if err := scanner.Err(); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — REDACTED:154
`if _, err := exec.LookPath(" "); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — prelude/go/tools/gopackagesdriver/driver/stdlib.go:57
`catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — prelude/erlang/toolchain/dependency_analyzer.erl:179
`.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. — app/buck2_trailcam/js/src/lib/parallel-decode/orchestrator.ts:199
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `REDACTED` 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.
`warning` at line 121 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/codesign_bundle.py:121
`info` at line 127 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/codesign_bundle.py:127
`info` at line 207 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/codesign_bundle.py:207
`info` at line 233 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/codesign_bundle.py:233
`warning` at line 580 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/codesign_bundle.py:580
`info` at line 744 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/codesign_bundle.py:744
`warning` at line 836 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/codesign_bundle.py:836
`info` at line 59 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/fast_adhoc.py:59
`info` at line 67 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/fast_adhoc.py:67
`info` at line 69 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/fast_adhoc.py:69
`info` at line 74 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/fast_adhoc.py:74
`info` at line 96 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/fast_adhoc.py:96
`info` at line 129 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/fast_adhoc.py:129
`info` at line 179 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/fast_adhoc.py:179
`info` at line 216 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/fast_adhoc.py:216
`info` at line 221 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/fast_adhoc.py:221
`info` at line 258 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/provisioning_profile_selection.py:258
`info` at line 339 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/provisioning_profile_selection.py:339
`info` at line 385 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/code_signing/provisioning_profile_selection.py:385
`info` at line 85 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/bundling/assemble_bundle.py:85
`debug` at line 190 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/bundling/assemble_bundle.py:190
`info` at line 225 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/bundling/assemble_bundle.py:225
`info` at line 103 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/bundling/incremental_utils.py:103
`info` at line 588 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/bundling/main.py:588
`warning` at line 590 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/bundling/main.py:590
`info` at line 46 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — prelude/apple/tools/bundling/swift_support.py:46
`debug!` at line 132 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`. — superconsole/src/stdin.rs:132
`debug!` at line 143 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`. — superconsole/src/stdin.rs:143
`debug!` at line 420 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`. — shed/scribe_client/src/producer.rs:420
`debug!` at line 444 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`. — shed/scribe_client/src/producer.rs:444
`debug!` at line 537 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`. — shed/scribe_client/src/producer.rs:537
`warn!` at line 681 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: `warn!(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`. — remote_execution/oss/re_grpc/src/client.rs:681
`debug!` at line 1916 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`. — remote_execution/oss/re_grpc/src/client.rs:1916
`warn!` at line 124 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: `warn!(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`. — pagable_storage/src/storage/sqlite.rs:124
`warn!` at line 735 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: `warn!(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`. — pagable_storage/src/storage/sqlite.rs:735
`warn!` at line 791 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: `warn!(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`. — integrations/rust-project/src/buck.rs:791
`debug!` at line 932 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`. — integrations/rust-project/src/buck.rs:932
`info!` at line 991 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`. — integrations/rust-project/src/buck.rs:991
`info!` at line 1037 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`. — integrations/rust-project/src/buck.rs:1037
`warn!` at line 407 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: `warn!(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`. — dice/dice/src/storage.rs:407
Other · Code Health — Whether Java packages are null-marked and not undermined by heavy nullness suppression — a package under `@NullMarked` (or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, or a NullAway/Checker Framework configuration naming it) makes an unannotated reference exclude null, and `@SuppressWarnings("NullAway")`, `("nullness")`, `("null")` and `castToNonNull(…)` are what silence it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
0/84 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.
What to do
Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 12 of 55 WCAG 2.2 Level A/AA success criteria (22%; ≈24% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 43 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 1 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 — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 43 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 image/media element found in the parsed markup — AC1 not applicable here.
AX1 Captive dependencies — Not applicable: the BEAM has no dependency-injection container — state lives in processes, and no process is handed an instance whose lifetime another one scopes; this repository's Java imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Kotlin imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Go request handler (a net/http, Gin, Echo, Fiber or fasthttp handler, or a gRPC service method) is declared as a method or function, and no handler function literal writes a value captured from outside it, so no state is shared between request goroutines. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Erlang processes share no mutable memory — state lives in a process's own mailbox — so there is no shared object to race on. 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
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the dev server did not expose a crawlable HTTP endpoint in time — no runtime evidence This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not 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 — Naming consistency is measured on C# only; Erlang, Go, Java, JavaScript, Kotlin, Python, Rust, TypeScript, html not measured.
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+ projects each declaring an entity of their own. 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# and Visual Basic comments only — this repository's production source is .erl, .go, .java, .kt, .py, .rs, .ts, .tsx, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D26 Project Cohesion — D26 measured no build unit over this repository's .c, .cpp, .erl, .go, .java, .kt, .m, .rs source. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 14 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — app/buck2_trailcam/js/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
DM1 Domain Modelling — applicable but not scored (2 signals for this style, 2 needed — the count is met but a required primary signal is absent): 1034 value object(s); 5 domain event(s); its domain events are published by services or handlers — no domain entity raises one
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
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'.
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 — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X31 Test-only surface in a production module — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score.
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.
AC2 · Forms & labels· <input> without a programmatic label · ×10
<input> without a programmatic label app/buck2_explain/js/src/SearchBox.tsx:34— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label app/buck2_explain/js/src/graph2/GraphImpl2.tsx:271— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label app/buck2_explain/js/src/graph2/GraphImpl2.tsx:279— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label app/buck2_explain/js/src/graph2/GraphImpl2.tsx:292— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label app/buck2_explain/output_format_js/src/graph2/GraphImpl2.tsx:259— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label app/buck2_explain/output_format_js/src/graph2/GraphImpl2.tsx:267— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label app/buck2_explain/output_format_js/src/graph2/GraphImpl2.tsx:280— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:654— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label app/buck2_trailcam/js/src/components/invocation/TestResultsTab.tsx:285— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label explorer/index.html:11— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
Boundary-crossing change coupling: select.rs ↔ coerced_attr.rs app/buck2_node/src/attrs/coerced/select.rs:1— `app/buck2_node/src/attrs/coerced/select.rs` (context buck2_node) and `app/buck2_node_tests/src/attrs/coerced_attr.rs` (context buck2_node_tests) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `755d9bd9` Delete the owned `CoercedAttr` enum (at that commit the file was still `app/buck2_node/src/attrs/coerced_attr.rs`); `c17695cb` Delete the `CoercedAttr` operation walks (at that commit the file was still `app/buck2_node/src/attrs/coerced_attr.rs`); `cfc18c8d` Share complete concatenation sequences (at that commit the file was still `app/buck2_node/src/attrs/coerced_attr.rs`) — run `git show` on any of them.
Boundary-crossing change coupling: forkserver.rs ↔ launch.rs app/buck2/src/commands/forkserver.rs:1— `app/buck2/src/commands/forkserver.rs` (context buck2) and `app/buck2_forkserver/src/launch.rs` (context buck2_forkserver) sit in DIFFERENT parts of the tree yet change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `d64b9751` cgroups: Tell the forkserver fewer things it doesn't have to know about; `cc1f63c3` cgroups: Kill non-pool codepaths around forkserver; `88c5ad87` cgroups: Manage cgroup pool in the daemon — run `git show` on any of them.
Boundary-crossing change coupling: forkserver.rs ↔ service.rs app/buck2/src/commands/forkserver.rs:1— `app/buck2/src/commands/forkserver.rs` (context buck2) and `app/buck2_forkserver/src/service.rs` (context buck2_forkserver) sit in DIFFERENT parts of the tree yet change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `d64b9751` cgroups: Tell the forkserver fewer things it doesn't have to know about; `cc1f63c3` cgroups: Kill non-pool codepaths around forkserver; `88c5ad87` cgroups: Manage cgroup pool in the daemon — run `git show` on any of them.
Boundary-crossing change coupling: lib.rs ↔ calculation_apply_transition.rs app/buck2_cfg_constructor/src/lib.rs:1— `app/buck2_cfg_constructor/src/lib.rs` (context buck2_cfg_constructor) and `app/buck2_transition/src/transition/calculation_apply_transition.rs` (context buck2_transition) sit in DIFFERENT parts of the tree yet change together 59% of the time (10 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `dea81bbc` Preserve exec platform markers across configuration changes; `b5e53555` Revert D96871697; `0434303f` Preserve exec platform marker across transitions — run `git show` on any of them.
Boundary-crossing change coupling: calculation.rs ↔ argfiles.rs app/buck2_build_api/src/actions/calculation.rs:1— `app/buck2_build_api/src/actions/calculation.rs` (context buck2_build_api) and `app/buck2_client_ctx/src/argfiles.rs` (context buck2_client_ctx) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `68ae450b` Reland D119985356: [rust-1.98.1] Rollout xplat & buckified Rust 1.98.1; `c4db8cbd` Revert D119985356: Rollout xplat & buckified Rust 1.98.1; `367f6658` Rollout xplat & buckified Rust 1.98.1 — run `git show` on any of them.
Boundary-crossing change coupling: arg.rs ↔ collection.rs app/buck2_analysis/src/attrs/resolve/attr_type/arg.rs:1— `app/buck2_analysis/src/attrs/resolve/attr_type/arg.rs` (context buck2_analysis) and `app/buck2_build_api/src/interpreter/rule_defs/provider/collection.rs` (context buck2_build_api) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `42640124` lifetimes: Frozen checks stop unpacking a `FrozenValue`; `4d7d48ff` lifetimes: De-panic the `ProviderCollection` builtin-provider accessors; `af5c0dc9` lifetimes: Complex branded `DefaultInfo` — run `git show` on any of them.
Boundary-crossing change coupling: argfiles.rs ↔ local.rs app/buck2_client_ctx/src/argfiles.rs:1— `app/buck2_client_ctx/src/argfiles.rs` (context buck2_client_ctx) and `app/buck2_execute_impl/src/executors/local.rs` (context buck2_execute_impl) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `68ae450b` Reland D119985356: [rust-1.98.1] Rollout xplat & buckified Rust 1.98.1; `c4db8cbd` Revert D119985356: Rollout xplat & buckified Rust 1.98.1; `367f6658` Rollout xplat & buckified Rust 1.98.1 — run `git show` on any of them.
Boundary-crossing change coupling: argfiles.rs ↔ action_scene.rs app/buck2_client_ctx/src/argfiles.rs:1— `app/buck2_client_ctx/src/argfiles.rs` (context buck2_client_ctx) and `app/buck2_resource_control/src/action_scene.rs` (context buck2_resource_control) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `68ae450b` Reland D119985356: [rust-1.98.1] Rollout xplat & buckified Rust 1.98.1; `c4db8cbd` Revert D119985356: Rollout xplat & buckified Rust 1.98.1; `367f6658` Rollout xplat & buckified Rust 1.98.1 — run `git show` on any of them.
Boundary-crossing change coupling: argfiles.rs ↔ sketch.rs app/buck2_client_ctx/src/argfiles.rs:1— `app/buck2_client_ctx/src/argfiles.rs` (context buck2_client_ctx) and `shed/setsketch/src/sketch.rs` (context shed) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `68ae450b` Reland D119985356: [rust-1.98.1] Rollout xplat & buckified Rust 1.98.1; `c4db8cbd` Revert D119985356: Rollout xplat & buckified Rust 1.98.1; `367f6658` Rollout xplat & buckified Rust 1.98.1 — run `git show` on any of them.
AC4 · Keyboard semantics· Click handler on a non-interactive <div> · ×5
Click handler on a non-interactive <div> app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:538— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:627— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> app/buck2_trailcam/js/src/components/invocation/InvocationBar.tsx:184— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> app/buck2_trailcam/js/src/components/invocation/event-log/EventLogTable.tsx:163— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <div> app/buck2_trailcam/js/src/components/invocation/event-log/EventLogToolbar.tsx:131— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC2 · Forms & labels· <label> that labels no control · ×4
<label> that labels no control app/buck2_explain/js/src/graph2/GraphImpl2.tsx:269— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control app/buck2_explain/js/src/graph2/GraphImpl2.tsx:290— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control app/buck2_explain/output_format_js/src/graph2/GraphImpl2.tsx:257— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control app/buck2_explain/output_format_js/src/graph2/GraphImpl2.tsx:278— This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC4 · Keyboard semantics· Click handler on a non-interactive <th> · ×4
Click handler on a non-interactive <th> app/buck2_trailcam/js/src/components/invocation/TestResultsTab.tsx:299— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <th> app/buck2_trailcam/js/src/components/invocation/TestResultsTab.tsx:305— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <th> app/buck2_trailcam/js/src/components/invocation/TestResultsTab.tsx:311— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <th> app/buck2_trailcam/js/src/components/invocation/TestResultsTab.tsx:318— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Orphaned knowledge starlark-rust/starlark_lsp/src/definition.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge games/src/games/sokoban.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge games/src/games/breakout.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge app/buck2_node/src/attrs/attr_type/arg/parser.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
AC2 · Forms & labels· Custom control with no accessible name on <div> · ×2
Custom control with no accessible name on <div> app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:627— This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
Custom control with no accessible name on <div> app/buck2_trailcam/js/src/components/invocation/event-log/EventLogToolbar.tsx:131— This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
AC2 · Forms & labels· <select> without a programmatic label · ×2
<select> without a programmatic label explorer/index.html:14— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<select> without a programmatic label explorer/index.html:18— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels· <textarea> without a programmatic label · ×2
<textarea> without a programmatic label starlark-rust/starlark_js_example/index.html:70— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<textarea> without a programmatic label starlark-rust/starlark_js_example/index.html:75— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics· Click handler on a non-interactive <span> · ×2
Click handler on a non-interactive <span> app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:588— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <span> app/buck2_trailcam/js/src/components/invocation/event-log/FilterableValue.tsx:42— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Hover-only interaction on <rect> · ×2
Hover-only interaction on <rect> app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:93— This <rect> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
Hover-only interaction on <rect> app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:117— This <rect> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
AC4 · Keyboard semantics· Click handler on a non-interactive <tr> · ×2
Click handler on a non-interactive <tr> app/buck2_trailcam/js/src/components/invocation/TestResultsTab.tsx:359— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
Click handler on a non-interactive <tr> app/buck2_trailcam/js/src/components/invocation/event-log/EventLogTable.tsx:189— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC3 · Page structure· <iframe> without a title · ×1
<iframe> without a title REDACTED:124— An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
<html> without a lang explorer/index.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
Banned license: async-condvar-fair — `async-condvar-fair` 1.0.1 is published on crates.io under `GPL-3.0-or-later`, which this policy bans, and it is in the SHIPPED closure of this repository's REDACTED — so it is compiled by everything that builds this repository, not just by its test harness. The expression was read as SPDX, not as text: an `OR` is a choice and is only charged when every branch is banned, while an `AND` binds you to both operands and is charged when either is. Replace the crate, or record an accepted exception.
TodoComment tests/select_type_params/test_select_types.py:38— # TODO(D94266514): expect_failure once Select[T] lands — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/select_type_params/test_select_types.py:56— # TODO(D94266514): expect_failure once Select[T] lands — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/select_type_params/test_select_types.py:74— # TODO(D94266514): expect_failure once Select[T] lands — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/select_type_params/test_select_types.py:92— # TODO(D94266514): expect_failure once Select[T] lands — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/select_type_params/test_select_types.py:110— # TODO(D94266514): expect_failure once Select[T] lands — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/select_type_params/test_select_types.py:128— # TODO(D94266514): expect_failure once Select[T] lands — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/select_type_params/test_select_types.py:159— # TODO(D94266514): expect_failure once Select[T] lands — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/select_type_params/test_select_types.py:174— # TODO(D94266514): expect_failure once Select[T] lands — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e_util/buck_workspace.py:622— # TODO: The toolchain platform definitions we hard-code in the prelude are — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/test_cpp_gen_cdb.py:21— # TODO(marwhal): Fix and enable on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/test/test_test_inplace.py:42— # TODO(marwhal): Fix and enable on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/test/test_test_inplace.py:56— # TODO(marwhal): Fix and enable on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/test/test_test_inplace.py:91— # TODO(marwhal): Fix and enable on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/test/test_test_inplace.py:312— # TODO(marwhal): Fix and enable on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/test/test_test_inplace.py:383— # TODO(marwhal): Fix and enable on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/test/test_test_inplace.py:392— # TODO(marwhal): Fix and enable on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/test/test_test_inplace.py:411— # TODO(marwhal): Fix and enable on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/test/test_test_inplace.py:447— # TODO(marwhal): Fix and enable on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/test/test_test_inplace.py:454— # TODO(marwhal): Fix and enable on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/test/test_test_inplace.py:522— # TODO(marwhal): Fix and enable on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/test/test_test_inplace.py:646— # TODO(marwhal): Fix and enable on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/log/test_what_ran.py:27— # TODO(marwhal): Fix and enable on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/core/materializer/test_materializer.py:54— # TODO(marwhal): Fix and enable on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/test_cpp_gen_cdb.py:47— # TODO(marwhal): Add this back one at least one test in this file passes on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/e2e/targets_command/test_targets.py:28— # TODO: Make this test isolated, i.e. inplace=False. — 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 REDACTED:158— # FIXME(scottcao): Not fully implemented yet — 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 tests/e2e_util/buck_workspace.py:194— # FIXME(T136079642): Buck2 on Windows has problem with relative symlinks over 260 chars, shorten the hash — 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 tests/e2e/test_starlark.py:19— # FIXME(JakobDegen): Reusing `project.ignore` for this is bad, `starlark — 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 tests/e2e/audit/test_audit_classpath.py:11— # FIXME(JakobDegen): These tests should be isolated and moved into `tests/isolated/audit` — 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 tests/core/resource_control/test_instruction_count.py:90— # FIXME(JakobDegen): Are we really expecting downward variation? Why? Leave a comment — 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 tests/core/query/uquery/test_uquery.py:361— # FIXME(JakobDegen): Providers in a query literal should be an error; they are dropped. — 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 tests/core/query/cquery/test_cquery.py:55— # FIXME(JakobDegen): Providers in a query literal should be an error; they are dropped. — 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 tests/core/query/uquery/test_uquery.py:611— # FIXME(JakobDegen): A source that names a subpackage directory crosses a package — 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 tests/core/query/uquery/test_uquery.py:615— # FIXME(JakobDegen): Likewise for a directory source that contains a subpackage; it — 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 tests/core/io/test_compare_providers.py:95— # FIXME(minglunli): Test was passing for the wrong reason, reached out to Eden and will disable the test for now — 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 tests/core/io/test_edenfs.py:326— # FIXME(JakobDegen): Bug: This directory doesn't exist. — 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 tests/core/invocation_record/test_invocation_record.py:25— # FIXME(JakobDegen): Flakey in CI — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment tests/core/external_cells/test_in_subdir.py:29— # FIXME(JakobDegen): Decide if this is a bug or not — 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 tests/core/debug/test_debug.py:57— # FIXME(JakobDegen): `.` is an error — 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 tests/core/daemon/test_nested_invocations.py:34— # FIXME(JakobDegen): Nested invocations seem to have buggy behavior around writing the event — 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 tests/core/configurations/test_configuration_dep_uquery_correctness.py:58— # FIXME(JakobDegen): Bug. — 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 tests/core/configurations/test_configuration_dep_uquery_correctness.py:63— # FIXME(JakobDegen): Bug. — 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 tests/core/configurations/test_subtarget_configuration_dep.py:21— # FIXME(JakobDegen): Bug. The target specifies a subtarget that does have an appropriate — 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 tests/core/configurations/test_subtarget_configuration_dep.py:34— # FIXME(JakobDegen): Bug. `buck.deps`-like attributes do not include subtargets — 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 tests/core/configurations/transition/test_constructor_validation.py:40— # FIXME(JakobDegen): Evaluate whether we can implement this. The performance — 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 tests/core/completion/test_completion.py:120— # FIXME(JakobDegen): Should probably not be inconsistent — 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 tests/core/completion/test_completion.py:226— # FIXME(JakobDegen): Bug: expected=[], — 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 tests/core/completion/test_completion.py:259— # FIXME(JakobDegen): Why is this different from 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.
FixmeComment tests/core/common/io/file_watcher_symlink_tests.py:31— # FIXME(JakobDegen): Bug. Notify consistently reports this incorrectly. It might be fine 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.
FixmeComment tests/core/common/io/file_watcher_symlink_tests.py:80— # FIXME(JakobDegen): Watchman non-deterministically produces either a create or modify — 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.
FileTooLong: subscribers/recorder.rs app/buck2_client_ctx/src/subscribers/recorder.rs— FileTooLong — 2268 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 91% of them inside a single declaration: InvocationRecorder (4 blocks, 120-2897). The bar is 500 significant lines; this is 1768 over it, 4.54× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/orchestrator.rs app/buck2_test/src/orchestrator.rs— FileTooLong — 2121 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 61% of them inside a single declaration: BuckTestOrchestrator (5 blocks, 375-2273). The bar is 500 significant lines; this is 1621 over it, 4.24× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/gui.rs tools/retrace/src/gui.rs— FileTooLong — 1964 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 1464 over it, 3.93× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/analyses.rs tools/retrace/src/analyses.rs— FileTooLong — 1926 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 45 free functions. The bar is 500 significant lines; this is 1426 over it, 3.85× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: gui/detail_ui.rs tools/retrace/src/gui/detail_ui.rs— FileTooLong — 1914 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 46 free functions. The bar is 500 significant lines; this is 1414 over it, 3.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: deferred/clean_stale.rs app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs— FileTooLong — 1860 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 1360 over it, 3.72× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ingest/emit.rs tools/retrace/src/ingest/emit.rs— FileTooLong — 1858 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 1358 over it, 3.72× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: run/dep_files.rs app/buck2_action_impl/src/actions/impls/run/dep_files.rs— FileTooLong — 1743 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 1243 over it, 3.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/detail.rs tools/retrace/src/detail.rs— FileTooLong — 1662 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 51 free functions. The bar is 500 significant lines; this is 1162 over it, 3.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: daemon/server.rs app/buck2_server/src/daemon/server.rs— FileTooLong — 1637 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 61% of them inside a single declaration: BuckdServer (2 blocks, 363-2006). The bar is 500 significant lines; this is 1137 over it, 3.27× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/chrome_trace.rs app/buck2_log_common/src/chrome_trace.rs— FileTooLong — 1621 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 1121 over it, 3.24× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: re/client.rs app/buck2_execute/src/re/client.rs— FileTooLong — 1596 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 63% of them inside a single declaration: RemoteExecutionClientImpl (3 blocks, 591-2177). The bar is 500 significant lines; this is 1096 over it, 3.19× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: v2/core.rs app/buck2_execute_impl/src/materializers/v2/core.rs— FileTooLong — 1542 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 1042 over it, 3.08× 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: pipeline/AbiGenPipeline.kt prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt— FileTooLong — 1516 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1016 over it, 3.03× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/command.rs app/buck2_test/src/command.rs— FileTooLong — 1475 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 975 over it, 2.95× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/export.rs tools/retrace/src/export.rs— FileTooLong — 1415 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 915 over it, 2.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/client.rs remote_execution/oss/re_grpc/src/client.rs— FileTooLong — 1389 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 889 over it, 2.78× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: impls/run.rs app/buck2_action_impl/src/actions/impls/run.rs— FileTooLong — 1379 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 66% of them inside a single declaration: RunAction (4 blocks, 455-1865). The bar is 500 significant lines; this is 879 over it, 2.76× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: ingest/scan.rs tools/retrace/src/ingest/scan.rs— FileTooLong — 1370 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 40 free functions. The bar is 500 significant lines; this is 870 over it, 2.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/lib.rs app/buck2_concurrency/src/lib.rs— FileTooLong — 1353 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 853 over it, 2.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: gui/panels.rs tools/retrace/src/gui/panels.rs— FileTooLong — 1345 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 845 over it, 2.69× 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/nodes.rs app/buck2_configured/src/nodes.rs— FileTooLong — 1339 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 839 over it, 2.68× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: bc/instr_impl.rs starlark-rust/starlark/src/eval/bc/instr_impl.rs— FileTooLong — 1271 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 771 over it, 2.54× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: executors/local.rs app/buck2_execute_impl/src/executors/local.rs— FileTooLong — 1263 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 65% of them inside a single declaration: LocalExecutor (3 blocks, 137-1295). The bar is 500 significant lines; this is 763 over it, 2.53× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: daemon/state.rs app/buck2_server/src/daemon/state.rs— FileTooLong — 1217 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 717 over it, 2.43× 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.
Hotspot: app/buck2_error/src/classify.rs app/buck2_error/src/classify.rs:183— app/buck2_error/src/classify.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 311 in buck2_error::classify::tag_metadata at line 183. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_error/src/classify.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: app/buck2_client_ctx/src/subscribers/recorder.rs app/buck2_client_ctx/src/subscribers/recorder.rs:2533— app/buck2_client_ctx/src/subscribers/recorder.rs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in InvocationRecorder::handle_event at line 2533. 1 of those changes was a fix/bug commit, and the other 31 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_client_ctx/src/subscribers/recorder.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: app/buck2_server/src/daemon/state.rs app/buck2_server/src/daemon/state.rs:360— app/buck2_server/src/daemon/state.rs changed 79 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in TenantState::create at line 360. 2 of those changes were fix/bug commits, and the other 77 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_server/src/daemon/state.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: app/buck2_action_impl/src/actions/impls/run.rs app/buck2_action_impl/src/actions/impls/run.rs:1729— app/buck2_action_impl/src/actions/impls/run.rs changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in RunAction::execute at line 1729. 3 of those changes were fix/bug commits, and the other 43 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_action_impl/src/actions/impls/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: app/buck2_execute_impl/src/executors/local.rs app/buck2_execute_impl/src/executors/local.rs:535— app/buck2_execute_impl/src/executors/local.rs changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in LocalExecutor::exec_request at line 535. 6 of those changes were fix/bug commits, and the other 30 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_execute_impl/src/executors/local.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: prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:155— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in FirMetadataSanitizerStage.cleanupFirMetadataSources at line 155. 1 of those changes was a fix/bug commit, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:1120— app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in buck2_execute_impl::materializers::deferred::clean_stale::create_clean_fut at line 1120. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_execute_impl/src/materializers/deferred/clean_stale.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: app/buck2_execute/src/re/client.rs app/buck2_execute/src/re/client.rs:770— app/buck2_execute/src/re/client.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in RemoteExecutionClientImpl::new at line 770. 1 of those changes was a fix/bug commit, and the other 25 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_execute/src/re/client.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: app/buck2_test/src/orchestrator.rs app/buck2_test/src/orchestrator.rs:1296— app/buck2_test/src/orchestrator.rs changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in BuckTestOrchestrator::execute_request at line 1296. 3 of those changes were fix/bug commits, and the other 43 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_test/src/orchestrator.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: app/buck2_interpreter_for_build/src/rule.rs app/buck2_interpreter_for_build/src/rule.rs:485— app/buck2_interpreter_for_build/src/rule.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in buck2_interpreter_for_build::rule::validate_execution_groups at line 485. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_interpreter_for_build/src/rule.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: dice/dice/src/core/processor.rs dice/dice/src/core/processor.rs:69— dice/dice/src/core/processor.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in StateProcessor::iteration at line 69. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- dice/dice/src/core/processor.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: starlark-rust/starlark/src/values/types/string/methods.rs starlark-rust/starlark/src/values/types/string/methods.rs:117— starlark-rust/starlark/src/values/types/string/methods.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in starlark::values::types::string::methods::string_methods at line 117. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- starlark-rust/starlark/src/values/types/string/methods.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: starlark-rust/starlark/src/eval/compiler/expr.rs starlark-rust/starlark/src/eval/compiler/expr.rs:1293— starlark-rust/starlark/src/eval/compiler/expr.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in Compiler::expr at line 1293. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- starlark-rust/starlark/src/eval/compiler/expr.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: app/buck2_action_impl/src/context/run.rs app/buck2_action_impl/src/context/run.rs:131— app/buck2_action_impl/src/context/run.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in buck2_action_impl::context::run::analysis_actions_methods_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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_action_impl/src/context/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: app/buck2_log_common/src/chrome_trace.rs app/buck2_log_common/src/chrome_trace.rs:1334— app/buck2_log_common/src/chrome_trace.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in ChromeTraceWriter::handle_event at line 1334. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_log_common/src/chrome_trace.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: starlark-rust/starlark/src/eval/runtime/params/spec.rs starlark-rust/starlark/src/eval/runtime/params/spec.rs:734— starlark-rust/starlark/src/eval/runtime/params/spec.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in ParametersSpec::collect_slow at line 734. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- starlark-rust/starlark/src/eval/runtime/params/spec.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: app/buck2/src/lib.rs app/buck2/src/lib.rs:518— app/buck2/src/lib.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in CommandKind::exec_no_daemon at line 518. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2/src/lib.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: app/buck2_node/src/attrs/coerced/select.rs app/buck2_node/src/attrs/coerced/select.rs:575— app/buck2_node/src/attrs/coerced/select.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in buck2_node::attrs::coerced::select::validate_concat at line 575. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_node/src/attrs/coerced/select.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: app/buck2_execute_impl/src/materializers/v2/core.rs app/buck2_execute_impl/src/materializers/v2/core.rs:2076— app/buck2_execute_impl/src/materializers/v2/core.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Processor::handle at line 2076. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_execute_impl/src/materializers/v2/core.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: app/buck2_action_impl/src/actions/impls/run/dep_files.rs app/buck2_action_impl/src/actions/impls/run/dep_files.rs:1209— app/buck2_action_impl/src/actions/impls/run/dep_files.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in buck2_action_impl::actions::impls::run::dep_files::match_if_identical_action at line 1209. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_action_impl/src/actions/impls/run/dep_files.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: app/buck2_execute/src/re/uploader.rs app/buck2_execute/src/re/uploader.rs:138— app/buck2_execute/src/re/uploader.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in Uploader::upload at line 138. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_execute/src/re/uploader.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: app/buck2_configured/src/nodes.rs app/buck2_configured/src/nodes.rs:1131— app/buck2_configured/src/nodes.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in buck2_configured::nodes::compute_configured_target_node_no_transition at line 1131. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_configured/src/nodes.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: prelude/rust/tools/extract_link_action.py prelude/rust/tools/extract_link_action.py:123— prelude/rust/tools/extract_link_action.py changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in extract_link_action.process_link_args at line 123. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- prelude/rust/tools/extract_link_action.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: app/buck2_event_observer/src/display.rs app/buck2_event_observer/src/display.rs:319— app/buck2_event_observer/src/display.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in buck2_event_observer::display::display_event at line 319. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_event_observer/src/display.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: app/buck2_server/src/daemon/common.rs app/buck2_server/src/daemon/common.rs:189— app/buck2_server/src/daemon/common.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in CommandExecutorFactory::get_command_executor at line 189. 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-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 08:23:32 -07:00' --until='2026-10-28 08:23:32 -07:00' --full-history --no-merges -- app/buck2_server/src/daemon/common.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
FunctionTooLong: retrace::gui::panels::show_panels tools/retrace/src/gui/panels.rs:138— FunctionTooLong — retrace::gui::panels::show_panels runs 1251 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 1151 over it, 12.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: retrace::export::export tools/retrace/src/export.rs:458— FunctionTooLong — retrace::export::export runs 920 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 820 over it, 9.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: retrace::gui::detail_ui::show_cp_walker tools/retrace/src/gui/detail_ui.rs:1780— FunctionTooLong — retrace::gui::detail_ui::show_cp_walker runs 550 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 450 over it, 5.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: buck2_interpreter_for_build::attrs::attrs_global::attr_module app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:164— FunctionTooLong — buck2_interpreter_for_build::attrs::attrs_global::attr_module runs 438 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 338 over it, 4.38× 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: retrace::gui::canvas::show_canvas tools/retrace/src/gui/canvas.rs:600— FunctionTooLong — retrace::gui::canvas::show_canvas runs 438 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 338 over it, 4.38× 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: EventLogProvider.EventLogProvider app/buck2_trailcam/js/src/components/invocation/EventLogProvider.tsx:215— FunctionTooLong — EventLogProvider runs 411 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 311 over it, 4.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: buck2_bxl::bxl::starlark_defs::context::methods::bxl_context_methods app/buck2_bxl/src/bxl/starlark_defs/context/methods.rs:87— FunctionTooLong — buck2_bxl::bxl::starlark_defs::context::methods::bxl_context_methods runs 375 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 275 over it, 3.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: BuildHistorySidebar.BuildHistorySidebar app/buck2_trailcam/js/src/components/invocation/BuildHistorySidebar.tsx:61— FunctionTooLong — BuildHistorySidebar runs 373 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 273 over it, 3.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: retrace::main tools/retrace/src/main.rs:221— FunctionTooLong — retrace::main runs 355 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 255 over it, 3.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: buck2_bxl::bxl::starlark_defs::cquery::cquery_methods app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:136— FunctionTooLong — buck2_bxl::bxl::starlark_defs::cquery::cquery_methods runs 342 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 242 over it, 3.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: buck2_action_impl::context::run::analysis_actions_methods_run app/buck2_action_impl/src/context/run.rs:131— FunctionTooLong — buck2_action_impl::context::run::analysis_actions_methods_run runs 324 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 224 over it, 3.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: buck2_error::classify::tag_metadata app/buck2_error/src/classify.rs:183— FunctionTooLong — buck2_error::classify::tag_metadata runs 317 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 217 over it, 3.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: buck2_bxl::bxl::starlark_defs::uquery::uquery_methods app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:125— FunctionTooLong — buck2_bxl::bxl::starlark_defs::uquery::uquery_methods runs 312 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 212 over it, 3.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: retrace::analyses::load_extras_impl tools/retrace/src/analyses.rs:981— FunctionTooLong — retrace::analyses::load_extras_impl runs 287 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 187 over it, 2.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ActionResultsTab.ActionsView app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:133— FunctionTooLong — ActionsView runs 280 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 180 over it, 2.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: retrace::sim::standard_whatifs_cancellable tools/retrace/src/sim.rs:456— FunctionTooLong — retrace::sim::standard_whatifs_cancellable runs 273 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 173 over it, 2.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: retrace::parse::parse_opts_with_threads_cancellable tools/retrace/src/parse.rs:867— FunctionTooLong — retrace::parse::parse_opts_with_threads_cancellable runs 265 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 165 over it, 2.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: retrace::gui::command_ui::chart tools/retrace/src/gui/command_ui.rs:255— FunctionTooLong — retrace::gui::command_ui::chart runs 262 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 162 over it, 2.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: retrace::analyses::overview_rows tools/retrace/src/analyses.rs:1560— FunctionTooLong — retrace::analyses::overview_rows runs 261 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 161 over it, 2.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: retrace::detail::stage_lines tools/retrace/src/detail.rs:1259— FunctionTooLong — retrace::detail::stage_lines runs 259 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 159 over it, 2.59× 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: buck2_action_impl::context::write::analysis_actions_methods_write app/buck2_action_impl/src/context/write.rs:146— FunctionTooLong — buck2_action_impl::context::write::analysis_actions_methods_write runs 253 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 153 over it, 2.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: buck2_execute_impl::materializers::deferred::clean_stale::create_clean_fut app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:1120— FunctionTooLong — buck2_execute_impl::materializers::deferred::clean_stale::create_clean_fut runs 250 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 150 over it, 2.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: retrace::gui::menu_bar tools/retrace/src/gui.rs:2455— FunctionTooLong — retrace::gui::menu_bar runs 246 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 146 over it, 2.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: retrace::gui::widgets::act_table tools/retrace/src/gui/widgets.rs:427— FunctionTooLong — retrace::gui::widgets::act_table runs 243 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 143 over it, 2.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: buck2_test::command::test app/buck2_test/src/command.rs:367— FunctionTooLong — buck2_test::command::test runs 239 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 139 over it, 2.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: InvocationRecorder.create_record_event app/buck2_client_ctx/src/subscribers/recorder.rs:771— MethodTooLong — create_record_event runs 602 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 502 over it, 6.02× 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: FirMetadataSanitizerStage.cleanupFirMetadataSources prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:155— MethodTooLong — cleanupFirMetadataSources runs 399 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 299 over it, 3.99× 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: TenantState.create app/buck2_server/src/daemon/state.rs:360— MethodTooLong — create runs 389 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 289 over it, 3.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: ValidationStage.collectEmittedTypeReferences prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:1547— MethodTooLong — collectEmittedTypeReferences runs 379 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 279 over it, 3.79× 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: ChromeTraceWriter.handle_event app/buck2_log_common/src/chrome_trace.rs:1334— MethodTooLong — handle_event runs 352 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 252 over it, 3.52× 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: RemoteExecutionClientImpl.new app/buck2_execute/src/re/client.rs:770— MethodTooLong — new runs 278 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 178 over it, 2.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DiceCommandUpdater.make_user_computation_data app/buck2_server/src/ctx.rs:838— MethodTooLong — make_user_computation_data runs 273 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 173 over it, 2.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RunAction.expand_command_line_and_worker app/buck2_action_impl/src/actions/impls/run.rs:635— MethodTooLong — expand_command_line_and_worker runs 262 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 162 over it, 2.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LocalExecutor.exec_request app/buck2_execute_impl/src/executors/local.rs:535— MethodTooLong — exec_request runs 262 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 162 over it, 2.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CommandExecutorFactory.get_command_executor app/buck2_server/src/daemon/common.rs:189— MethodTooLong — get_command_executor runs 241 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 141 over it, 2.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RemoteExecutionClientImpl.execute_impl app/buck2_execute/src/re/client.rs:1243— MethodTooLong — execute_impl runs 236 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 136 over it, 2.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: Game.ensure_safe games/src/games/minesweeper.rs:456— MethodTooLong — ensure_safe runs 220 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 120 over it, 2.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: InvocationRecorder.new app/buck2_client_ctx/src/subscribers/recorder.rs:351— MethodTooLong — new runs 214 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 114 over it, 2.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CliArgType.parse_clap app/buck2_bxl/src/bxl/starlark_defs/cli_args.rs:616— MethodTooLong — parse_clap runs 208 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 108 over it, 2.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.
MethodTooLong: RemoteExecutionStaticMetadata.from_legacy_config app/buck2_re_configuration/src/lib.rs:169— MethodTooLong — from_legacy_config runs 206 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 106 over it, 2.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BuckTestOrchestrator.execute_request app/buck2_test/src/orchestrator.rs:1296— MethodTooLong — execute_request runs 204 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 104 over it, 2.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Collector.event tools/retrace/src/ingest/profile.rs:307— MethodTooLong — event runs 196 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 96 over it, 1.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DaemonKotlincToJarStepFactory.createCompileStep prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/DaemonKotlincToJarStepFactory.java:71— MethodTooLong — createCompileStep runs 194 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 94 over it, 1.94× 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: MultiDexExecutableMain.run prelude/toolchains/android/src/com/facebook/buck/android/dex/MultiDexExecutableMain.java:158— MethodTooLong — run runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DaemonCommand.run app/buck2_daemon/src/daemon.rs:243— MethodTooLong — run runs 178 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 78 over it, 1.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CleanStaleArtifactsCommand.scan_and_create_clean_fut app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:635— MethodTooLong — scan_and_create_clean_fut runs 177 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 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AstModule.get_auto_complete_type starlark-rust/starlark_lsp/src/inspect.rs:84— MethodTooLong — get_auto_complete_type runs 175 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 75 over it, 1.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BuckdServer.run_streaming_erased app/buck2_server/src/daemon/server.rs:578— MethodTooLong — run_streaming_erased runs 174 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 74 over it, 1.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Compiler.expr starlark-rust/starlark/src/eval/compiler/expr.rs:1293— MethodTooLong — expr runs 171 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 71 over it, 1.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: KaptStepsBuilder.prepareKaptProcessorsIfNeeded prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/KaptStepsBuilder.java:86— MethodTooLong — prepareKaptProcessorsIfNeeded runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
retrace::gui::panels::show_panels (cognitive 316) tools/retrace/src/gui/panels.rs:138— retrace::gui::panels::show_panels has cognitive complexity 316 (threshold 15). Drivers by points: if/else 68 (180 pts), loops 20 (67 pts), match/switch 25 (64 pts), boolean chains 5 (nesting depth added 198). 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.
retrace::ingest::scan::scan_input_with_details_cancellable (cognitive 310) tools/retrace/src/ingest/scan.rs:932— retrace::ingest::scan::scan_input_with_details_cancellable has cognitive complexity 310 (threshold 15). Drivers by points: if/else 53 (231 pts), match/switch 14 (61 pts), boolean chains 9, loops 3 (9 pts) (nesting depth added 231). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retrace::export::export (cognitive 256) tools/retrace/src/export.rs:458— retrace::export::export has cognitive complexity 256 (threshold 15). Drivers by points: if/else 92 (180 pts), match/switch 21 (59 pts), boolean chains 14, loops 2 (3 pts) (nesting depth added 127). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retrace::analyses::load_extras_impl (cognitive 168) tools/retrace/src/analyses.rs:981— retrace::analyses::load_extras_impl has cognitive complexity 168 (threshold 15). Drivers by points: if/else 22 (106 pts), match/switch 8 (43 pts), boolean chains 10, loops 5 (9 pts) (nesting depth added 123). 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.
retrace::gui::canvas::show_canvas (cognitive 150) tools/retrace/src/gui/canvas.rs:600— retrace::gui::canvas::show_canvas has cognitive complexity 150 (threshold 15). Drivers by points: if/else 80 (118 pts), boolean chains 20, loops 6 (9 pts), match/switch 1 (3 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retrace::gui::detail_ui::show_cp_walker (cognitive 149) tools/retrace/src/gui/detail_ui.rs:1780— retrace::gui::detail_ui::show_cp_walker has cognitive complexity 149 (threshold 15). Drivers by points: if/else 70 (118 pts), loops 9 (15 pts), boolean chains 9, match/switch 4 (7 pts) (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retrace::gui::command_ui::chart (cognitive 139) tools/retrace/src/gui/command_ui.rs:255— retrace::gui::command_ui::chart has cognitive complexity 139 (threshold 15). Drivers by points: if/else 38 (105 pts), loops 7 (19 pts), match/switch 3 (10 pts), boolean chains 5 (nesting depth added 86). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retrace::ingest::emit::action_event (cognitive 139) tools/retrace/src/ingest/emit.rs:1584— retrace::ingest::emit::action_event has cognitive complexity 139 (threshold 15). Drivers by points: if/else 75 (104 pts), loops 12 (21 pts), boolean chains 12, match/switch 2 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retrace::parse::parse_chunk (cognitive 108) tools/retrace/src/parse.rs:335— retrace::parse::parse_chunk has cognitive complexity 108 (threshold 15). Drivers by points: if/else 23 (80 pts), match/switch 5 (22 pts), boolean chains 5, loops 1 (nesting depth added 74). 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.
retrace::ingest::emit::write_full_graph (cognitive 98) tools/retrace/src/ingest/emit.rs:3262— retrace::ingest::emit::write_full_graph has cognitive complexity 98 (threshold 15). Drivers by points: if/else 35 (62 pts), loops 15 (23 pts), match/switch 4 (10 pts), boolean chains 3 (nesting depth added 41). Of this number, 95 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retrace::parse::repair_optional_args (cognitive 90) tools/retrace/src/parse.rs:506— retrace::parse::repair_optional_args has cognitive complexity 90 (threshold 15). Drivers by points: if/else 27 (64 pts), loops 4 (11 pts), boolean chains 10, match/switch 1 (5 pts) (nesting depth added 48). Of this number, 84 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
retrace::detail::stage_lines (cognitive 89) tools/retrace/src/detail.rs:1259— retrace::detail::stage_lines has cognitive complexity 89 (threshold 15). Drivers by points: if/else 34 (65 pts), boolean chains 16, match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retrace::main (cognitive 87) tools/retrace/src/main.rs:221— retrace::main has cognitive complexity 87 (threshold 15). Drivers by points: if/else 35 (42 pts), boolean chains 24, match/switch 11 (17 pts), loops 3 (4 pts) (nesting depth added 14). 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.
retrace::parse::parse_opts_with_threads_cancellable (cognitive 81) tools/retrace/src/parse.rs:867— retrace::parse::parse_opts_with_threads_cancellable has cognitive complexity 81 (threshold 15). Drivers by points: if/else 34 (58 pts), loops 9 (14 pts), boolean chains 6, match/switch 1 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retrace::detail::popup_rows (cognitive 79) tools/retrace/src/detail.rs:1914— retrace::detail::popup_rows has cognitive complexity 79 (threshold 15). Drivers by points: if/else 34 (59 pts), loops 4 (9 pts), match/switch 2 (6 pts), boolean chains 5 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retrace::gui::widgets::act_table (cognitive 78) tools/retrace/src/gui/widgets.rs:427— retrace::gui::widgets::act_table has cognitive complexity 78 (threshold 15). Drivers by points: if/else 43 (56 pts), loops 6 (11 pts), match/switch 3 (6 pts), boolean chains 5 (nesting depth added 21). 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.
retrace::dag::build_full_with_cancel (cognitive 73) tools/retrace/src/dag.rs:433— retrace::dag::build_full_with_cancel has cognitive complexity 73 (threshold 15). Drivers by points: if/else 17 (46 pts), loops 6 (14 pts), match/switch 3 (9 pts), boolean chains 4 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retrace::sim::standard_whatifs_cancellable (cognitive 65) tools/retrace/src/sim.rs:456— retrace::sim::standard_whatifs_cancellable has cognitive complexity 65 (threshold 15). Drivers by points: if/else 28 (43 pts), boolean chains 11, loops 8 (11 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retrace::gui::detail_ui::show_detail_ui (cognitive 61) tools/retrace/src/gui/detail_ui.rs:1307— retrace::gui::detail_ui::show_detail_ui has cognitive complexity 61 (threshold 15). Drivers by points: if/else 30 (52 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retrace::graph::load_graph_with_workers (cognitive 60) tools/retrace/src/graph.rs:1082— retrace::graph::load_graph_with_workers has cognitive complexity 60 (threshold 15). Drivers by points: if/else 22 (38 pts), loops 12 (15 pts), boolean chains 7 (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.
retrace::ingest::emit::emit_with_options_and_execution (cognitive 60) tools/retrace/src/ingest/emit.rs:2457— retrace::ingest::emit::emit_with_options_and_execution has cognitive complexity 60 (threshold 15). Drivers by points: if/else 29 (37 pts), match/switch 5 (10 pts), boolean chains 7, loops 5 (6 pts) (nesting depth added 14). 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.
retrace::dag::cp_chain (cognitive 56) tools/retrace/src/dag.rs:597— retrace::dag::cp_chain has cognitive complexity 56 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 10 (16 pts), match/switch 3 (9 pts), boolean chains 2 (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.
retrace::gui::update_ready (cognitive 56) tools/retrace/src/gui.rs:2210— retrace::gui::update_ready has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (31 pts), loops 6 (12 pts), match/switch 3 (8 pts), boolean chains 5 (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.
retrace::ingest::scan::validate_graph_identity (cognitive 56) tools/retrace/src/ingest/scan.rs:1624— retrace::ingest::scan::validate_graph_identity has cognitive complexity 56 (threshold 15). Drivers by points: if/else 20 (41 pts), loops 8 (10 pts), boolean chains 5 (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.
retrace::analyses::overview_rows (cognitive 51) tools/retrace/src/analyses.rs:1560— retrace::analyses::overview_rows has cognitive complexity 51 (threshold 15). Drivers by points: if/else 26 (33 pts), match/switch 9 (16 pts), loops 1 (2 pts) (nesting depth added 15). 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.
retrace::gui::panels::show_panels (cyclomatic 117) tools/retrace/src/gui/panels.rs:138— retrace::gui::panels::show_panels has cyclomatic complexity 117 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::export::export (cyclomatic 105) tools/retrace/src/export.rs:458— retrace::export::export has cyclomatic complexity 105 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::ingest::scan::scan_input_with_details_cancellable (cyclomatic 103) tools/retrace/src/ingest/scan.rs:932— retrace::ingest::scan::scan_input_with_details_cancellable has cyclomatic complexity 103 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::ingest::emit::action_event (cyclomatic 102) tools/retrace/src/ingest/emit.rs:1584— retrace::ingest::emit::action_event has cyclomatic complexity 102 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::gui::canvas::show_canvas (cyclomatic 96) tools/retrace/src/gui/canvas.rs:600— retrace::gui::canvas::show_canvas has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::gui::detail_ui::show_cp_walker (cyclomatic 89) tools/retrace/src/gui/detail_ui.rs:1780— retrace::gui::detail_ui::show_cp_walker has cyclomatic complexity 89 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::main (cyclomatic 75) tools/retrace/src/main.rs:221— retrace::main has cyclomatic complexity 75 (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.
retrace::detail::stage_lines (cyclomatic 50) tools/retrace/src/detail.rs:1259— retrace::detail::stage_lines has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::gui::command_ui::chart (cyclomatic 49) tools/retrace/src/gui/command_ui.rs:255— retrace::gui::command_ui::chart has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::ingest::emit::write_full_graph (cyclomatic 49) tools/retrace/src/ingest/emit.rs:3262— retrace::ingest::emit::write_full_graph has cyclomatic complexity 49 (threshold 15). Of this number, 47 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::gui::widgets::act_table (cyclomatic 48) tools/retrace/src/gui/widgets.rs:427— retrace::gui::widgets::act_table has cyclomatic complexity 48 (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.
retrace::ingest::emit::emit_with_options_and_execution (cyclomatic 47) tools/retrace/src/ingest/emit.rs:2457— retrace::ingest::emit::emit_with_options_and_execution has cyclomatic complexity 47 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
retrace::analyses::load_extras_impl (cyclomatic 46) tools/retrace/src/analyses.rs:981— retrace::analyses::load_extras_impl has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::sim::standard_whatifs_cancellable (cyclomatic 46) tools/retrace/src/sim.rs:456— retrace::sim::standard_whatifs_cancellable has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::detail::popup_rows (cyclomatic 45) tools/retrace/src/detail.rs:1914— retrace::detail::popup_rows has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::gui::update_ready (cyclomatic 44) tools/retrace/src/gui.rs:2210— retrace::gui::update_ready has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::parse::parse_opts_with_threads_cancellable (cyclomatic 44) tools/retrace/src/parse.rs:867— retrace::parse::parse_opts_with_threads_cancellable has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::gui::menu_bar (cyclomatic 42) tools/retrace/src/gui.rs:2455— retrace::gui::menu_bar has cyclomatic complexity 42 (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.
retrace::parse::repair_optional_args (cyclomatic 42) tools/retrace/src/parse.rs:506— retrace::parse::repair_optional_args has cyclomatic complexity 42 (threshold 15). Of this number, 37 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrace::graph::load_graph_with_workers (cyclomatic 40) tools/retrace/src/graph.rs:1082— retrace::graph::load_graph_with_workers 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.
retrace::gui::detail_ui::show_detail_ui (cyclomatic 36) tools/retrace/src/gui/detail_ui.rs:1307— retrace::gui::detail_ui::show_detail_ui 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.
retrace::analyses::overview_rows (cyclomatic 35) tools/retrace/src/analyses.rs:1560— retrace::analyses::overview_rows has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
retrace::graph::scan_object (cyclomatic 31) tools/retrace/src/graph.rs:488— retrace::graph::scan_object 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.
retrace::ingest::scan::validate_graph_identity (cyclomatic 31) tools/retrace/src/ingest/scan.rs:1624— retrace::ingest::scan::validate_graph_identity 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. This is NOT this file's highest cyclomatic complexity: retrace::ingest::scan::executor_stage_name (cyclomatic 35) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
retrace::parse::parse_chunk (cyclomatic 31) tools/retrace/src/parse.rs:335— retrace::parse::parse_chunk 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.
Duplicated block (9 lines × 2) app/buck2_action_impl/src/actions/impls/write.rs:465— app/buck2_action_impl/src/actions/impls/write.rs:465-473 | app/buck2_action_impl/src/actions/impls/write_json.rs:269-277 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) app/buck2_action_impl/src/context/copy.rs:42— app/buck2_action_impl/src/context/copy.rs:42-50 | app/buck2_action_impl/src/context/copy.rs:80-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) app/buck2_action_impl/src/context/write.rs:273— app/buck2_action_impl/src/context/write.rs:273-281 | app/buck2_action_impl/src/context/write.rs:397-405 — both copies are in the same file, so extract the 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) app/buck2_analysis/src/attrs/resolve/configured_attr.rs:128— app/buck2_analysis/src/attrs/resolve/configured_attr.rs:128-136 | app/buck2_anon_target/src/anon_target_attr_resolve.rs:110-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:654— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:654-662 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:545-553 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/cquery.rs` and `app/buck2_bxl/src/bxl/starlark_defs/uquery.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 183 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) app/buck2_client_ctx/src/subscribers/superconsole/message_renderer.rs:110— app/buck2_client_ctx/src/subscribers/superconsole/message_renderer.rs:110-118 | app/buck2_client_ctx/src/subscribers/superconsole/message_renderer.rs:121-129 — both copies are in the same file, so extract the 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) app/buck2_client_ctx/src/subscribers/superconsole/timed_list/table_builder.rs:262— app/buck2_client_ctx/src/subscribers/superconsole/timed_list/table_builder.rs:262-270 | app/buck2_client_ctx/src/subscribers/superconsole/timed_list/table_builder.rs:275-283 — both copies are in the same file, so extract the 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) app/buck2_cmd_completion_client/src/complete/path_completer.rs:96— app/buck2_cmd_completion_client/src/complete/path_completer.rs:96-104 | app/buck2_cmd_completion_client/src/complete/path_completer.rs:120-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) app/buck2_configured/src/nodes.rs:1748— app/buck2_configured/src/nodes.rs:1748-1756 | app/buck2_configured/src/nodes.rs:1818-1826 — both copies are in the same file, so extract the 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) app/buck2_execute/src/re/client.rs:1716— app/buck2_execute/src/re/client.rs:1716-1724 | app/buck2_execute/src/re/client.rs:1776-1784 — both copies are in the same file, so extract the 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) starlark-rust/starlark/src/values/types/bytes/value.rs:160— starlark-rust/starlark/src/values/types/bytes/value.rs:160-168 | starlark-rust/starlark_syntax/src/syntax/ast.rs:536-544 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) starlark-rust/starlark/src/values/types/namespace/typing.rs:89— starlark-rust/starlark/src/values/types/namespace/typing.rs:89-97 | starlark-rust/starlark/src/values/types/structs/structs.rs:65-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) starlark-rust/starlark/src/values/types/string/methods.rs:287— starlark-rust/starlark/src/values/types/string/methods.rs:287-295 | starlark-rust/starlark/src/values/types/string/methods.rs:388-396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) starlark-rust/starlark/src/values/types/string/methods.rs:835— starlark-rust/starlark/src/values/types/string/methods.rs:835-843 | starlark-rust/starlark/src/values/types/string/methods.rs:870-878 — both copies are in the same file, so extract the 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) starlark-rust/starlark_lsp/src/server.rs:694— starlark-rust/starlark_lsp/src/server.rs:694-702 | starlark-rust/starlark_lsp/src/server.rs:1041-1049 — both copies are in the same file, so extract the 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) tools/retrace/src/dag.rs:456— tools/retrace/src/dag.rs:456-464 | tools/retrace/src/dag.rs:603-611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) app/buck2_build_api/src/interpreter/rule_defs/artifact/starlark_artifact.rs:154— app/buck2_build_api/src/interpreter/rule_defs/artifact/starlark_artifact.rs:154-162 | app/buck2_build_api/src/interpreter/rule_defs/artifact/starlark_declared_artifact.rs:158-166 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) app/buck2_cmd_query_server/src/query/cquery.rs:56— app/buck2_cmd_query_server/src/query/cquery.rs:56-64 | app/buck2_cmd_query_server/src/query/uquery.rs:44-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) app/buck2_cmd_query_server/src/query/cquery.rs:70— app/buck2_cmd_query_server/src/query/cquery.rs:70-78 | app/buck2_cmd_query_server/src/query/uquery.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.
Duplicated block (9 lines × 2) app/buck2_anon_target/src/anon_target_attr_coerce.rs:303— app/buck2_anon_target/src/anon_target_attr_coerce.rs:303-311 | app/buck2_interpreter_for_build/src/attrs/coerce/error.rs:25-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:110— app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:110-118 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:87-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) app/buck2_file_watcher/src/edenfs/utils.rs:30— app/buck2_file_watcher/src/edenfs/utils.rs:30-38 | app/buck2_file_watcher/src/watchman/utils.rs:15-23 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) integrations/rust-project/src/buck.rs:811— integrations/rust-project/src/buck.rs:811-819 | integrations/rust-project/src/buck.rs:861-875 — both copies are in the same file, so extract the 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) app/buck2_server/src/version_control_revision.rs:158— app/buck2_server/src/version_control_revision.rs:158-166 | app/buck2_server/src/version_control_revision.rs:255-265 — both copies are in the same file, so extract the 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) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:417— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:417-425 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:214-222 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/cquery.rs` and `app/buck2_bxl/src/bxl/starlark_defs/uquery.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 183 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) app/buck2_action_impl/src/actions/impls/run.rs:601— app/buck2_action_impl/src/actions/impls/run.rs:601-607 | app/buck2_action_impl/src/actions/impls/run.rs:613-619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) app/buck2_action_impl/src/context/copy.rs:201— app/buck2_action_impl/src/context/copy.rs:201-207 | app/buck2_action_impl/src/context/copy.rs:221-227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) app/buck2_analysis/src/analysis/env.rs:136— app/buck2_analysis/src/analysis/env.rs:136-142 | app/buck2_build_api_tests/src/attrs/resolve/testing.rs:235-241 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) app/buck2_anon_target/src/anon_target_attr.rs:171— app/buck2_anon_target/src/anon_target_attr.rs:171-177 | app/buck2_anon_target/src/anon_target_attr.rs:209-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.
Duplicated block (7 lines × 2) app/buck2_build_api/src/interpreter/rule_defs/resolve_query_macro.rs:49— app/buck2_build_api/src/interpreter/rule_defs/resolve_query_macro.rs:49-55 | app/buck2_dynamic_actions/src/storage.rs:68-74 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs:315— app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs:315-321 | app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_json_projection.rs:148-154 — before extracting anything, compare `app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs` and `app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_json_projection.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs:511— app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs:511-517 | app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs:778-784 — both copies are in the same file, so extract the 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) app/buck2_cmd_log_client/src/what_materialized.rs:180— app/buck2_cmd_log_client/src/what_materialized.rs:180-186 | app/buck2_cmd_log_client/src/what_uploaded.rs:165-172 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) app/buck2_configuration_providers/src/configuration_info.rs:78— app/buck2_configuration_providers/src/configuration_info.rs:78-84 | app/buck2_configuration_providers/src/configuration_info.rs:87-93 — both copies are in the same file, so extract the 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) app/buck2_core/src/bzl.rs:59— app/buck2_core/src/bzl.rs:59-65 | app/buck2_core/src/bzl.rs:82-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:613— app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:613-621 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:737-743 — both copies are in the same file, so extract the 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) app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:693— app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:693-699 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:713-719 — both copies are in the same file, so extract the 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) app/buck2_query_impls/src/analysis/environment.rs:143— app/buck2_query_impls/src/analysis/environment.rs:143-149 | app/buck2_query_impls/src/aquery/functions.rs:36-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) app/buck2_server/src/daemon/common.rs:352— app/buck2_server/src/daemon/common.rs:352-358 | app/buck2_server/src/daemon/common.rs:372-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) games/src/games.rs:443— games/src/games.rs:443-449 | games/src/games.rs:467-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) games/src/games/minesweeper.rs:339— games/src/games/minesweeper.rs:339-345 | games/src/games/minesweeper.rs:386-392 — both copies are in the same file, so extract the 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) games/src/games/sokoban.rs:245— games/src/games/sokoban.rs:245-251 | games/src/games/sokoban.rs:369-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) shed/mini_map/src/fixed_insertion_map.rs:690— shed/mini_map/src/fixed_insertion_map.rs:690-696 | shed/mini_map/src/mut_insertion_map.rs:1334-1340 — before extracting anything, compare `shed/mini_map/src/fixed_insertion_map.rs` and `shed/mini_map/src/mut_insertion_map.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) starlark-rust/starlark/src/typing/bindings.rs:224— starlark-rust/starlark/src/typing/bindings.rs:224-230 | starlark-rust/starlark/src/typing/fill_types_for_lint.rs:455-463 — 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 (7 lines × 2) starlark-rust/starlark/src/values/types/string/methods.rs:735— starlark-rust/starlark/src/values/types/string/methods.rs:735-741 | starlark-rust/starlark/src/values/types/string/methods.rs:903-909 — both copies are in the same file, so extract the 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) starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:868— starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:868-874 | starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:1398-1404 — both copies are in the same file, so extract the 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) superconsole/src/content/lines.rs:151— superconsole/src/content/lines.rs:151-157 | superconsole/src/content/lines.rs:163-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) tools/retrace/src/analyses.rs:140— tools/retrace/src/analyses.rs:140-146 | tools/retrace/src/analyses.rs:160-166 — both copies are in the same file, so extract the 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) tools/retrace/src/main.rs:525— tools/retrace/src/main.rs:525-531 | tools/retrace/src/main.rs:575-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) app/buck2_node/src/attrs/attr_type/list.rs:113— app/buck2_node/src/attrs/attr_type/list.rs:113-119 | app/buck2_node/src/attrs/attr_type/tuple.rs:116-122 — 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.
ClassTooLong: InvocationRecorder app/buck2_client_ctx/src/subscribers/recorder.rs:120— ClassTooLong — 2074 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 51 methods, 4 blocks, lines 120-2897. The bar is 400 significant lines; this is 1674 over it, 5.19× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BuckTestOrchestrator app/buck2_test/src/orchestrator.rs:375— ClassTooLong — 1304 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, 5 blocks, lines 375-2273. The bar is 400 significant lines; this is 904 over it, 3.26× 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: RemoteExecutionClientImpl app/buck2_execute/src/re/client.rs:591— ClassTooLong — 1008 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 14 methods, 3 blocks, lines 591-2177. The bar is 400 significant lines; this is 608 over it, 2.52× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BuckdServer app/buck2_server/src/daemon/server.rs:361— ClassTooLong — 1003 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 7 methods, 2 blocks, lines 363-2006. The bar is 400 significant lines; this is 603 over it, 2.51× 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: ParserRd starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:60— ClassTooLong — 971 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 60 methods, 2 blocks, lines 60-1469. The bar is 400 significant lines; this is 571 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RunAction app/buck2_action_impl/src/actions/impls/run.rs:455— ClassTooLong — 906 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, 4 blocks, lines 455-1865. The bar is 400 significant lines; this is 506 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ChromeTraceWriter app/buck2_log_common/src/chrome_trace.rs:851— ClassTooLong — 888 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, 2 blocks, lines 851-2157. The bar is 400 significant lines; this is 488 over it, 2.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LocalExecutor app/buck2_execute_impl/src/executors/local.rs:137— ClassTooLong — 815 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 9 methods, 3 blocks, lines 137-1295. The bar is 400 significant lines; this is 415 over it, 2.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DeferredMaterializerCommandProcessor app/buck2_execute_impl/src/materializers/deferred/command_processor.rs:99— ClassTooLong — 790 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 2 blocks, lines 99-1591. The bar is 400 significant lines; this is 390 over it, 1.98× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Game games/src/games/minesweeper.rs:95— ClassTooLong — 749 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 16 methods, 4 blocks, lines 95-1175. The bar is 400 significant lines; this is 349 over it, 1.87× 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: AbiValidationInputs prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:1252— ClassTooLong — 740 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 340 over it, 1.85× 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: Ready tools/retrace/src/gui.rs:732— ClassTooLong — 706 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 32 methods, 2 blocks, lines 732-1758. The bar is 400 significant lines; this is 306 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AdbHelper prelude/toolchains/android/src/com/facebook/buck/android/AdbHelper.java:76— ClassTooLong — 651 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. 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: MiniMutInsertionMap shed/mini_map/src/mut_insertion_map.rs:77— ClassTooLong — 638 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 68 methods, 23 blocks, lines 77-1413. The bar is 400 significant lines; this is 238 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TypingOracleCtx starlark-rust/starlark/src/typing/oracle/ctx.rs:86— ClassTooLong — 629 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 34 methods, 2 blocks, lines 86-1031. The bar is 400 significant lines; this is 229 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FirMetadataSanitizerStage prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:128— ClassTooLong — 627 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 227 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Backend starlark-rust/starlark_lsp/src/server.rs:405— ClassTooLong — 613 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 35 methods, 3 blocks, lines 405-1290. The bar is 400 significant lines; this is 213 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: EdenFsFileWatcher app/buck2_file_watcher/src/edenfs/interface.rs:102— ClassTooLong — 562 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 12 methods, 3 blocks, lines 102-884. The bar is 400 significant lines; this is 162 over it, 1.41× 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: BuildReportCollector app/buck2_build_api/src/build/build_report.rs:322— ClassTooLong — 550 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 2 blocks, lines 322-1118. The bar is 400 significant lines; this is 150 over it, 1.38× 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: AndroidDeviceImpl prelude/toolchains/android/src/com/facebook/buck/android/exopackage/AndroidDeviceImpl.kt:33— ClassTooLong — 540 significant lines (blank, comment-only and punctuation-only lines excluded), 49 methods. The bar is 400 significant lines; this is 140 over it, 1.35× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Value starlark-rust/starlark/src/values/layout/value.rs:140— ClassTooLong — 534 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 100 methods, 9 blocks, lines 142-1219. The bar is 400 significant lines; this is 134 over it, 1.34× 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: Evaluator starlark-rust/starlark/src/eval/runtime/evaluator.rs:136— ClassTooLong — 518 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 62 methods, 3 blocks, lines 136-1130. The bar is 400 significant lines; this is 118 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StatefulSuperConsoleImpl app/buck2_client_ctx/src/subscribers/superconsole.rs:441— ClassTooLong — 492 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 2 blocks, lines 441-1588. The bar is 400 significant lines; this is 92 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ExecutionUi tools/retrace/src/gui/execution_ui.rs:110— ClassTooLong — 492 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 14 methods, 3 blocks, lines 110-801. The bar is 400 significant lines; this is 92 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Jsr199JavacInvocation prelude/toolchains/android/src/com/facebook/buck/jvm/java/Jsr199JavacInvocation.java:70— ClassTooLong — 483 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 83 over it, 1.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (6 lines × 2) app/buck2_analysis/src/attrs/resolve/configured_attr.rs:114— app/buck2_analysis/src/attrs/resolve/configured_attr.rs:114-119 | app/buck2_anon_target/src/anon_target_attr_resolve.rs:96-101 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/bxl_function.rs:59— app/buck2_bxl/src/bxl/starlark_defs/bxl_function.rs:59-64 | app/buck2_bxl/src/bxl/starlark_defs/bxl_function.rs:71-76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/file_set.rs:137— app/buck2_bxl/src/bxl/starlark_defs/file_set.rs:137-142 | app/buck2_bxl/src/bxl/starlark_defs/targetset.rs:270-275 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/file_set.rs:158— app/buck2_bxl/src/bxl/starlark_defs/file_set.rs:158-163 | app/buck2_bxl/src/bxl/starlark_defs/targetset.rs:285-290 — 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) app/buck2_bxl/src/bxl/starlark_defs/lazy_ctx/lazy_uquery_ctx.rs:120— app/buck2_bxl/src/bxl/starlark_defs/lazy_ctx/lazy_uquery_ctx.rs:120-125 | app/buck2_bxl/src/bxl/starlark_defs/lazy_ctx/lazy_uquery_ctx.rs:343-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/nodes/configured.rs:575— app/buck2_bxl/src/bxl/starlark_defs/nodes/configured.rs:575-581 | app/buck2_node/src/nodes/configured.rs:876-881 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) app/buck2_cmd_log_client/src/critical_path.rs:145— app/buck2_cmd_log_client/src/critical_path.rs:145-150 | app/buck2_cmd_log_client/src/external_configs.rs:57-62 — 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) app/buck2_event_observer/src/display.rs:163— app/buck2_event_observer/src/display.rs:163-169 | app/buck2_server_commands/src/explain_code.rs:85-90 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:1635— app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:1635-1640 | app/buck2_execute_impl/src/materializers/v2/clean_stale.rs:1014-1019 — `app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs` and `app/buck2_execute_impl/src/materializers/v2/clean_stale.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) app/buck2_execute_impl/src/materializers/deferred/data_tree.rs:503— app/buck2_execute_impl/src/materializers/deferred/data_tree.rs:503-508 | app/buck2_execute_impl/src/materializers/deferred/data_tree.rs:543-548 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) app/buck2_interpreter/src/types/target_label.rs:120— app/buck2_interpreter/src/types/target_label.rs:120-125 | app/buck2_interpreter/src/types/target_label.rs:241-246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) starlark-rust/starlark/src/docs/markdown.rs:169— starlark-rust/starlark/src/docs/markdown.rs:169-174 | starlark-rust/starlark/src/docs/markdown.rs:218-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) starlark-rust/starlark/src/eval/runtime/arguments.rs:279— starlark-rust/starlark/src/eval/runtime/arguments.rs:279-284 | starlark-rust/starlark/src/eval/runtime/arguments.rs:297-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) starlark-rust/starlark/src/values/types/string/methods.rs:249— starlark-rust/starlark/src/values/types/string/methods.rs:249-254 | starlark-rust/starlark/src/values/types/string/methods.rs:1174-1179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:861— starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:861-866 | starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:1391-1396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) tools/retrace/src/gui/panels.rs:538— tools/retrace/src/gui/panels.rs:538-543 | tools/retrace/src/gui/panels.rs:705-710 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) tools/retrace/src/ingest/emit.rs:3153— tools/retrace/src/ingest/emit.rs:3153-3158 | tools/retrace/src/ingest/emit.rs:3177-3182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) tools/retrace/src/ingest/scan.rs:1054— tools/retrace/src/ingest/scan.rs:1054-1059 | tools/retrace/src/ingest/scan.rs:1330-1335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) app/buck2_anon_target/src/anon_target_attr.rs:96— app/buck2_anon_target/src/anon_target_attr.rs:96-101 | app/buck2_node/src/attrs/configured_attr.rs:228-233 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) app/buck2_build_api/src/actions/artifact/get_artifact_fs.rs:67— app/buck2_build_api/src/actions/artifact/get_artifact_fs.rs:67-72 | app/buck2_common/src/dice/cells.rs:149-154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) starlark-rust/starlark_derive/src/starlark_pagable_unsupported.rs:29— starlark-rust/starlark_derive/src/starlark_pagable_unsupported.rs:29-34 | starlark-rust/starlark_derive/src/starlark_pagable_via_pagable.rs:31-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) app/buck2_directory/src/directory/builder.rs:702— app/buck2_directory/src/directory/builder.rs:702-707 | app/buck2_directory/src/directory/immutable_or_exclusive.rs:79-84 — 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) app/buck2_interpreter/src/execution_group.rs:116— app/buck2_interpreter/src/execution_group.rs:116-121 | app/buck2_interpreter_for_build/src/plugins.rs:103-108 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) app/buck2_server/src/daemon/dice_dump.rs:82— app/buck2_server/src/daemon/dice_dump.rs:82-87 | app/buck2_server/src/daemon/dice_dump.rs:88-96 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) app/buck2_test/src/command.rs:2013— app/buck2_test/src/command.rs:2013-2018 | app/buck2_test/src/command.rs:2021-2026 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
+ 15 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file app/buck2_trailcam/js/src/lib/proto/bundle.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file prelude/nodejs/tools/nodejs_test_adapter.cjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/components/invocation/EventLogProvider.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/lib/event-log-cache.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/lib/event-log-decoder.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/components/invocation/BuildHistorySidebar.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/lib/event-summary-store.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/lib/critical-path.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/components/invocation/event-log/useEventLogState.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/lib/parallel-decode/orchestrator.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/components/invocation/TestResultsTab.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/lib/load-events.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/components/invocation/InvocationView.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_explain/js/src/graph2/GraphImpl2.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/components/invocation/FileChanges.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/components/invocation/DecodeTimeline.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_explain/output_format_js/src/graph2/GraphImpl2.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file app/buck2_trailcam/js/src/lib/action-results.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
TooManyMethods: Value starlark-rust/starlark/src/values/layout/value.rs:140— TooManyMethods — 100 methods. The bar is 30 methods; this is 70 over it, 3.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MiniMutInsertionMap shed/mini_map/src/mut_insertion_map.rs:77— TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CommandExecutionRequest app/buck2_execute/src/execute/request.rs:366— TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Evaluator starlark-rust/starlark/src/eval/runtime/evaluator.rs:136— TooManyMethods — 62 methods, declared across 4 files: runtime/evaluator.rs (57), debug/inspect.rs (2), src/eval.rs (2), debug/evaluate.rs (1). The bar is 30 methods; this is 32 over it, 2.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ParserRd starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:60— 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: AValueDyn starlark-rust/starlark/src/values/layout/vtable.rs:344— TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: InvocationRecorder app/buck2_client_ctx/src/subscribers/recorder.rs:120— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CoreState dice/dice_core/src/state.rs:43— TooManyMethods — 50 methods, declared across 7 files: src/state.rs (24), src/resolve.rs (9), src/invariants.rs (6), src/introspect.rs (4), +3 more file(s). The bar is 30 methods; this is 20 over it, 1.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AndroidDeviceImpl prelude/toolchains/android/src/com/facebook/buck/android/exopackage/AndroidDeviceImpl.kt:33— TooManyMethods — 49 methods. The bar is 30 methods; this is 19 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.
TooManyMethods: CoercedAttrArenaBuilder app/buck2_node/src/attrs/arena/builder.rs:49— TooManyMethods — 47 methods, declared across 25 files: arena/builder.rs (11), attr_type/query.rs (6), attr_type/arg.rs (4), coerced/select.rs (4), +21 more file(s). The bar is 30 methods; this is 17 over it, 1.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Ty starlark-rust/starlark/src/typing/ty.rs:86— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× 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: LargeByteBuffer prelude/toolchains/android/src/com/facebook/buck/util/nio/LargeByteBuffer.java:20— 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: MiniMutInsertionSet shed/mini_map/src/mut_insertion_set.rs:47— 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: ProjectFilesystemUtils prelude/toolchains/android/src/com/facebook/buck/io/filesystem/impl/ProjectFilesystemUtils.java:67— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ExprCompiled starlark-rust/starlark/src/eval/compiler/expr.rs:238— TooManyMethods — 41 methods, declared across 2 files: compiler/expr.rs (40), compiler/expr.rs (1). The bar is 30 methods; this is 11 over it, 1.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ConfiguredTargetNode app/buck2_node/src/nodes/configured.rs:92— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AttrType app/buck2_node/src/attrs/attr_type.rs:86— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Compiler starlark-rust/starlark/src/eval/compiler.rs:98— TooManyMethods — 39 methods, declared across 8 files: compiler/stmt.rs (9), compiler/types.rs (8), compiler/module.rs (6), compiler/expr.rs (5), +4 more file(s). The bar is 30 methods; this is 9 over it, 1.30× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Heap starlark-rust/starlark/src/values/layout/heap/unfrozen.rs:106— TooManyMethods — 39 methods, declared across 9 files: heap/unfrozen.rs (23), avalues/str_.rs (5), avalues/list.rs (4), avalues/tuple.rs (2), +5 more file(s). The bar is 30 methods; this is 9 over it, 1.30× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BcWriter starlark-rust/starlark/src/eval/bc/writer.rs:160— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: JarBuilder prelude/toolchains/android/src/com/facebook/buck/util/zip/JarBuilder.java:50— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MorePaths prelude/toolchains/android/src/com/facebook/buck/io/file/MorePaths.java:37— TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× 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: Vec2 app/buck2_util/src/vec2.rs:96— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Dice dice/dice/src/dice.rs:57— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Backend starlark-rust/starlark_lsp/src/server.rs:405— TooManyMethods — 35 methods, declared across 2 files: src/server.rs (29), src/completion.rs (6). The bar is 30 methods; this is 5 over it, 1.17× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (8 lines × 2) allocative/allocative_derive/src/derive_allocative.rs:181— allocative/allocative_derive/src/derive_allocative.rs:181-188 | allocative/allocative_derive/src/derive_allocative.rs:202-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) app/buck2_anon_target/src/anon_target_attr_coerce.rs:455— app/buck2_anon_target/src/anon_target_attr_coerce.rs:455-462 | app/buck2_anon_target/src/anon_target_attr_coerce.rs:464-471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) app/buck2_build_api/src/build/graph_properties.rs:214— app/buck2_build_api/src/build/graph_properties.rs:214-221 | app/buck2_configured/src/nodes.rs:1621-1628 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) app/buck2_build_api/src/interpreter/rule_defs/provider/collection.rs:729— app/buck2_build_api/src/interpreter/rule_defs/provider/collection.rs:729-736 | app/buck2_build_api/src/interpreter/rule_defs/provider/collection.rs:743-750 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) app/buck2_execute/src/execute/command_executor.rs:322— app/buck2_execute/src/execute/command_executor.rs:322-329 | app/buck2_execute/src/execute/command_executor.rs:405-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:664— app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:664-671 | app/buck2_execute_impl/src/materializers/v2/clean_stale.rs:317-324 — `app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs` and `app/buck2_execute_impl/src/materializers/v2/clean_stale.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 67 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 (8 lines × 2) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:1420— app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:1420-1427 | app/buck2_execute_impl/src/materializers/v2/clean_stale.rs:483-490 — `app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs` and `app/buck2_execute_impl/src/materializers/v2/clean_stale.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 67 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 (8 lines × 2) app/buck2_query/src/query/graph/graph.rs:404— app/buck2_query/src/query/graph/graph.rs:404-411 | app/buck2_query/src/query/graph/graph.rs:417-424 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) app/buck2_trailcam/src/invocation.rs:205— app/buck2_trailcam/src/invocation.rs:205-212 | tools/retrace/src/ingest/profile.rs:860-867 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) dice/dice/src/epoch/task/dice.rs:331— dice/dice/src/epoch/task/dice.rs:331-338 | dice/dice/src/epoch/task/dice.rs:377-384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) games/src/games.rs:516— games/src/games.rs:516-523 | games/src/games.rs:567-574 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) games/src/games/minesweeper.rs:597— games/src/games/minesweeper.rs:597-604 | games/src/games/minesweeper.rs:727-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.
Duplicated block (8 lines × 2) shed/mini_map/src/fixed_insertion_map.rs:605— shed/mini_map/src/fixed_insertion_map.rs:605-612 | shed/mini_map/src/mut_insertion_map.rs:1281-1289 — before extracting anything, compare `shed/mini_map/src/fixed_insertion_map.rs` and `shed/mini_map/src/mut_insertion_map.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) starlark-rust/starlark/src/docs/parse.rs:179— starlark-rust/starlark/src/docs/parse.rs:179-189 | starlark-rust/starlark/src/docs/parse.rs:192-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) starlark-rust/starlark/src/typing/fill_types_for_lint.rs:437— starlark-rust/starlark/src/typing/fill_types_for_lint.rs:437-444 | starlark-rust/starlark/src/typing/fill_types_for_lint.rs:508-515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) starlark-rust/starlark/src/values/layout/avalues/array.rs:109— starlark-rust/starlark/src/values/layout/avalues/array.rs:109-116 | starlark-rust/starlark/src/values/layout/avalues/tuple.rs:112-119 — 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) starlark-rust/starlark/src/values/types/list/methods.rs:262— starlark-rust/starlark/src/values/types/list/methods.rs:262-269 | starlark-rust/starlark/src/values/types/set/methods.rs:236-243 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) tools/retrace/src/dag.rs:493— tools/retrace/src/dag.rs:493-500 | tools/retrace/src/dag.rs:639-646 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) tools/retrace/src/gui/detail_ui.rs:1196— tools/retrace/src/gui/detail_ui.rs:1196-1203 | tools/retrace/src/gui/detail_ui.rs:1240-1247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) tools/retrace/src/ingest/testlog.rs:918— tools/retrace/src/ingest/testlog.rs:918-925 | tools/retrace/src/ingest/testlog.rs:1519-1526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) app/buck2_node/src/attrs/attr_type/list.rs:102— app/buck2_node/src/attrs/attr_type/list.rs:102-109 | app/buck2_node/src/attrs/attr_type/tuple.rs:105-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) app/buck2_query/src/query/syntax/simple/eval/label_indexed.rs:175— app/buck2_query/src/query/syntax/simple/eval/label_indexed.rs:175-182 | shed/mini_map/src/mut_insertion_set.rs:92-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) dice/dice_examples/src/math_computation.rs:121— dice/dice_examples/src/math_computation.rs:121-128 | dice/fuzzy_dice/src/computation.rs:117-124 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) games/src/games/breakout.rs:528— games/src/games/breakout.rs:528-535 | games/src/games/twenty48.rs:298-305 — 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) app/buck2_cmd_audit_server/src/server.rs:53— app/buck2_cmd_audit_server/src/server.rs:53-60 | app/buck2_cmd_starlark_server/src/lib.rs:67-74 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) app/buck2_build_api/src/interpreter/rule_defs/cmd_args/options.rs:181— app/buck2_build_api/src/interpreter/rule_defs/cmd_args/options.rs:181-190 | app/buck2_build_api/src/interpreter/rule_defs/cmd_args/options.rs:211-220 — both copies are in the same file, so extract the 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) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:442— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:442-451 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:466-475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:667— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:667-676 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:558-567 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/cquery.rs` and `app/buck2_bxl/src/bxl/starlark_defs/uquery.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 183 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) app/buck2_client_ctx/src/signal_handler.rs:19— app/buck2_client_ctx/src/signal_handler.rs:19-28 | games/src/console.rs:79-88 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) app/buck2_client_ctx/src/subscribers/recorder.rs:492— app/buck2_client_ctx/src/subscribers/recorder.rs:492-501 | app/buck2_cmd_log_client/src/summary.rs:350-359 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) app/buck2_client_ctx/src/subscribers/simpleconsole.rs:465— app/buck2_client_ctx/src/subscribers/simpleconsole.rs:465-474 | app/buck2_client_ctx/src/subscribers/superconsole.rs:945-954 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) app/buck2_common/src/memory.rs:41— app/buck2_common/src/memory.rs:41-50 | app/buck2_common/src/memory.rs:79-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) app/buck2_execute/src/execute/request.rs:824— app/buck2_execute/src/execute/request.rs:824-833 | app/buck2_execute/src/execute/request.rs:844-853 — both copies are in the same file, so extract the 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) app/buck2_execute_impl/src/materializers/deferred/data_tree.rs:516— app/buck2_execute_impl/src/materializers/deferred/data_tree.rs:516-525 | app/buck2_execute_impl/src/materializers/deferred/data_tree.rs:556-565 — both copies are in the same file, so extract the 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) app/buck2_log_common/src/chrome_trace.rs:1912— app/buck2_log_common/src/chrome_trace.rs:1912-1921 | app/buck2_log_common/src/chrome_trace.rs:2047-2056 — both copies are in the same file, so extract the 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) app/buck2_query_derive/src/codegen.rs:209— app/buck2_query_derive/src/codegen.rs:209-218 | app/buck2_query_derive/src/codegen.rs:254-263 — both copies are in the same file, so extract the 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) games/src/games/minesweeper.rs:587— games/src/games/minesweeper.rs:587-596 | games/src/games/minesweeper.rs:646-655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) pagable/src/flavors.rs:146— pagable/src/flavors.rs:146-155 | pagable/src/flavors.rs:161-170 — both copies are in the same file, so extract the 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) starlark-rust/starlark/src/eval/bc/call.rs:160— starlark-rust/starlark/src/eval/bc/call.rs:160-169 | starlark-rust/starlark/src/eval/bc/call.rs:205-214 — both copies are in the same file, so extract the 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) starlark-rust/starlark/src/values/freeze.rs:355— starlark-rust/starlark/src/values/freeze.rs:355-364 | starlark-rust/starlark/src/values/freeze.rs:397-406 — both copies are in the same file, so extract the 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) starlark-rust/starlark/src/values/types/list/unpack.rs:54— starlark-rust/starlark/src/values/types/list/unpack.rs:54-63 | starlark-rust/starlark/src/values/types/tuple/unpack.rs:53-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) starlark-rust/starlark_lsp/src/symbols.rs:70— starlark-rust/starlark_lsp/src/symbols.rs:70-79 | starlark-rust/starlark_lsp/src/symbols.rs:82-91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:1211— starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:1211-1220 | starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:1270-1279 — both copies are in the same file, so extract the 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) tools/retrace/src/ingest/testlog.rs:381— tools/retrace/src/ingest/testlog.rs:381-390 | tools/retrace/src/ingest/testlog.rs:1799-1808 — both copies are in the same file, so extract the 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) app/buck2_client_ctx/src/subscribers/superconsole.rs:429— app/buck2_client_ctx/src/subscribers/superconsole.rs:429-438 | app/buck2_event_observer/src/what_ran.rs:439-449 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) app/buck2_cmd_query_server/src/query/cquery.rs:85— app/buck2_cmd_query_server/src/query/cquery.rs:85-94 | app/buck2_cmd_query_server/src/query/uquery.rs:73-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) app/buck2_cmd_audit_server/src/server.rs:34— app/buck2_cmd_audit_server/src/server.rs:34-43 | app/buck2_cmd_starlark_server/src/lib.rs:38-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) starlark-rust/starlark/src/values/types/dict/refs.rs:42— starlark-rust/starlark/src/values/types/dict/refs.rs:42-51 | starlark-rust/starlark/src/values/types/set/refs.rs:41-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) app/buck2_health_check/src/health_check_client.rs:173— app/buck2_health_check/src/health_check_client.rs:173-182 | app/buck2_health_check/src/health_check_client.rs:200-210 — both copies are in the same file, so extract the 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) app/buck2_action_impl/src/actions/impls/cas_artifact.rs:598— app/buck2_action_impl/src/actions/impls/cas_artifact.rs:598-608 | app/buck2_action_impl/src/actions/impls/cas_artifact.rs:615-624 — both copies are in the same file, so extract the 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) app/buck2_configuration_providers/src/configuration_info.rs:446— app/buck2_configuration_providers/src/configuration_info.rs:446-450 | app/buck2_configuration_providers/src/configuration_info.rs:454-458 — both copies are in the same file, so extract the 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) app/buck2_event_observer/src/display.rs:1301— app/buck2_event_observer/src/display.rs:1301-1305 | app/buck2_event_observer/src/display.rs:1314-1318 — both copies are in the same file, so extract the 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) app/buck2_execute_impl/src/materializers/v2/core.rs:1420— app/buck2_execute_impl/src/materializers/v2/core.rs:1420-1424 | app/buck2_execute_impl/src/materializers/v2/core.rs:1470-1474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) app/buck2_execute_impl/src/sqlite/tables/incremental_state_table.rs:160— app/buck2_execute_impl/src/sqlite/tables/incremental_state_table.rs:160-164 | app/buck2_execute_impl/src/sqlite/tables/materializer_state_table.rs:786-791 — 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 (5 lines × 2) app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:213— app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:213-217 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:266-270 — both copies are in the same file, so extract the 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) app/buck2_query_parser/src/lib.rs:465— app/buck2_query_parser/src/lib.rs:465-469 | app/buck2_query_parser/src/lib.rs:483-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) app/buck2_server/src/snapshot.rs:746— app/buck2_server/src/snapshot.rs:746-750 | app/buck2_server/src/snapshot.rs:758-762 — both copies are in the same file, so extract the 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) integrations/rust-project/src/main.rs:316— integrations/rust-project/src/main.rs:316-320 | integrations/rust-project/src/main.rs:337-341 — both copies are in the same file, so extract the 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) shed/mini_map/src/mut_insertion_map.rs:329— shed/mini_map/src/mut_insertion_map.rs:329-333 | shed/mini_map/src/mut_insertion_map.rs:343-347 — both copies are in the same file, so extract the 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) starlark-rust/starlark/src/stdlib/extra.rs:179— starlark-rust/starlark/src/stdlib/extra.rs:179-183 | starlark-rust/starlark/src/values/types/string/globals.rs:153-157 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) starlark-rust/starlark/src/stdlib/json.rs:176— starlark-rust/starlark/src/stdlib/json.rs:176-180 | starlark-rust/starlark/src/stdlib/json.rs:197-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) starlark-rust/starlark/src/values/layout/avalues/list.rs:95— starlark-rust/starlark/src/values/layout/avalues/list.rs:95-99 | starlark-rust/starlark/src/values/layout/avalues/tuple.rs:93-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) starlark-rust/starlark/src/values/types/string/methods.rs:1283— starlark-rust/starlark/src/values/types/string/methods.rs:1283-1287 | starlark-rust/starlark/src/values/types/string/methods.rs:1311-1315 — both copies are in the same file, so extract the 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) tools/retrace/src/gui/detail_ui.rs:286— tools/retrace/src/gui/detail_ui.rs:286-290 | tools/retrace/src/gui/detail_ui.rs:300-304 — both copies are in the same file, so extract the 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) app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs:99— app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs:99-103 | app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_json_projection.rs:86-90 — before extracting anything, compare `app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs` and `app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_json_projection.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) app/buck2_cli_proto/src/lib.rs:254— app/buck2_cli_proto/src/lib.rs:254-258 | app/buck2_proto_serde/src/lib.rs:33-37 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) starlark-rust/starlark/src/values/types/dict/value.rs:517— starlark-rust/starlark/src/values/types/dict/value.rs:517-521 | starlark-rust/starlark/src/values/types/set/value.rs:270-274 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) app/buck2_action_impl/src/actions/impls/write.rs:141— app/buck2_action_impl/src/actions/impls/write.rs:141-146 | app/buck2_action_impl/src/actions/impls/write_json.rs:113-117 — 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 (5 lines × 2) app/buck2_execute_impl/src/sqlite/incremental_state_db.rs:142— app/buck2_execute_impl/src/sqlite/incremental_state_db.rs:142-146 | app/buck2_execute_impl/src/sqlite/materializer_db.rs:74-78 — 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 (5 lines × 2) app/buck2_execute_impl/src/sqlite/tables/materializer_state_table.rs:733— app/buck2_execute_impl/src/sqlite/tables/materializer_state_table.rs:733-737 | app/buck2_execute_impl/src/sqlite/tables/materializer_state_table.rs:757-761 — both copies are in the same file, so extract the 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) app/buck2_bxl/src/bxl/starlark_defs/lazy_ctx/lazy_uquery_ctx.rs:174— app/buck2_bxl/src/bxl/starlark_defs/lazy_ctx/lazy_uquery_ctx.rs:174-178 | app/buck2_bxl/src/bxl/starlark_defs/lazy_ctx/lazy_uquery_ctx.rs:198-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) starlark-rust/starlark/src/values/types/set/methods.rs:103— starlark-rust/starlark/src/values/types/set/methods.rs:103-107 | starlark-rust/starlark/src/values/types/set/methods.rs:321-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) starlark-rust/starlark/src/values/types/set/methods.rs:131— starlark-rust/starlark/src/values/types/set/methods.rs:131-135 | starlark-rust/starlark/src/values/types/set/methods.rs:158-162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) tools/retrace/src/detail.rs:1915— tools/retrace/src/detail.rs:1915-1919 | tools/retrace/src/detail.rs:2375-2379 — both copies are in the same file, so extract the 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) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:584— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:584-588 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:621-625 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/BytecodeTransformer.kt:218— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/BytecodeTransformer.kt:269— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/KosabiClassUsageCollector.kt:558— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:459— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:467— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:530— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:542— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:550— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:701— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:774— `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:835— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:868— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:876— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:1131— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:1143— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:1150— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:1158— `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/KotlinMetadataReader.java:265— `catch (RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/python/tools/make_par/sitecustomize.py:63— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/go/tools/gen_embedcfg.go:173— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/go/tools/gen_embedcfg.go:178— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:154— `if err := scanner.Err(); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/go/tools/gopackagesdriver/driver/stdlib.go:57— `if _, err := exec.LookPath(" "); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/go/tools/gopackagesdriver/driver/stdlib.go:91— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) prelude/erlang/toolchain/dependency_analyzer.erl:179— `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Duplicated block (11 lines × 2) app/buck2_action_impl/src/actions/impls/write_hmap.rs:250— app/buck2_action_impl/src/actions/impls/write_hmap.rs:250-260 | app/buck2_action_impl/src/actions/impls/write_json.rs:265-275 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs:303— app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs:303-313 | app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_json_projection.rs:136-146 — before extracting anything, compare `app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs` and `app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_json_projection.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/nodes/configured.rs:311— app/buck2_bxl/src/bxl/starlark_defs/nodes/configured.rs:311-321 | app/buck2_bxl/src/bxl/starlark_defs/nodes/unconfigured.rs:142-152 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/nodes/configured.rs` and `app/buck2_bxl/src/bxl/starlark_defs/nodes/unconfigured.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:454— app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:454-464 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:485-495 — both copies are in the same file, so extract the 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) app/buck2_cmd_log_client/src/what_materialized.rs:137— app/buck2_cmd_log_client/src/what_materialized.rs:137-147 | app/buck2_cmd_log_client/src/what_uploaded.rs:109-119 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) app/buck2_events/src/sink/smart_truncate_event.rs:184— app/buck2_events/src/sink/smart_truncate_event.rs:184-194 | app/buck2_events/src/sink/smart_truncate_event.rs:198-208 — both copies are in the same file, so extract the 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) app/buck2_fs/src/paths/relative_path.rs:551— app/buck2_fs/src/paths/relative_path.rs:551-561 | app/buck2_fs/src/paths/relative_path.rs:571-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) app/buck2_node/src/load_patterns.rs:340— app/buck2_node/src/load_patterns.rs:340-350 | app/buck2_node/src/load_patterns.rs:363-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.
Duplicated block (11 lines × 2) games/src/games.rs:619— games/src/games.rs:619-629 | games/src/games.rs:686-696 — both copies are in the same file, so extract the 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) pagable_storage/src/storage/sled.rs:204— pagable_storage/src/storage/sled.rs:204-214 | pagable_storage/src/storage/sqlite.rs:786-796 — before extracting anything, compare `pagable_storage/src/storage/sled.rs` and `pagable_storage/src/storage/sqlite.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) starlark-rust/starlark/src/values/layout/avalues/list.rs:168— starlark-rust/starlark/src/values/layout/avalues/list.rs:168-178 | starlark-rust/starlark/src/values/layout/avalues/tuple.rs:191-201 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) starlark-rust/starlark/src/values/types/string/methods.rs:743— starlark-rust/starlark/src/values/types/string/methods.rs:743-753 | starlark-rust/starlark/src/values/types/string/methods.rs:911-921 — both copies are in the same file, so extract the 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) tools/retrace/src/detail.rs:913— tools/retrace/src/detail.rs:913-923 | tools/retrace/src/detail.rs:938-948 — both copies are in the same file, so extract the 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) tools/retrace/src/ingest/testlog.rs:510— tools/retrace/src/ingest/testlog.rs:510-520 | tools/retrace/src/ingest/testlog.rs:1453-1463 — both copies are in the same file, so extract the 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) allocative/allocative/src/key.rs:53— allocative/allocative/src/key.rs:53-63 | allocative/allocative_derive/src/derive_allocative.rs:34-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) app/buck2_execute_impl/src/sqlite/tables/materializer_state_table.rs:823— app/buck2_execute_impl/src/sqlite/tables/materializer_state_table.rs:823-833 | app/buck2_execute_impl/src/sqlite/tables/materializer_state_table.rs:848-858 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:487— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:487-497 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:307-317 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/cquery.rs` and `app/buck2_bxl/src/bxl/starlark_defs/uquery.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 183 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) app/buck2_cmd_log_client/src/summary.rs:239— app/buck2_cmd_log_client/src/summary.rs:239-249 | app/buck2_cmd_log_client/src/summary.rs:270-280 — both copies are in the same file, so extract the 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) prelude/toolchains/android/src/com/facebook/buck/android/bundle/AndroidBundleBuilderExecutableMain.java:144— prelude/toolchains/android/src/com/facebook/buck/android/bundle/AndroidBundleBuilderExecutableMain.java:144-154 | prelude/toolchains/android/src/com/facebook/buck/android/bundle/AndroidBundleBuilderExecutableMain.java:243-253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/android/src/com/facebook/buck/android/bundle/AndroidBundleBuilderExecutableMain.java:144` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) prelude/toolchains/android/src/com/facebook/buck/features/zip/rules/utils/ZipMain.java:60— prelude/toolchains/android/src/com/facebook/buck/features/zip/rules/utils/ZipMain.java:60-70 | prelude/toolchains/android/src/com/facebook/buck/util/zip/ZipScrubber.java:246-256 — 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 `prelude/toolchains/android/src/com/facebook/buck/features/zip/rules/utils/ZipMain.java:60` 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) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/KotlinMetadataReader.java:138— prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/KotlinMetadataReader.java:138-148 | prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/kotlin-1.4.2/KotlinMetadataReader.java:84-94 — 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 `prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/KotlinMetadataReader.java:138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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: `JvmExtensionsKt` names `kotlin.metadata.jvm.JvmExtensionsKt` in one and `kotlinx.metadata.jvm.JvmExtensionsKt` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, 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) prelude/toolchains/android/src/com/facebook/buck/android/apk/sdk/ApkCreationException.java:20— prelude/toolchains/android/src/com/facebook/buck/android/apk/sdk/ApkCreationException.java:20-30 | prelude/toolchains/android/src/com/facebook/buck/android/apk/sdk/SealedApkException.java:20-30 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) prelude/cxx/dist_lto/tools/dist_lto_prepare_darwin.py:70— prelude/cxx/dist_lto/tools/dist_lto_prepare_darwin.py:70-80 | prelude/cxx/dist_lto/tools/dist_lto_prepare_gnu.py:77-87 — before extracting anything, compare `prelude/cxx/dist_lto/tools/dist_lto_prepare_darwin.py` and `prelude/cxx/dist_lto/tools/dist_lto_prepare_gnu.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `prelude/cxx/dist_lto/tools/dist_lto_prepare_darwin.py:68` calls `add_argument` and `prelude/cxx/dist_lto/tools/dist_lto_prepare_gnu.py:76` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) prelude/erlang/toolchain/boot_script_builder.erl:25— prelude/erlang/toolchain/boot_script_builder.erl:25-35 | prelude/erlang/toolchain/release_variables_builder.erl:30-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:336— app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:336-349 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:614-627 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/aquery.rs` and `app/buck2_bxl/src/bxl/starlark_defs/uquery.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:599— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:599-612 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:427-440 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/cquery.rs` and `app/buck2_bxl/src/bxl/starlark_defs/uquery.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 183 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:635— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:635-648 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:526-539 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/cquery.rs` and `app/buck2_bxl/src/bxl/starlark_defs/uquery.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 183 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) app/buck2_dynamic_actions/src/deferred.rs:657— app/buck2_dynamic_actions/src/deferred.rs:657-670 | app/buck2_dynamic_actions/src/deferred.rs:698-711 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) app/buck2_execute_impl/src/executors/local.rs:772— app/buck2_execute_impl/src/executors/local.rs:772-785 | app/buck2_execute_impl/src/executors/local.rs:881-894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) app/buck2_explain/src/flatbuffers.rs:272— app/buck2_explain/src/flatbuffers.rs:272-285 | app/buck2_explain/src/flatbuffers.rs:287-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) app/buck2_file_watcher/src/edenfs/interface.rs:509— app/buck2_file_watcher/src/edenfs/interface.rs:509-522 | app/buck2_file_watcher/src/watchman/interface.rs:125-138 — 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) app/buck2_interpreter_for_build/src/interpreter/dice_calculation_delegate.rs:330— app/buck2_interpreter_for_build/src/interpreter/dice_calculation_delegate.rs:330-343 | app/buck2_interpreter_for_build/src/interpreter/dice_calculation_delegate.rs:360-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.
Duplicated block (14 lines × 2) pagable_storage/src/storage/sled.rs:224— pagable_storage/src/storage/sled.rs:224-237 | pagable_storage/src/storage/sqlite.rs:806-819 — before extracting anything, compare `pagable_storage/src/storage/sled.rs` and `pagable_storage/src/storage/sqlite.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) starlark-rust/starlark_derive/src/module/parse/fun.rs:104— starlark-rust/starlark_derive/src/module/parse/fun.rs:104-117 | starlark-rust/starlark_derive/src/module/parse/fun.rs:196-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) starlark-rust/starlark_syntax/src/lexer.rs:624— starlark-rust/starlark_syntax/src/lexer.rs:624-637 | starlark-rust/starlark_syntax/src/lexer.rs:641-654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) starlark-rust/starlark_syntax/src/lexer.rs:882— starlark-rust/starlark_syntax/src/lexer.rs:882-895 | starlark-rust/starlark_syntax/src/lexer.rs:899-912 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) starlark-rust/starlark_syntax/src/lexer.rs:949— starlark-rust/starlark_syntax/src/lexer.rs:949-962 | starlark-rust/starlark_syntax/src/lexer.rs:968-981 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) tools/retrace/src/graph.rs:925— tools/retrace/src/graph.rs:925-938 | tools/retrace/src/graph/parallel.rs:141-154 — 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) tools/starlark_fmt/lib/autofixes/sort_kwargs.rs:151— tools/starlark_fmt/lib/autofixes/sort_kwargs.rs:151-164 | tools/starlark_fmt/lib/autofixes/sort_kwargs.rs:244-257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) app/buck2_fs/src/fs_util.rs:352— app/buck2_fs/src/fs_util.rs:352-365 | app/buck2_fs/src/fs_util.rs:557-570 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:436— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:436-449 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:473-486 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 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 `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:436` it does not close everything it opens, so those exact lines 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) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:418— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:418-431 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:455-468 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/java/lang/model/MoreElements.java:164— prelude/toolchains/android/src/com/facebook/buck/jvm/java/lang/model/MoreElements.java:164-177 | prelude/toolchains/android/src/com/facebook/buck/jvm/java/lang/model/MoreElements.java:180-193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:245— app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:245-260 | app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/internal_runner_test_info.rs:375-388 — before extracting anything, compare `app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs` and `app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/internal_runner_test_info.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) prelude/toolchains/android/src/com/facebook/buck/testresultsoutput/TestResultsOutputSender.java:103— prelude/toolchains/android/src/com/facebook/buck/testresultsoutput/TestResultsOutputSender.java:103-116 | prelude/toolchains/android/src/com/facebook/buck/testresultsoutput/TestResultsOutputSender.java:142-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/android/src/com/facebook/buck/testresultsoutput/TestResultsOutputSender.java:103` 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.
Game::ensure_safe (cognitive 156) games/src/games/minesweeper.rs:456— Game::ensure_safe has cognitive complexity 156 (threshold 15). Drivers by points: if/else 29 (102 pts), loops 23 (49 pts), boolean chains 5 (nesting depth added 99). Of this number, 130 points are the body's own statements and 26 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Game::solve_constraints (cognitive 136) games/src/games/minesweeper.rs:312— Game::solve_constraints has cognitive complexity 136 (threshold 15). Drivers by points: if/else 21 (79 pts), loops 16 (54 pts), match/switch 1 (3 pts) (nesting depth added 98). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Game::draw_unchecked (cognitive 97) games/src/games/breakout.rs:550— Game::draw_unchecked has cognitive complexity 97 (threshold 15). Drivers by points: if/else 21 (62 pts), loops 8 (23 pts), boolean chains 6, match/switch 2 (6 pts) (nesting depth added 60). 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.
Game::tick (cognitive 62) games/src/games/blocks.rs:579— Game::tick has cognitive complexity 62 (threshold 15). Drivers by points: if/else 15 (37 pts), loops 6 (18 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 37). 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.
Game::update (cognitive 51) games/src/games/breakout.rs:272— Game::update has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (38 pts), boolean chains 6, loops 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Game::check_for_matches (cognitive 42) games/src/games/blocks.rs:708— Game::check_for_matches has cognitive complexity 42 (threshold 15). Drivers by points: loops 8 (24 pts), if/else 4 (10 pts), match/switch 2 (6 pts), boolean chains 2 (nesting depth added 26). 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.
Game::input (cognitive 38) games/src/games/minesweeper.rs:893— Game::input has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (30 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Game::draw_unchecked (cognitive 37) games/src/games/sokoban.rs:715— Game::draw_unchecked has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 2 (6 pts), loops 2 (5 pts) (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Game::check_for_floaters (cognitive 34) games/src/games/blocks.rs:776— Game::check_for_floaters has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 4 (6 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 15). Of this number, 26 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Game::auto_chord (cognitive 30) games/src/games/minesweeper.rs:283— Game::auto_chord has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 4 (10 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.
Game::cell_color (cognitive 28) games/src/games/life.rs:242— Game::cell_color has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (25 pts), match/switch 2 (3 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Game::draw_unchecked (cognitive 21) games/src/games/blocks.rs:1038— Game::draw_unchecked has cognitive complexity 21 (threshold 15). Drivers by points: if/else 2 (11 pts), loops 2 (5 pts), match/switch 2 (5 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Game::render_cell (cognitive 21) games/src/games/minesweeper.rs:766— Game::render_cell has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Game::step (cognitive 19) games/src/games/life.rs:363— Game::step has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (6 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.
Game::slide (cognitive 18) games/src/games/twenty48.rs:133— Game::slide has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Game::draw_unchecked (cognitive 17) games/src/games/minesweeper.rs:1110— Game::draw_unchecked has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (5 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Game::load_state (cognitive 16) games/src/games/minesweeper.rs:1045— Game::load_state has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 3, loops 3, match/switch 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (13 lines × 2) app/buck2_anon_target/src/anon_target_attr_resolve.rs:151— app/buck2_anon_target/src/anon_target_attr_resolve.rs:151-163 | app/buck2_build_api/src/artifact_groups/promise.rs:202-214 — 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 (13 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/nodes/configured.rs:538— app/buck2_bxl/src/bxl/starlark_defs/nodes/configured.rs:538-550 | app/buck2_bxl/src/bxl/starlark_defs/nodes/unconfigured.rs:205-217 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/nodes/configured.rs` and `app/buck2_bxl/src/bxl/starlark_defs/nodes/unconfigured.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) app/buck2_execute_impl/src/materializers/deferred.rs:494— app/buck2_execute_impl/src/materializers/deferred.rs:494-506 | app/buck2_execute_impl/src/materializers/deferred.rs:744-756 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) games/src/games/sokoban.rs:556— games/src/games/sokoban.rs:556-568 | games/src/games/sokoban.rs:571-583 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) starlark-rust/starlark_syntax/src/lexer.rs:432— starlark-rust/starlark_syntax/src/lexer.rs:432-444 | starlark-rust/starlark_syntax/src/lexer.rs:595-607 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) tools/retrace/src/graph.rs:511— tools/retrace/src/graph.rs:511-523 | tools/retrace/src/graph.rs:596-608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) tools/retrace/src/ingest/scan.rs:1512— tools/retrace/src/ingest/scan.rs:1512-1524 | tools/retrace/src/ingest/scan.rs:1526-1538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) tools/starlark_fmt/lib/autofixes/sort_list_args.rs:390— tools/starlark_fmt/lib/autofixes/sort_list_args.rs:390-402 | tools/starlark_fmt/lib/autofixes/sort_list_args.rs:580-592 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) app/buck2_action_impl/src/actions/impls/run/dep_files.rs:2731— app/buck2_action_impl/src/actions/impls/run/dep_files.rs:2731-2743 | app/buck2_cmd_audit_server/src/output/buck_out_path_parser.rs:139-151 — 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 (13 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/functions.rs:67— app/buck2_bxl/src/bxl/starlark_defs/functions.rs:67-79 | app/buck2_bxl/src/bxl/starlark_defs/functions.rs:90-102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) app/buck2_configuration_providers/src/configuration_info.rs:359— app/buck2_configuration_providers/src/configuration_info.rs:359-371 | app/buck2_configuration_providers/src/configuration_info.rs:410-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) app/buck2_query_impls/src/aquery/bxl.rs:295— app/buck2_query_impls/src/aquery/bxl.rs:295-307 | app/buck2_query_impls/src/aquery/bxl.rs:319-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) tools/retrace/src/export.rs:651— tools/retrace/src/export.rs:651-663 | tools/retrace/src/export.rs:713-725 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:373— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:373-385 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:376-388 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 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 (13 lines × 2) app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:214— app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:214-226 | app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/internal_runner_test_info.rs:269-281 — before extracting anything, compare `app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs` and `app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/internal_runner_test_info.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
starlark::values::types::int::globals::register_int::int (cognitive 38) starlark-rust/starlark/src/values/types/int/globals.rs:81— starlark::values::types::int::globals::register_int::int has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 5 (9 pts), boolean chains 5 (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.
starlark::values::types::string::interpolation::percent (cognitive 31) starlark-rust/starlark/src/values/types/string/interpolation.rs:191— starlark::values::types::string::interpolation::percent has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 11 (28 pts), if/else 2, loops 1 (nesting depth added 17). 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.
starlark::values::types::set::methods::set_methods (cognitive 30) starlark-rust/starlark/src/values/types/set/methods.rs:86— starlark::values::types::set::methods::set_methods has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (21 pts), loops 6 (7 pts), match/switch 2 (nesting depth added 6). None of this is in the body itself: all 30 points belong to 8 function items inside it that branch (issuperset, update, difference, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
starlark::values::types::float::float::write_scientific (cognitive 26) starlark-rust/starlark/src/values/types/float/float.rs:75— starlark::values::types::float::float::write_scientific has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark::stdlib::breakpoint::breakpoint_loop (cognitive 25) starlark-rust/starlark/src/stdlib/breakpoint.rs:162— starlark::stdlib::breakpoint::breakpoint_loop has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 3 (11 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark::analysis::unused_loads::find::find_unused_loads (cognitive 24) starlark-rust/starlark/src/analysis/unused_loads/find.rs:84— starlark::analysis::unused_loads::find::find_unused_loads has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 5 (8 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.
starlark::stdlib::funcs::other::register_other (cognitive 24) starlark-rust/starlark/src/stdlib/funcs/other.rs:41— starlark::stdlib::funcs::other::register_other has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 6 (8 pts), match/switch 5 (7 pts) (nesting depth added 8). None of this is in the body itself: all 24 points belong to 6 function items inside it that branch (hash, sorted, fail, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
starlark::analysis::dubious::duplicate_dictionary_key (cognitive 22) starlark-rust/starlark/src/analysis/dubious.rs:62— starlark::analysis::dubious::duplicate_dictionary_key has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 3 (4 pts), loops 1 (2 pts) (nesting depth added 12). None of this is in the body itself: all 22 points belong to 2 function items inside it that branch (to_key, expr). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
starlark::eval::runtime::params::display::fmt_param_spec_maybe_multiline (cognitive 20) starlark-rust/starlark/src/eval/runtime/params/display.rs:93— starlark::eval::runtime::params::display::fmt_param_spec_maybe_multiline has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark::typing::typecheck::solve_bindings (cognitive 18) starlark-rust/starlark/src/typing/typecheck.rs:61— starlark::typing::typecheck::solve_bindings has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
starlark::values::types::string::methods::string_methods::splitlines (cognitive 17) starlark-rust/starlark/src/values/types/string/methods.rs:1116— starlark::values::types::string::methods::string_methods::splitlines has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark::values::types::string::repr::string_repr (cognitive 17) starlark-rust/starlark/src/values/types/string/repr.rs:94— starlark::values::types::string::repr::string_repr has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (nesting depth added 5). None of this is in the body itself: all 17 points belong to 3 function items inside it that branch (loop_ascii_simd, loop_ascii, loop_unicode). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
starlark::values::types::dict::methods::dict_methods::update (cognitive 16) starlark-rust/starlark/src/values/types/dict/methods.rs:308— starlark::values::types::dict::methods::dict_methods::update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (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.
Duplicated block (12 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/context/dynamic.rs:291— app/buck2_bxl/src/bxl/starlark_defs/context/dynamic.rs:291-302 | app/buck2_dynamic_actions/src/dynamic_actions_globals.rs:105-116 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:375— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:375-386 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:297-308 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/cquery.rs` and `app/buck2_bxl/src/bxl/starlark_defs/uquery.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 183 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) app/buck2_client_ctx/src/subscribers/simpleconsole.rs:218— app/buck2_client_ctx/src/subscribers/simpleconsole.rs:218-229 | app/buck2_client_ctx/src/subscribers/simpleconsole.rs:240-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) app/buck2_file_watcher/src/edenfs/interface.rs:601— app/buck2_file_watcher/src/edenfs/interface.rs:601-612 | app/buck2_file_watcher/src/edenfs/interface.rs:660-671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) app/buck2_interpreter/src/types/configured_providers_label.rs:142— app/buck2_interpreter/src/types/configured_providers_label.rs:142-153 | app/buck2_interpreter/src/types/configured_providers_label.rs:283-294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) starlark-rust/starlark_syntax/src/syntax/uniplate.rs:415— starlark-rust/starlark_syntax/src/syntax/uniplate.rs:415-426 | starlark-rust/starlark_syntax/src/syntax/uniplate.rs:515-526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs:84— app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs:84-95 | app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_json_projection.rs:71-82 — before extracting anything, compare `app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs` and `app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_json_projection.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) app/buck2_query_derive/src/codegen.rs:39— app/buck2_query_derive/src/codegen.rs:39-50 | starlark-rust/starlark_derive/src/module/util.rs:21-32 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) app/buck2_core/src/fs/buck_out_path.rs:304— app/buck2_core/src/fs/buck_out_path.rs:304-315 | app/buck2_core/src/fs/buck_out_path.rs:321-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) tools/retrace/src/ingest/scan.rs:1408— tools/retrace/src/ingest/scan.rs:1408-1419 | tools/retrace/src/ingest/scan.rs:1428-1439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) app/buck2_build_api/src/interpreter/rule_defs/provider/test_provider.rs:138— app/buck2_build_api/src/interpreter/rule_defs/provider/test_provider.rs:138-149 | app/buck2_build_api/src/interpreter/rule_defs/provider/test_provider.rs:176-187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) dice/dice_examples/src/supply_chain.rs:225— dice/dice_examples/src/supply_chain.rs:225-236 | dice/dice_examples/src/supply_chain.rs:302-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) dice/dice_tests/src/legacy/projection.rs:206— dice/dice_tests/src/legacy/projection.rs:206-217 | dice/dice_tests/src/projection/smoke.rs:214-225 — before extracting anything, compare `dice/dice_tests/src/legacy/projection.rs` and `dice/dice_tests/src/projection/smoke.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
buck2_execute_impl::materializers::deferred::clean_stale::create_clean_fut (cognitive 47) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:1120— buck2_execute_impl::materializers::deferred::clean_stale::create_clean_fut has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 8 (15 pts), loops 5 (6 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.
buck2_execute_impl::materializers::deferred::io_handler::create_ttl_refresh (cognitive 31) app/buck2_execute_impl/src/materializers/deferred/io_handler.rs:669— buck2_execute_impl::materializers::deferred::io_handler::create_ttl_refresh has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 5 (10 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_execute_impl::executors::local::materialize_inputs (cognitive 28) app/buck2_execute_impl/src/executors/local.rs:1337— buck2_execute_impl::executors::local::materialize_inputs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_execute_impl::materializers::deferred::clean_stale::apply_adaptive_low_disk (cognitive 26) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:2049— buck2_execute_impl::materializers::deferred::clean_stale::apply_adaptive_low_disk has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 3, match/switch 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_execute_impl::materializers::v2::clean_stale::plan (cognitive 20) app/buck2_execute_impl/src/materializers/v2/clean_stale.rs:712— buck2_execute_impl::materializers::v2::clean_stale::plan has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (14 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_execute_impl::materializers::io::materialize_recursively (cognitive 19) app/buck2_execute_impl/src/materializers/io.rs:136— buck2_execute_impl::materializers::io::materialize_recursively has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
buck2_execute_impl::materializers::v2::core::download_task (cognitive 19) app/buck2_execute_impl/src/materializers/v2/core.rs:1273— buck2_execute_impl::materializers::v2::core::download_task has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (5 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_execute_impl::re::download::materialize_failed_build_outputs (cognitive 19) app/buck2_execute_impl/src/re/download.rs:229— buck2_execute_impl::re::download::materialize_failed_build_outputs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_execute_impl::sqlite::tables::materializer_state_table::convert_sqlite_entries_to_materializer_state (cognitive 19) app/buck2_execute_impl/src/sqlite/tables/materializer_state_table.rs:400— buck2_execute_impl::sqlite::tables::materializer_state_table::convert_sqlite_entries_to_materializer_state has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_execute_impl::executors::local::check_inputs (cognitive 17) app/buck2_execute_impl/src/executors/local.rs:1483— buck2_execute_impl::executors::local::check_inputs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_execute_impl::materializers::deferred::clean_stale::scratch_sweep (cognitive 17) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:1598— buck2_execute_impl::materializers::deferred::clean_stale::scratch_sweep has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (7 pts), if/else 2 (6 pts), loops 3 (4 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.
buck2_execute_impl::executors::local::materialize_build_outputs (cognitive 16) app/buck2_execute_impl/src/executors/local.rs:1554— buck2_execute_impl::executors::local::materialize_build_outputs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (13 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.
Duplicated block (15 lines × 2) app/buck2_action_impl/src/actions/impls/run.rs:685— app/buck2_action_impl/src/actions/impls/run.rs:685-699 | app/buck2_action_impl/src/actions/impls/run.rs:787-801 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) app/buck2_analysis/src/analysis/calculation.rs:380— app/buck2_analysis/src/analysis/calculation.rs:380-394 | app/buck2_anon_target/src/anon_targets.rs:193-207 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:190— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:190-204 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:179-193 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/cquery.rs` and `app/buck2_bxl/src/bxl/starlark_defs/uquery.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 183 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) dice/dice/src/epoch/task/dice.rs:225— dice/dice/src/epoch/task/dice.rs:225-239 | dice/dice/src/epoch/task/dice.rs:253-267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) dice/dice/src/epoch/task/dice.rs:424— dice/dice/src/epoch/task/dice.rs:424-438 | dice/dice/src/epoch/task/dice.rs:451-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) games/src/games/life.rs:209— games/src/games/life.rs:209-223 | games/src/games/life.rs:226-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) starlark-rust/starlark_derive/src/module/render/fun.rs:575— starlark-rust/starlark_derive/src/module/render/fun.rs:575-589 | starlark-rust/starlark_derive/src/module/render/fun.rs:590-604 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) tools/retrace/src/gui/command_ui.rs:367— tools/retrace/src/gui/command_ui.rs:367-381 | tools/retrace/src/gui/command_ui.rs:595-609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) starlark-rust/starlark_syntax/src/syntax/def.rs:237— starlark-rust/starlark_syntax/src/syntax/def.rs:237-251 | starlark-rust/starlark_syntax/src/syntax/def.rs:272-286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/java/JavaStepsBuilder.java:64— prelude/toolchains/android/src/com/facebook/buck/jvm/java/JavaStepsBuilder.java:64-78 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/KotlinStepsBuilder.java:88-102 — 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 `prelude/toolchains/android/src/com/facebook/buck/jvm/java/JavaStepsBuilder.java: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 (15 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/java/JavaStepsBuilder.java:87— prelude/toolchains/android/src/com/facebook/buck/jvm/java/JavaStepsBuilder.java:87-101 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/KotlinStepsBuilder.java:117-131 — 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 `prelude/toolchains/android/src/com/facebook/buck/jvm/java/JavaStepsBuilder.java:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) prelude/go/tools/go_wrapper.go:27— prelude/go/tools/go_wrapper.go:27-41 | prelude/go/tools/testmaingen.go:77-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
starlark_derive::module::parse::fun::parse_fun (cognitive 46) starlark-rust/starlark_derive/src/module/parse/fun.rs:307— starlark_derive::module::parse::fun::parse_fun has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (30 pts), match/switch 4 (10 pts), boolean chains 5, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark_derive::starlark_pagable::extract_field_attrs (cognitive 35) starlark-rust/starlark_derive/src/starlark_pagable.rs:347— starlark_derive::starlark_pagable::extract_field_attrs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark_derive::starlark_pagable::gen_serialize_enum (cognitive 31) starlark-rust/starlark_derive/src/starlark_pagable.rs:641— starlark_derive::starlark_pagable::gen_serialize_enum has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark_derive::trace::derive_trace_impl (cognitive 29) starlark-rust/starlark_derive/src/trace.rs:50— starlark_derive::trace::derive_trace_impl has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (6 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark_derive::freeze::extract_options (cognitive 26) starlark-rust/starlark_derive/src/freeze.rs:193— starlark_derive::freeze::extract_options has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark_derive::starlark_pagable::gen_deserialize_enum (cognitive 24) starlark-rust/starlark_derive/src/starlark_pagable.rs:758— starlark_derive::starlark_pagable::gen_deserialize_enum has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark_derive::module::parse::fun::parse_arg (cognitive 23) starlark-rust/starlark_derive/src/module/parse/fun.rs:705— starlark_derive::module::parse::fun::parse_arg has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 7, match/switch 3 (4 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.
starlark_derive::module::parse::fun::parse_starlark_fn_param_attr (cognitive 21) starlark-rust/starlark_derive/src/module/parse/fun.rs:100— starlark_derive::module::parse::fun::parse_starlark_fn_param_attr has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (20 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.
starlark_derive::starlark_pagable::gen_deserialize_struct (cognitive 17) starlark-rust/starlark_derive/src/starlark_pagable.rs:561— starlark_derive::starlark_pagable::gen_deserialize_struct has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
starlark_derive::module::parse::fun::resolve_args (cognitive 16) starlark-rust/starlark_derive/src/module/parse/fun.rs:480— starlark_derive::module::parse::fun::resolve_args has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark_derive::starlark_pagable::extract_type_attrs (cognitive 16) starlark-rust/starlark_derive/src/starlark_pagable.rs:101— starlark_derive::starlark_pagable::extract_type_attrs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 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.
Change coupling: logging.rs ↔ longest_path_graph.rs app/buck2_build_signals_impl/src/backend/logging.rs:1— `app/buck2_build_signals_impl/src/backend/logging.rs` and `app/buck2_build_signals_impl/src/backend/longest_path_graph.rs` change together 91% of the time (10 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 10 shared commits counted here, the most recent 3 are `08e9395a` Derive package-load discovery edges from DICE deps instead of walking…; `4858648f` maps: Convert the direct `std::collections` map holdouts in app; `e00fc966` Reland D96227005: Add anon target nodes to critical path — run `git show` on any of them.
Change coupling: in_memory.rs ↔ testing.rs pagable/src/storage/in_memory.rs:1— `pagable/src/storage/in_memory.rs` and `pagable/src/testing.rs` change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 9 shared commits counted here, the most recent 3 are `e92c5665` Drop a cancelled page-out's queued rows instead of draining them; `7822b57e` Evict page-out values only once their rows have committed; `c8acaf22` Reuse DataKeys during concurrent page-out — run `git show` on any of them.
Change coupling: context.rs ↔ testing.rs pagable/src/context.rs:1— `pagable/src/context.rs` and `pagable/src/testing.rs` change together 62% of the time (8 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 8 shared commits counted here, the most recent 3 are `a23fb099` Pair a taken arc key with its page-in scope; `310aa92e` Read an arc slot's key without fetching it; `7ceee7ac` Read scalars without erasing the deserializer — run `git show` on any of them.
Change coupling: tests.rs ↔ processor.rs dice/dice/src/core/graph/tests.rs:1— `dice/dice/src/core/graph/tests.rs` and `dice/dice/src/core/processor.rs` change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 9 shared commits counted here, the most recent 3 are `36ca9ebc` Evict backed values on demand; `68c50fb8` Write recomputed values at page-out but keep them resident; `05fe8d25` Add page-out and eviction policy settings — run `git show` on any of them.
Change coupling: tests.rs ↔ state.rs dice/dice/src/core/graph/tests.rs:1— `dice/dice/src/core/graph/tests.rs` and `dice/dice/src/core/state.rs` change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 9 shared commits counted here, the most recent 3 are `36ca9ebc` Evict backed values on demand; `68c50fb8` Write recomputed values at page-out but keep them resident; `05fe8d25` Add page-out and eviction policy settings — run `git show` on any of them.
Change coupling: write_json.rs ↔ write_macros.rs app/buck2_action_impl/src/actions/impls/write_json.rs:1— `app/buck2_action_impl/src/actions/impls/write_json.rs` and `app/buck2_action_impl/src/actions/impls/write_macros.rs` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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 `19c73231` Fix write-during-read race condition in immediate materializer; `165a8c31` writes: Rename `CommandLineFormatter` to `CommandLineBuilder`; `a87e98cf` writes: `CommandLineBuilder` -> `CommandLineSink` — run `git show` on any of them.
Change coupling: evaluator.rs ↔ opaque.rs dice/dice/src/epoch/evaluator.rs:1— `dice/dice/src/epoch/evaluator.rs` and `dice/dice/src/opaque.rs` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `d5db6ee6` cycles: Run the cycle detector in the background; `6aafa001` hypermodern: Check dependencies by revision equality; `97fbc005` mem: Move `project_for_key`... and then fix a bunch of arcs — run `git show` on any of them.
Change coupling: json.rs ↔ transitive_set_args_projection.rs app/buck2_build_api/src/actions/impls/json.rs:1— `app/buck2_build_api/src/actions/impls/json.rs` and `app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `c600dd54` Pass `InputProperties` to `cmd_args` artifact visitors; `fc1a5876` Prefetch transitive set children before a traversal; `165a8c31` writes: Rename `CommandLineFormatter` to `CommandLineBuilder` — run `git show` on any of them.
Change coupling: typ.rs ↔ transitive_set_args_projection.rs app/buck2_build_api/src/interpreter/rule_defs/cmd_args/typ.rs:1— `app/buck2_build_api/src/interpreter/rule_defs/cmd_args/typ.rs` and `app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `c600dd54` Pass `InputProperties` to `cmd_args` artifact visitors; `165a8c31` writes: Rename `CommandLineFormatter` to `CommandLineBuilder`; `ded470db` writes: Attach `'v` to `CommandLineFormatter` — run `git show` on any of them.
Change coupling: buck_ct_records.hrl ↔ test_logger.erl prelude/erlang/common_test/common/include/buck_ct_records.hrl:1— `prelude/erlang/common_test/common/include/buck_ct_records.hrl` and `prelude/erlang/common_test/common/src/test_logger.erl` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `46d3c5e6` Let test_binary choose the total timeout; `4b38ad66` Eqwalize test_runner; `d558ca87` Back out "Revert D79234804" — run `git show` on any of them.
Change coupling: argfiles.rs ↔ recorder.rs app/buck2_client_ctx/src/argfiles.rs:1— `app/buck2_client_ctx/src/argfiles.rs` and `app/buck2_client_ctx/src/subscribers/recorder.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, 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 5 shared commits counted here, the most recent 3 are `68ae450b` Reland D119985356: [rust-1.98.1] Rollout xplat & buckified Rust 1.98.1; `c4db8cbd` Revert D119985356: Rollout xplat & buckified Rust 1.98.1; `367f6658` Rollout xplat & buckified Rust 1.98.1 — run `git show` on any of them.
Sync-over-async blocking tests/core/common/io/file_watcher_scm_tests.py:27— `setup_file_watcher_scm_test` is async and calls subprocess.run, subprocess.check_output — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
Sync-over-async blocking tests/core/common/io/file_watcher_scm_tests.py:68— `run_checkout_mergebase_changes_test` is async and calls subprocess.run, subprocess.check_output — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
Sync-over-async blocking tests/core/common/io/file_watcher_scm_tests.py:123— `run_checkout_with_mergebase_test` is async and calls subprocess.run — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
Sync-over-async blocking tests/core/common/io/file_watcher_scm_tests.py:140— `run_rebase_with_mergebase_test` is async and calls subprocess.run — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
Sync-over-async blocking tests/core/common/io/file_watcher_scm_tests.py:162— `run_restack_with_mergebase_test` is async and calls subprocess.run — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
Sync-over-async blocking tests/core/common/io/file_watcher_tests.py:25— `setup_file_watcher_test` is async and calls subprocess.run, subprocess.check_output — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
Sync-over-async blocking tests/core/common/io/file_watcher_tests.py:49— `run_aba_test` is async and calls subprocess.run — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
Sync-over-async blocking app/buck2_resource_control/src/memory_tracker.rs:175— `spawn` 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 dice/dice_examples/bin/many_cancel.rs:136— `compute` is async and calls thread::sleep — 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 dice/dice_examples/bin/many_cancel.rs:183— `compute` is async and calls thread::sleep — 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 dice/dice_examples/bin/many_cancel.rs:219— `compute` is async and calls thread::sleep — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
Low cohesion: CommandExecutionRequest (LCOM4 28) app/buck2_execute/src/execute/request.rs:366— CommandExecutionRequest's methods fall into 28 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 28 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DiceComputations (LCOM4 14) dice/dice/src/api/computations.rs:48— DiceComputations's methods fall into 14 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 14 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: StarlarkBigInt (LCOM4 12) starlark-rust/starlark/src/values/types/bigint.rs:72— StarlarkBigInt's methods fall into 12 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 12 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Value (LCOM4 7) starlark-rust/starlark/src/values/layout/value.rs:140— Value's methods fall into 7 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 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: CoercedDepsCollector (LCOM4 6) app/buck2_node/src/attrs/coerced_deps_collector.rs:73— CoercedDepsCollector's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: StarlarkFloat (LCOM4 6) starlark-rust/starlark/src/values/types/float/float.rs:205— StarlarkFloat's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: TargetInfo (LCOM4 4) integrations/rust-project/src/target.rs:110— TargetInfo's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MiniVec (LCOM4 4) shed/mini_vec/src/mini_vec.rs:83— MiniVec's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: StarlarkStr (LCOM4 4) starlark-rust/starlark/src/values/types/string/str_type.rs:80— StarlarkStr's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: StarFun (LCOM4 4) starlark-rust/starlark_derive/src/module/typ.rs:117— StarFun's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Outbound HTTP without resilience app/buck2_http/src/client.rs:1018— `Client::builder(TokioExecutor` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience app/buck2_http/src/client/builder.rs:267— `Client::builder(TokioExecutor` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience app/buck2_http/src/client/builder.rs:275— `Client::builder(TokioExecutor` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience app/buck2_http/src/client/builder.rs:287— `Client::builder(TokioExecutor` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience app/buck2_http/src/client/builder.rs:297— `Client::builder(TokioExecutor` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience app/buck2_http/src/client/builder.rs:304— `Client::builder(TokioExecutor` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience app/buck2_http/src/client/builder.rs:310— `Client::builder(TokioExecutor` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience app/buck2_http/src/client/builder.rs:317— `Client::builder(TokioExecutor` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience app/buck2_http/src/client/builder.rs:321— `Client::builder(TokioExecutor` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience prelude/toolchains/android/src/com/facebook/buck/jvm/java/fatjar/FatJarMain.java:174— `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Game::ensure_safe (cyclomatic 55) games/src/games/minesweeper.rs:456— Game::ensure_safe has cyclomatic complexity 55 (threshold 15). Of this number, 46 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Game::solve_constraints (cyclomatic 40) games/src/games/minesweeper.rs:312— Game::solve_constraints 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.
Game::draw_unchecked (cyclomatic 34) games/src/games/breakout.rs:550— Game::draw_unchecked has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Game::update (cyclomatic 32) games/src/games/breakout.rs:272— Game::update has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Game::input (cyclomatic 30) games/src/games/minesweeper.rs:893— Game::input has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Game::tick (cyclomatic 26) games/src/games/blocks.rs:579— Game::tick 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. This is NOT this file's highest cyclomatic complexity: Piece::grid (cyclomatic 28) 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.
Game::cell_color (cyclomatic 22) games/src/games/life.rs:242— Game::cell_color has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Game::check_for_matches (cyclomatic 16) games/src/games/blocks.rs:708— Game::check_for_matches has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This is NOT this file's highest cyclomatic complexity: Piece::grid (cyclomatic 28) 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.
Game::check_for_floaters (cyclomatic 16) games/src/games/blocks.rs:776— Game::check_for_floaters has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Piece::grid (cyclomatic 28) 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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×9
Duplicated block (17 lines × 2) app/buck2_client_ctx/src/subscribers/superconsole.rs:1674— app/buck2_client_ctx/src/subscribers/superconsole.rs:1674-1690 | app/buck2_client_ctx/src/subscribers/superconsole.rs:1709-1725 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) app/buck2_cmd_targets_server/src/targets/fmt.rs:345— app/buck2_cmd_targets_server/src/targets/fmt.rs:345-361 | app/buck2_cmd_targets_server/src/targets/fmt.rs:454-470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) app/buck2_core/src/deferred/base_deferred_key.rs:207— app/buck2_core/src/deferred/base_deferred_key.rs:207-223 | app/buck2_core/src/deferred/base_deferred_key.rs:229-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) starlark-rust/starlark/src/values/types/string/methods.rs:943— starlark-rust/starlark/src/values/types/string/methods.rs:943-959 | starlark-rust/starlark/src/values/types/string/methods.rs:1047-1063 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) app/buck2_client_ctx/src/subscribers/recorder.rs:2467— app/buck2_client_ctx/src/subscribers/recorder.rs:2467-2483 | app/buck2_client_ctx/src/subscribers/recorder.rs:2494-2510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:492— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:492-508 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:529-545 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 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 (17 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/cd/workertool/MainUtils.java:29— prelude/toolchains/android/src/com/facebook/buck/jvm/cd/workertool/MainUtils.java:29-45 | prelude/toolchains/android/src/com/facebook/buck/jvm/cd/workertool/grpc/WorkerGrpcServer.java:126-142 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/android/src/com/facebook/buck/jvm/cd/workertool/MainUtils.java:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) prelude/android/tools/filter_extra_resources.py:19— prelude/android/tools/filter_extra_resources.py:19-35 | prelude/java/tools/list_class_names.py:16-33 — 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 `prelude/android/tools/filter_extra_resources.py:19` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) prelude/java/tools/compile_and_package.py:42— prelude/java/tools/compile_and_package.py:42-58 | prelude/java/tools/compile_and_package.py:119-135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/java/tools/compile_and_package.py:42` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Swallowed exception (empty catch) prelude/toolchains/android/src/com/facebook/buck/util/io/IoUtil.java:32— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) prelude/toolchains/android/src/com/facebook/buck/android/AdbHelper.java:636— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/buck2_trailcam/js/src/lib/use-local-storage-state.ts:30— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/buck2_trailcam/js/src/lib/use-local-storage-state.ts:43— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/buck2_trailcam/js/src/lib/parallel-decode/orchestrator.ts:199— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) app/buck2_trailcam/js/src/components/invocation/useExpandedCommand.ts:82— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/buck2_trailcam/js/src/components/invocation/EventLogProvider.tsx:398— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/buck2_trailcam/js/src/components/invocation/EventLogProvider.tsx:512— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) app/buck2_trailcam/js/src/components/invocation/EventLogProvider.tsx:813— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
HackComment tests/e2e_util/helper/assert_occurrences.py:24— # Hacky way to actually make sure we print the full output when a string — 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 starlark-rust/starlark/src/typing/ctx.rs:136— // Hack for `list[str]`: list of `list` is just "function", and we don't want — 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 prelude/go_bootstrap/tools/go_wrapper.py:77— # HACK: Split the value into a list of arguments then join them back. — 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 prelude/go_bootstrap/tools/go_wrapper.py:81— # HACK: Replace %cwd% with the current working directory to make it work when `go` does `cd` to a tmp-dir. — 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 prelude/go/tools/gopackagesdriver/driver/stdlib.go:44— // HACK: patch request to fix Syntax and Types for stdlib — 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 prelude/go/tools/gopackagesdriver/driver/stdlib.go:53— // HACK: if go distribution has been built with CGO_ENABLED=0, this changes default behaviour on "always disabled" — 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 prelude/go/tools/gopackagesdriver/driver/targets.go:31— // Hack for golangci-lint, it doesn't add the file= prefix, let's detect it ourselves — 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 prelude/erlang/common_test/test_exec/src/test_exec.erl:32— %% hack to make startup not fail if no config is set — 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.
buck2_build_api::build::detailed_aggregated_metrics::buck2_sketches::gather_heap_graph_sketch (cognitive 21) app/buck2_build_api/src/build/detailed_aggregated_metrics/buck2_sketches.rs:434— buck2_build_api::build::detailed_aggregated_metrics::buck2_sketches::gather_heap_graph_sketch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
buck2_build_api::materialize::materialize_artifact_group (cognitive 21) app/buck2_build_api/src/materialize.rs:78— buck2_build_api::materialize::materialize_artifact_group has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 1 (2 pts) (nesting depth added 13). 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.
buck2_build_api::configure_targets::get_maybe_compatible_targets (cognitive 20) app/buck2_build_api/src/configure_targets.rs:76— buck2_build_api::configure_targets::get_maybe_compatible_targets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_build_api::interpreter::rule_defs::command_executor_config::register_command_executor_config::CommandExecutorConfig (cognitive 20) app/buck2_build_api/src/interpreter/rule_defs/command_executor_config.rs:189— buck2_build_api::interpreter::rule_defs::command_executor_config::register_command_executor_config::CommandExecutorConfig has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, match/switch 3 (4 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buck2_build_api::actions::calculation::build_action_inner (cognitive 18) app/buck2_build_api/src/actions/calculation.rs:210— buck2_build_api::actions::calculation::build_action_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 6 (9 pts) (nesting depth added 6). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_build_api::interpreter::rule_defs::provider::builtin::template_placeholder_info::verify_variables_type (cognitive 18) app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/template_placeholder_info.rs:157— buck2_build_api::interpreter::rule_defs::provider::builtin::template_placeholder_info::verify_variables_type has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 2 (6 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
buck2_build_api::interpreter::rule_defs::provider::callable::register_provider (cognitive 18) app/buck2_build_api/src/interpreter/rule_defs/provider/callable.rs:595— buck2_build_api::interpreter::rule_defs::provider::callable::register_provider has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (2 pts), match/switch 2 (nesting depth added 6). None of this is in the body itself: all 18 points belong to 2 function items inside it that branch (provider_field, provider). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
buck2_build_api::interpreter::rule_defs::provider::doc::provider_callable_documentation (cognitive 17) app/buck2_build_api/src/interpreter/rule_defs/provider/doc.rs:40— buck2_build_api::interpreter::rule_defs::provider::doc::provider_callable_documentation has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (8 pts), if/else 5 (7 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
games::bin::sokoban_gen::generate_room (cognitive 85) games/bin/sokoban_gen.rs:42— games::bin::sokoban_gen::generate_room has cognitive complexity 85 (threshold 15). Drivers by points: if/else 13 (39 pts), loops 19 (36 pts), boolean chains 7, match/switch 1 (3 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
games::games::run_game (cognitive 85) games/src/games.rs:579— games::games::run_game has cognitive complexity 85 (threshold 15). Drivers by points: if/else 16 (53 pts), match/switch 7 (26 pts), loops 2 (6 pts) (nesting depth added 60). 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.
games::bin::sokoban_gen::expand_box_lines (cognitive 55) games/bin/sokoban_gen.rs:334— games::bin::sokoban_gen::expand_box_lines has cognitive complexity 55 (threshold 15). Drivers by points: if/else 9 (33 pts), loops 6 (15 pts), boolean chains 7 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
games::bin::sokoban_gen::generate_level (cognitive 36) games/bin/sokoban_gen.rs:522— games::bin::sokoban_gen::generate_level has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (22 pts), loops 4 (10 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
games::bin::sokoban_gen::find_farthest (cognitive 29) games/bin/sokoban_gen.rs:436— games::bin::sokoban_gen::find_farthest has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 4 (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.
games::console::control_reader (cognitive 25) games/src/console.rs:134— games::console::control_reader has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 4 (10 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
games::bin::menu::main (cognitive 17) games/bin/menu.rs:216— games::bin::menu::main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 3 (6 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_client_ctx::agent_detection::classify (cognitive 33) app/buck2_client_ctx/src/agent_detection.rs:162— buck2_client_ctx::agent_detection::classify has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 3 (8 pts), boolean chains 2, 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.
buck2_client_ctx::subscribers::superconsole::io::do_render (cognitive 31) app/buck2_client_ctx/src/subscribers/superconsole/io.rs:95— buck2_client_ctx::subscribers::superconsole::io::do_render has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21 (24 pts), boolean chains 6, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
buck2_client_ctx::subscribers::classify_server_stderr::classify_server_stderr (cognitive 30) app/buck2_client_ctx/src/subscribers/classify_server_stderr.rs:22— buck2_client_ctx::subscribers::classify_server_stderr::classify_server_stderr has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
buck2_client_ctx::subscribers::superconsole::lines_for_command_details (cognitive 29) app/buck2_client_ctx/src/subscribers/superconsole.rs:1663— buck2_client_ctx::subscribers::superconsole::lines_for_command_details has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 4 (8 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_client_ctx::daemon::client::connect::establish_connection_inner (cognitive 22) app/buck2_client_ctx/src/daemon/client/connect.rs:854— buck2_client_ctx::daemon::client::connect::establish_connection_inner has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 4 (9 pts) (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
buck2_client_ctx::daemon::daemon_windows::spawn_background_process_on_windows::append_quoted (cognitive 20) app/buck2_client_ctx/src/daemon/daemon_windows.rs:61— buck2_client_ctx::daemon::daemon_windows::spawn_background_process_on_windows::append_quoted has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 4 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
buck2_client_ctx::argfiles::expand_argfile_contents (cognitive 16) app/buck2_client_ctx/src/argfiles.rs:187— buck2_client_ctx::argfiles::expand_argfile_contents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TooManyFields: InvocationRecorder app/buck2_client_ctx/src/subscribers/recorder.rs:120— TooManyFields — 201 stored fields beside 51 methods. The bar is 30 stored fields; this is 171 over it, 6.70× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Ready tools/retrace/src/gui.rs:732— TooManyFields — 81 stored fields beside 32 methods. The bar is 30 stored fields; this is 51 over it, 2.70× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Scan tools/retrace/src/ingest/scan.rs:388— TooManyFields — 43 stored fields beside 4 methods. The bar is 30 stored fields; this is 13 over it, 1.43× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RemoteExecutionStaticMetadata app/buck2_re_configuration/src/lib.rs:105— TooManyFields — 42 stored fields. The bar is 30 stored fields; this is 12 over it, 1.40× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RunInfo tools/retrace/src/types.rs:106— TooManyFields — 36 stored fields. The bar is 30 stored fields; this is 6 over it, 1.20× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ServerCommandContext app/buck2_server/src/ctx.rs:230— TooManyFields — 32 stored fields beside 6 methods. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CommandExecutionRequest app/buck2_execute/src/execute/request.rs:366— TooManyFields — 31 stored fields beside 65 methods. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
Duplicated block (19 lines × 2) app/buck2_execute/src/execute/manager.rs:172— app/buck2_execute/src/execute/manager.rs:172-190 | app/buck2_execute/src/execute/manager.rs:268-286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:889— starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:889-907 | starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:914-932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:285— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:285-303 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:288-306 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 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 (19 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:456— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:456-474 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:493-511 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 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 `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:456` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) prelude/toolchains/android/src/com/facebook/buck/android/apk/ApkBuilderExecutableMain.java:123— prelude/toolchains/android/src/com/facebook/buck/android/apk/ApkBuilderExecutableMain.java:123-141 | prelude/toolchains/android/src/com/facebook/buck/android/bundle/AndroidBundleBuilderExecutableMain.java:102-120 — 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 (19 lines × 2) prelude/apple/tools/bundling/main.py:146— prelude/apple/tools/bundling/main.py:146-164 | prelude/apple/tools/bundling/signing_context.py:76-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/apple/tools/bundling/main.py:146` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) prelude/apple/tools/codesign_manifest_tree_postprocessor/main.py:50— prelude/apple/tools/codesign_manifest_tree_postprocessor/main.py:50-68 | prelude/apple/tools/signing_context_tree_postprocessor/main.py:49-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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.
starlark_fmt_lib::lib::autofixes::sort_list_args::collect_sorted_elements_with_keys (cognitive 33) tools/starlark_fmt/lib/autofixes/sort_list_args.rs:253— starlark_fmt_lib::lib::autofixes::sort_list_args::collect_sorted_elements_with_keys has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (26 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark_fmt_lib::lib::autofixes::unused_loads::collect_edits (cognitive 28) tools/starlark_fmt/lib/autofixes/unused_loads.rs:190— starlark_fmt_lib::lib::autofixes::unused_loads::collect_edits has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark_fmt_lib::lib::autofixes::load_utils::extract_load_statements (cognitive 21) tools/starlark_fmt/lib/autofixes/load_utils.rs:56— starlark_fmt_lib::lib::autofixes::load_utils::extract_load_statements has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark_fmt_lib::lib::autofixes::move_loads_to_top::collect_edits (cognitive 21) tools/starlark_fmt/lib/autofixes/move_loads_to_top.rs:78— starlark_fmt_lib::lib::autofixes::move_loads_to_top::collect_edits has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark_fmt_lib::lib::autofixes::sort_loads::collect_edits (cognitive 20) tools/starlark_fmt/lib/autofixes/sort_loads.rs:485— starlark_fmt_lib::lib::autofixes::sort_loads::collect_edits has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark_fmt_lib::lib::autofixes::sort_dict_keys::process_dict_multiline (cognitive 17) tools/starlark_fmt/lib/autofixes/sort_dict_keys.rs:341— starlark_fmt_lib::lib::autofixes::sort_dict_keys::process_dict_multiline has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Duplicated block (7 lines × 3) app/buck2_action_impl/src/context/copy.rs:132— app/buck2_action_impl/src/context/copy.rs:132-140 | app/buck2_action_impl/src/context/copy.rs:157-165 | app/buck2_action_impl/src/context/copy.rs:179-185 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) app/buck2_execute_impl/src/sqlite/tables/dep_file_state_table.rs:73— app/buck2_execute_impl/src/sqlite/tables/dep_file_state_table.rs:73-79 | app/buck2_execute_impl/src/sqlite/tables/dep_file_state_table.rs:81-87 | app/buck2_execute_impl/src/sqlite/tables/materializer_state_table.rs:171-177 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) shed/mini_map/src/fixed_insertion_map.rs:561— shed/mini_map/src/fixed_insertion_map.rs:561-567 | shed/mini_map/src/mut_insertion_map.rs:1215-1221 | starlark-rust/starlark_map/src/ordered_map.rs:210-216 — before extracting anything, compare `shed/mini_map/src/fixed_insertion_map.rs` and `shed/mini_map/src/mut_insertion_map.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) app/buck2_interpreter/src/types/package_path.rs:77— app/buck2_interpreter/src/types/package_path.rs:77-83 | app/buck2_interpreter/src/types/target_label.rs:98-104 | app/buck2_interpreter/src/types/target_label.rs:219-225 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) app/buck2_interpreter/src/types/package_path.rs:85— app/buck2_interpreter/src/types/package_path.rs:85-91 | app/buck2_interpreter/src/types/target_label.rs:106-112 | app/buck2_interpreter/src/types/target_label.rs:227-233 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) prelude/toolchains/android/src/com/facebook/buck/android/apkmodule/APKModuleGraphExecutableMain.java:169— prelude/toolchains/android/src/com/facebook/buck/android/apkmodule/APKModuleGraphExecutableMain.java:169-175 | prelude/toolchains/android/src/com/facebook/buck/android/apkmodule/APKModuleGraphExecutableMain.java:191-198 | prelude/toolchains/android/src/com/facebook/buck/android/apkmodule/APKModuleGraphExecutableMain.java:206-213 — 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.
AC3 · Page structure· Page without a main landmark · ×5
Page without a main landmark app/buck2_explain/js/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div id="root">, so there is no content here to wrap — render the <main> from the component mounted into it.
Page without a main landmark app/buck2_explain/output_format_js/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div id="root">, so there is no content here to wrap — render the <main> from the component mounted into it.
Page without a main landmark app/buck2_trailcam/js/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div id="root">, so there is no content here to wrap — render the <main> from the component mounted into it.
Page without a main landmark explorer/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark starlark-rust/starlark_js_example/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
starlark::values::types::string::methods::string_methods (cyclomatic 83) starlark-rust/starlark/src/values/types/string/methods.rs:117— starlark::values::types::string::methods::string_methods has cyclomatic complexity 83 (threshold 15). Most of this is not in the body itself: 1 of the 83 points is its own statement and the rest belongs to 28 function items inside it that branch (split, rsplit, splitlines, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
starlark::values::types::string::interpolation::percent (cyclomatic 29) starlark-rust/starlark/src/values/types/string/interpolation.rs:191— starlark::values::types::string::interpolation::percent has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
starlark::values::types::int::globals::register_int::int (cyclomatic 26) starlark-rust/starlark/src/values/types/int/globals.rs:81— starlark::values::types::int::globals::register_int::int 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.
starlark::values::types::set::methods::set_methods (cyclomatic 23) starlark-rust/starlark/src/values/types/set/methods.rs:86— starlark::values::types::set::methods::set_methods has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 8 function items inside it that branch (difference, issuperset, issubset, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
starlark::stdlib::funcs::other::register_other (cyclomatic 16) starlark-rust/starlark/src/stdlib/funcs/other.rs:41— starlark::stdlib::funcs::other::register_other has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 6 function items inside it that branch (sorted, hash, fail, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Lexer::next (cyclomatic 50) starlark-rust/starlark_syntax/src/lexer.rs:664— Lexer::next has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Token::fmt (cyclomatic 85) 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.
Lexer::string (cyclomatic 22) starlark-rust/starlark_syntax/src/lexer.rs:338— Lexer::string has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Token::fmt (cyclomatic 85) 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.
Lexer::bytes_string (cyclomatic 21) starlark-rust/starlark_syntax/src/lexer.rs:511— Lexer::bytes_string has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Token::fmt (cyclomatic 85) 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.
Lexer::lex_fstring_content (cyclomatic 20) starlark-rust/starlark_syntax/src/lexer.rs:928— Lexer::lex_fstring_content has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Token::fmt (cyclomatic 85) 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.
Lexer::calculate_indent (cyclomatic 18) starlark-rust/starlark_syntax/src/lexer.rs:169— Lexer::calculate_indent has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: Token::fmt (cyclomatic 85) 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.
games::bin::sokoban_gen::generate_room (cyclomatic 45) games/bin/sokoban_gen.rs:42— games::bin::sokoban_gen::generate_room has cyclomatic complexity 45 (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.
games::games::run_game (cyclomatic 28) games/src/games.rs:579— games::games::run_game 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.
games::console::control_reader (cyclomatic 24) games/src/console.rs:134— games::console::control_reader has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
games::bin::sokoban_gen::expand_box_lines (cyclomatic 23) games/bin/sokoban_gen.rs:334— games::bin::sokoban_gen::expand_box_lines 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.
games::bin::sokoban_gen::find_farthest (cyclomatic 16) games/bin/sokoban_gen.rs:436— games::bin::sokoban_gen::find_farthest 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.
buck2_client_ctx::subscribers::superconsole::io::do_render (cyclomatic 28) app/buck2_client_ctx/src/subscribers/superconsole/io.rs:95— buck2_client_ctx::subscribers::superconsole::io::do_render has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buck2_client_ctx::agent_detection::classify (cyclomatic 22) app/buck2_client_ctx/src/agent_detection.rs:162— buck2_client_ctx::agent_detection::classify has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buck2_client_ctx::subscribers::classify_server_stderr::classify_server_stderr (cyclomatic 22) app/buck2_client_ctx/src/subscribers/classify_server_stderr.rs:22— buck2_client_ctx::subscribers::classify_server_stderr::classify_server_stderr has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buck2_client_ctx::daemon::daemon_windows::spawn_background_process_on_windows (cyclomatic 18) app/buck2_client_ctx/src/daemon/daemon_windows.rs:30— buck2_client_ctx::daemon::daemon_windows::spawn_background_process_on_windows has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (append_quoted, make_envp, make_command_line, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
buck2_client_ctx::subscribers::superconsole::lines_for_command_details (cyclomatic 16) app/buck2_client_ctx/src/subscribers/superconsole.rs:1663— buck2_client_ctx::subscribers::superconsole::lines_for_command_details 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.
Lexer::next (cognitive 120) starlark-rust/starlark_syntax/src/lexer.rs:664— Lexer::next has cognitive complexity 120 (threshold 15). Drivers by points: if/else 21 (100 pts), match/switch 3 (11 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 91). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer::string (cognitive 51) starlark-rust/starlark_syntax/src/lexer.rs:338— Lexer::string has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (38 pts), match/switch 3 (8 pts), boolean chains 3, loops 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer::bytes_string (cognitive 47) starlark-rust/starlark_syntax/src/lexer.rs:511— Lexer::bytes_string has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (34 pts), match/switch 3 (8 pts), boolean chains 3, loops 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer::lex_fstring_content (cognitive 36) starlark-rust/starlark_syntax/src/lexer.rs:928— Lexer::lex_fstring_content has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (24 pts), match/switch 4 (11 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer::calculate_indent (cognitive 22) starlark-rust/starlark_syntax/src/lexer.rs:169— Lexer::calculate_indent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 4 (8 pts), match/switch 2 (6 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.
buck2_action_impl::context::run::analysis_actions_methods_run::run (cognitive 62) app/buck2_action_impl/src/context/run.rs:261— buck2_action_impl::context::run::analysis_actions_methods_run::run has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (37 pts), loops 9 (15 pts), match/switch 7 (9 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_action_impl::actions::impls::run::dep_files::match_if_identical_action (cognitive 27) app/buck2_action_impl/src/actions/impls/run/dep_files.rs:1209— buck2_action_impl::actions::impls::run::dep_files::match_if_identical_action has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 4 (11 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_action_impl::actions::impls::run::dep_files::resolve_loaded_outputs (cognitive 23) app/buck2_action_impl/src/actions/impls/run/dep_files.rs:1520— buck2_action_impl::actions::impls::run::dep_files::resolve_loaded_outputs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 4 (8 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_action_impl::context::write::analysis_actions_methods_write::write (cognitive 20) app/buck2_action_impl/src/context/write.rs:323— buck2_action_impl::context::write::analysis_actions_methods_write::write has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, loops 3 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buck2_action_impl::actions::impls::declare_writes::declare_writes (cognitive 18) app/buck2_action_impl/src/actions/impls/declare_writes.rs:35— buck2_action_impl::actions::impls::declare_writes::declare_writes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_query_impls::dice::aquery::compute_tset_node (cognitive 44) app/buck2_query_impls/src/dice/aquery.rs:335— buck2_query_impls::dice::aquery::compute_tset_node has cognitive complexity 44 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 5 (11 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_query_impls::analysis::environment::get_from_template_placeholder_info (cognitive 28) app/buck2_query_impls/src/analysis/environment.rs:353— buck2_query_impls::analysis::environment::get_from_template_placeholder_info has cognitive complexity 28 (threshold 15). Drivers by points: if/else 4 (16 pts), loops 3 (10 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_query_impls::uquery::environment::rbuildfiles (cognitive 24) app/buck2_query_impls/src/uquery/environment.rs:499— buck2_query_impls::uquery::environment::rbuildfiles has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 6 (11 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.
buck2_query_impls::analysis::environment::get_template_info_provider_artifacts (cognitive 20) app/buck2_query_impls/src/analysis/environment.rs:301— buck2_query_impls::analysis::environment::get_template_info_provider_artifacts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (9 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
buck2_query_impls::aquery::find_matching_action::find_matching_action (cognitive 20) app/buck2_query_impls/src/aquery/find_matching_action.rs:60— buck2_query_impls::aquery::find_matching_action::find_matching_action has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 4 (7 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreState::fork (cognitive 39) dice/dice_core/src/fork.rs:29— CoreState::fork has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 8 (11 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.
CoreState::check_attachment (cognitive 21) dice/dice_core/src/invariants.rs:165— CoreState::check_attachment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreState::resolve (cognitive 18) dice/dice_core/src/resolve.rs:139— CoreState::resolve has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 2 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreState::materialize_inheritance (cognitive 18) dice/dice_core/src/state.rs:287— CoreState::materialize_inheritance has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2, 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.
CoreState::close_dependents (cognitive 16) dice/dice_core/src/commit.rs:117— CoreState::close_dependents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 4 (5 pts), match/switch 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (4 members, 50+ identical tokens) app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:324— app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:324-353 | app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:437-466 | app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:470-511 | app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/worker_info.rs:113-142 — 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) app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs:345— app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs:345-401 | app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs:489-523 | app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs:586-624 | app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs:757-790 — 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) app/buck2_file_watcher/src/edenfs/interface.rs:865— app/buck2_file_watcher/src/edenfs/interface.rs:865-883 | app/buck2_file_watcher/src/fs_hash_crawler.rs:103-121 | app/buck2_file_watcher/src/notify.rs:339-357 | app/buck2_file_watcher/src/watchman/interface.rs:442-460 — 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) tools/retrace/src/ingest/testlog.rs:868— tools/retrace/src/ingest/testlog.rs:868-929 | tools/retrace/src/ingest/testlog.rs:1433-1537 | tools/retrace/src/ingest/testlog.rs:1544-1645 | tools/retrace/src/ingest/testlog.rs:1654-1761 — 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) docs/developers/perf/scripts/frag_symbolize.py:86— docs/developers/perf/scripts/frag_symbolize.py:86-103 | docs/developers/perf/scripts/heap_aggregate.py:72-90 | docs/developers/perf/scripts/heap_diff.py:63-86 | docs/developers/perf/scripts/heap_stacks.py:104-127 — 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.
Duplicated block (28 lines × 2) app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:326— app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:326-353 | app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/worker_info.rs:115-142 — 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 (28 lines × 2) starlark-rust/starlark_derive/src/starlark_pagable.rs:672— starlark-rust/starlark_derive/src/starlark_pagable.rs:672-699 | starlark-rust/starlark_derive/src/starlark_pagable.rs:712-739 — both copies are in the same file, so extract the 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 (28 lines × 2) tools/retrace/src/ingest/testlog.rs:1610— tools/retrace/src/ingest/testlog.rs:1610-1637 | tools/retrace/src/ingest/testlog.rs:1726-1753 — both copies are in the same file, so extract the 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 (28 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:52— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:52-79 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:55-82 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 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 (28 lines × 2) app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:536— app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:536-563 | app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/internal_runner_test_info.rs:544-571 — before extracting anything, compare `app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs` and `app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/internal_runner_test_info.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:248— app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:248-260 | app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:276-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) app/buck2_cmd_log_client/src/show_log.rs:36— app/buck2_cmd_log_client/src/show_log.rs:36-48 | app/buck2_cmd_log_client/src/show_user_log.rs:37-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.
Duplicated block (13–14 lines × 2) app/buck2_execute_impl/src/executors/action_cache.rs:284— app/buck2_execute_impl/src/executors/action_cache.rs:284-296 | app/buck2_execute_impl/src/executors/action_cache.rs:354-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) prelude/toolchains/android/src/com/facebook/buck/android/dex/JarSplitterExecutableMain.java:96— prelude/toolchains/android/src/com/facebook/buck/android/dex/JarSplitterExecutableMain.java:96-108 | prelude/toolchains/android/src/com/facebook/buck/android/dex/MultiDexExecutableMain.java:590-603 — before extracting anything, compare `prelude/toolchains/android/src/com/facebook/buck/android/dex/JarSplitterExecutableMain.java` and `prelude/toolchains/android/src/com/facebook/buck/android/dex/MultiDexExecutableMain.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/android/src/com/facebook/buck/android/dex/JarSplitterExecutableMain.java:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–14 lines × 2) prelude/java/tools/fat_jar.py:252— prelude/java/tools/fat_jar.py:252-264 | prelude/kotlin/tools/compile_kotlin/compile_kotlin.py:579-592 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `prelude/java/tools/fat_jar.py:251` calls `log_message`, `format` and `prelude/kotlin/tools/compile_kotlin/compile_kotlin.py:577` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 2) app/buck2_event_observer/src/debug_events.rs:90— app/buck2_event_observer/src/debug_events.rs:90-99 | app/buck2_event_observer/src/debug_events.rs:111-121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:681— app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:681-691 | app/buck2_execute_impl/src/materializers/v2/clean_stale.rs:332-341 — `app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs` and `app/buck2_execute_impl/src/materializers/v2/clean_stale.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10–11 lines × 2) app/buck2_node/src/nodes/configured.rs:883— app/buck2_node/src/nodes/configured.rs:883-892 | app/buck2_node/src/nodes/unconfigured.rs:864-874 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10–11 lines × 2) games/src/games/life.rs:268— games/src/games/life.rs:268-278 | games/src/games/life.rs:284-293 — both copies are in the same file, so extract the 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–11 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/cd/ErrorInterceptor.java:357— prelude/toolchains/android/src/com/facebook/buck/jvm/cd/ErrorInterceptor.java:357-366 | prelude/toolchains/android/src/com/facebook/buck/jvm/cd/ErrorInterceptor.java:371-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `prelude/toolchains/android/src/com/facebook/buck/jvm/cd/ErrorInterceptor.java:383` calls `group` and `prelude/toolchains/android/src/com/facebook/buck/jvm/cd/ErrorInterceptor.java:366` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) starlark-rust/starlark/src/values/types/set/methods.rs:178— starlark-rust/starlark/src/values/types/set/methods.rs:178-182 | starlark-rust/starlark/src/values/types/set/methods.rs:241-245 | starlark-rust/starlark/src/values/types/set/methods.rs:277-281 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) starlark-rust/starlark/src/values/types/string/methods.rs:699— starlark-rust/starlark/src/values/types/string/methods.rs:699-703 | starlark-rust/starlark/src/values/types/string/methods.rs:995-999 | starlark-rust/starlark/src/values/types/string/methods.rs:1200-1204 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) starlark-rust/starlark/src/values/types/array.rs:338— starlark-rust/starlark/src/values/types/array.rs:338-342 | starlark-rust/starlark/src/values/types/list/value.rs:389-393 | starlark-rust/starlark/src/values/types/tuple/value.rs:193-197 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (5 lines × 3) starlark-rust/starlark/src/values/layout/avalues/complex.rs:82— starlark-rust/starlark/src/values/layout/avalues/complex.rs:82-86 | starlark-rust/starlark/src/values/layout/avalues/complex_no_freeze.rs:84-88 | starlark-rust/starlark/src/values/layout/avalues/simple.rs:168-172 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (5 lines × 3) prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:415— prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:415-419 | prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:428-432 | prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:441-445 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (26 lines × 2) app/buck2_util/src/rtabort.rs:38— app/buck2_util/src/rtabort.rs:38-63 | starlark-rust/starlark/src/util/rtabort.rs:46-71 — 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 (26 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:253— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:253-278 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:256-281 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 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 (26 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/java17/SourceVersionUtils.java:20— prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/java17/SourceVersionUtils.java:20-45 | prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/java21/SourceVersionUtils.java:20-45 — `prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/java17/SourceVersionUtils.java` and `prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/java21/SourceVersionUtils.java` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 2 separate duplicated blocks between them, totalling at least 51 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 `prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/java17/SourceVersionUtils.java:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26 lines × 2) prelude/cxx/dist_lto/tools/dist_lto_prepare_darwin.py:116— prelude/cxx/dist_lto/tools/dist_lto_prepare_darwin.py:116-141 | prelude/cxx/dist_lto/tools/dist_lto_prepare_gnu.py:119-144 — before extracting anything, compare `prelude/cxx/dist_lto/tools/dist_lto_prepare_darwin.py` and `prelude/cxx/dist_lto/tools/dist_lto_prepare_gnu.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26 lines × 2) prelude/toolchains/conan/conan_package.py:179— prelude/toolchains/conan/conan_package.py:179-204 | prelude/toolchains/conan/conan_package_extract.py:29-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/conan/conan_package.py:179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
buck2_client::commands::clean::clean_buck_out_pass (cognitive 50) app/buck2_client/src/commands/clean.rs:617— buck2_client::commands::clean::clean_buck_out_pass has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 7 (17 pts), loops 5 (9 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.
buck2_client::commands::clean::clean (cognitive 26) app/buck2_client/src/commands/clean.rs:267— buck2_client::commands::clean::clean has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_client::commands::build::out::copy_to_out (cognitive 16) app/buck2_client/src/commands/build/out.rs:87— buck2_client::commands::build::out::copy_to_out has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (5 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_client::commands::build::out::enqueue_directory (cognitive 16) app/buck2_client/src/commands/build/out.rs:266— buck2_client::commands::build::out::enqueue_directory has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatefulSuperConsoleImpl::handle_games_control (cognitive 45) app/buck2_client_ctx/src/subscribers/superconsole.rs:1362— StatefulSuperConsoleImpl::handle_games_control has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (40 pts), match/switch 3 (5 pts) (nesting depth added 25). 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.
StatefulSuperConsoleImpl::handle_action_error (cognitive 31) app/buck2_client_ctx/src/subscribers/superconsole.rs:1074— StatefulSuperConsoleImpl::handle_action_error has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 1 (5 pts), match/switch 2 (4 pts) (nesting depth added 21). 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.
StatefulSuperConsoleImpl::handle_console_interaction (cognitive 25) app/buck2_client_ctx/src/subscribers/superconsole.rs:1191— StatefulSuperConsoleImpl::handle_console_interaction has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 5 (8 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.
StatefulSuperConsoleImpl::tick (cognitive 22) app/buck2_client_ctx/src/subscribers/superconsole.rs:1476— StatefulSuperConsoleImpl::tick has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteExecutionClientImpl::new (cognitive 40) app/buck2_execute/src/re/client.rs:770— RemoteExecutionClientImpl::new has cognitive complexity 40 (threshold 15). Drivers by points: if/else 24 (29 pts), match/switch 3 (7 pts), boolean chains 4 (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.
RemoteExecutionClientImpl::execute_impl::wait_for_response_or_stage_change (cognitive 34) app/buck2_execute/src/re/client.rs:1282— RemoteExecutionClientImpl::execute_impl::wait_for_response_or_stage_change has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (RemoteExecutionClientImpl::execute_impl) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RemoteExecutionClientImpl::execute_impl (cognitive 21) app/buck2_execute/src/re/client.rs:1243— RemoteExecutionClientImpl::execute_impl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (38 pts), match/switch 7 (14 pts), boolean chains 3, loops 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (RemoteExecutionClientImpl::execute_impl::wait_for_response_or_stage_change) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RemoteExecutionClientImpl::execute (cognitive 19) app/buck2_execute/src/re/client.rs:1605— RemoteExecutionClientImpl::execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
buck2_cmd_audit_server::providers::server_execute_with_dice (cognitive 39) app/buck2_cmd_audit_server/src/providers.rs:55— buck2_cmd_audit_server::providers::server_execute_with_dice has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 5 (9 pts), match/switch 2 (7 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_cmd_audit_server::subtargets::server_execute_with_dice (cognitive 37) app/buck2_cmd_audit_server/src/subtargets.rs:51— buck2_cmd_audit_server::subtargets::server_execute_with_dice has cognitive complexity 37 (threshold 15). Drivers by points: loops 7 (22 pts), if/else 8 (13 pts), match/switch 1 (2 pts) (nesting depth added 21). Of this number, 27 points are the body's own statements and 10 belong to 2 function items inside it that branch. 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.
buck2_cmd_audit_server::visibility::verify_visibility (cognitive 21) app/buck2_cmd_audit_server/src/visibility.rs:49— buck2_cmd_audit_server::visibility::verify_visibility has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (6 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_cmd_audit_server::output::buck_out_path_parser::get_cell_path (cognitive 19) app/buck2_cmd_audit_server/src/output/buck_out_path_parser.rs:153— buck2_cmd_audit_server::output::buck_out_path_parser::get_cell_path has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
BazelContext::get_filesystem_entries (cognitive 34) starlark-rust/starlark_bin/bin/bazel.rs:502— BazelContext::get_filesystem_entries has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (26 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BazelContext::get_string_completion_options (cognitive 26) starlark-rust/starlark_bin/bin/bazel.rs:797— BazelContext::get_string_completion_options has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 11, match/switch 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BazelContext::get_repository_names (cognitive 22) starlark-rust/starlark_bin/bin/bazel.rs:478— BazelContext::get_repository_names has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 1 (3 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BazelContext::resolve_folder (cognitive 17) starlark-rust/starlark_bin/bin/bazel.rs:401— BazelContext::resolve_folder has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 4 (8 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Ready::poll_graph (cognitive 32) tools/retrace/src/gui.rs:1640— Ready::poll_graph has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (20 pts), match/switch 5 (12 pts) (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Ready::respawn_cp_sim (cognitive 23) tools/retrace/src/gui.rs:1422— Ready::respawn_cp_sim has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 3 (6 pts), loops 2 (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.
Ready::ensure_cp_savings (cognitive 19) tools/retrace/src/gui.rs:1565— Ready::ensure_cp_savings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Ready::new_with_pending_graph (cognitive 16) tools/retrace/src/gui.rs:907— Ready::new_with_pending_graph has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_wrapper_common::killall (cognitive 20) app/buck2_wrapper_common/src/lib.rs:276— buck2_wrapper_common::killall has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (7 pts), match/switch 4 (7 pts), if/else 4 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_wrapper_common::cleanall::discovery::find_lifecycle_markers (cognitive 18) app/buck2_wrapper_common/src/cleanall/discovery.rs:50— buck2_wrapper_common::cleanall::discovery::find_lifecycle_markers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_wrapper_common::find_buck2_processes (cognitive 17) app/buck2_wrapper_common/src/lib.rs:194— buck2_wrapper_common::find_buck2_processes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2, boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_wrapper_common::is_buck2::is_buck2_exe (cognitive 17) app/buck2_wrapper_common/src/is_buck2.rs:25— buck2_wrapper_common::is_buck2::is_buck2_exe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Duplicated block (20 lines × 2) remote_execution/oss/re_grpc/src/client.rs:2010— remote_execution/oss/re_grpc/src/client.rs:2010-2029 | remote_execution/oss/re_grpc/src/pool.rs:70-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (20 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compose/ComposerParamInjector.kt:206— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compose/ComposerParamInjector.kt:206-225 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compose/ComposerParamInjector.kt:230-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compose/ComposerParamInjector.kt:206` it begins part-way through the construct above it, so those exact lines 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) prelude/toolchains/android/src/com/facebook/buck/util/zip/AppendableCentralDirectory.java:88— prelude/toolchains/android/src/com/facebook/buck/util/zip/AppendableCentralDirectory.java:88-107 | prelude/toolchains/android/src/com/facebook/buck/util/zip/CentralDirectoryReader.java:101-120 — 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 `prelude/toolchains/android/src/com/facebook/buck/util/zip/AppendableCentralDirectory.java:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) prelude/cxx/dist_lto/tools/dist_lto_prepare_darwin.py:94— prelude/cxx/dist_lto/tools/dist_lto_prepare_darwin.py:94-113 | prelude/cxx/dist_lto/tools/dist_lto_prepare_gnu.py:97-116 — before extracting anything, compare `prelude/cxx/dist_lto/tools/dist_lto_prepare_darwin.py` and `prelude/cxx/dist_lto/tools/dist_lto_prepare_gnu.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:377— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:377-392 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:345-360 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/cquery.rs` and `app/buck2_bxl/src/bxl/starlark_defs/uquery.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 183 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) tools/retrace/src/ingest/testlog.rs:1846— tools/retrace/src/ingest/testlog.rs:1846-1861 | tools/retrace/src/ingest/testlog.rs:2015-2030 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:388— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:388-403 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:479-494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:388` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) dice/dice_tests/src/legacy/projection.rs:151— dice/dice_tests/src/legacy/projection.rs:151-166 | dice/dice_tests/src/projection/smoke.rs:160-175 — before extracting anything, compare `dice/dice_tests/src/legacy/projection.rs` and `dice/dice_tests/src/projection/smoke.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:340— app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:340-350 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:556-566 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:618-628 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/aquery.rs` and `app/buck2_bxl/src/bxl/starlark_defs/uquery.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) app/buck2_bxl/src/bxl/starlark_defs/cli_args.rs:561— app/buck2_bxl/src/bxl/starlark_defs/cli_args.rs:561-571 | app/buck2_bxl/src/bxl/starlark_defs/cli_args.rs:579-589 | app/buck2_bxl/src/bxl/starlark_defs/cli_args.rs:597-607 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) app/buck2_client/src/commands/lsp.rs:93— app/buck2_client/src/commands/lsp.rs:93-103 | app/buck2_client/src/commands/subscribe.rs:175-185 | app/buck2_cmd_starlark_client/src/debug.rs:124-134 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (11 lines × 3) app/buck2_configuration_providers/src/configuration_info.rs:311— app/buck2_configuration_providers/src/configuration_info.rs:311-321 | app/buck2_configuration_providers/src/configuration_info.rs:362-372 | app/buck2_configuration_providers/src/configuration_info.rs:413-423 — 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.
ExecutionUi::show (cyclomatic 40) tools/retrace/src/gui/execution_ui.rs:402— ExecutionUi::show 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.
ExecutionUi::fetch_ui (cyclomatic 25) tools/retrace/src/gui/execution_ui.rs:640— ExecutionUi::fetch_ui 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.
ExecutionUi::poll (cyclomatic 17) tools/retrace/src/gui/execution_ui.rs:224— ExecutionUi::poll 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.
Activity::read_spans (cyclomatic 39) tools/retrace/src/activity.rs:219— Activity::read_spans has cyclomatic complexity 39 (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.
Activity::explain (cyclomatic 29) tools/retrace/src/activity.rs:329— Activity::explain has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Activity::from_record (cyclomatic 18) tools/retrace/src/activity.rs:113— Activity::from_record 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.
RemoteExecutionClientImpl::new (cyclomatic 29) app/buck2_execute/src/re/client.rs:770— RemoteExecutionClientImpl::new has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RemoteExecutionClientImpl::execute (cyclomatic 18) app/buck2_execute/src/re/client.rs:1605— RemoteExecutionClientImpl::execute has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RemoteExecutionClientImpl::execute_impl::wait_for_response_or_stage_change (cyclomatic 16) app/buck2_execute/src/re/client.rs:1282— RemoteExecutionClientImpl::execute_impl::wait_for_response_or_stage_change 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.
TypingOracleCtx::expr_bin_op_ty_basic_lhs (cyclomatic 23) starlark-rust/starlark/src/typing/oracle/ctx.rs:602— TypingOracleCtx::expr_bin_op_ty_basic_lhs 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. This is NOT this file's highest cyclomatic complexity: TypingOracleCtx::intersects_one_side (cyclomatic 25) 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.
TypingOracleCtx::validate_args (cyclomatic 22) starlark-rust/starlark/src/typing/oracle/ctx.rs:189— TypingOracleCtx::validate_args has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: TypingOracleCtx::intersects_one_side (cyclomatic 25) 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.
TypingOracleCtx::expr_bin_op (cyclomatic 19) starlark-rust/starlark/src/typing/oracle/ctx.rs:812— TypingOracleCtx::expr_bin_op has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: TypingOracleCtx::intersects_one_side (cyclomatic 25) 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.
Expr::render (cognitive 66) tools/starlark_fmt/lib/fuzz_starlark.rs:619— Expr::render has cognitive complexity 66 (threshold 15). Drivers by points: if/else 17 (39 pts), loops 9 (22 pts), match/switch 3 (5 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Expr::fmt (cognitive 21) app/buck2_query_parser/src/lib.rs:131— Expr::fmt has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (8 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Expr::fmt (cognitive 20) starlark-rust/starlark_syntax/src/syntax/ast.rs:554— Expr::fmt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ExecutionUi::show (cognitive 63) tools/retrace/src/gui/execution_ui.rs:402— ExecutionUi::show has cognitive complexity 63 (threshold 15). Drivers by points: if/else 36 (52 pts), boolean chains 5, match/switch 2 (5 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecutionUi::fetch_ui (cognitive 55) tools/retrace/src/gui/execution_ui.rs:640— ExecutionUi::fetch_ui has cognitive complexity 55 (threshold 15). Drivers by points: if/else 21 (50 pts), boolean chains 5 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ExecutionUi::poll (cognitive 22) tools/retrace/src/gui/execution_ui.rs:224— ExecutionUi::poll has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 6 (10 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BuildReportCollector::convert (cognitive 58) app/buck2_build_api/src/build/build_report.rs:399— BuildReportCollector::convert has cognitive complexity 58 (threshold 15). Drivers by points: if/else 15 (41 pts), loops 7 (15 pts), match/switch 1 (2 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BuildReportCollector::collect_results_for_configured (cognitive 37) app/buck2_build_api/src/build/build_report.rs:861— BuildReportCollector::collect_results_for_configured has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (5 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildReportCollector::collect_results_for_unconfigured (cognitive 20) app/buck2_build_api/src/build/build_report.rs:750— BuildReportCollector::collect_results_for_unconfigured has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_interpreter_for_build::rule::validate_execution_groups (cognitive 50) app/buck2_interpreter_for_build/src/rule.rs:485— buck2_interpreter_for_build::rule::validate_execution_groups has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (26 pts), match/switch 8 (17 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_interpreter_for_build::attrs::coerce::coerced_attr::coerce_inner (cognitive 49) app/buck2_interpreter_for_build/src/attrs/coerce/coerced_attr.rs:89— buck2_interpreter_for_build::attrs::coerce::coerced_attr::coerce_inner has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (32 pts), match/switch 3 (13 pts), loops 1 (4 pts) (nesting depth added 33). 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.
buck2_interpreter_for_build::interpreter::functions::xml::parse_xml (cognitive 38) app/buck2_interpreter_for_build/src/interpreter/functions/xml.rs:78— buck2_interpreter_for_build::interpreter::functions::xml::parse_xml has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (26 pts), match/switch 3 (8 pts), loops 2 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypingOracleCtx::validate_args (cognitive 42) starlark-rust/starlark/src/typing/oracle/ctx.rs:189— TypingOracleCtx::validate_args has cognitive complexity 42 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 7 (13 pts), match/switch 3 (8 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypingOracleCtx::expr_bin_op_ty_basic_lhs (cognitive 39) starlark-rust/starlark/src/typing/oracle/ctx.rs:602— TypingOracleCtx::expr_bin_op_ty_basic_lhs has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (32 pts), match/switch 4 (7 pts) (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TypingOracleCtx::params_intersect (cognitive 22) starlark-rust/starlark/src/typing/oracle/ctx.rs:898— TypingOracleCtx::params_intersect has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RunAction::execute (cognitive 33) app/buck2_action_impl/src/actions/impls/run.rs:1729— RunAction::execute has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 5, loops 1 (3 pts), match/switch 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RunAction::execute_inner (cognitive 27) app/buck2_action_impl/src/actions/impls/run.rs:1213— RunAction::execute_inner has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 4, match/switch 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RunAction::expand_command_line_and_worker (cognitive 16) app/buck2_action_impl/src/actions/impls/run.rs:635— RunAction::expand_command_line_and_worker has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Activity::from_record (cognitive 33) tools/retrace/src/activity.rs:113— Activity::from_record has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 3 (8 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Activity::explain (cognitive 30) tools/retrace/src/activity.rs:329— Activity::explain has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Activity::read_spans (cognitive 27) tools/retrace/src/activity.rs:219— Activity::read_spans has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, 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.
buck2_configured::nodes::gather_deps (cognitive 30) app/buck2_configured/src/nodes.rs:538— buck2_configured::nodes::gather_deps has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 6 (12 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_configured::nodes::compute_configured_target_node_no_transition (cognitive 25) app/buck2_configured/src/nodes.rs:1131— buck2_configured::nodes::compute_configured_target_node_no_transition has cognitive complexity 25 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 8, boolean chains 3, match/switch 2 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
buck2_configured::nodes::resolve_transition_input_attrs (cognitive 20) app/buck2_configured/src/nodes.rs:860— buck2_configured::nodes::resolve_transition_input_attrs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
remote_execution::client::upload_impl (cognitive 29) remote_execution/oss/re_grpc/src/client.rs:1689— remote_execution::client::upload_impl has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 5 (6 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 8). Of this number, 27 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
remote_execution::client::download_impl (cognitive 28) remote_execution/oss/re_grpc/src/client.rs:1447— remote_execution::client::download_impl has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (22 pts), loops 4 (5 pts), match/switch 1 (nesting depth added 6). Of this number, 26 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, 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.
remote_execution::client::is_retryable (cognitive 20) remote_execution/oss/re_grpc/src/client.rs:604— remote_execution::client::is_retryable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParserRd::parse_index_or_slice (cognitive 29) starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:885— ParserRd::parse_index_or_slice has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParserRd::parse_atom (cognitive 22) starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:953— ParserRd::parse_atom has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 4 (13 pts), if/else 2 (7 pts), loops 1 (2 pts) (nesting depth added 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. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ParserRd::parse_expr (cognitive 18) starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:768— ParserRd::parse_expr has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_execute::directory::expand_selector_for_dependencies (cognitive 26) app/buck2_execute/src/directory.rs:727— buck2_execute::directory::expand_selector_for_dependencies has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 5 (15 pts), loops 3 (6 pts), if/else 2 (5 pts) (nesting depth added 16). 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.
buck2_execute::blob_store::collect (cognitive 25) app/buck2_execute/src/blob_store.rs:476— buck2_execute::blob_store::collect has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 4 (8 pts), match/switch 2 (7 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.
buck2_execute::materialize::http::copy_and_hash (cognitive 22) app/buck2_execute/src/materialize/http.rs:310— buck2_execute::materialize::http::copy_and_hash has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rust_project::buck::to_project_json (cognitive 23) integrations/rust-project/src/buck.rs:69— rust_project::buck::to_project_json has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rust_project::buck::check_cycles_in_crate_graph (cognitive 23) integrations/rust-project/src/buck.rs:307— rust_project::buck::check_cycles_in_crate_graph has cognitive complexity 23 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 2 (10 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
rust_project::buck::merge_unit_test_targets (cognitive 17) integrations/rust-project/src/buck.rs:474— rust_project::buck::merge_unit_test_targets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (22 lines × 2) app/buck2_cmd_audit_client/src/lib.rs:106— app/buck2_cmd_audit_client/src/lib.rs:106-127 | app/buck2_cmd_audit_server/src/lib.rs:85-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (22 lines × 2) app/buck2_file_watcher/src/edenfs/interface.rs:294— app/buck2_file_watcher/src/edenfs/interface.rs:294-315 | app/buck2_file_watcher/src/edenfs/interface.rs:335-356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) app/buck2_node/src/attrs/attr_type/arg.rs:303— app/buck2_node/src/attrs/attr_type/arg.rs:303-324 | app/buck2_node/src/attrs/attr_type/arg.rs:432-453 — both copies are in the same file, so extract the 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 × 3) tools/retrace/src/ingest/testlog.rs:1524— tools/retrace/src/ingest/testlog.rs:1524-1533 | tools/retrace/src/ingest/testlog.rs:1632-1641 | tools/retrace/src/ingest/testlog.rs:1748-1757 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) app/buck2_cmd_targets_server/src/targets.rs:156— app/buck2_cmd_targets_server/src/targets.rs:156-165 | app/buck2_server_commands/src/install.rs:196-205 | app/buck2_test/src/command.rs:346-355 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10 lines × 3) starlark-rust/starlark/src/values/types/string/interpolation.rs:255— starlark-rust/starlark/src/values/types/string/interpolation.rs:255-264 | starlark-rust/starlark/src/values/types/string/interpolation.rs:282-291 | starlark-rust/starlark/src/values/types/string/interpolation.rs:309-318 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:325— app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:325-333 | app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:438-446 | app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:471-479 | app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/worker_info.rs:114-122 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 4) app/buck2_bxl/src/bxl/starlark_defs/lazy_ctx/operation/uquery.rs:152— app/buck2_bxl/src/bxl/starlark_defs/lazy_ctx/operation/uquery.rs:152-160 | app/buck2_bxl/src/bxl/starlark_defs/lazy_ctx/operation/uquery.rs:168-176 | app/buck2_bxl/src/bxl/starlark_defs/lazy_ctx/operation/uquery.rs:225-233 | app/buck2_bxl/src/bxl/starlark_defs/lazy_ctx/operation/uquery.rs:246-254 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) app/buck2_file_watcher/src/edenfs/interface.rs:875— app/buck2_file_watcher/src/edenfs/interface.rs:875-883 | app/buck2_file_watcher/src/fs_hash_crawler.rs:113-121 | app/buck2_file_watcher/src/notify.rs:349-357 | app/buck2_file_watcher/src/watchman/interface.rs:452-460 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (5 lines × 4) starlark-rust/starlark/src/values/types/string/methods.rs:286— starlark-rust/starlark/src/values/types/string/methods.rs:286-290 | starlark-rust/starlark/src/values/types/string/methods.rs:387-391 | starlark-rust/starlark/src/values/types/string/methods.rs:834-838 | starlark-rust/starlark/src/values/types/string/methods.rs:869-873 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 4) app/buck2_bxl/src/bxl/starlark_defs/nodes/action.rs:71— app/buck2_bxl/src/bxl/starlark_defs/nodes/action.rs:71-75 | app/buck2_bxl/src/bxl/starlark_defs/nodes/action.rs:139-143 | app/buck2_bxl/src/bxl/starlark_defs/nodes/configured.rs:241-245 | app/buck2_bxl/src/bxl/starlark_defs/nodes/unconfigured.rs:69-73 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/nodes/configured.rs` and `app/buck2_bxl/src/bxl/starlark_defs/nodes/unconfigured.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:549— prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:549-554 | prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:565-569 | prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:571-575 | prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:578-583 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (25 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/java17/SourceVersionUtils.java:53— prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/java17/SourceVersionUtils.java:53-77 | prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/java21/SourceVersionUtils.java:55-79 — `prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/java17/SourceVersionUtils.java` and `prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/java21/SourceVersionUtils.java` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 2 separate duplicated blocks between them, totalling at least 51 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 `prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/java17/SourceVersionUtils.java:53` it does not close everything it opens, so those 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 (25 lines × 2) dice/dice_tests/src/legacy/projection.rs:90— dice/dice_tests/src/legacy/projection.rs:90-114 | dice/dice_tests/src/projection/smoke.rs:97-121 — before extracting anything, compare `dice/dice_tests/src/legacy/projection.rs` and `dice/dice_tests/src/projection/smoke.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) docs/developers/perf/scripts/heap_diff.py:131— docs/developers/perf/scripts/heap_diff.py:131-155 | docs/developers/perf/scripts/heap_stacks.py:76-100 — before extracting anything, compare `docs/developers/perf/scripts/heap_diff.py` and `docs/developers/perf/scripts/heap_stacks.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 3) prelude/kotlin/tools/compile_kotlin/compile_kotlin.py:91— prelude/kotlin/tools/compile_kotlin/compile_kotlin.py:91-108 | prelude/kotlin/tools/compile_kotlin/compile_kotlin.py:133-150 | prelude/kotlin/tools/compile_kotlin/compile_kotlin.py:161-178 — 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 `prelude/kotlin/tools/compile_kotlin/compile_kotlin.py:91` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 3) prelude/toolchains/conan/conan_generate.py:121— prelude/toolchains/conan/conan_generate.py:121-138 | prelude/toolchains/conan/conan_init.py:35-52 | prelude/toolchains/conan/conan_update.py:88-105 — before extracting anything, compare `prelude/toolchains/conan/conan_generate.py` and `prelude/toolchains/conan/conan_update.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/conan/conan_generate.py: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 (18 lines × 3) prelude/toolchains/conan/conan_lock.py:69— prelude/toolchains/conan/conan_lock.py:69-86 | prelude/toolchains/conan/conan_package.py:110-127 | prelude/toolchains/conan/conan_package.py:174-191 — before extracting anything, compare `prelude/toolchains/conan/conan_lock.py` and `prelude/toolchains/conan/conan_package.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/conan/conan_lock.py:69` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) prelude/apple/tools/bundling/main.py:116— prelude/apple/tools/bundling/main.py:116-133 | prelude/apple/tools/bundling/main.py:146-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/apple/tools/bundling/main.py:116` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) prelude/apple/tools/bundling/main.py:130— prelude/apple/tools/bundling/main.py:130-147 | prelude/apple/tools/bundling/resolve_signing_context_main.py:29-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/apple/tools/bundling/main.py:130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) prelude/apple/tools/bundling/signing_context.py:114— prelude/apple/tools/bundling/signing_context.py:114-131 | prelude/toolchains/conan/lock_generate.py:98-115 — 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 `prelude/apple/tools/bundling/signing_context.py:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (34 lines × 2 locations) app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts:197— app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts:197 · app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts:270 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (34 lines × 2 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:290— app/buck2_trailcam/js/src/lib/proto/bundle.js:290 · app/buck2_trailcam/js/src/lib/proto/bundle.js:381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (34 lines × 2 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:22759— app/buck2_trailcam/js/src/lib/proto/bundle.js:22759 · app/buck2_trailcam/js/src/lib/proto/bundle.js:25249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2 locations) app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:401— app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:401 · app/buck2_trailcam/js/src/components/invocation/TestResultsTab.tsx:98 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (19 lines × 2 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:1120— app/buck2_trailcam/js/src/lib/proto/bundle.js:1120 · app/buck2_trailcam/js/src/lib/proto/bundle.js:2634 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (19 lines × 2 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:14783— app/buck2_trailcam/js/src/lib/proto/bundle.js:14783 · app/buck2_trailcam/js/src/lib/proto/bundle.js:16058 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Focus outline removed inline app/buck2_trailcam/js/src/ui/Input.tsx:26— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline app/buck2_trailcam/js/src/ui/Tabs.tsx:206— <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
InvocationRecorder::handle_snapshot (cyclomatic 58) app/buck2_client_ctx/src/subscribers/recorder.rs:2132— InvocationRecorder::handle_snapshot has cyclomatic complexity 58 (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.
InvocationRecorder::handle_action_execution_end (cyclomatic 17) app/buck2_client_ctx/src/subscribers/recorder.rs:1621— InvocationRecorder::handle_action_execution_end has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: InvocationRecorder::handle_event (cyclomatic 51) 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.
buck2_event_observer::display::display_event (cyclomatic 54) app/buck2_event_observer/src/display.rs:319— buck2_event_observer::display::display_event has cyclomatic complexity 54 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buck2_event_observer::display::display_executor_stage (cyclomatic 33) app/buck2_event_observer/src/display.rs:664— buck2_event_observer::display::display_executor_stage has cyclomatic complexity 33 (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.
Collector::event (cyclomatic 46) tools/retrace/src/ingest/profile.rs:307— Collector::event has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Collector::result (cyclomatic 16) tools/retrace/src/ingest/profile.rs:245— Collector::result has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: retrace::ingest::profile::command_kind (cyclomatic 24) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
buck2_action_impl::context::run::analysis_actions_methods_run::run (cyclomatic 45) app/buck2_action_impl/src/context/run.rs:261— buck2_action_impl::context::run::analysis_actions_methods_run::run has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buck2_action_impl::context::write::analysis_actions_methods_write (cyclomatic 22) app/buck2_action_impl/src/context/write.rs:146— buck2_action_impl::context::write::analysis_actions_methods_write has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 3 function items inside it that branch (write, write_json, write::count_write_to_file_macros). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Expr::render (cyclomatic 42) tools/starlark_fmt/lib/fuzz_starlark.rs:619— Expr::render has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Expr::fmt (cyclomatic 28) starlark-rust/starlark_syntax/src/syntax/ast.rs:554— Expr::fmt has cyclomatic complexity 28 (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.
StatefulSuperConsoleImpl::handle_console_interaction (cyclomatic 36) app/buck2_client_ctx/src/subscribers/superconsole.rs:1191— StatefulSuperConsoleImpl::handle_console_interaction 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.
StatefulSuperConsoleImpl::handle_games_control (cyclomatic 23) app/buck2_client_ctx/src/subscribers/superconsole.rs:1362— StatefulSuperConsoleImpl::handle_games_control 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.
buck2_interpreter_for_build::rule::validate_execution_groups (cyclomatic 32) app/buck2_interpreter_for_build/src/rule.rs:485— buck2_interpreter_for_build::rule::validate_execution_groups has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buck2_interpreter_for_build::interpreter::functions::xml::parse_xml (cyclomatic 19) app/buck2_interpreter_for_build/src/interpreter/functions/xml.rs:78— buck2_interpreter_for_build::interpreter::functions::xml::parse_xml 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.
buck2_execute_impl::materializers::deferred::clean_stale::create_clean_fut (cyclomatic 29) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:1120— buck2_execute_impl::materializers::deferred::clean_stale::create_clean_fut has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buck2_execute_impl::materializers::deferred::clean_stale::apply_adaptive_low_disk (cyclomatic 20) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:2049— buck2_execute_impl::materializers::deferred::clean_stale::apply_adaptive_low_disk 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.
ConfiguredAttr::traverse (cyclomatic 29) app/buck2_node/src/attrs/configured_attr.rs:274— ConfiguredAttr::traverse has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ConfiguredAttr::concat (cyclomatic 22) app/buck2_node/src/attrs/configured_attr.rs:382— ConfiguredAttr::concat has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: ConfiguredAttr::strong_hash_without_config (cyclomatic 24) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
starlark_derive::module::parse::fun::parse_fun (cyclomatic 28) starlark-rust/starlark_derive/src/module/parse/fun.rs:307— starlark_derive::module::parse::fun::parse_fun 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.
starlark_derive::module::parse::fun::parse_arg (cyclomatic 24) starlark-rust/starlark_derive/src/module/parse/fun.rs:705— starlark_derive::module::parse::fun::parse_arg has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
TypingContext::expression_type (cyclomatic 26) starlark-rust/starlark/src/typing/ctx.rs:411— TypingContext::expression_type has cyclomatic complexity 26 (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.
TypingContext::expression_bind_type (cyclomatic 23) starlark-rust/starlark/src/typing/ctx.rs:163— TypingContext::expression_bind_type 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.
Quality::graph_limitations (cyclomatic 26) tools/retrace/src/quality.rs:382— Quality::graph_limitations has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Quality::seal (cyclomatic 18) tools/retrace/src/quality.rs:570— Quality::seal has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Stmt::render (cyclomatic 26) tools/starlark_fmt/lib/fuzz_starlark.rs:514— Stmt::render has cyclomatic complexity 26 (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.
Stmt::fmt_with_tab (cyclomatic 18) starlark-rust/starlark_syntax/src/syntax/ast.rs:757— Stmt::fmt_with_tab has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: BinOp::fmt (cyclomatic 21) 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.
CliArgType::parse_clap (cyclomatic 25) app/buck2_bxl/src/bxl/starlark_defs/cli_args.rs:616— CliArgType::parse_clap has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
CliArgType::coerce_value (cyclomatic 18) app/buck2_bxl/src/bxl/starlark_defs/cli_args.rs:440— CliArgType::coerce_value 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.
BuildReportCollector::convert (cyclomatic 24) app/buck2_build_api/src/build/build_report.rs:399— BuildReportCollector::convert has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BuildReportCollector::collect_results_for_configured (cyclomatic 17) app/buck2_build_api/src/build/build_report.rs:861— BuildReportCollector::collect_results_for_configured 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.
buck2_server_commands::debug_anon_targets::debug_anon_targets_command (cyclomatic 22) app/buck2_server_commands/src/debug_anon_targets.rs:48— buck2_server_commands::debug_anon_targets::debug_anon_targets_command has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buck2_server_commands::explain_code::explain (cyclomatic 16) app/buck2_server_commands/src/explain_code.rs:122— buck2_server_commands::explain_code::explain 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.
remote_execution::client::upload_impl (cyclomatic 21) remote_execution/oss/re_grpc/src/client.rs:1689— remote_execution::client::upload_impl has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
remote_execution::client::download_impl (cyclomatic 19) remote_execution/oss/re_grpc/src/client.rs:1447— remote_execution::client::download_impl has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buck2_node::attrs::attr_type::arg::parser::read_literal_opt_slow (cyclomatic 19) app/buck2_node/src/attrs/attr_type/arg/parser.rs:350— buck2_node::attrs::attr_type::arg::parser::read_literal_opt_slow has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buck2_node::attrs::coerced::select::validate_concat (cyclomatic 17) app/buck2_node/src/attrs/coerced/select.rs:575— buck2_node::attrs::coerced::select::validate_concat 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.
State::stmt (cyclomatic 18) starlark-rust/starlark/src/analysis/names.rs:465— State::stmt 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.
State::exit_scope (cyclomatic 16) starlark-rust/starlark/src/analysis/names.rs:209— State::exit_scope 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.
buck2_build_api::actions::impls::json::visit_json_artifacts (cyclomatic 17) app/buck2_build_api/src/actions/impls/json.rs:325— buck2_build_api::actions::impls::json::visit_json_artifacts has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
buck2_build_api::interpreter::rule_defs::command_executor_config::register_command_executor_config::CommandExecutorConfig (cyclomatic 16) app/buck2_build_api/src/interpreter/rule_defs/command_executor_config.rs:189— buck2_build_api::interpreter::rule_defs::command_executor_config::register_command_executor_config::CommandExecutorConfig 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.
MathAnswerKey::permit_recompute (cyclomatic 17) dice/fuzzy_dice/src/execution.rs:470— MathAnswerKey::permit_recompute 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.
MathAnswerKey::new (cyclomatic 16) dice/fuzzy_dice/src/execution.rs:126— MathAnswerKey::new 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.
NonAbiDeclarationsStrippingIrVisitor.removeNonPublicApi (cyclomatic 16) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:510— NonAbiDeclarationsStrippingIrVisitor.removeNonPublicApi 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.
NonAbiDeclarationsStrippingIrVisitor.removeNonPublicApi (cyclomatic 16) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:547— NonAbiDeclarationsStrippingIrVisitor.removeNonPublicApi 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.
AstModule::get_auto_complete_type::walk_and_find_completion_type (cognitive 82) starlark-rust/starlark_lsp/src/inspect.rs:95— AstModule::get_auto_complete_type::walk_and_find_completion_type has cognitive complexity 82 (threshold 15). Drivers by points: if/else 25 (62 pts), match/switch 6 (14 pts), loops 3 (6 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AstModule::typecheck (cognitive 20) starlark-rust/starlark/src/typing/typecheck.rs:192— AstModule::typecheck has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (11 pts), loops 3 (5 pts), if/else 2 (4 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ChromeTraceWriter::handle_event (cognitive 78) app/buck2_log_common/src/chrome_trace.rs:1334— ChromeTraceWriter::handle_event has cognitive complexity 78 (threshold 15). Drivers by points: if/else 25 (55 pts), match/switch 9 (16 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 41). 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.
ChromeTraceWriter::write_build_phases (cognitive 23) app/buck2_log_common/src/chrome_trace.rs:1088— ChromeTraceWriter::write_build_phases has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Solver::solve (cognitive 45) games/src/games/sokoban.rs:295— Solver::solve has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 6 (14 pts), boolean chains 4 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Solver::compute_dead_cells (cognitive 21) games/src/games/sokoban.rs:184— Solver::compute_dead_cells has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 5 (7 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_cmd_targets_server::targets::streaming::targets_streaming (cognitive 44) app/buck2_cmd_targets_server/src/targets/streaming.rs:98— buck2_cmd_targets_server::targets::streaming::targets_streaming has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (30 pts), match/switch 2 (9 pts), loops 3 (5 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_cmd_targets_server::targets::default::targets_batch (cognitive 20) app/buck2_cmd_targets_server/src/targets/default.rs:86— buck2_cmd_targets_server::targets::default::targets_batch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_server_commands::explain_code::explain (cognitive 42) app/buck2_server_commands/src/explain_code.rs:122— buck2_server_commands::explain_code::explain has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 4 (9 pts), boolean chains 2 (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.
buck2_server_commands::debug_anon_targets::debug_anon_targets_command (cognitive 35) app/buck2_server_commands/src/debug_anon_targets.rs:48— buck2_server_commands::debug_anon_targets::debug_anon_targets_command has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 9 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pagable_derive::typetag::pagable_typetag_impl (cognitive 40) pagable_derive/src/typetag.rs:316— pagable_derive::typetag::pagable_typetag_impl has cognitive complexity 40 (threshold 15). Drivers by points: match/switch 8 (21 pts), if/else 11 (16 pts), loops 1 (3 pts) (nesting depth added 20). 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.
pagable_derive::derive_pagable::extract_attrs (cognitive 35) pagable_derive/src/derive_pagable.rs:537— pagable_derive::derive_pagable::extract_attrs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_query::query::graph::async_bfs::async_bfs_find_path (cognitive 39) app/buck2_query/src/query/graph/async_bfs.rs:62— buck2_query::query::graph::async_bfs::async_bfs_find_path has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (27 pts), match/switch 3 (7 pts), loops 3 (5 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_query::query::traversal::async_depth_limited_traversal (cognitive 26) app/buck2_query/src/query/traversal.rs:149— buck2_query::query::traversal::async_depth_limited_traversal has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (10 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_event_observer::display::display_event (cognitive 37) app/buck2_event_observer/src/display.rs:319— buck2_event_observer::display::display_event has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 8 (15 pts), boolean chains 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
buck2_event_observer::display::display_file_watcher_end (cognitive 33) app/buck2_event_observer/src/display.rs:570— buck2_event_observer::display::display_file_watcher_end has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_test::command::generate_config_entry_args (cognitive 36) app/buck2_test/src/command.rs:1949— buck2_test::command::generate_config_entry_args has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (32 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_test::internal_runner::run_internal_test (cognitive 29) app/buck2_test/src/internal_runner.rs:46— buck2_test::internal_runner::run_internal_test has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 7 (14 pts), if/else 4 (9 pts), loops 3 (6 pts) (nesting depth added 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. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LocalExecutor::exec_request (cognitive 35) app/buck2_execute_impl/src/executors/local.rs:535— LocalExecutor::exec_request has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (26 pts), match/switch 7 (8 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalExecutor::exec_with_resource_control (cognitive 29) app/buck2_execute_impl/src/executors/local.rs:403— LocalExecutor::exec_with_resource_control has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MathAnswerKey::new (cognitive 35) dice/fuzzy_dice/src/execution.rs:126— MathAnswerKey::new has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 3 (7 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MathAnswerKey::permit_recompute (cognitive 27) dice/fuzzy_dice/src/execution.rs:470— MathAnswerKey::permit_recompute has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 3, loops 3, 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.
buck2_common::file_ops::error::extended_ignore_error (cognitive 32) app/buck2_common/src/file_ops/error.rs:88— buck2_common::file_ops::error::extended_ignore_error has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (18 pts), match/switch 4 (9 pts), loops 1 (5 pts) (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
buck2_common::pattern::package_roots::collect_package_roots (cognitive 20) app/buck2_common/src/pattern/package_roots.rs:78— buck2_common::pattern::package_roots::collect_package_roots has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (4 pts), match/switch 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Graph::topo_sort (cognitive 32) app/buck2_critical_path/src/graph.rs:93— Graph::topo_sort has cognitive complexity 32 (threshold 15). Drivers by points: if/else 4 (21 pts), loops 3 (8 pts), match/switch 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Graph::build (cognitive 17) app/buck2_query/src/query/graph/graph.rs:153— Graph::build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (5 pts), match/switch 1 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Quality::graph_limitations (cognitive 32) tools/retrace/src/quality.rs:382— Quality::graph_limitations has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 4, loops 1 (2 pts), 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.
Quality::seal (cognitive 22) tools/retrace/src/quality.rs:570— Quality::seal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 8, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SimpleConsole::tick (cognitive 29) app/buck2_client_ctx/src/subscribers/simpleconsole.rs:739— SimpleConsole::tick has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 3 (10 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimpleConsole::print_stats_while_waiting (cognitive 22) app/buck2_client_ctx/src/subscribers/simpleconsole.rs:291— SimpleConsole::print_stats_while_waiting has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_node::attrs::coerced::select::validate_concat (cognitive 28) app/buck2_node/src/attrs/coerced/select.rs:575— buck2_node::attrs::coerced::select::validate_concat has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (8 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_node::attrs::coerced::select::check_select_keys_unique (cognitive 16) app/buck2_node/src/attrs/coerced/select.rs:95— buck2_node::attrs::coerced::select::check_select_keys_unique has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
State::exit_scope (cognitive 28) starlark-rust/starlark/src/analysis/names.rs:209— State::exit_scope has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (7 pts), boolean chains 4, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
State::branch (cognitive 17) starlark-rust/starlark/src/analysis/names.rs:302— State::branch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), match/switch 3 (6 pts), loops 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MixedGraph::postorder_actions (cognitive 25) app/buck2_query_impls/src/aquery/mixed_graph.rs:471— MixedGraph::postorder_actions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 3 (7 pts), match/switch 1 (3 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.
MixedGraph::reachable_within_action_depth (cognitive 20) app/buck2_query_impls/src/aquery/mixed_graph.rs:430— MixedGraph::reachable_within_action_depth has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (7 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.
Stats::update_with_event (cognitive 24) app/buck2_cmd_log_client/src/summary.rs:64— Stats::update_with_event has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (8 pts), match/switch 4 (8 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.
Stats::fmt (cognitive 19) app/buck2_cmd_log_client/src/summary.rs:159— Stats::fmt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
buck2_fs::paths::relative_path::verify_relative_path (cognitive 23) app/buck2_fs/src/paths/relative_path.rs:621— buck2_fs::paths::relative_path::verify_relative_path has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_fs::paths::intern_forward_rel_path::interner::walk_parts_for_tails (cognitive 18) app/buck2_fs/src/paths/intern_forward_rel_path/interner.rs:187— buck2_fs::paths::intern_forward_rel_path::interner::walk_parts_for_tails has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_server::agent_context_validation::validate_agent_context (cognitive 22) app/buck2_server/src/agent_context_validation.rs:32— buck2_server::agent_context_validation::validate_agent_context has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_server::daemon::server::eden_health::edenfs_health_check (cognitive 17) app/buck2_server/src/daemon/server.rs:2262— buck2_server::daemon::server::eden_health::edenfs_health_check has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (9 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StarlarkSelector::select_map (cognitive 21) app/buck2_interpreter_for_build/src/interpreter/selector.rs:136— StarlarkSelector::select_map has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StarlarkSelector::select_test (cognitive 20) app/buck2_interpreter_for_build/src/interpreter/selector.rs:196— StarlarkSelector::select_test has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildSignalReceiver::record_load_discovery (cognitive 20) app/buck2_build_signals_impl/src/lib.rs:1130— BuildSignalReceiver::record_load_discovery has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildSignalReceiver::process_evaluation (cognitive 16) app/buck2_build_signals_impl/src/lib.rs:1002— BuildSignalReceiver::process_evaluation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (4 pts), loops 2 (3 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.
TestDriver::drive_to_completion (cognitive 19) app/buck2_test/src/command.rs:1114— TestDriver::drive_to_completion has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (7 pts), if/else 2 (6 pts), match/switch 2 (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.
TestDriver::interpret_targets (cognitive 18) app/buck2_test/src/command.rs:1196— TestDriver::interpret_targets has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 5 (6 pts), loops 1 (3 pts) (nesting depth added 7). 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.
DocString::parse_and_remove_sections (cognitive 19) starlark-rust/starlark/src/docs/parse.rs:254— DocString::parse_and_remove_sections has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 2 (3 pts), loops 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.
DocString::from_docstring (cognitive 16) starlark-rust/starlark/src/docs/parse.rs:164— DocString::from_docstring has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 3 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
NonAbiDeclarationsStrippingIrVisitor.removeNonPublicApi (cognitive 19) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:510— NonAbiDeclarationsStrippingIrVisitor.removeNonPublicApi has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 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.
NonAbiDeclarationsStrippingIrVisitor.removeNonPublicApi (cognitive 19) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:547— NonAbiDeclarationsStrippingIrVisitor.removeNonPublicApi has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 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.
DirectoryBuilder::merge_inner (cognitive 18) app/buck2_directory/src/directory/builder.rs:297— DirectoryBuilder::merge_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 5 (7 pts), boolean chains 2 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
DirectoryBuilder::map_entry_fasttrack (cognitive 18) app/buck2_directory/src/directory/builder.rs:520— DirectoryBuilder::map_entry_fasttrack has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (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.
crate::shed::completion_verify::src::extract_from_single_output (cognitive 18) shed/completion_verify/src/main.rs:69— crate::shed::completion_verify::src::extract_from_single_output has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crate::starlark-rust::benchmark_memory::src::main (cognitive 16) starlark-rust/benchmark_memory/src/main.rs:182— crate::starlark-rust::benchmark_memory::src::main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeferredMaterializerCommandProcessor::run (cognitive 18) app/buck2_execute_impl/src/materializers/deferred/command_processor.rs:500— DeferredMaterializerCommandProcessor::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeferredMaterializerCommandProcessor::materialize_artifact_inner (cognitive 16) app/buck2_execute_impl/src/materializers/deferred/command_processor.rs:1242— DeferredMaterializerCommandProcessor::materialize_artifact_inner has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 7 (9 pts), if/else 2 (7 pts) (nesting depth added 7). 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.
buck2_cmd_docs_client::help_doc::cmd_content_markdown (cognitive 17) app/buck2_cmd_docs_client/src/help_doc.rs:183— buck2_cmd_docs_client::help_doc::cmd_content_markdown has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4 (7 pts), boolean chains 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.
buck2_cmd_docs_client::help_doc::write_arg_markdown (cognitive 17) app/buck2_cmd_docs_client/src/help_doc.rs:285— buck2_cmd_docs_client::help_doc::write_arg_markdown has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Value::add (cognitive 17) starlark-rust/starlark/src/values/layout/value.rs:845— Value::add has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Value::any_matches (cognitive 16) app/buck2_node/src/attrs/attr_type/any_matches.rs:20— Value::any_matches has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Duplicated block (31 lines × 2) app/buck2_build_api/src/actions/calculation.rs:801— app/buck2_build_api/src/actions/calculation.rs:801-831 | app/buck2_execute/src/execute/result.rs:414-444 — 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 (31 lines × 2) prelude/toolchains/android/src/com/facebook/buck/testrunner/InstrumentationTestRunner.java:538— prelude/toolchains/android/src/com/facebook/buck/testrunner/InstrumentationTestRunner.java:538-568 | prelude/toolchains/android/src/com/facebook/buck/testrunner/InstrumentationTestRunnerForClout.java:88-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/android/src/com/facebook/buck/testrunner/InstrumentationTestRunner.java:538` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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, `prelude/toolchains/android/src/com/facebook/buck/testrunner/InstrumentationTestRunner.java:569` calls `isEmpty`, `addReportLayer`, `LogExtractorReportLayer` and `prelude/toolchains/android/src/com/facebook/buck/testrunner/InstrumentationTestRunnerForClout.java:119` 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 (20–22 lines × 2) app/buck2_forkserver/src/launch.rs:59— app/buck2_forkserver/src/launch.rs:59-78 | app/buck2_test/src/unix/executor.rs:71-92 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (20–22 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/K2JvmAbiFirAnalysisHandlerExtension.kt:1118— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/K2JvmAbiFirAnalysisHandlerExtension.kt:1118-1139 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/K2JvmAbiFirAnalysisHandlerExtension.kt:1182-1201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/K2JvmAbiFirAnalysisHandlerExtension.kt:1118` 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–16 lines × 2) app/buck2_query/src/query/environment.rs:294— app/buck2_query/src/query/environment.rs:294-308 | app/buck2_query/src/query/environment.rs:332-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 2) games/src/games/blocks.rs:722— games/src/games/blocks.rs:722-737 | games/src/games/blocks.rs:750-764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 3) app/buck2_interpreter_for_build/src/interpreter/check_starlark_stack_size.rs:112— app/buck2_interpreter_for_build/src/interpreter/check_starlark_stack_size.rs:112-126 | app/buck2_interpreter_for_build/src/interpreter/dice_calculation_delegate.rs:476-490 | app/buck2_interpreter_for_build/src/interpreter/dice_calculation_delegate.rs:577-591 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (15 lines × 3) app/buck2_query_impls/src/aquery/bxl.rs:201— app/buck2_query_impls/src/aquery/bxl.rs:201-215 | app/buck2_query_impls/src/aquery/bxl.rs:220-234 | app/buck2_query_impls/src/uquery/bxl.rs:189-203 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (14–15 lines × 2) tools/retrace/src/graph.rs:909— tools/retrace/src/graph.rs:909-923 | tools/retrace/src/graph/parallel.rs:126-139 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14–15 lines × 2) app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:608— app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs:608-621 | app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/internal_runner_test_info.rs:634-648 — before extracting anything, compare `app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/external_runner_test_info.rs` and `app/buck2_build_api/src/interpreter/rule_defs/provider/builtin/internal_runner_test_info.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–14 lines × 2) app/buck2_cmd_log_client/src/external_configs.rs:117— app/buck2_cmd_log_client/src/external_configs.rs:117-130 | app/buck2_cmd_log_client/src/external_configs.rs:159-170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–14 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/common/stub/render/StubRender.kt:243— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/common/stub/render/StubRender.kt:243-256 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/common/stub/render/StubRender.kt:262-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/common/stub/render/StubRender.kt:243` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 3) app/buck2_cmd_audit_server/src/includes.rs:83— app/buck2_cmd_audit_server/src/includes.rs:83-95 | app/buck2_query_impls/src/uquery/environment.rs:533-545 | app/buck2_query_impls/src/uquery/environment.rs:752-764 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (13 lines × 3) docs/developers/perf/scripts/heap_aggregate.py:105— docs/developers/perf/scripts/heap_aggregate.py:105-117 | docs/developers/perf/scripts/heap_diff.py:94-106 | docs/developers/perf/scripts/heap_stacks.py:134-146 — before extracting anything, compare `docs/developers/perf/scripts/heap_aggregate.py` and `docs/developers/perf/scripts/heap_diff.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 3) app/buck2_cmd_log_client/src/what_ran.rs:452— app/buck2_cmd_log_client/src/what_ran.rs:452-463 | app/buck2_cmd_log_client/src/what_ran.rs:465-476 | app/buck2_cmd_log_client/src/what_ran.rs:481-492 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) tools/retrace/src/ingest/testlog.rs:368— tools/retrace/src/ingest/testlog.rs:368-379 | tools/retrace/src/ingest/testlog.rs:1478-1489 | tools/retrace/src/ingest/testlog.rs:1786-1797 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–12 lines × 2) app/buck2_action_impl/src/actions/impls/run.rs:701— app/buck2_action_impl/src/actions/impls/run.rs:701-709 | app/buck2_action_impl/src/actions/impls/run.rs:802-813 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–12 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/KotlinMetadataReader.java:160— prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/KotlinMetadataReader.java:160-171 | prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/KotlinMetadataReader.java:186-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/KotlinMetadataReader.java:160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) app/buck2_action_impl/src/context/copy.rs:132— app/buck2_action_impl/src/context/copy.rs:132-143 | app/buck2_action_impl/src/context/copy.rs:179-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.
Duplicated block (10–12 lines × 2) shed/mini_map/src/fixed_insertion_map.rs:516— shed/mini_map/src/fixed_insertion_map.rs:516-525 | shed/mini_map/src/mut_insertion_map.rs:970-981 — before extracting anything, compare `shed/mini_map/src/fixed_insertion_map.rs` and `shed/mini_map/src/mut_insertion_map.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 2) starlark-rust/starlark_syntax/src/lexer.rs:349— starlark-rust/starlark_syntax/src/lexer.rs:349-360 | starlark-rust/starlark_syntax/src/lexer.rs:517-527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) prelude/cxx/dist_lto/tools/dist_lto_planner_gnu.py:299— prelude/cxx/dist_lto/tools/dist_lto_planner_gnu.py:299-309 | prelude/cxx/dist_lto/tools/dist_lto_planner_gnu.py:346-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–11 lines × 3) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:176— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:176-184 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:358-368 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:504-514 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–11 lines × 3) docs/developers/perf/scripts/frag_symbolize.py:123— docs/developers/perf/scripts/frag_symbolize.py:123-131 | docs/developers/perf/scripts/heap_diff.py:133-143 | docs/developers/perf/scripts/heap_stacks.py:78-88 — before extracting anything, compare `docs/developers/perf/scripts/heap_diff.py` and `docs/developers/perf/scripts/heap_stacks.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `docs/developers/perf/scripts/heap_diff.py:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) app/buck2_action_impl/src/context/write.rs:200— app/buck2_action_impl/src/context/write.rs:200-209 | app/buck2_action_impl/src/context/write.rs:274-282 — both copies are in the same file, so extract the 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–10 lines × 2) app/buck2_query_impls/src/cquery/bxl.rs:54— app/buck2_query_impls/src/cquery/bxl.rs:54-63 | app/buck2_query_impls/src/uquery/bxl.rs:53-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.
Duplicated block (9 lines × 3) app/buck2_action_impl/src/actions/impls/run.rs:715— app/buck2_action_impl/src/actions/impls/run.rs:715-723 | app/buck2_action_impl/src/actions/impls/run.rs:819-827 | app/buck2_action_impl/src/actions/impls/run.rs:892-900 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:223— app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:223-231 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:424-432 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:514-522 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–9 lines × 2) app/buck2_build_api/src/interpreter/rule_defs/provider/callable.rs:482— app/buck2_build_api/src/interpreter/rule_defs/provider/callable.rs:482-490 | app/buck2_build_api/src/interpreter/rule_defs/provider/callable.rs:563-570 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) app/buck2_client_ctx/src/stream_util.rs:89— app/buck2_client_ctx/src/stream_util.rs:89-97 | app/buck2_client_ctx/src/stream_util.rs:100-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 3) app/buck2_configured/src/nodes.rs:1748— app/buck2_configured/src/nodes.rs:1748-1755 | app/buck2_configured/src/nodes.rs:1818-1825 | app/buck2_configured/src/target_platform_resolution.rs:59-68 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 3) prelude/toolchains/android/src/com/facebook/buck/android/dex/JarSplitterExecutableMain.java:96— prelude/toolchains/android/src/com/facebook/buck/android/dex/JarSplitterExecutableMain.java:96-103 | prelude/toolchains/android/src/com/facebook/buck/android/dex/MultiDexExecutableMain.java:590-597 | prelude/toolchains/android/src/com/facebook/buck/android/dex/MultiDexExecutableMain.java:625-632 — before extracting anything, compare `prelude/toolchains/android/src/com/facebook/buck/android/dex/JarSplitterExecutableMain.java` and `prelude/toolchains/android/src/com/facebook/buck/android/dex/MultiDexExecutableMain.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/android/src/com/facebook/buck/android/dex/JarSplitterExecutableMain.java:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 3) app/buck2_build_api/src/actions/errors/error_handler.rs:471— app/buck2_build_api/src/actions/errors/error_handler.rs:471-476 | app/buck2_build_api/src/actions/errors/error_handler.rs:480-485 | app/buck2_build_api/src/actions/errors/error_handler.rs:513-518 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) starlark-rust/starlark/src/values/types/string/interpolation.rs:243— starlark-rust/starlark/src/values/types/string/interpolation.rs:243-248 | starlark-rust/starlark/src/values/types/string/interpolation.rs:270-275 | starlark-rust/starlark/src/values/types/string/interpolation.rs:297-302 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (37 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:188— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:188-224 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:191-227 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 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 (37 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/KotlinMetadataReader.java:358— prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/KotlinMetadataReader.java:358-394 | prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/kotlin-1.4.2/KotlinMetadataReader.java:101-137 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (21–22 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:651— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:651-672 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:688-708 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 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 `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:688` it does not close everything it opens, so those 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 (21–22 lines × 2) prelude/android/tools/unpack_aar.py:32— prelude/android/tools/unpack_aar.py:32-52 | prelude/java/tools/list_class_names.py:18-39 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/android/tools/unpack_aar.py:32` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `prelude/android/tools/unpack_aar.py:30` calls `add_argument` and `prelude/java/tools/list_class_names.py:17` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (21 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:395— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:395-415 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:398-418 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 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 (21 lines × 2) prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java:323— prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java:323-343 | prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitSupport.java:188-208 — 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 `prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java:323` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (50 lines × 2 locations) app/buck2_trailcam/js/src/components/invocation/CriticalPathChart.tsx:174— app/buck2_trailcam/js/src/components/invocation/CriticalPathChart.tsx:174 · app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:188 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (50 lines × 2 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:11531— app/buck2_trailcam/js/src/lib/proto/bundle.js:11531 · app/buck2_trailcam/js/src/lib/proto/bundle.js:32951 — all 2 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×1
Animation without a prefers-reduced-motion guard app/buck2_trailcam/js/src/components/invocation/InvocationBar.tsx:221— <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 72 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
BuildHistorySidebar.BuildHistorySidebar (cyclomatic 79) app/buck2_trailcam/js/src/components/invocation/BuildHistorySidebar.tsx:61— BuildHistorySidebar.BuildHistorySidebar has cyclomatic complexity 79 (threshold 15). Of this number, 27 points are the body's own statements and 52 belong to 11 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FirMetadataSanitizerStage.cleanupFirMetadataSources (cyclomatic 77) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:155— FirMetadataSanitizerStage.cleanupFirMetadataSources has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EventLogProvider.EventLogProvider (cyclomatic 74) app/buck2_trailcam/js/src/components/invocation/EventLogProvider.tsx:215— EventLogProvider.EventLogProvider has cyclomatic complexity 74 (threshold 15). Most of this is not in the body itself: 1 of the 74 points is its own statement and the rest belongs to 15 function literals inside it that branch (lines 385, 600, 724, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
dist_lto_planner_gnu.main (cyclomatic 59) prelude/cxx/dist_lto/tools/dist_lto_planner_gnu.py:108— dist_lto_planner_gnu.main has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ActionResultsTab.ActionsView (cyclomatic 51) app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:133— ActionResultsTab.ActionsView has cyclomatic complexity 51 (threshold 15). Most of this is not in the body itself: 13 of the 51 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 221, a function literal at line 212, a function literal at line 139, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ChromeTraceWriter::handle_event (cyclomatic 50) app/buck2_log_common/src/chrome_trace.rs:1334— ChromeTraceWriter::handle_event has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IrSpanned::write_bc (cyclomatic 46) starlark-rust/starlark/src/eval/bc/compiler/expr.rs:317— IrSpanned::write_bc has cyclomatic complexity 46 (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.
Compiler::expr (cyclomatic 44) starlark-rust/starlark/src/eval/compiler/expr.rs:1293— Compiler::expr has cyclomatic complexity 44 (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.
CrashAnalyzer.extractSignalCode (cyclomatic 44) prelude/toolchains/android/src/com/facebook/buck/testrunner/CrashAnalyzer.java:314— CrashAnalyzer.extractSignalCode has cyclomatic complexity 44 (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.
AstModule::get_auto_complete_type::walk_and_find_completion_type (cyclomatic 42) starlark-rust/starlark_lsp/src/inspect.rs:95— AstModule::get_auto_complete_type::walk_and_find_completion_type has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LoadTreemap.LoadTreemap (cyclomatic 41) app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:175— LoadTreemap.LoadTreemap has cyclomatic complexity 41 (threshold 15). Of this number, 20 points are the body's own statements and 21 belong to 9 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
rustc_action.main (cyclomatic 40) prelude/rust/tools/rustc_action.py:446— rustc_action.main 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.
PostEnterCanonicalizer.getCanonicalType (cyclomatic 39) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/source/PostEnterCanonicalizer.java:105— PostEnterCanonicalizer.getCanonicalType has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProgressHeader::draw_unchecked (cyclomatic 35) app/buck2_client_ctx/src/subscribers/superconsole/header.rs:415— ProgressHeader::draw_unchecked has cyclomatic complexity 35 (threshold 15). Of this number, 33 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GraphImpl2.GraphImpl2 (cyclomatic 35) app/buck2_explain/output_format_js/src/graph2/GraphImpl2.tsx:56— GraphImpl2.GraphImpl2 has cyclomatic complexity 35 (threshold 15). Of this number, 34 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RemoteEventSink::should_send_event (cyclomatic 34) app/buck2_events/src/sink/scribe.rs:177— RemoteEventSink::should_send_event has cyclomatic complexity 34 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
CriticalPathEntryDisplay::from_entry (cyclomatic 33) app/buck2_event_observer/src/display.rs:1238— CriticalPathEntryDisplay::from_entry has cyclomatic complexity 33 (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.
HybridExecutor::exec_cmd (cyclomatic 33) app/buck2_execute_impl/src/executors/hybrid.rs:115— HybridExecutor::exec_cmd 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.
AttrType::coerce_item (cyclomatic 33) app/buck2_anon_target/src/anon_target_attr_coerce.rs:62— AttrType::coerce_item has cyclomatic complexity 33 (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.
fat_jar.main (cyclomatic 33) prelude/java/tools/fat_jar.py:225— fat_jar.main has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GraphImpl2.GraphImpl2 (cyclomatic 33) app/buck2_explain/js/src/graph2/GraphImpl2.tsx:52— GraphImpl2.GraphImpl2 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.
ConsoleInteractionStream::interaction (cyclomatic 30) app/buck2_client_ctx/src/console_interaction_stream.rs:286— ConsoleInteractionStream::interaction has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buck2_error::starlark_error::from_starlark_impl (cyclomatic 29) app/buck2_error/src/starlark_error.rs:113— buck2_error::starlark_error::from_starlark_impl has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DefParams::unpack (cyclomatic 29) starlark-rust/starlark_syntax/src/syntax/def.rs:127— DefParams::unpack has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buck2_analysis::attrs::resolve::configured_attr::configured_attr_to_value (cyclomatic 28) app/buck2_analysis/src/attrs/resolve/configured_attr.rs:184— buck2_analysis::attrs::resolve::configured_attr::configured_attr_to_value has cyclomatic complexity 28 (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.
SerializeValue::serialize (cyclomatic 28) app/buck2_build_api/src/actions/impls/json.rs:153— SerializeValue::serialize has cyclomatic complexity 28 (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.
Cleaner::run_inner (cyclomatic 28) app/buck2_execute_impl/src/materializers/v2/clean_stale.rs:267— Cleaner::run_inner has cyclomatic complexity 28 (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.
buck2_common::argv::parse_config_flags (cyclomatic 27) app/buck2_common/src/argv.rs:181— buck2_common::argv::parse_config_flags has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
BuckTarget.Normalise (cyclomatic 27) prelude/go/tools/gobuckify/lib/buck.go:47— BuckTarget.Normalise has cyclomatic complexity 27 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
FileChanges.FileChangesSection (cyclomatic 27) app/buck2_trailcam/js/src/components/invocation/FileChanges.tsx:199— FileChanges.FileChangesSection has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
InvocationBar.InvocationBar (cyclomatic 27) app/buck2_trailcam/js/src/components/invocation/InvocationBar.tsx:66— InvocationBar.InvocationBar has cyclomatic complexity 27 (threshold 15). Of this number, 15 points are the body's own statements and 12 belong to 8 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EscapeState::feed (cyclomatic 26) app/buck2_client_ctx/src/subscribers/superconsole.rs:216— EscapeState::feed has cyclomatic complexity 26 (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.
CleanStaleArtifactsCommand::scan_and_create_clean_fut (cyclomatic 26) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:635— CleanStaleArtifactsCommand::scan_and_create_clean_fut 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.
ChromeTraceFirstPass::handle_event (cyclomatic 26) app/buck2_log_common/src/chrome_trace.rs:192— ChromeTraceFirstPass::handle_event has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommandExecutorFactory::get_command_executor (cyclomatic 26) app/buck2_server/src/daemon/common.rs:189— CommandExecutorFactory::get_command_executor 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.
starlark_syntax::syntax::validate::validate_module (cyclomatic 26) starlark-rust/starlark_syntax/src/syntax/validate.rs:66— starlark_syntax::syntax::validate::validate_module has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 3 function items inside it that branch (f, validate_params, expr). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
K2JvmAbiFirAnalysisHandlerExtension.findClassIdForImportWithProperty (cyclomatic 26) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/K2JvmAbiFirAnalysisHandlerExtension.kt:1075— K2JvmAbiFirAnalysisHandlerExtension.findClassIdForImportWithProperty 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.
swift_exec.main (cyclomatic 26) prelude/apple/tools/swift_exec.py:262— swift_exec.main 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.
streaming-decode-worker.processLargeLog (cyclomatic 26) app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts:359— streaming-decode-worker.processLargeLog has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 6 function items inside it that branch (processMessage, flushChunk, flushSummaries, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
BindingsCollect::visit (cyclomatic 25) starlark-rust/starlark/src/typing/bindings.rs:290— BindingsCollect::visit has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StructuralListArgSorter::visit_expr (cyclomatic 25) tools/starlark_fmt/lib/autofixes/sort_list_args/structural.rs:198— StructuralListArgSorter::visit_expr 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.
critical-path.parseEntry (cyclomatic 25) app/buck2_trailcam/js/src/lib/critical-path.ts:179— critical-path.parseEntry has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RunAction::execute (cyclomatic 24) app/buck2_action_impl/src/actions/impls/run.rs:1729— RunAction::execute has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LocalExecutor::exec_request (cyclomatic 24) app/buck2_execute_impl/src/executors/local.rs:535— LocalExecutor::exec_request has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PrivateMetadataStripper.transform (cyclomatic 24) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/BytecodeTransformer.kt:143— PrivateMetadataStripper.transform has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
FirSanitizingVisitor.hasErrorExpression (cyclomatic 24) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:1093— FirSanitizingVisitor.hasErrorExpression has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MultiDexExecutableMain.run (cyclomatic 24) prelude/toolchains/android/src/com/facebook/buck/android/dex/MultiDexExecutableMain.java:158— MultiDexExecutableMain.run has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StubJar.writeTo (cyclomatic 24) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/StubJar.java:121— StubJar.writeTo has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JUnitRunner.run (cyclomatic 24) prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java:86— JUnitRunner.run has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
extract_link_action.process_link_args (cyclomatic 24) prelude/rust/tools/extract_link_action.py:123— extract_link_action.process_link_args has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GenericTreemapView.GenericTreemapView (cyclomatic 24) app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:149— GenericTreemapView.GenericTreemapView has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 271, 343, 178, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
decoder-worker.onmessage (cyclomatic 24) app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts:197— decoder-worker.onmessage has cyclomatic complexity 24 (threshold 15). Of this number, 14 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Uploader::upload (cyclomatic 23) app/buck2_execute/src/re/uploader.rs:138— Uploader::upload 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.
DiceExecutionOrder::execute_once (cyclomatic 23) dice/fuzzy_dice/src/execution.rs:815— DiceExecutionOrder::execute_once 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.
IsSafeToInlineExpr::is_safe_to_inline_expr (cyclomatic 23) starlark-rust/starlark/src/eval/compiler/def_inline.rs:90— IsSafeToInlineExpr::is_safe_to_inline_expr 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.
GlobalTypesBuilder::from_type_expr_impl (cyclomatic 23) starlark-rust/starlark/src/typing/fill_types_for_lint.rs:579— GlobalTypesBuilder::from_type_expr_impl 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.
D8ExecutableMain.run (cyclomatic 23) prelude/toolchains/android/src/com/facebook/buck/android/dex/D8ExecutableMain.java:204— D8ExecutableMain.run 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.
compile_kotlin.main (cyclomatic 23) prelude/kotlin/tools/compile_kotlin/compile_kotlin.py:549— compile_kotlin.main has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AnonTargetAttr::resolve_single (cyclomatic 22) app/buck2_anon_target/src/anon_target_attr_resolve.rs:83— AnonTargetAttr::resolve_single has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
buck2_server::host_info::get_host_info (cyclomatic 22) app/buck2_server/src/host_info.rs:19— buck2_server::host_info::get_host_info has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
CommandProfile::validate (cyclomatic 22) tools/retrace/src/command_profile.rs:437— CommandProfile::validate has cyclomatic complexity 22 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
KwargSorter::process_call (cyclomatic 22) tools/starlark_fmt/lib/autofixes/sort_kwargs.rs:82— KwargSorter::process_call has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NodeKey::into_critical_path_entry_data (cyclomatic 21) app/buck2_build_signals_impl/src/lib.rs:175— NodeKey::into_critical_path_entry_data has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buck2_cmd_log_client::snoop::snoop_one (cyclomatic 21) app/buck2_cmd_log_client/src/snoop.rs:341— buck2_cmd_log_client::snoop::snoop_one has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ActionErrorDisplay::simple_format_inner (cyclomatic 21) app/buck2_event_observer/src/display.rs:924— ActionErrorDisplay::simple_format_inner has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ResultReporter::collect_result (cyclomatic 21) app/buck2_server_commands/src/build/result_report.rs:132— ResultReporter::collect_result has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ExprCompiled::mark_definitely_assigned_after (cyclomatic 21) starlark-rust/starlark/src/eval/bc/compiler/expr.rs:122— ExprCompiled::mark_definitely_assigned_after has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
compile_and_package.main (cyclomatic 21) prelude/java/tools/compile_and_package.py:305— compile_and_package.main has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DecodeStatsPanel.DecodeStatsPanel (cyclomatic 21) app/buck2_trailcam/js/src/components/invocation/DecodeStatsPanel.tsx:153— DecodeStatsPanel.DecodeStatsPanel has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
EventLogDetailPanel.EventLogDetailPanel (cyclomatic 21) app/buck2_trailcam/js/src/components/invocation/event-log/EventLogDetailPanel.tsx:26— EventLogDetailPanel.EventLogDetailPanel has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HealthCheckSubscriber::handle_event (cyclomatic 20) app/buck2_client_ctx/src/subscribers/health_check_subscriber.rs:88— HealthCheckSubscriber::handle_event 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.
Stats::update_with_event (cyclomatic 20) app/buck2_cmd_log_client/src/summary.rs:64— Stats::update_with_event 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.
QueryResultPrinter::print_single_output (cyclomatic 20) app/buck2_cmd_query_server/src/query/printer.rs:341— QueryResultPrinter::print_single_output 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.
CoreState::fork (cyclomatic 20) dice/dice_core/src/fork.rs:29— CoreState::fork 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.
Solver::solve (cyclomatic 20) games/src/games/sokoban.rs:295— Solver::solve 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.
starlark_fmt_lib::lib::autofixes::sort_list_args::collect_sorted_elements_with_keys (cyclomatic 20) tools/starlark_fmt/lib/autofixes/sort_list_args.rs:253— starlark_fmt_lib::lib::autofixes::sort_list_args::collect_sorted_elements_with_keys 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.
MissingTypeCollectorVisitor.checkTypeResolvableRecursively (cyclomatic 20) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/K2JvmAbiFirAnalysisHandlerExtension.kt:297— MissingTypeCollectorVisitor.checkTypeResolvableRecursively 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.
MiniAapt.addStyleItemReference (cyclomatic 20) prelude/toolchains/android/src/com/facebook/buck/android/aapt/MiniAapt.java:397— MiniAapt.addStyleItemReference 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.
typechecker._run (cyclomatic 20) prelude/kotlin/tools/typechecker/typechecker.py:178— typechecker._run has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
make_py_package_modules.create_modules_dir (cyclomatic 20) prelude/python/tools/make_py_package_modules.py:283— make_py_package_modules.create_modules_dir 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.
rustc_action.handle_output (cyclomatic 20) prelude/rust/tools/rustc_action.py:361— rustc_action.handle_output 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.
dependency_analyzer.extract_dependencies (cyclomatic 20) prelude/erlang/toolchain/dependency_analyzer.erl:108— dependency_analyzer.extract_dependencies 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.
ActionTreemap.ActionTreemap (cyclomatic 20) app/buck2_trailcam/js/src/components/invocation/ActionTreemap.tsx:24— ActionTreemap.ActionTreemap has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
useEventLogState.useEventLogState.filteredEvents (cyclomatic 20) app/buck2_trailcam/js/src/components/invocation/event-log/useEventLogState.ts:203— useEventLogState.useEventLogState.filteredEvents has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
dispatch-worker.handleMessage (cyclomatic 20) app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts:573— dispatch-worker.handleMessage has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buck2_client::commands::clean::clean_buck_out_pass (cyclomatic 19) app/buck2_client/src/commands/clean.rs:617— buck2_client::commands::clean::clean_buck_out_pass 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.
OutputFormatWithWriter::emit_command (cyclomatic 19) app/buck2_cmd_log_client/src/what_ran.rs:376— OutputFormatWithWriter::emit_command 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.
buck2_query_impls::dice::aquery::compute_tset_node (cyclomatic 19) app/buck2_query_impls/src/dice/aquery.rs:335— buck2_query_impls::dice::aquery::compute_tset_node 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.
pagable_derive::typetag::pagable_typetag_impl (cyclomatic 19) pagable_derive/src/typetag.rs:316— pagable_derive::typetag::pagable_typetag_impl has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
BazelContext::get_string_completion_options (cyclomatic 19) starlark-rust/starlark_bin/bin/bazel.rs:797— BazelContext::get_string_completion_options 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.
ParserRd::parse_atom (cyclomatic 19) starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:953— ParserRd::parse_atom has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: ParserRd::infix_binding_power (cyclomatic 22) 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.
MissingConstantDeclarationGenerationExtension.getCallableNamesForClass (cyclomatic 19) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/K2JvmAbiFirAnalysisHandlerExtension.kt:1405— MissingConstantDeclarationGenerationExtension.getCallableNamesForClass 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.
ClassStabilityTransformer.computeStability (cyclomatic 19) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compose/ClassStabilityTransformer.kt:257— ClassStabilityTransformer.computeStability 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.
AndroidBundleBuilderExecutableMain.run (cyclomatic 19) prelude/toolchains/android/src/com/facebook/buck/android/bundle/AndroidBundleBuilderExecutableMain.java:96— AndroidBundleBuilderExecutableMain.run has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BaseRunner.parseArgs (cyclomatic 19) REDACTED:219— BaseRunner.parseArgs 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.
sokoban_pipeline.parse_levels_from_file (cyclomatic 19) games/bin/sokoban_pipeline.py:143— sokoban_pipeline.parse_levels_from_file 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.
buildscript_run.main (cyclomatic 19) prelude/rust/tools/buildscript_run.py:211— buildscript_run.main 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.
testFuncs.load (cyclomatic 19) prelude/go/tools/testmaingen.go:278— testFuncs.load 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.
ActionResultsTab.ExpandedRow (cyclomatic 19) app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:679— ActionResultsTab.ExpandedRow has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CriticalPathChart.CriticalPathChart (cyclomatic 19) app/buck2_trailcam/js/src/components/invocation/CriticalPathChart.tsx:43— CriticalPathChart.CriticalPathChart has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PerfettoEmbed.PerfettoEmbed (cyclomatic 19) REDACTED:23— PerfettoEmbed.PerfettoEmbed has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 37, 76, 101, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
buck2_bxl::bxl::starlark_defs::context::methods::bxl_context_methods (cyclomatic 18) app/buck2_bxl/src/bxl/starlark_defs/context/methods.rs:87— buck2_bxl::bxl::starlark_defs::context::methods::bxl_context_methods has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 7 function items inside it that branch (bxl_actions, configured_targets, unconfigured_targets, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SimpleConsole::handle_event_inner (cyclomatic 18) app/buck2_client_ctx/src/subscribers/simpleconsole.rs:403— SimpleConsole::handle_event_inner 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.
buck2_cmd_starlark_server::util::paths::starlark_file (cyclomatic 18) app/buck2_cmd_starlark_server/src/util/paths.rs:42— buck2_cmd_starlark_server::util::paths::starlark_file has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
buck2_critical_path::potential::compute_critical_path_potentials (cyclomatic 18) app/buck2_critical_path/src/potential.rs:31— buck2_critical_path::potential::compute_critical_path_potentials has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
buck2_test::command::generate_config_entry_args (cyclomatic 18) app/buck2_test/src/command.rs:1949— buck2_test::command::generate_config_entry_args 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.
ColoredStringParser::apply_sgr (cyclomatic 18) superconsole/src/content/lines.rs:139— ColoredStringParser::apply_sgr 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.
Ready::respawn_cp_sim (cyclomatic 18) tools/retrace/src/gui.rs:1422— Ready::respawn_cp_sim has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ValidationStage.validate (cyclomatic 18) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:1304— ValidationStage.validate 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.
AdbHelper.filterDevices (cyclomatic 18) prelude/toolchains/android/src/com/facebook/buck/android/AdbHelper.java:686— AdbHelper.filterDevices 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.
PostEnterCanonicalizer.getInferredType (cyclomatic 18) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/source/PostEnterCanonicalizer.java:262— PostEnterCanonicalizer.getInferredType 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.
CompilerWorker.runCompilerTask (cyclomatic 18) prelude/toolchains/android/src/com/facebook/buck/jvm/java/Jsr199JavacInvocation.java:435— CompilerWorker.runCompilerTask 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.
prepare_code_signing_entitlements.postprocess_entitlements (cyclomatic 18) prelude/apple/tools/code_signing/prepare_code_signing_entitlements.py:23— prepare_code_signing_entitlements.postprocess_entitlements 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.
DecodeTimeline.DecodeTimeline (cyclomatic 18) app/buck2_trailcam/js/src/components/invocation/DecodeTimeline.tsx:123— DecodeTimeline.DecodeTimeline has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
FileChanges.FileChanges (cyclomatic 18) app/buck2_trailcam/js/src/components/invocation/FileChanges.tsx:68— FileChanges.FileChanges has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
dispatch-worker.ingestChunk (cyclomatic 18) app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts:351— dispatch-worker.ingestChunk has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TransitiveSet::new (cyclomatic 17) app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set.rs:519— TransitiveSet::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.
LegacyConfigFileParser::parse_lines (cyclomatic 17) app/buck2_common/src/legacy_configs/parser.rs:341— LegacyConfigFileParser::parse_lines 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.
buck2_configured::nodes::compute_configured_target_node_no_transition (cyclomatic 17) app/buck2_configured/src/nodes.rs:1131— buck2_configured::nodes::compute_configured_target_node_no_transition 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.
ScribeProducer::send_impl (cyclomatic 17) shed/scribe_client/src/producer.rs:394— ScribeProducer::send_impl 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.
StaleFinder::visit (cyclomatic 17) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:1811— StaleFinder::visit 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.
PercentFormatParser::next (cyclomatic 17) starlark-rust/starlark/src/values/types/string/interpolation.rs:97— PercentFormatParser::next 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.
starlark_bin::bin::main (cyclomatic 17) starlark-rust/starlark_bin/bin/main.rs:277— starlark_bin::bin::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.
GreedyCascade::next_with_cancel (cyclomatic 17) tools/retrace/src/sim.rs:1040— GreedyCascade::next_with_cancel 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.
K2JvmAbiFirAnalysisHandlerExtension.forAllFiles (cyclomatic 17) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/K2JvmAbiFirAnalysisHandlerExtension.kt:714— K2JvmAbiFirAnalysisHandlerExtension.forAllFiles 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.
MergeAndroidResources.sortSymbols (cyclomatic 17) prelude/toolchains/android/src/com/facebook/buck/android/resources/MergeAndroidResources.java:277— MergeAndroidResources.sortSymbols 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.
CentralDirectoryFileHeader.read (cyclomatic 17) prelude/toolchains/android/src/com/facebook/buck/util/zip/CentralDirectoryFileHeader.java:56— CentralDirectoryFileHeader.read 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.
merge_sequence.get_native_linkables_by_merge_sequence (cyclomatic 17) prelude/android/tools/merge_sequence.py:421— merge_sequence.get_native_linkables_by_merge_sequence has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
load-events.extractLoadPackageSpans (cyclomatic 17) app/buck2_trailcam/js/src/lib/load-events.ts:111— load-events.extractLoadPackageSpans 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.
buck2_cmd_audit_server::providers::server_execute_with_dice (cyclomatic 16) app/buck2_cmd_audit_server/src/providers.rs:55— buck2_cmd_audit_server::providers::server_execute_with_dice 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.
buck2_cmd_targets_server::targets::streaming::targets_streaming (cyclomatic 16) app/buck2_cmd_targets_server/src/targets/streaming.rs:98— buck2_cmd_targets_server::targets::streaming::targets_streaming 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.
buck2_events::metadata::collect (cyclomatic 16) app/buck2_events/src/metadata.rs:40— buck2_events::metadata::collect has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, 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.
ReExecutor::re_execute (cyclomatic 16) app/buck2_execute_impl/src/executors/re.rs:166— ReExecutor::re_execute 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.
Processor::handle (cyclomatic 16) app/buck2_execute_impl/src/materializers/v2/core.rs:2076— Processor::handle has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
QueryExprRef::reprint (cyclomatic 16) app/buck2_node/src/attrs/attr_type/query.rs:555— QueryExprRef::reprint has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Arg::traverse (cyclomatic 16) app/buck2_node/src/attrs/attr_type/arg.rs:843— Arg::traverse has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
TenantState::create (cyclomatic 16) app/buck2_server/src/daemon/state.rs:360— TenantState::create 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.
BuckTestOrchestrator::execute_request (cyclomatic 16) app/buck2_test/src/orchestrator.rs:1296— BuckTestOrchestrator::execute_request has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
buck2_wrapper_common::killall (cyclomatic 16) app/buck2_wrapper_common/src/lib.rs:276— buck2_wrapper_common::killall has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Backend::resolve_definition_location (cyclomatic 16) starlark-rust/starlark_lsp/src/server.rs:581— Backend::resolve_definition_location has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
FormatParser::next (cyclomatic 16) starlark-rust/starlark_syntax/src/dot_format_parser.rs:85— FormatParser::next 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.
App::ui (cyclomatic 16) tools/retrace/src/gui.rs:1988— App::ui 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.
StubRenderKt.renderFunction (cyclomatic 16) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/common/stub/render/StubRender.kt:161— StubRenderKt.renderFunction 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.
GenerationContext.<init> (cyclomatic 16) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/stubsgen/generators/GenerationContext.kt:101— GenerationContext.<init> has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
APKModuleGraph.generateSharedModules (cyclomatic 16) prelude/toolchains/android/src/com/facebook/buck/android/apkmodule/APKModuleGraph.java:564— APKModuleGraph.generateSharedModules 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.
AdbHelper.adbCall (cyclomatic 16) prelude/toolchains/android/src/com/facebook/buck/android/AdbHelper.java:221— AdbHelper.adbCall 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.
WindowsFS.createSymbolicLink (cyclomatic 16) prelude/toolchains/android/src/com/facebook/buck/io/windowsfs/WindowsFS.java:102— WindowsFS.createSymbolicLink 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.
AbiFilteringClassVisitor.visitMethod (cyclomatic 16) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/AbiFilteringClassVisitor.java:278— AbiFilteringClassVisitor.visitMethod has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
TestListener.testFinished (cyclomatic 16) prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java:518— TestListener.testFinished 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.
main._main (cyclomatic 16) prelude/apple/tools/bundling/main.py:318— main._main 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.
provisioning_profile_selection.select_best_provisioning_profile_core (cyclomatic 16) prelude/apple/tools/code_signing/provisioning_profile_selection.py:222— provisioning_profile_selection.select_best_provisioning_profile_core 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.
streaming-decode-worker.labelFromValue (cyclomatic 16) app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts:174— streaming-decode-worker.labelFromValue 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.
AnalysisTreemap.AnalysisTreemap (cyclomatic 16) app/buck2_trailcam/js/src/components/invocation/AnalysisTreemap.tsx:26— AnalysisTreemap.AnalysisTreemap has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CriticalPathView.CriticalPathView (cyclomatic 16) app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:366— CriticalPathView.CriticalPathView has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
decoder-worker.labelFromValue (cyclomatic 16) app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts:133— decoder-worker.labelFromValue 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.
dist_lto_planner_gnu.main (cognitive 130) prelude/cxx/dist_lto/tools/dist_lto_planner_gnu.py:108— dist_lto_planner_gnu.main has cognitive complexity 130 (threshold 15). Drivers by points: if/else 38 (92 pts), loops 16 (31 pts), boolean chains 7 (nesting depth added 69). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FirMetadataSanitizerStage.cleanupFirMetadataSources (cognitive 103) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:155— FirMetadataSanitizerStage.cleanupFirMetadataSources has cognitive complexity 103 (threshold 15). Drivers by points: if/else 43 (60 pts), error handling 11 (18 pts), loops 9 (13 pts), boolean chains 9, match/switch 3 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildHistorySidebar.BuildHistorySidebar (cognitive 93) app/buck2_trailcam/js/src/components/invocation/BuildHistorySidebar.tsx:61— BuildHistorySidebar.BuildHistorySidebar has cognitive complexity 93 (threshold 15). Drivers by points: if/else 31 (39 pts), boolean chains 29, ternaries 12 (23 pts), error handling 1, loops 1 (nesting depth added 19). Of this number, 25 points are the body's own statements and 68 belong to 11 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventLogProvider.EventLogProvider (cognitive 92) app/buck2_trailcam/js/src/components/invocation/EventLogProvider.tsx:215— EventLogProvider.EventLogProvider has cognitive complexity 92 (threshold 15). Drivers by points: if/else 39 (60 pts), ternaries 9 (14 pts), error handling 5 (8 pts), boolean chains 5, loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 32). None of this is in the body itself: all 92 points belong to 15 function literals inside it that branch (lines 385, 600, 250, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Collector::event (cognitive 86) tools/retrace/src/ingest/profile.rs:307— Collector::event has cognitive complexity 86 (threshold 15). Drivers by points: if/else 38 (76 pts), match/switch 4 (6 pts), boolean chains 4 (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.
ProgressHeader::draw_unchecked (cognitive 80) app/buck2_client_ctx/src/subscribers/superconsole/header.rs:415— ProgressHeader::draw_unchecked has cognitive complexity 80 (threshold 15). Drivers by points: if/else 39 (69 pts), match/switch 4 (8 pts), boolean chains 2, loops 1 (nesting depth added 34). Of this number, 78 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GraphImpl2.GraphImpl2 (cognitive 76) app/buck2_explain/output_format_js/src/graph2/GraphImpl2.tsx:56— GraphImpl2.GraphImpl2 has cognitive complexity 76 (threshold 15). Drivers by points: if/else 20 (46 pts), loops 14 (26 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 39). Of this number, 74 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GraphImpl2.GraphImpl2 (cognitive 75) app/buck2_explain/js/src/graph2/GraphImpl2.tsx:52— GraphImpl2.GraphImpl2 has cognitive complexity 75 (threshold 15). Drivers by points: if/else 19 (45 pts), loops 13 (26 pts), boolean chains 2, ternaries 1 (2 pts) (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.
K2JvmAbiFirAnalysisHandlerExtension.findClassIdForImportWithProperty (cognitive 63) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/K2JvmAbiFirAnalysisHandlerExtension.kt:1075— K2JvmAbiFirAnalysisHandlerExtension.findClassIdForImportWithProperty has cognitive complexity 63 (threshold 15). Drivers by points: if/else 19 (55 pts), boolean chains 7, loops 1 (nesting depth added 36). 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.
BuckTarget.Normalise (cognitive 62) prelude/go/tools/gobuckify/lib/buck.go:47— BuckTarget.Normalise has cognitive complexity 62 (threshold 15). Drivers by points: loops 16 (38 pts), if/else 8 (22 pts), boolean chains 2 (nesting depth added 36). 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.
InvocationRecorder::handle_snapshot (cognitive 59) app/buck2_client_ctx/src/subscribers/recorder.rs:2132— InvocationRecorder::handle_snapshot has cognitive complexity 59 (threshold 15). Drivers by points: if/else 54 (55 pts), loops 3, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BindingsCollect::visit (cognitive 58) starlark-rust/starlark/src/typing/bindings.rs:290— BindingsCollect::visit has cognitive complexity 58 (threshold 15). Drivers by points: if/else 9 (41 pts), match/switch 5 (14 pts), loops 1 (3 pts) (nesting depth added 43). Of this number, 55 points are the body's own statements and 3 belong to one function item inside it that branches. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
DefParams::unpack (cognitive 58) starlark-rust/starlark_syntax/src/syntax/def.rs:127— DefParams::unpack has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (46 pts), match/switch 5 (10 pts), boolean chains 1, loops 1 (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.
rustc_action.main (cognitive 58) prelude/rust/tools/rustc_action.py:446— rustc_action.main has cognitive complexity 58 (threshold 15). Drivers by points: if/else 25 (39 pts), boolean chains 9, loops 3 (6 pts), ternaries 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MissingConstantDeclarationGenerationExtension.getCallableNamesForClass (cognitive 56) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/K2JvmAbiFirAnalysisHandlerExtension.kt:1405— MissingConstantDeclarationGenerationExtension.getCallableNamesForClass has cognitive complexity 56 (threshold 15). Drivers by points: if/else 9 (40 pts), boolean chains 8, loops 2 (8 pts) (nesting depth added 37). 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.
ConfiguredAttr::concat (cognitive 55) app/buck2_node/src/attrs/configured_attr.rs:382— ConfiguredAttr::concat has cognitive complexity 55 (threshold 15). Drivers by points: match/switch 7 (25 pts), loops 5 (18 pts), if/else 4 (11 pts), boolean chains 1 (nesting depth added 38). 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.
StructuralListArgSorter::visit_expr (cognitive 53) tools/starlark_fmt/lib/autofixes/sort_list_args/structural.rs:198— StructuralListArgSorter::visit_expr has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (38 pts), match/switch 3 (8 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JUnitRunner.run (cognitive 50) prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java:86— JUnitRunner.run has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (39 pts), loops 2 (5 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActionResultsTab.ActionsView (cognitive 50) app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:133— ActionResultsTab.ActionsView has cognitive complexity 50 (threshold 15). Drivers by points: boolean chains 17, if/else 14 (16 pts), ternaries 7 (11 pts), loops 4, match/switch 2 (nesting depth added 6). Most of this is not in the body itself: 11 of the 50 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 139, a function literal at line 212, a function literal at line 221, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
CleanStaleArtifactsCommand::scan_and_create_clean_fut (cognitive 49) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:635— CleanStaleArtifactsCommand::scan_and_create_clean_fut has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (26 pts), match/switch 8 (18 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GlobalTypesBuilder::from_type_expr_impl (cognitive 48) starlark-rust/starlark/src/typing/fill_types_for_lint.rs:579— GlobalTypesBuilder::from_type_expr_impl has cognitive complexity 48 (threshold 15). Drivers by points: match/switch 10 (27 pts), if/else 10 (21 pts) (nesting depth added 28). 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.
CrashAnalyzer.extractSignalCode (cognitive 48) prelude/toolchains/android/src/com/facebook/buck/testrunner/CrashAnalyzer.java:314— CrashAnalyzer.extractSignalCode has cognitive complexity 48 (threshold 15). Drivers by points: if/else 25 (30 pts), boolean chains 18 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
InMemoryPagableStorage::page_out_pending (cognitive 47) pagable/src/storage/in_memory.rs:150— InMemoryPagableStorage::page_out_pending has cognitive complexity 47 (threshold 15). Drivers by points: if/else 7 (27 pts), loops 5 (16 pts), match/switch 1 (4 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HybridExecutor::exec_cmd (cognitive 46) app/buck2_execute_impl/src/executors/hybrid.rs:115— HybridExecutor::exec_cmd has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (36 pts), boolean chains 6, match/switch 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiDexExecutableMain.run (cognitive 46) prelude/toolchains/android/src/com/facebook/buck/android/dex/MultiDexExecutableMain.java:158— MultiDexExecutableMain.run has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (19 pts), ternaries 4 (10 pts), error handling 3 (9 pts), boolean chains 4, loops 1 (4 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.
swift_exec.main (cognitive 46) prelude/apple/tools/swift_exec.py:262— swift_exec.main has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (29 pts), loops 6 (13 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AttrType::coerce_item (cognitive 45) app/buck2_anon_target/src/anon_target_attr_coerce.rs:62— AttrType::coerce_item has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 9 (21 pts) (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
StubJar.writeTo (cognitive 45) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/StubJar.java:121— StubJar.writeTo has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 6 (13 pts), boolean chains 6, ternaries 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LspModule::find_exported_symbol_and_member (cognitive 44) starlark-rust/starlark_lsp/src/definition.rs:474— LspModule::find_exported_symbol_and_member has cognitive complexity 44 (threshold 15). Drivers by points: if/else 7 (31 pts), match/switch 3 (8 pts), loops 2 (5 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CentralDirectoryFileHeader.read (cognitive 43) prelude/toolchains/android/src/com/facebook/buck/util/zip/CentralDirectoryFileHeader.java:56— CentralDirectoryFileHeader.read has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (37 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
merge_sequence.get_native_linkables_by_merge_sequence (cognitive 43) prelude/android/tools/merge_sequence.py:421— merge_sequence.get_native_linkables_by_merge_sequence has cognitive complexity 43 (threshold 15). Drivers by points: if/else 5 (21 pts), loops 8 (19 pts), boolean chains 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rustc_action.handle_output (cognitive 43) prelude/rust/tools/rustc_action.py:361— rustc_action.handle_output has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 2 (5 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandExecutorFactory::get_command_executor (cognitive 42) app/buck2_server/src/daemon/common.rs:189— CommandExecutorFactory::get_command_executor has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 6, match/switch 3 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KwargSorter::process_call (cognitive 42) tools/starlark_fmt/lib/autofixes/sort_kwargs.rs:82— KwargSorter::process_call has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (33 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MissingTypeCollectorVisitor.checkTypeResolvableRecursively (cognitive 42) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/K2JvmAbiFirAnalysisHandlerExtension.kt:297— MissingTypeCollectorVisitor.checkTypeResolvableRecursively has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 2 (9 pts), match/switch 3 (8 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
make_py_package_modules.create_modules_dir (cognitive 42) prelude/python/tools/make_py_package_modules.py:283— make_py_package_modules.create_modules_dir has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 10 (17 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useEventLogState.useEventLogState.filteredEvents (cognitive 42) app/buck2_trailcam/js/src/components/invocation/event-log/useEventLogState.ts:203— useEventLogState.useEventLogState.filteredEvents has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 2 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 25). Of this number, 38 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BaseDeferredKey::make_hashed_path (cognitive 41) app/buck2_core/src/deferred/base_deferred_key.rs:180— BaseDeferredKey::make_hashed_path has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (38 pts), match/switch 2 (3 pts) (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Uploader::upload (cognitive 41) app/buck2_execute/src/re/uploader.rs:138— Uploader::upload has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 4 (7 pts), match/switch 3 (7 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiceExecutionOrder::execute_once (cognitive 41) dice/fuzzy_dice/src/execution.rs:815— DiceExecutionOrder::execute_once has cognitive complexity 41 (threshold 15). Drivers by points: if/else 5 (23 pts), match/switch 4 (12 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fat_jar.main (cognitive 41) prelude/java/tools/fat_jar.py:225— fat_jar.main has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 8, loops 2 (4 pts), ternaries 1 (2 pts) (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.
dispatch-worker.handleMessage (cognitive 41) app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts:573— dispatch-worker.handleMessage has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 8 (14 pts), error handling 4 (9 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 22). Of this number, 31 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_cmd_log_client::snoop::snoop_one (cognitive 40) app/buck2_cmd_log_client/src/snoop.rs:341— buck2_cmd_log_client::snoop::snoop_one has cognitive complexity 40 (threshold 15). Drivers by points: match/switch 10 (24 pts), if/else 7 (15 pts), loops 1 (nesting depth added 22). 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.
ActionErrorDisplay::simple_format_inner (cognitive 40) app/buck2_event_observer/src/display.rs:924— ActionErrorDisplay::simple_format_inner has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (31 pts), match/switch 3 (5 pts), loops 1 (4 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Cleaner::run_inner (cognitive 40) app/buck2_execute_impl/src/materializers/v2/clean_stale.rs:267— Cleaner::run_inner has cognitive complexity 40 (threshold 15). Drivers by points: match/switch 10 (17 pts), if/else 13 (15 pts), loops 5 (7 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
merge_sequence.post_order_traversal_by (cognitive 40) prelude/android/tools/merge_sequence.py:615— merge_sequence.post_order_traversal_by has cognitive complexity 40 (threshold 15). Drivers by points: if/else 5 (16 pts), ternaries 2 (13 pts), loops 3 (11 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LoadTreemap.LoadTreemap (cognitive 40) app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:175— LoadTreemap.LoadTreemap has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 12 (16 pts), boolean chains 11, if/else 10 (11 pts), loops 2 (nesting depth added 5). Of this number, 21 points are the body's own statements and 19 belong to 9 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
LegacyConfigFileParser::parse_lines (cognitive 39) app/buck2_common/src/legacy_configs/parser.rs:341— LegacyConfigFileParser::parse_lines has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (29 pts), match/switch 1 (5 pts), boolean chains 4, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starlark_bin::bin::main (cognitive 38) starlark-rust/starlark_bin/bin/main.rs:277— starlark_bin::bin::main has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 2 (6 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryResultPrinter::print_single_output (cognitive 37) app/buck2_cmd_query_server/src/query/printer.rs:341— QueryResultPrinter::print_single_output has cognitive complexity 37 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 4 (13 pts), match/switch 4 (10 pts) (nesting depth added 25). 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.
ScribeProducer::send_impl (cognitive 37) shed/scribe_client/src/producer.rs:394— ScribeProducer::send_impl has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (26 pts), match/switch 4 (9 pts), loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
K2JvmAbiFirAnalysisHandlerExtension.forAllFiles (cognitive 37) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/K2JvmAbiFirAnalysisHandlerExtension.kt:714— K2JvmAbiFirAnalysisHandlerExtension.forAllFiles has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 3 (5 pts), boolean chains 3 (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.
FirSanitizingVisitor.hasErrorExpression (cognitive 37) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:1093— FirSanitizingVisitor.hasErrorExpression has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (25 pts), error handling 4 (8 pts), boolean chains 3, match/switch 1 (nesting depth added 20). 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.
CommandProfile::validate (cognitive 36) tools/retrace/src/command_profile.rs:437— CommandProfile::validate has cognitive complexity 36 (threshold 15). Drivers by points: loops 12 (18 pts), if/else 7 (16 pts), boolean chains 2 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PostEnterCanonicalizer.getCanonicalType (cognitive 36) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/source/PostEnterCanonicalizer.java:105— PostEnterCanonicalizer.getCanonicalType has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (22 pts), ternaries 4 (8 pts), boolean chains 3, error handling 1 (2 pts), match/switch 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.
prepare_code_signing_entitlements.postprocess_entitlements (cognitive 36) prelude/apple/tools/code_signing/prepare_code_signing_entitlements.py:23— prepare_code_signing_entitlements.postprocess_entitlements has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 4 (11 pts), boolean chains 1 (nesting depth added 21). 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.
streaming-decode-worker.processLargeLog (cognitive 36) app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts:359— streaming-decode-worker.processLargeLog has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (23 pts), loops 5 (9 pts), boolean chains 2, error handling 1, ternaries 1 (nesting depth added 10). Most of this is not in the body itself: 14 of the 36 points are its own statements and the rest belongs to 6 function items inside it that branch (processMessage, flushChunk, flushSummaries, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ConcreteDepFiles::add_path_to_selector (cognitive 35) app/buck2_action_impl/src/actions/impls/run/dep_files.rs:2578— ConcreteDepFiles::add_path_to_selector has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 4 (10 pts), match/switch 2 (5 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D8ExecutableMain.run (cognitive 35) prelude/toolchains/android/src/com/facebook/buck/android/dex/D8ExecutableMain.java:204— D8ExecutableMain.run has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 3, loops 1 (2 pts), ternaries 2, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResultReporter::collect_result (cognitive 34) app/buck2_server_commands/src/build/result_report.rs:132— ResultReporter::collect_result has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 4 (9 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClassStabilityTransformer.computeStability (cognitive 34) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compose/ClassStabilityTransformer.kt:257— ClassStabilityTransformer.computeStability has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ValidatingListener.onImport (cognitive 34) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/source/InterfaceValidator.java:216— ValidatingListener.onImport has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (28 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FormatParser::next (cognitive 33) starlark-rust/starlark_syntax/src/dot_format_parser.rs:85— FormatParser::next has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 2 (6 pts), loops 2 (4 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.
starlark_syntax::syntax::validate::validate_module (cognitive 33) starlark-rust/starlark_syntax/src/syntax/validate.rs:66— starlark_syntax::syntax::validate::validate_module has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 2 (4 pts), boolean chains 2, match/switch 2 (nesting depth added 13). None of this is in the body itself: all 33 points belong to 3 function items inside it that branch (f, validate_params, expr). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ApkBuilder.addNativeLibraries (cognitive 33) prelude/toolchains/android/src/com/facebook/buck/android/apk/sdk/ApkBuilder.java:478— ApkBuilder.addNativeLibraries has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (19 pts), error handling 1 (7 pts), loops 2 (7 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AppendableCentralDirectory.readHeader (cognitive 33) prelude/toolchains/android/src/com/facebook/buck/util/zip/AppendableCentralDirectory.java:67— AppendableCentralDirectory.readHeader has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (29 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
JoinCore::poll (cognitive 32) dice/dice_futures/src/join.rs:200— JoinCore::poll has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (8 pts), match/switch 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MergeAndroidResources.sortSymbols (cognitive 32) prelude/toolchains/android/src/com/facebook/buck/android/resources/MergeAndroidResources.java:277— MergeAndroidResources.sortSymbols has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 4 (7 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChromeTraceFirstPass::handle_event (cognitive 31) app/buck2_log_common/src/chrome_trace.rs:192— ChromeTraceFirstPass::handle_event has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 2 (5 pts) (nesting depth added 17). 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.
DiceStorage::page_out (cognitive 31) dice/dice/src/storage.rs:334— DiceStorage::page_out has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 3 (5 pts), match/switch 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dice::epoch::cycles::strongly_connected_components (cognitive 31) dice/dice/src/epoch/cycles.rs:277— dice::epoch::cycles::strongly_connected_components has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 6 (10 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
testFuncs.load (cognitive 31) prelude/go/tools/testmaingen.go:278— testFuncs.load has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
load-events.extractLoadPackageSpans (cognitive 31) app/buck2_trailcam/js/src/lib/load-events.ts:111— load-events.extractLoadPackageSpans has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (23 pts), ternaries 1 (4 pts), boolean chains 2, loops 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
filters.evaluateFilters (cognitive 31) app/buck2_trailcam/js/src/components/invocation/event-log/filters.ts:63— filters.evaluateFilters has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LongestPathGraphBackend::finish (cognitive 30) app/buck2_build_signals_impl/src/backend/longest_path_graph.rs:121— LongestPathGraphBackend::finish has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 7 (17 pts), loops 4 (7 pts), if/else 2 (6 pts) (nesting depth added 17). 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.
Stmt::render (cognitive 30) tools/starlark_fmt/lib/fuzz_starlark.rs:514— Stmt::render has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 4 (9 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
K2JvmAbiFirAnalysisHandlerExtension.collectMissingConstantsFromSourceFiles (cognitive 30) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/K2JvmAbiFirAnalysisHandlerExtension.kt:964— K2JvmAbiFirAnalysisHandlerExtension.collectMissingConstantsFromSourceFiles has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AndroidBundleBuilderExecutableMain.run (cognitive 30) prelude/toolchains/android/src/com/facebook/buck/android/bundle/AndroidBundleBuilderExecutableMain.java:96— AndroidBundleBuilderExecutableMain.run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 6 (9 pts), error handling 4 (6 pts), ternaries 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdbHelper.filterDevices (cognitive 30) prelude/toolchains/android/src/com/facebook/buck/android/AdbHelper.java:686— AdbHelper.filterDevices has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 4 (11 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
merge_sequence.main (cognitive 30) prelude/android/tools/merge_sequence.py:724— merge_sequence.main has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 6 (15 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CliArgType::parse_clap (cognitive 29) app/buck2_bxl/src/bxl/starlark_defs/cli_args.rs:616— CliArgType::parse_clap has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 6 (11 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BcInstrs::fmt_impl (cognitive 29) starlark-rust/starlark/src/eval/bc/instrs.rs:400— BcInstrs::fmt_impl has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (27 pts), loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CallArgsUnpack::unpack (cognitive 29) starlark-rust/starlark_syntax/src/syntax/call.rs:45— CallArgsUnpack::unpack has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
APKModuleGraph.generateSharedModules (cognitive 29) prelude/toolchains/android/src/com/facebook/buck/android/apkmodule/APKModuleGraph.java:564— APKModuleGraph.generateSharedModules has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 7 (10 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FatJarMain.getCommand (cognitive 29) prelude/toolchains/android/src/com/facebook/buck/jvm/java/fatjar/FatJarMain.java:218— FatJarMain.getCommand has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
critical-path.parseEntry (cognitive 29) app/buck2_trailcam/js/src/lib/critical-path.ts:179— critical-path.parseEntry has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 5, ternaries 3 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
AuditAnalysisQueriesCommand::server_execute (cognitive 28) app/buck2_cmd_audit_server/src/analysis_queries.rs:31— AuditAnalysisQueriesCommand::server_execute has cognitive complexity 28 (threshold 15). Drivers by points: loops 5 (19 pts), if/else 1 (7 pts), match/switch 1 (2 pts) (nesting depth added 21). 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.
CompilerWorker.runCompilerTask (cognitive 28) prelude/toolchains/android/src/com/facebook/buck/jvm/java/Jsr199JavacInvocation.java:435— CompilerWorker.runCompilerTask has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (16 pts), error handling 4 (6 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
signing_context.signing_context_and_selected_identity_from_args (cognitive 28) prelude/apple/tools/bundling/signing_context.py:178— signing_context.signing_context_and_selected_identity_from_args has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (26 pts), ternaries 1 (2 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
compile_and_package.main (cognitive 28) prelude/java/tools/compile_and_package.py:305— compile_and_package.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (22 pts), loops 2 (5 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
compile_kotlin.main (cognitive 28) prelude/kotlin/tools/compile_kotlin/compile_kotlin.py:549— compile_kotlin.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 7 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
InvocationBar.InvocationBar (cognitive 28) app/buck2_trailcam/js/src/components/invocation/InvocationBar.tsx:66— InvocationBar.InvocationBar has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11, ternaries 8 (11 pts), boolean chains 6 (nesting depth added 3). Of this number, 17 points are the body's own statements and 11 belong to 8 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
HealthCheckSubscriber::handle_event (cognitive 27) app/buck2_client_ctx/src/subscribers/health_check_subscriber.rs:88— HealthCheckSubscriber::handle_event has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 5 (9 pts), boolean chains 1 (nesting depth added 13). 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.
buck2_critical_path::potential::compute_critical_path_potentials (cognitive 27) app/buck2_critical_path/src/potential.rs:31— buck2_critical_path::potential::compute_critical_path_potentials has cognitive complexity 27 (threshold 15). Drivers by points: loops 9 (11 pts), match/switch 5 (10 pts), if/else 2 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiLineState::parse_line (cognitive 27) app/buck2_errorformat/src/lib.rs:394— MultiLineState::parse_line has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Span::fmt_for_test (cognitive 27) superconsole/src/content/span.rs:281— Span::fmt_for_test has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 13). Of this number, 19 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ListArgSorter::visit_expr (cognitive 27) tools/starlark_fmt/lib/autofixes/sort_list_args.rs:933— ListArgSorter::visit_expr has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AndroidInstall.installApk (cognitive 27) prelude/toolchains/android/src/com/facebook/buck/installer/android/AndroidInstall.java:72— AndroidInstall.installApk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (6 pts), error handling 3 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbiFilteringClassVisitor.findJvmStaticMemberKeys (cognitive 27) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/AbiFilteringClassVisitor.java:138— AbiFilteringClassVisitor.findJvmStaticMemberKeys has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (8 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sokoban_pipeline.parse_levels_from_file (cognitive 27) games/bin/sokoban_pipeline.py:143— sokoban_pipeline.parse_levels_from_file has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 7, ternaries 1 (4 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
event-log-decoder.extractTargetLabel (cognitive 27) app/buck2_trailcam/js/src/lib/event-log-decoder.ts:228— event-log-decoder.extractTargetLabel has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
critical-path.groupByPhase (cognitive 27) app/buck2_trailcam/js/src/lib/critical-path.ts:339— critical-path.groupByPhase has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 4 (7 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.
SerializeValue::serialize (cognitive 26) app/buck2_build_api/src/actions/impls/json.rs:153— SerializeValue::serialize has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 6 (14 pts), if/else 6 (12 pts) (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AuditExecutionPlatformResolutionCommand::server_execute (cognitive 26) app/buck2_cmd_audit_server/src/execution_platform_resolution.rs:42— AuditExecutionPlatformResolutionCommand::server_execute has cognitive complexity 26 (threshold 15). Drivers by points: loops 6 (15 pts), match/switch 5 (11 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
StubRenderKt.renderFunction (cognitive 26) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/common/stub/render/StubRender.kt:161— StubRenderKt.renderFunction has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
provisioning_profile_selection.select_best_provisioning_profile_core (cognitive 26) prelude/apple/tools/code_signing/provisioning_profile_selection.py:222— provisioning_profile_selection.select_best_provisioning_profile_core has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dist_lto_planner_darwin.main (cognitive 26) prelude/cxx/dist_lto/tools/dist_lto_planner_darwin.py:183— dist_lto_planner_darwin.main has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (5 pts), ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buildscript_run.main (cognitive 26) prelude/rust/tools/buildscript_run.py:211— buildscript_run.main has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extract_link_action.process_link_args (cognitive 26) prelude/rust/tools/extract_link_action.py:123— extract_link_action.process_link_args has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
allocative_derive::derive_allocative::extract_attrs (cognitive 25) allocative/allocative_derive/src/derive_allocative.rs:308— allocative_derive::derive_allocative::extract_attrs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_bxl::bxl::starlark_defs::context::methods::bxl_context_methods (cognitive 25) app/buck2_bxl/src/bxl/starlark_defs/context/methods.rs:87— buck2_bxl::bxl::starlark_defs::context::methods::bxl_context_methods has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 9 (12 pts), if/else 8 (11 pts), boolean chains 2 (nesting depth added 6). None of this is in the body itself: all 25 points belong to 7 function items inside it that branch (bxl_actions, configured_targets, unconfigured_targets, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ConsoleInteractionStream::interaction (cognitive 25) app/buck2_client_ctx/src/console_interaction_stream.rs:286— ConsoleInteractionStream::interaction has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 4 (12 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OutputFormatWithWriter::emit_command (cognitive 25) app/buck2_cmd_log_client/src/what_ran.rs:376— OutputFormatWithWriter::emit_command has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 4 (9 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WhatRanCommandState::event (cognitive 25) app/buck2_cmd_log_client/src/what_ran.rs:256— WhatRanCommandState::event has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ReExecutor::re_execute (cognitive 25) app/buck2_execute_impl/src/executors/re.rs:166— ReExecutor::re_execute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (18 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MiniAapt.addStyleItemReference (cognitive 25) prelude/toolchains/android/src/com/facebook/buck/android/aapt/MiniAapt.java:397— MiniAapt.addStyleItemReference has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 9, ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CentralDirectoryReader.readCentralDirectory (cognitive 25) prelude/toolchains/android/src/com/facebook/buck/util/zip/CentralDirectoryReader.java:88— CentralDirectoryReader.readCentralDirectory has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (22 pts), boolean chains 2, loops 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
dist_lto_opt_gnu._filter_flags (cognitive 25) prelude/cxx/dist_lto/tools/dist_lto_opt_gnu.py:31— dist_lto_opt_gnu._filter_flags has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gobuckifylib.CollectPackages (cognitive 25) prelude/go/tools/gobuckify/lib/golist.go:160— gobuckifylib.CollectPackages has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (10 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). Of this number, 19 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
streaming-decode-worker.labelFromValue (cognitive 25) app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts:174— streaming-decode-worker.labelFromValue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (7 pts), boolean chains 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
streaming-decode-worker.extractTargetLabel (cognitive 25) app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts:201— streaming-decode-worker.extractTargetLabel has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
decoder-worker.labelFromValue (cognitive 25) app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts:133— decoder-worker.labelFromValue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (7 pts), boolean chains 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
decoder-worker.extractTargetLabel (cognitive 25) app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts:162— decoder-worker.extractTargetLabel has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResolvedQueryMacro::add_to_arg (cognitive 24) app/buck2_build_api/src/interpreter/rule_defs/resolve_query_macro.rs:98— ResolvedQueryMacro::add_to_arg has cognitive complexity 24 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 3 (11 pts), match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ConfiguredTargetsServerCommand::command (cognitive 24) app/buck2_cmd_targets_server/src/ctargets.rs:61— ConfiguredTargetsServerCommand::command has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts), match/switch 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.
CriticalPathEntryDisplay::from_entry (cognitive 24) app/buck2_event_observer/src/display.rs:1238— CriticalPathEntryDisplay::from_entry has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 12 (21 pts), if/else 2 (3 pts) (nesting depth added 10). 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.
GreedyCascade::next_with_cancel (cognitive 24) tools/retrace/src/sim.rs:1040— GreedyCascade::next_with_cancel has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (7 pts), boolean chains 5 (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.
create_link_tree.main (cognitive 24) prelude/python/tools/create_link_tree.py:16— create_link_tree.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (16 pts), error handling 1 (4 pts), loops 3 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extract.main (cognitive 24) prelude/python/tools/extract.py:97— extract.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (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.
BuckActionExecutor::execute (cognitive 23) app/buck2_build_api/src/actions/execute/action_executor.rs:929— BuckActionExecutor::execute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (nesting depth added 11). Of this number, 20 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ForwardingState::compute_next_transition (cognitive 23) app/buck2_client_ctx/src/stream_util.rs:35— ForwardingState::compute_next_transition has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 10 (20 pts), if/else 2 (3 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WhatUploadedCommand::exec_impl (cognitive 23) app/buck2_cmd_log_client/src/what_uploaded.rs:158— WhatUploadedCommand::exec_impl has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (6 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Evaluator::eval_statements (cognitive 23) starlark-rust/starlark/src/debug/evaluate.rs:33— Evaluator::eval_statements has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (8 pts), match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlastIndex::blast_of_cancellable (cognitive 23) tools/retrace/src/blast.rs:167— BlastIndex::blast_of_cancellable has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FirMetadataSanitizerStage.hasErrorExpressionRecursive (cognitive 23) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:809— FirMetadataSanitizerStage.hasErrorExpressionRecursive has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 3, error handling 1 (2 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ValidationStage.validate (cognitive 23) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:1304— ValidationStage.validate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 8, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MiniAapt.processValuesFile (cognitive 23) prelude/toolchains/android/src/com/facebook/buck/android/aapt/MiniAapt.java:290— MiniAapt.processValuesFile has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecondaryDexCompressionExecutableMain.run (cognitive 23) prelude/toolchains/android/src/com/facebook/buck/android/dex/SecondaryDexCompressionExecutableMain.java:85— SecondaryDexCompressionExecutableMain.run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (6 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extract.extract (cognitive 23) prelude/python/tools/extract.py:61— extract.extract has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 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.
make_py_package_manifest_module.main (cognitive 23) prelude/python/tools/make_py_package_manifest_module.py:87— make_py_package_manifest_module.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
action-events.extractActionSpans (cognitive 23) app/buck2_trailcam/js/src/lib/action-events.ts:104— action-events.extractActionSpans has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, ternaries 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.
ActionTreemap.ActionTreemap (cognitive 23) app/buck2_trailcam/js/src/components/invocation/ActionTreemap.tsx:24— ActionTreemap.ActionTreemap has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 7, boolean chains 5 (nesting depth added 6). Of this number, 15 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventLogDetailPanel.EventLogDetailPanel (cognitive 23) app/buck2_trailcam/js/src/components/invocation/event-log/EventLogDetailPanel.tsx:26— EventLogDetailPanel.EventLogDetailPanel has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (13 pts), boolean chains 8, if/else 2 (nesting depth added 6). Of this number, 22 points are the body's own statements and 1 belongs to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DetailedAggregatedMetricsStateTracker::compute_metrics (cognitive 22) app/buck2_build_api/src/build/detailed_aggregated_metrics/implementation/state.rs:115— DetailedAggregatedMetricsStateTracker::compute_metrics has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (12 pts), if/else 7 (10 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CommandLineBuilderRegular::write_str_inner (cognitive 22) app/buck2_build_api/src/interpreter/rule_defs/cmd_args/builder.rs:718— CommandLineBuilderRegular::write_str_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransitiveSet::new (cognitive 22) app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set.rs:519— TransitiveSet::new has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 3, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AuditIncludesCommand::server_execute (cognitive 22) app/buck2_cmd_audit_server/src/includes.rs:205— AuditIncludesCommand::server_execute has cognitive complexity 22 (threshold 15). Drivers by points: loops 4 (10 pts), match/switch 2 (7 pts), if/else 4 (5 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SnoopCommand::exec_impl (cognitive 22) app/buck2_cmd_log_client/src/snoop.rs:95— SnoopCommand::exec_impl has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 4 (6 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 10). 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.
BuckTestOrchestrator::execute_request (cognitive 22) app/buck2_test/src/orchestrator.rs:1296— BuckTestOrchestrator::execute_request has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 7 (12 pts), if/else 5 (8 pts), boolean chains 2 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AutoBoundVisitor::visit_type_path (cognitive 22) starlark-rust/starlark_derive/src/starlark_pagable.rs:302— AutoBoundVisitor::visit_type_path has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CascadeState::poll (cognitive 22) tools/retrace/src/gui/cascade.rs:201— CascadeState::poll has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
App::ui (cognitive 22) tools/retrace/src/gui.rs:1988— App::ui has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
APKModuleGraphExecutableMain.run (cognitive 22) prelude/toolchains/android/src/com/facebook/buck/android/apkmodule/APKModuleGraphExecutableMain.java:96— APKModuleGraphExecutableMain.run has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (11 pts), loops 3 (6 pts), if/else 5 (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.
BuildConfigFields.generateBuildConfigDotJava (cognitive 22) prelude/toolchains/android/src/com/facebook/buck/android/build_config/BuildConfigFields.java:183— BuildConfigFields.generateBuildConfigDotJava has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MergeAndroidResources.writePerPackageRDotJava (cognitive 22) prelude/toolchains/android/src/com/facebook/buck/android/resources/MergeAndroidResources.java:222— MergeAndroidResources.writePerPackageRDotJava has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (14 pts), ternaries 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TraversableGraphs.isAcyclic (cognitive 22) prelude/toolchains/android/src/com/facebook/buck/core/util/graph/TraversableGraphs.java:113— TraversableGraphs.isAcyclic has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (7 pts), boolean chains 2, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PostEnterCanonicalizer.getInferredType (cognitive 22) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/source/PostEnterCanonicalizer.java:262— PostEnterCanonicalizer.getInferredType has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, 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.
BaseRunner.parseArgs (cognitive 22) REDACTED:219— BaseRunner.parseArgs has cognitive complexity 22 (threshold 15). Drivers by points: error handling 3 (9 pts), if/else 4 (8 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ZipScrubber.scrubExtraFields (cognitive 22) prelude/toolchains/android/src/com/facebook/buck/util/zip/ZipScrubber.java:186— ZipScrubber.scrubExtraFields has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sort_pre_dexed_files._organize_lib (cognitive 22) prelude/android/tools/sort_pre_dexed_files.py:221— sort_pre_dexed_files._organize_lib has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 4 (8 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dist_lto_prepare_gnu.main (cognitive 22) prelude/cxx/dist_lto/tools/dist_lto_prepare_gnu.py:75— dist_lto_prepare_gnu.main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (9 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dependency_analyzer.extract_dependencies (cognitive 22) prelude/erlang/toolchain/dependency_analyzer.erl:108— dependency_analyzer.extract_dependencies has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (10 pts), match/switch 5 (8 pts), if/else 1 (3 pts), boolean chains 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
App.App (cognitive 22) app/buck2_explain/js/src/App.tsx:56— App.App has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 8 (10 pts), boolean chains 1, error handling 1 (nesting depth added 8). None of this is in the body itself: all 22 points belong to one function literal inside it that branches (line 63). 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.
DecodeStatsPanel.DecodeStatsPanel (cognitive 22) app/buck2_trailcam/js/src/components/invocation/DecodeStatsPanel.tsx:153— DecodeStatsPanel.DecodeStatsPanel has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 7, if/else 2 (nesting depth added 3). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
BuckOutPathTypePrinter::all_attributes (cognitive 21) app/buck2_cmd_audit_server/src/output/buck_out_path_type_printer.rs:69— BuckOutPathTypePrinter::all_attributes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
buck2_cmd_starlark_server::util::paths::starlark_file (cognitive 21) app/buck2_cmd_starlark_server/src/util/paths.rs:42— buck2_cmd_starlark_server::util::paths::starlark_file has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 4 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Batcher::finish (cognitive 21) app/buck2_execute/src/re/presence.rs:461— Batcher::finish has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 2 (6 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Menu::input (cognitive 21) games/src/games/menu.rs:128— Menu::input has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 3 (5 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
REClient::get_digests_ttl (cognitive 21) remote_execution/oss/re_grpc/src/client.rs:1073— REClient::get_digests_ttl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypeExprUnpackP::unpack_path (cognitive 21) starlark-rust/starlark_syntax/src/syntax/type_expr.rs:85— TypeExprUnpackP::unpack_path has cognitive complexity 21 (threshold 15). Drivers by points: if/else 2 (9 pts), loops 2 (8 pts), match/switch 2 (4 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Phase::interval (cognitive 21) tools/retrace/src/ingest/profile.rs:81— Phase::interval has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplayScratch::path (cognitive 21) tools/retrace/src/sim.rs:868— ReplayScratch::path has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortKey::extract (cognitive 21) tools/starlark_fmt/lib/sort_key.rs:158— SortKey::extract has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 6 (13 pts), if/else 2 (6 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AndroidDeviceImpl.installApexOnDevice (cognitive 21) prelude/toolchains/android/src/com/facebook/buck/android/exopackage/AndroidDeviceImpl.kt:249— AndroidDeviceImpl.installApexOnDevice has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 3 (6 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.
KosabiClassUsageCollector.recordClassDeclaration (cognitive 21) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/KosabiClassUsageCollector.kt:262— KosabiClassUsageCollector.recordClassDeclaration has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
GenericStubsGenerator.generateStubs (cognitive 21) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/stubsgen/generators/GenericStubsGenerator.kt:22— GenericStubsGenerator.generateStubs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 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.
process._traverse_keypath (cognitive 21) prelude/apple/tools/info_plist_processor/process.py:72— process._traverse_keypath has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compile_and_package._run_javac (cognitive 21) prelude/java/tools/compile_and_package.py:180— compile_and_package._run_javac has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 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.
main.matchPattern (cognitive 21) prelude/go/tools/gen_embedcfg.go:153— main.matchPattern has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
driver.queryBXL (cognitive 21) prelude/go/tools/gopackagesdriver/driver/query_bxl.go:37— driver.queryBXL has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EscapeState::feed (cognitive 20) app/buck2_client_ctx/src/subscribers/superconsole.rs:216— EscapeState::feed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 4 (8 pts), boolean chains 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
StaleFinder::visit (cognitive 20) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:1811— StaleFinder::visit has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 7 (15 pts), if/else 2 (4 pts), loops 1 (nesting depth added 10). 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.
buck2_log_common::chrome_trace::build_phase_mask (cognitive 20) app/buck2_log_common/src/chrome_trace.rs:792— buck2_log_common::chrome_trace::build_phase_mask has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 2 (6 pts), loops 1 (3 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TenantState::create (cognitive 20) app/buck2_server/src/daemon/state.rs:360— TenantState::create has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, boolean chains 5, loops 1, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PagableStorage::page_out_item_ticketed (cognitive 20) pagable/src/storage/traits.rs:551— PagableStorage::page_out_item_ticketed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Backend::resolve_definition_location (cognitive 20) starlark-rust/starlark_lsp/src/server.rs:581— Backend::resolve_definition_location has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 9 (18 pts), if/else 1 (2 pts) (nesting depth added 10). 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.
StubRenderKt.renderType (cognitive 20) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/common/stub/render/StubRender.kt:93— StubRenderKt.renderType has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 3, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PrivateMetadataStripper.transform (cognitive 20) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/BytecodeTransformer.kt:143— PrivateMetadataStripper.transform has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, match/switch 3, error handling 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
CrashAnalyzer.analyzeCrashInformation (cognitive 20) prelude/toolchains/android/src/com/facebook/buck/testrunner/CrashAnalyzer.java:100— CrashAnalyzer.analyzeCrashInformation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
consolidate_class_names.main (cognitive 20) prelude/android/tools/consolidate_class_names.py:43— consolidate_class_names.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FinalLibGraph.assign_names (cognitive 20) prelude/android/tools/merge_sequence.py:310— FinalLibGraph.assign_names has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
typechecker._run (cognitive 20) prelude/kotlin/tools/typechecker/typechecker.py:178— typechecker._run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), loops 4, boolean chains 1, error handling 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
VarintStreamParser.parseInPlace (cognitive 20) app/buck2_trailcam/js/src/lib/varint-stream-parser.ts:130— VarintStreamParser.parseInPlace has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenericTreemapView.GenericTreemapView (cognitive 20) app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:149— GenericTreemapView.GenericTreemapView has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8, boolean chains 6, if/else 3 (4 pts), loops 2 (nesting depth added 1). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 271, 178, 214, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
TransitiveSetArgsProjection::as_command_line (cognitive 19) app/buck2_build_api/src/interpreter/rule_defs/transitive_set/transitive_set_args_projection.rs:111— TransitiveSetArgsProjection::as_command_line has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 3 (5 pts), match/switch 4 (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.
GatherPackageListingError::fmt (cognitive 19) app/buck2_common/src/package_listing/interpreter.rs:177— GatherPackageListingError::fmt has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 4 (9 pts) (nesting depth added 10). 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.
ConfiguredTargetNodeCalculationInstance::get_configured_target_node (cognitive 19) app/buck2_configured/src/nodes.rs:1650— ConfiguredTargetNodeCalculationInstance::get_configured_target_node has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 1 (5 pts) (nesting depth added 13). 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.
Error::from (cognitive 19) app/buck2_build_api/src/actions/errors/action_error.rs:31— Error::from has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 2, loops 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BuildProgressStateTracker::handle_actions (cognitive 19) app/buck2_event_observer/src/progress.rs:344— BuildProgressStateTracker::handle_actions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 2 (3 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
VisibilityPatternList::any_matches (cognitive 19) app/buck2_node/src/visibility.rs:483— VisibilityPatternList::any_matches has cognitive complexity 19 (threshold 15). Drivers by points: if/else 2 (9 pts), loops 2 (6 pts), match/switch 2 (4 pts) (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
UqueryEnvironment::owner (cognitive 19) app/buck2_query_impls/src/uquery/environment.rs:350— UqueryEnvironment::owner has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 2 (6 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Arguments::names_map (cognitive 19) starlark-rust/starlark/src/eval/runtime/arguments.rs:275— Arguments::names_map has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 3 (7 pts), match/switch 2 (4 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
JArgs::sanitize (cognitive 19) tools/retrace/src/analyses.rs:870— JArgs::sanitize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 5 (8 pts) (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StringResourcesUtils.copyVoltronStringResources (cognitive 19) prelude/toolchains/android/src/com/facebook/buck/android/resources/strings/StringResourcesUtils.java:60— StringResourcesUtils.copyVoltronStringResources has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResTableType.processReferencesAt (cognitive 19) prelude/toolchains/android/src/com/facebook/buck/android/resources/ResTableType.java:451— ResTableType.processReferencesAt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowsFS.createSymbolicLink (cognitive 19) prelude/toolchains/android/src/com/facebook/buck/io/windowsfs/WindowsFS.java:102— WindowsFS.createSymbolicLink has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, ternaries 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbiFilteringClassVisitor.isHiddenDeprecated (cognitive 19) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/AbiFilteringClassVisitor.java:199— AbiFilteringClassVisitor.isHiddenDeprecated has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BridgeMethodsFinder.findBridgesToType (cognitive 19) prelude/toolchains/android/src/com/facebook/buck/jvm/java/plugin/adapter/BridgeMethods.java:114— BridgeMethodsFinder.findBridgesToType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KotlincStep.getOptions (cognitive 19) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/KotlincStep.java:283— KotlincStep.getOptions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TestListener.testFinished (cognitive 19) prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java:518— TestListener.testFinished has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 4 (5 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ZipScrubber.getLocalHeaderOffset (cognitive 19) prelude/toolchains/android/src/com/facebook/buck/util/zip/ZipScrubber.java:132— ZipScrubber.getLocalHeaderOffset has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
assemble_bundle._assemble_incrementally (cognitive 19) prelude/apple/tools/bundling/assemble_bundle.py:134— assemble_bundle._assemble_incrementally has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main._main (cognitive 19) prelude/apple/tools/bundling/main.py:318— main._main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
list_class_names._get_class_names (cognitive 19) prelude/java/tools/list_class_names.py:60— list_class_names._get_class_names has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
package_tree.assemble_package (cognitive 19) prelude/nodejs/tools/package_tree.py:51— package_tree.assemble_package has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (5 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
driver.parsePatterns (cognitive 19) prelude/go/tools/gopackagesdriver/driver/targets.go:26— driver.parsePatterns has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shell_buck2_module_search.find_module_source (cognitive 19) prelude/erlang/shell/src/shell_buck2_module_search.erl:50— shell_buck2_module_search.find_module_source has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (5 pts), match/switch 4 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CriticalPathChart.CriticalPathChart (cognitive 19) app/buck2_trailcam/js/src/components/invocation/CriticalPathChart.tsx:43— CriticalPathChart.CriticalPathChart has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, ternaries 5 (6 pts), boolean chains 5 (nesting depth added 1). Of this number, 11 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
renderer.addTab (cognitive 19) explorer/renderer.js:68— renderer.addTab has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (6 pts), error handling 1 (nesting depth added 10). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 70). 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.
AnonTargetAttr::resolve_single (cognitive 18) app/buck2_anon_target/src/anon_target_attr_resolve.rs:83— AnonTargetAttr::resolve_single has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TargetListExpr::unpack_iterable (cognitive 18) app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs:403— TargetListExpr::unpack_iterable has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 2 (5 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
StatusCommand::exec (cognitive 18) app/buck2_client/src/commands/status.rs:41— StatusCommand::exec has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SystemWarningComponent::draw_unchecked (cognitive 18) app/buck2_client_ctx/src/subscribers/superconsole/system_warning.rs:36— SystemWarningComponent::draw_unchecked has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 1 (4 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExternalConfigDiffCommand::exec_impl (cognitive 18) app/buck2_cmd_log_client/src/diff/external_config_diff.rs:206— ExternalConfigDiffCommand::exec_impl has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (6 pts), match/switch 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_events::metadata::collect (cognitive 18) app/buck2_events/src/metadata.rs:40— buck2_events::metadata::collect has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 1 (2 pts) (nesting depth added 3). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: 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.
Scan::visit (cognitive 18) app/buck2_execute_impl/src/materializers/v2/clean_stale.rs:989— Scan::visit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 4 (7 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IoError::convert_to_buck2_error (cognitive 18) app/buck2_fs/src/error.rs:281— IoError::convert_to_buck2_error has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 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.
Scheduler::update (cognitive 18) app/buck2_resource_control/src/scheduler.rs:433— Scheduler::update has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, match/switch 2, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TestLabelFiltering::is_excluded (cognitive 18) app/buck2_test/src/command.rs:1903— TestLabelFiltering::is_excluded has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenerationContext.<init> (cognitive 18) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/stubsgen/generators/GenerationContext.kt:101— GenerationContext.<init> has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
InterfaceStubsGenerator.generateStubs (cognitive 18) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/stubsgen/generators/InterfaceStubsGenerator.kt:22— InterfaceStubsGenerator.generateStubs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApkBuilder.processFileForResource (cognitive 18) prelude/toolchains/android/src/com/facebook/buck/android/apk/sdk/ApkBuilder.java:596— ApkBuilder.processFileForResource has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (4 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.
ResourceFilters.filterByDensity (cognitive 18) prelude/toolchains/android/src/com/facebook/buck/android/resources/filter/ResourceFilters.java:163— ResourceFilters.filterByDensity has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 4 (7 pts), boolean chains 2, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompileStrings.groupFilesByLocale (cognitive 18) prelude/toolchains/android/src/com/facebook/buck/android/resources/strings/CompileStrings.java:191— CompileStrings.groupFilesByLocale has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdbHelper.adbCall (cognitive 18) prelude/toolchains/android/src/com/facebook/buck/android/AdbHelper.java:221— AdbHelper.adbCall has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 4 (5 pts), boolean chains 2, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
CompilerWorker.createCompilationUnits (cognitive 18) prelude/toolchains/android/src/com/facebook/buck/jvm/java/Jsr199JavacInvocation.java:671— CompilerWorker.createCompilationUnits has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 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.
combine_native_library_dirs.main (cognitive 18) prelude/android/tools/combine_native_library_dirs.py:16— combine_native_library_dirs.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
unpack_aar.main (cognitive 18) prelude/android/tools/unpack_aar.py:97— unpack_aar.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17 (18 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
compile_kotlin._run_kotlinc (cognitive 18) prelude/kotlin/tools/compile_kotlin/compile_kotlin.py:265— compile_kotlin._run_kotlinc has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LiveBuilder._gen_contents (cognitive 18) prelude/python/tools/make_par/live_builder.py:54— LiveBuilder._gen_contents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 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.
driver.query (cognitive 18) prelude/go/tools/gopackagesdriver/driver/driver.go:39— driver.query has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
event-log-decoder.decodeEventLogWithSummaries (cognitive 18) app/buck2_trailcam/js/src/lib/event-log-decoder.ts:549— event-log-decoder.decodeEventLogWithSummaries has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 1 (2 pts), loops 2 (nesting depth added 7). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnalysisTreemap.AnalysisTreemap (cognitive 18) app/buck2_trailcam/js/src/components/invocation/AnalysisTreemap.tsx:26— AnalysisTreemap.AnalysisTreemap has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 6, boolean chains 4 (nesting depth added 4). Of this number, 11 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CriticalPathView.CriticalPathView (cognitive 18) app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:366— CriticalPathView.CriticalPathView has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, ternaries 4 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 2). Of this number, 12 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
buck2::exec (cognitive 17) app/buck2/src/lib.rs:266— buck2::exec has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1, 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.
NodeKey::into_critical_path_entry_data (cognitive 17) app/buck2_build_signals_impl/src/lib.rs:175— NodeKey::into_critical_path_entry_data has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 6 (10 pts), if/else 2 (7 pts) (nesting depth added 9). 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.
BuildSignalSender::key_activated (cognitive 17) app/buck2_build_signals_impl/src/lib.rs:625— BuildSignalSender::key_activated has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 2 (3 pts) (nesting depth added 5). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuckConfigBasedCells::parse_with_file_ops_and_options_inner (cognitive 17) app/buck2_common/src/legacy_configs/cells.rs:279— BuckConfigBasedCells::parse_with_file_ops_and_options_inner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 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.
buck2_core::configuration::cfg_diff::cfg_diff (cognitive 17) app/buck2_core/src/configuration/cfg_diff.rs:21— buck2_core::configuration::cfg_diff::cfg_diff has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 6 (9 pts), if/else 3 (7 pts), loops 1 (nesting depth added 7). 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.
DynamicAttrType::coerce (cognitive 17) app/buck2_dynamic_actions/src/attrs.rs:289— DynamicAttrType::coerce has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ReDirectorySerializer::create_re_directory (cognitive 17) app/buck2_execute/src/directory.rs:145— ReDirectorySerializer::create_re_directory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Processor::handle (cognitive 17) app/buck2_execute_impl/src/materializers/v2/core.rs:2076— Processor::handle has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (9 pts), loops 3 (6 pts), if/else 1 (2 pts) (nesting depth added 9). 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.
StarlarkIntRef::right_shift (cognitive 17) starlark-rust/starlark/src/values/types/int/int_or_big.rs:364— StarlarkIntRef::right_shift has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1, 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.
TraceAttrs::parse (cognitive 17) starlark-rust/starlark_derive/src/trace.rs:136— TraceAttrs::parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ColoredStringParser::apply_sgr (cognitive 17) superconsole/src/content/lines.rs:139— ColoredStringParser::apply_sgr has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResolvedJavacOptions.appendOptionsTo (cognitive 17) prelude/toolchains/android/src/com/facebook/buck/jvm/java/ResolvedJavacOptions.kt:75— ResolvedJavacOptions.appendOptionsTo has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 7 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D8Utils.runD8Command (cognitive 17) prelude/toolchains/android/src/com/facebook/buck/android/dex/D8Utils.java:135— D8Utils.runD8Command has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 4, error handling 1, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ExoResourcesRewriter.rewriteRDotTxt (cognitive 17) prelude/toolchains/android/src/com/facebook/buck/android/resources/ExoResourcesRewriter.java:171— ExoResourcesRewriter.rewriteRDotTxt has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 3 (7 pts), error handling 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CompilerWorker.buildAbiJar (cognitive 17) prelude/toolchains/android/src/com/facebook/buck/jvm/java/Jsr199JavacInvocation.java:228— CompilerWorker.buildAbiJar has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (4 pts), error handling 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseRunner.writeResult (cognitive 17) REDACTED:80— BaseRunner.writeResult has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JUnitRunner.setupLogging (cognitive 17) prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java:245— JUnitRunner.setupLogging has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
combine_apk_with_relinked_libs.main (cognitive 17) prelude/android/tools/combine_apk_with_relinked_libs.py:250— combine_apk_with_relinked_libs.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
package_tree._cmd_call_arg (cognitive 17) prelude/nodejs/tools/package_tree.py:366— package_tree._cmd_call_arg has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shared_libraries_symlink_tree.main (cognitive 17) prelude/rust/tools/shared_libraries_symlink_tree.py:68— shared_libraries_symlink_tree.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
conan_package.verify_build_and_cached_deps (cognitive 17) prelude/toolchains/conan/conan_package.py:43— conan_package.verify_build_and_cached_deps has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (7 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.
unzip.do_unzip (cognitive 17) prelude/zip_file/tools/unzip.py:24— unzip.do_unzip has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
event-log-decoder.decodeEventLogBatched (cognitive 17) app/buck2_trailcam/js/src/lib/event-log-decoder.ts:420— event-log-decoder.decodeEventLogBatched has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PerfettoEmbed.PerfettoEmbed (cognitive 17) REDACTED:23— PerfettoEmbed.PerfettoEmbed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 6, ternaries 1 (2 pts), error handling 1 (nesting depth added 1). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 37, 76, 101, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
decoder-worker.onmessage::processMessage (cognitive 17) app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts:245— decoder-worker.onmessage::processMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (5 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dispatch-worker.ingestChunk (cognitive 17) app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts:351— dispatch-worker.ingestChunk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 2, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CasArtifactAction::execute (cognitive 16) app/buck2_action_impl/src/actions/impls/cas_artifact.rs:484— CasArtifactAction::execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, match/switch 5 (7 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AnonTargetKey::prepare_anon_target_data (cognitive 16) app/buck2_anon_target/src/anon_targets.rs:256— AnonTargetKey::prepare_anon_target_data has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 3 (6 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LoadGraphPropertiesKey::compute (cognitive 16) app/buck2_build_api/src/build/detailed_aggregated_metrics/buck2_sketches.rs:353— LoadGraphPropertiesKey::compute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RunCommand::exec_impl (cognitive 16) app/buck2_client/src/commands/run.rs:120— RunCommand::exec_impl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TargetsCommand::output_format (cognitive 16) app/buck2_client/src/commands/targets.rs:244— TargetsCommand::output_format has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WhatMaterializedCommand::exec_impl (cognitive 16) app/buck2_cmd_log_client/src/what_materialized.rs:172— WhatMaterializedCommand::exec_impl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 2 (5 pts), loops 2 (3 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.
Environment::get_names (cognitive 16) app/buck2_cmd_starlark_server/src/util/environment.rs:72— Environment::get_names has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 4 (7 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BuckConfigTargetAliasResolver::resolve_alias (cognitive 16) app/buck2_common/src/target_aliases.rs:89— BuckConfigTargetAliasResolver::resolve_alias has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DaemonCommand::run (cognitive 16) app/buck2_daemon/src/daemon.rs:243— DaemonCommand::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TtlRefresher::pass (cognitive 16) app/buck2_execute/src/re/ttl_refresh.rs:177— TtlRefresher::pass has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (9 pts), loops 2 (6 pts), if/else 1 (nesting depth added 10). 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.
NotifyFileData::sync (cognitive 16) app/buck2_file_watcher/src/notify.rs:133— NotifyFileData::sync has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 4, loops 1 (nesting depth added 7). 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.
QueryExprRef::reprint (cognitive 16) app/buck2_node/src/attrs/attr_type/query.rs:555— QueryExprRef::reprint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 3 (6 pts), match/switch 2 (4 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ActiveCommandStateWriter::peek_event (cognitive 16) app/buck2_server/src/active_commands.rs:198— ActiveCommandStateWriter::peek_event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServerState::variables (cognitive 16) app/buck2_server_starlark_debug/src/server.rs:514— ServerState::variables has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
buck2_server_starlark_debug::run::run_dap_server (cognitive 16) app/buck2_server_starlark_debug/src/run.rs:61— buck2_server_starlark_debug::run::run_dap_server has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 2 (7 pts), loops 1 (nesting depth added 10). 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.
Develop::from_command (cognitive 16) integrations/rust-project/src/cli/develop.rs:58— Develop::from_command has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 2 (4 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.
DapAdapterEvalHookImpl::call (cognitive 16) starlark-rust/starlark/src/debug/adapter/implementation.rs:112— DapAdapterEvalHookImpl::call has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 4, loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ReadinessGraph::complete (cognitive 16) starlark-rust/starlark/src/pagable/starlark_deserialize_context/readiness.rs:327— ReadinessGraph::complete has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 3 (5 pts), boolean chains 2, match/switch 1 (nesting depth added 5). 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.
TypingContext::expression_bind_type (cognitive 16) starlark-rust/starlark/src/typing/ctx.rs:163— TypingContext::expression_bind_type has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 3 (6 pts), loops 1 (2 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Ty::typecheck_union_simple (cognitive 16) starlark-rust/starlark/src/typing/ty.rs:371— Ty::typecheck_union_simple has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), match/switch 2 (6 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JavaAndNativeResourceFilter.checkEntry (cognitive 16) prelude/toolchains/android/src/com/facebook/buck/android/apk/sdk/ApkBuilder.java:99— JavaAndNativeResourceFilter.checkEntry 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.
AndroidBundleUtils.processFileForResource (cognitive 16) prelude/toolchains/android/src/com/facebook/buck/android/bundle/AndroidBundleUtils.java:227— AndroidBundleUtils.processFileForResource has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MergeAssetsUtils.mergeAssets (cognitive 16) prelude/toolchains/android/src/com/facebook/buck/android/resources/MergeAssetsUtils.java:75— MergeAssetsUtils.mergeAssets has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (6 pts), if/else 4 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContentDigests.getJarManifestDigest (cognitive 16) REDACTED:74— ContentDigests.getJarManifestDigest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 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.
2.postVisitDirectory (cognitive 16) prelude/toolchains/android/src/com/facebook/buck/io/file/MostFiles.java:292— 2.postVisitDirectory has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 2 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TreeBackedResolvedType.<init> (cognitive 16) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/source/TreeBackedTypeResolutionSimulator.java:80— TreeBackedResolvedType.<init> has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AbiFilteringClassVisitor.visitMethod (cognitive 16) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/AbiFilteringClassVisitor.java:278— AbiFilteringClassVisitor.visitMethod has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (6 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
StubJarClassEntry.of (cognitive 16) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/StubJarClassEntry.java:48— StubJarClassEntry.of has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompilerWorker.getJavacTask (cognitive 16) prelude/toolchains/android/src/com/facebook/buck/jvm/java/Jsr199JavacInvocation.java:530— CompilerWorker.getJavacTask has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClassLoaderCache.close (cognitive 16) prelude/toolchains/android/src/com/facebook/buck/util/ClassLoaderCache.java:80— ClassLoaderCache.close has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codesign_bundle.codesign_bundle (cognitive 16) prelude/apple/tools/code_signing/codesign_bundle.py:343— codesign_bundle.codesign_bundle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
show_headers_to_dep_file.parse_into_dep_file (cognitive 16) prelude/cxx/tools/show_headers_to_dep_file.py:29— show_headers_to_dep_file.parse_into_dep_file has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 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.
package_tree._check_export_target (cognitive 16) prelude/nodejs/tools/package_tree.py:1252— package_tree._check_export_target has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extract_link_action.expand_response_files (cognitive 16) prelude/rust/tools/extract_link_action.py:85— extract_link_action.expand_response_files has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shell_buck2_utils.get_additional_paths (cognitive 16) prelude/erlang/shell/src/shell_buck2_utils.erl:180— shell_buck2_utils.get_additional_paths has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 2 (6 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
VarintStreamParser.parse (cognitive 16) app/buck2_trailcam/js/src/lib/varint-stream-parser.ts:60— VarintStreamParser.parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
span-index.buildSpanIndex (cognitive 16) app/buck2_trailcam/js/src/components/invocation/event-log/span-index.ts:120— span-index.buildSpanIndex has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (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.
FileChanges.FileChangesSection (cognitive 16) app/buck2_trailcam/js/src/components/invocation/FileChanges.tsx:199— FileChanges.FileChangesSection has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 2, ternaries 2. Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
Near-duplicate member pair (190 shared lines) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:136— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:136-677 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:125-644 — These two members are variants of one another: 190 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 (57 shared lines) prelude/cxx/dist_lto/tools/dist_lto_prepare_darwin.py:67— prelude/cxx/dist_lto/tools/dist_lto_prepare_darwin.py:67-150 | prelude/cxx/dist_lto/tools/dist_lto_prepare_gnu.py:76-164 — These two members are variants of one another: 57 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) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:648— app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:648-878 | app/buck2_execute_impl/src/materializers/v2/clean_stale.rs:271-500 — 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 (39 shared lines) starlark-rust/starlark_syntax/src/lexer.rs:343— starlark-rust/starlark_syntax/src/lexer.rs:343-455 | starlark-rust/starlark_syntax/src/lexer.rs:516-620 — These two members are variants of one another: 39 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (54 corresponding lines) · ×1
Edited copy of a member (54 corresponding lines) prelude/toolchains/conan/conan_generate.py:50— prelude/toolchains/conan/conan_generate.py:50-158 | prelude/toolchains/conan/conan_update.py:52-115 — 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 (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/KotlinMetadataReader.java:357— prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/KotlinMetadataReader.java:357-398 | prelude/toolchains/android/src/com/facebook/buck/jvm/java/abi/kotlin/kotlin-1.4.2/KotlinMetadataReader.java:100-141 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×1
Edited copy of a member (18 corresponding lines) prelude/toolchains/android/src/com/facebook/buck/jvm/cd/workertool/MainUtils.java:28— prelude/toolchains/android/src/com/facebook/buck/jvm/cd/workertool/MainUtils.java:28-57 | prelude/toolchains/android/src/com/facebook/buck/jvm/cd/workertool/grpc/WorkerGrpcServer.java:125-153 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (20 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (20 members, 50+ identical tokens) prelude/toolchains/android/src/com/facebook/buck/android/AndroidManifestReaderExecutableMain.java:38— prelude/toolchains/android/src/com/facebook/buck/android/AndroidManifestReaderExecutableMain.java:38-50 | prelude/toolchains/android/src/com/facebook/buck/android/aapt/MergeAndroidResourceSourcesExecutableMain.java:35-48 | prelude/toolchains/android/src/com/facebook/buck/android/aapt/MiniAaptExecutableMain.java:46-58 | prelude/toolchains/android/src/com/facebook/buck/android/aar/AarBuilderExecutableMain.java:59-71 | prelude/toolchains/android/src/com/facebook/buck/android/apk/ApkBuilderExecutableMain.java:96-108 | prelude/toolchains/android/src/com/facebook/buck/android/apkmodule/APKModuleGraphExecutableMain.java:82-94 | prelude/toolchains/android/src/com/facebook/buck/android/build_config/GenerateBuildConfigExecutableMain.java:47-59 | prelude/toolchains/android/src/com/facebook/buck/android/buildinfo/BuildInfoGeneratorExecutableMain.java:37-49 | prelude/toolchains/android/src/com/facebook/buck/android/bundle/AndroidBundleApksBuilderExecutableMain.java:91-106 | prelude/toolchains/android/src/com/facebook/buck/android/bundle/AndroidBundleBuilderExecutableMain.java:82-94 | prelude/toolchains/android/src/com/facebook/buck/android/dex/D8ExecutableMain.java:190-202 | prelude/toolchains/android/src/com/facebook/buck/android/dex/JarSplitterExecutableMain.java:62-74 | prelude/toolchains/android/src/com/facebook/buck/android/dex/MultiDexExecutableMain.java:120-132 | prelude/toolchains/android/src/com/facebook/buck/android/dex/SecondaryDexCompressionExecutableMain.java:71-83 | prelude/toolchains/android/src/com/facebook/buck/android/resources/ExoResourcesRewriterExecutableMain.java:45-57 | prelude/toolchains/android/src/com/facebook/buck/android/resources/MergeAndroidResourcesExecutableMain.java:75-87 | prelude/toolchains/android/src/com/facebook/buck/android/resources/MergeAssetsExecutableMain.java:71-83 | prelude/toolchains/android/src/com/facebook/buck/android/resources/filter/FilterResourcesExecutableMain.java:87-99 | prelude/toolchains/android/src/com/facebook/buck/android/resources/strings/CopyStringResourcesExecutableMain.java:36-48 | prelude/toolchains/android/src/com/facebook/buck/android/resources/strings/PackageStringsAsAssetsExecutableMain.java:63-75 — These 20 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 20 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 20 times.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) app/buck2_build_api/src/artifact_groups/calculation.rs:270— app/buck2_build_api/src/artifact_groups/calculation.rs:270-369 | app/buck2_cfg_constructor/src/calculation.rs:108-208 | app/buck2_configured/src/configuration.rs:357-398 | app/buck2_configured/src/nodes.rs:1735-1804 | app/buck2_configured/src/nodes.rs:1809-1880 | app/buck2_configured/src/target_platform_resolution.rs:48-108 | app/buck2_interpreter/src/allow_relative_paths.rs:59-150 | app/buck2_interpreter/src/import_paths.rs:106-158 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) tools/retrace/src/ingest/testlog.rs:324— tools/retrace/src/ingest/testlog.rs:324-625 | tools/retrace/src/ingest/testlog.rs:1433-1537 | tools/retrace/src/ingest/testlog.rs:1544-1645 | tools/retrace/src/ingest/testlog.rs:1654-1761 | tools/retrace/src/ingest/testlog.rs:1767-1812 | tools/retrace/src/ingest/testlog.rs:1817-2060 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Duplicated block (44 lines × 2) app/buck2_server/src/version_control_revision.rs:170— app/buck2_server/src/version_control_revision.rs:170-213 | app/buck2_server/src/version_control_revision.rs:273-316 — both copies are in the same file, so extract the 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 (34 lines × 2) app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:770— app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs:770-803 | app/buck2_execute_impl/src/materializers/v2/clean_stale.rs:397-430 — `app/buck2_execute_impl/src/materializers/deferred/clean_stale.rs` and `app/buck2_execute_impl/src/materializers/v2/clean_stale.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 67 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 (33 lines × 2) app/buck2_query_impls/src/uquery/environment.rs:524— app/buck2_query_impls/src/uquery/environment.rs:524-556 | app/buck2_query_impls/src/uquery/environment.rs:743-775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (30 lines × 2) app/buck2_action_impl/src/actions/impls/run.rs:715— app/buck2_action_impl/src/actions/impls/run.rs:715-744 | app/buck2_action_impl/src/actions/impls/run.rs:819-848 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24–25 lines × 2) starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:798— starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:798-822 | starlark-rust/starlark_syntax/src/syntax/parser_rd.rs:1430-1453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23–24 lines × 4) starlark-rust/starlark_derive/src/starlark_pagable.rs:568— starlark-rust/starlark_derive/src/starlark_pagable.rs:568-591 | starlark-rust/starlark_derive/src/starlark_pagable.rs:602-625 | starlark-rust/starlark_derive/src/starlark_pagable.rs:789-811 | starlark-rust/starlark_derive/src/starlark_pagable.rs:823-845 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17–19 lines × 2) app/buck2_bxl/src/bxl/starlark_defs/context/output.rs:690— app/buck2_bxl/src/bxl/starlark_defs/context/output.rs:690-708 | app/buck2_bxl/src/bxl/starlark_defs/context/output.rs:745-761 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–19 lines × 2) starlark-rust/starlark_syntax/src/lexer.rs:406— starlark-rust/starlark_syntax/src/lexer.rs:406-424 | starlark-rust/starlark_syntax/src/lexer.rs:572-586 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–18 lines × 2) app/buck2_log_common/src/chrome_trace.rs:1927— app/buck2_log_common/src/chrome_trace.rs:1927-1944 | app/buck2_log_common/src/chrome_trace.rs:2061-2075 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 3) app/buck2_client_ctx/src/subscribers/superconsole.rs:1675— app/buck2_client_ctx/src/subscribers/superconsole.rs:1675-1690 | app/buck2_client_ctx/src/subscribers/superconsole.rs:1710-1725 | app/buck2_client_ctx/src/subscribers/superconsole.rs:1728-1743 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14–16 lines × 2) starlark-rust/starlark_syntax/src/lexer.rs:298— starlark-rust/starlark_syntax/src/lexer.rs:298-313 | starlark-rust/starlark_syntax/src/lexer.rs:460-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 4) tools/retrace/src/ingest/testlog.rs:1434— tools/retrace/src/ingest/testlog.rs:1434-1448 | tools/retrace/src/ingest/testlog.rs:1545-1559 | tools/retrace/src/ingest/testlog.rs:1655-1669 | tools/retrace/src/ingest/testlog.rs:1768-1782 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5–14 lines × 4) starlark-rust/starlark/src/typing/fill_types_for_lint.rs:615— starlark-rust/starlark/src/typing/fill_types_for_lint.rs:615-619 | starlark-rust/starlark/src/typing/fill_types_for_lint.rs:650-663 | starlark-rust/starlark/src/typing/fill_types_for_lint.rs:676-689 | starlark-rust/starlark/src/typing/fill_types_for_lint.rs:708-721 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 5) tools/retrace/src/ingest/testlog.rs:332— tools/retrace/src/ingest/testlog.rs:332-344 | tools/retrace/src/ingest/testlog.rs:1434-1446 | tools/retrace/src/ingest/testlog.rs:1545-1557 | tools/retrace/src/ingest/testlog.rs:1655-1667 | tools/retrace/src/ingest/testlog.rs:1768-1780 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 2) pagable_derive/src/derive_pagable_panic.rs:28— pagable_derive/src/derive_pagable_panic.rs:28-40 | pagable_derive/src/derive_pagable_unsupported.rs:30-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10–11 lines × 8) app/buck2_build_api/src/artifact_groups/calculation.rs:356— app/buck2_build_api/src/artifact_groups/calculation.rs:356-366 | app/buck2_cfg_constructor/src/calculation.rs:155-165 | app/buck2_configured/src/configuration.rs:383-393 | app/buck2_configured/src/nodes.rs:1777-1787 | app/buck2_configured/src/nodes.rs:1849-1859 | app/buck2_configured/src/target_platform_resolution.rs:92-102 | app/buck2_interpreter/src/allow_relative_paths.rs:134-144 | app/buck2_interpreter/src/import_paths.rs:143-152 — there are 8 copies across 7 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 6) tools/retrace/src/ingest/testlog.rs:335— tools/retrace/src/ingest/testlog.rs:335-345 | tools/retrace/src/ingest/testlog.rs:1437-1447 | tools/retrace/src/ingest/testlog.rs:1548-1558 | tools/retrace/src/ingest/testlog.rs:1658-1668 | tools/retrace/src/ingest/testlog.rs:1771-1781 | tools/retrace/src/ingest/testlog.rs:1825-1835 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–11 lines × 5) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:208— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:208-216 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:230-238 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:258-266 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:286-294 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:398-408 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 5) app/buck2_cmd_audit_server/src/output/buck_out_path_type_printer.rs:82— app/buck2_cmd_audit_server/src/output/buck_out_path_type_printer.rs:82-92 | app/buck2_cmd_audit_server/src/output/buck_out_path_type_printer.rs:102-112 | app/buck2_cmd_audit_server/src/output/buck_out_path_type_printer.rs:122-132 | app/buck2_cmd_audit_server/src/output/buck_out_path_type_printer.rs:135-145 | app/buck2_cmd_audit_server/src/output/buck_out_path_type_printer.rs:153-163 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–11 lines × 5) app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:207— app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:207-209 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:132-140 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:165-173 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:280-290 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:324-334 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/aquery.rs` and `app/buck2_bxl/src/bxl/starlark_defs/uquery.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) tools/retrace/src/ingest/testlog.rs:369— tools/retrace/src/ingest/testlog.rs:369-379 | tools/retrace/src/ingest/testlog.rs:1453-1463 | tools/retrace/src/ingest/testlog.rs:1479-1489 | tools/retrace/src/ingest/testlog.rs:1787-1797 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–11 lines × 3) tools/retrace/src/ingest/testlog.rs:1476— tools/retrace/src/ingest/testlog.rs:1476-1486 | tools/retrace/src/ingest/testlog.rs:1562-1571 | tools/retrace/src/ingest/testlog.rs:1785-1794 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–10 lines × 4) app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:197— app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:197-205 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:252-259 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:366-375 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:580-588 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–10 lines × 2) app/buck2_execute_impl/src/sqlite/tables/incremental_state_table.rs:129— app/buck2_execute_impl/src/sqlite/tables/incremental_state_table.rs:129-136 | app/buck2_execute_impl/src/sqlite/tables/materializer_state_table.rs:693-702 — 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 (7–9 lines × 5) app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:198— app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:198-204 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:253-259 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:367-375 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:394-402 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:581-587 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–9 lines × 4) app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs:346— app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs:346-354 | app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs:498-506 | app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs:587-595 | app/buck2_bxl/src/bxl/starlark_defs/target_list_expr.rs:764-771 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–9 lines × 3) app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:250— app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:250-258 | app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:278-286 | app/buck2_bxl/src/bxl/starlark_defs/aquery.rs:305-311 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–9 lines × 3) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:426— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:426-433 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:596-604 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:623-631 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 5) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:598— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:598-605 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:625-632 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:225-232 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:426-433 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:516-523 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/cquery.rs` and `app/buck2_bxl/src/bxl/starlark_defs/uquery.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 183 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 7) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:178— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:178-184 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:360-368 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:506-514 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:134-140 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:167-173 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:282-290 | app/buck2_bxl/src/bxl/starlark_defs/uquery.rs:326-334 — before extracting anything, compare `app/buck2_bxl/src/bxl/starlark_defs/cquery.rs` and `app/buck2_bxl/src/bxl/starlark_defs/uquery.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 183 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 6) app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:376— app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:376-382 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:455-461 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:514-520 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:630-636 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:724-730 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:774-780 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–7 lines × 13) app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:168— app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:168-170 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:186-188 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:238-240 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:286-288 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:324-326 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:343-345 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:404-406 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:476-478 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:533-535 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:646-648 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:664-666 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:685-691 | app/buck2_interpreter_for_build/src/attrs/attrs_global.rs:705-711 — all 13 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 7) app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:209— app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:209-214 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:231-236 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:259-264 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:287-292 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:399-406 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:443-450 | app/buck2_bxl/src/bxl/starlark_defs/cquery.rs:467-474 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–6 lines × 5) starlark-rust/starlark/src/values/types/string/methods.rs:212— starlark-rust/starlark/src/values/types/string/methods.rs:212-217 | starlark-rust/starlark/src/values/types/string/methods.rs:283-285 | starlark-rust/starlark/src/values/types/string/methods.rs:381-386 | starlark-rust/starlark/src/values/types/string/methods.rs:831-833 | starlark-rust/starlark/src/values/types/string/methods.rs:866-868 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 5) tools/retrace/src/gui/panels.rs:277— tools/retrace/src/gui/panels.rs:277-281 | tools/retrace/src/gui/panels.rs:325-329 | tools/retrace/src/gui/panels.rs:390-394 | tools/retrace/src/gui/panels.rs:435-439 | tools/retrace/src/gui/panels.rs:631-635 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (4–5 lines × 3) starlark-rust/starlark_derive/src/starlark_pagable_panic.rs:42— starlark-rust/starlark_derive/src/starlark_pagable_panic.rs:42-46 | starlark-rust/starlark_derive/src/starlark_pagable_unsupported.rs:37-40 | starlark-rust/starlark_derive/src/starlark_pagable_via_pagable.rs:41-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (59 lines × 2) dice/dice/src/api/demand.rs:27— dice/dice/src/api/demand.rs:27-85 | shed/provider/src/lib.rs:31-110 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 21) app/buck2_build_api/src/artifact_groups/calculation.rs:524— app/buck2_build_api/src/artifact_groups/calculation.rs:524-529 | app/buck2_build_api/src/build/detailed_aggregated_metrics/buck2_sketches.rs:302-307 | app/buck2_build_api/src/build/detailed_aggregated_metrics/buck2_sketches.rs:416-421 | app/buck2_common/src/buildfiles.rs:114-119 | app/buck2_common/src/file_ops/dice.rs:346-351 | app/buck2_common/src/file_ops/dice.rs:381-386 | app/buck2_common/src/file_ops/dice.rs:421-426 | app/buck2_common/src/package_listing/dice.rs:75-80 | app/buck2_common/src/target_aliases.rs:161-166 | app/buck2_configured/src/configuration.rs:328-333 | app/buck2_configured/src/execution.rs:421-426 | app/buck2_configured/src/execution.rs:687-692 | app/buck2_configured/src/execution.rs:1019-1024 | app/buck2_interpreter/src/starlark_profiler/config.rs:187-192 | app/buck2_interpreter/src/starlark_profiler/config.rs:266-271 | app/buck2_validation/src/single_validation_key.rs:137-142 | app/buck2_validation/src/transitive_validation_key.rs:168-173 | dice/dice_examples/src/math_computation.rs:155-160 | dice/dice_tests/src/legacy/demo.rs:122-127 | dice/dice_tests/src/projection/smoke.rs:123-128 | dice/fuzzy_dice/src/computation.rs:264-269 — there are 21 copies across 15 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 21 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (66 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:512— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:512-577 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:549-614 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 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 (47 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:137— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:137-183 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:140-186 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 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 (38 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:97— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:97-134 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:100-137 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 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 (27 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:314— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:314-340 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt:317-343 — `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt` 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 23 separate duplicated blocks between them, totalling at least 468 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 (23 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:1677— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:1677-1699 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:1727-1749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/pipeline/AbiGenPipeline.kt:1677` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–22 lines × 2) prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/KaptStepsBuilder.java:135— prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/KaptStepsBuilder.java:135-153 | prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/KspStepsBuilder.java:86-107 — 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, `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/KspStepsBuilder.java:83` calls `add`, `MkdirIsolatedStep`, `getAnnotationOutputBasePath` and `prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/KaptStepsBuilder.java:132` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 20) prelude/toolchains/android/src/com/facebook/buck/android/AndroidManifestReaderExecutableMain.java:40— prelude/toolchains/android/src/com/facebook/buck/android/AndroidManifestReaderExecutableMain.java:40-49 | prelude/toolchains/android/src/com/facebook/buck/android/aapt/MergeAndroidResourceSourcesExecutableMain.java:38-47 | prelude/toolchains/android/src/com/facebook/buck/android/aapt/MiniAaptExecutableMain.java:48-57 | prelude/toolchains/android/src/com/facebook/buck/android/aar/AarBuilderExecutableMain.java:61-70 | prelude/toolchains/android/src/com/facebook/buck/android/apk/ApkBuilderExecutableMain.java:98-107 | prelude/toolchains/android/src/com/facebook/buck/android/apkmodule/APKModuleGraphExecutableMain.java:84-93 | prelude/toolchains/android/src/com/facebook/buck/android/build_config/GenerateBuildConfigExecutableMain.java:49-58 | prelude/toolchains/android/src/com/facebook/buck/android/buildinfo/BuildInfoGeneratorExecutableMain.java:39-48 | prelude/toolchains/android/src/com/facebook/buck/android/bundle/AndroidBundleApksBuilderExecutableMain.java:93-101 | prelude/toolchains/android/src/com/facebook/buck/android/bundle/AndroidBundleBuilderExecutableMain.java:84-93 | prelude/toolchains/android/src/com/facebook/buck/android/dex/D8ExecutableMain.java:192-201 | prelude/toolchains/android/src/com/facebook/buck/android/dex/JarSplitterExecutableMain.java:64-73 | prelude/toolchains/android/src/com/facebook/buck/android/dex/MultiDexExecutableMain.java:122-131 | prelude/toolchains/android/src/com/facebook/buck/android/dex/SecondaryDexCompressionExecutableMain.java:73-82 | prelude/toolchains/android/src/com/facebook/buck/android/resources/ExoResourcesRewriterExecutableMain.java:47-56 | prelude/toolchains/android/src/com/facebook/buck/android/resources/MergeAndroidResourcesExecutableMain.java:77-86 | prelude/toolchains/android/src/com/facebook/buck/android/resources/MergeAssetsExecutableMain.java:73-82 | prelude/toolchains/android/src/com/facebook/buck/android/resources/filter/FilterResourcesExecutableMain.java:89-98 | prelude/toolchains/android/src/com/facebook/buck/android/resources/strings/CopyStringResourcesExecutableMain.java:38-47 | prelude/toolchains/android/src/com/facebook/buck/android/resources/strings/PackageStringsAsAssetsExecutableMain.java:65-74 — before extracting anything, compare `prelude/toolchains/android/src/com/facebook/buck/android/dex/JarSplitterExecutableMain.java` and `prelude/toolchains/android/src/com/facebook/buck/android/dex/MultiDexExecutableMain.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/android/src/com/facebook/buck/android/bundle/AndroidBundleApksBuilderExecutableMain.java:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `prelude/toolchains/android/src/com/facebook/buck/android/resources/strings/CopyStringResourcesExecutableMain.java:51` calls `of`, `get`, `normalize` and `prelude/toolchains/android/src/com/facebook/buck/android/apk/ApkBuilderExecutableMain.java:111` 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–8 lines × 2) prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java:253— prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java:253-259 | prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java:265-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java:253` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–7 lines × 4) prelude/toolchains/android/src/com/facebook/buck/testrunner/CrashAnalyzer.java:318— prelude/toolchains/android/src/com/facebook/buck/testrunner/CrashAnalyzer.java:318-324 | prelude/toolchains/android/src/com/facebook/buck/testrunner/CrashAnalyzer.java:327-330 | prelude/toolchains/android/src/com/facebook/buck/testrunner/CrashAnalyzer.java:332-338 | prelude/toolchains/android/src/com/facebook/buck/testrunner/CrashAnalyzer.java:350-356 — 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 `prelude/toolchains/android/src/com/facebook/buck/testrunner/CrashAnalyzer.java:318` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `prelude/toolchains/android/src/com/facebook/buck/testrunner/CrashAnalyzer.java:331` calls `contains` and `prelude/toolchains/android/src/com/facebook/buck/testrunner/CrashAnalyzer.java:325` 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 (20–25 lines × 5) prelude/toolchains/conan/conan_generate.py:53— prelude/toolchains/conan/conan_generate.py:53-76 | prelude/toolchains/conan/conan_lock.py:37-56 | prelude/toolchains/conan/conan_package.py:92-111 | prelude/toolchains/conan/conan_package.py:129-153 | prelude/toolchains/conan/conan_update.py:55-78 — before extracting anything, compare `prelude/toolchains/conan/conan_generate.py` and `prelude/toolchains/conan/conan_package.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/conan/conan_generate.py:53` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (23 lines × 4) prelude/java/tools/compile_and_package.py:59— prelude/java/tools/compile_and_package.py:59-81 | prelude/kotlin/tools/compile_kotlin/compile_kotlin.py:58-80 | prelude/kotlin/tools/compile_kotlin/compile_kotlin.py:96-118 | prelude/kotlin/tools/compile_kotlin/compile_kotlin.py:166-188 — 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 `prelude/java/tools/compile_and_package.py: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 (22 lines × 6) prelude/toolchains/conan/conan_generate.py:53— prelude/toolchains/conan/conan_generate.py:53-74 | prelude/toolchains/conan/conan_init.py:30-51 | prelude/toolchains/conan/conan_lock.py:32-53 | prelude/toolchains/conan/conan_package.py:87-108 | prelude/toolchains/conan/conan_package.py:130-151 | prelude/toolchains/conan/conan_update.py:55-76 — before extracting anything, compare `prelude/toolchains/conan/conan_generate.py` and `prelude/toolchains/conan/conan_package.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/conan/conan_generate.py:53` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–21 lines × 2) prelude/toolchains/conan/conan_package.py:189— prelude/toolchains/conan/conan_package.py:189-209 | prelude/toolchains/conan/conan_package_extract.py:57-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `prelude/toolchains/conan/conan_package.py:189` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–14 lines × 2) prelude/java/tools/compile_and_package.py:336— prelude/java/tools/compile_and_package.py:336-349 | prelude/java/tools/fat_jar.py:264-274 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7–12 lines × 3) prelude/java/tools/compile_and_package.py:327— prelude/java/tools/compile_and_package.py:327-333 | prelude/java/tools/fat_jar.py:258-269 | prelude/java/tools/fat_jar.py:278-284 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (15–18 lines × 3) docs/developers/perf/scripts/heap_aggregate.py:136— docs/developers/perf/scripts/heap_aggregate.py:136-153 | docs/developers/perf/scripts/heap_diff.py:123-137 | docs/developers/perf/scripts/heap_stacks.py:68-82 — before extracting anything, compare `docs/developers/perf/scripts/heap_aggregate.py` and `docs/developers/perf/scripts/heap_diff.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `docs/developers/perf/scripts/heap_aggregate.py:136` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17 lines × 4) docs/developers/perf/scripts/frag_symbolize.py:86— docs/developers/perf/scripts/frag_symbolize.py:86-102 | docs/developers/perf/scripts/heap_aggregate.py:73-89 | docs/developers/perf/scripts/heap_diff.py:63-79 | docs/developers/perf/scripts/heap_stacks.py:104-120 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5–8 lines × 3) prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:547— prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:547-554 | prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:564-569 | prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:571-575 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5–6 lines × 3) prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:418— prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:418-423 | prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:444-448 | prelude/erlang/common_test/cth_hooks/src/cth_tpx.erl:451-455 — 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.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — app/buck2_trailcam/js/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
R10 · Code Duplication· Duplicated block with local edits (197 matched lines × 2 locations) · ×1
Duplicated block with local edits (197 matched lines × 2 locations) app/buck2_explain/js/src/graph2/GraphImpl2.tsx:34— app/buck2_explain/js/src/graph2/GraphImpl2.tsx:34 · app/buck2_explain/output_format_js/src/graph2/GraphImpl2.tsx:38 — the two spans are one implementation copied and then locally edited — 1251 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (172 matched lines × 2 locations) · ×1
Duplicated block with local edits (172 matched lines × 2 locations) prelude/nodejs/tools/nodejs_test_adapter.cjs:830— prelude/nodejs/tools/nodejs_test_adapter.cjs:830 · prelude/nodejs/tools/nodejs_test_adapter.cjs:1098 — the two spans are one implementation copied and then locally edited — 1028 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (136 matched lines × 2 locations) · ×1
Duplicated block with local edits (136 matched lines × 2 locations) app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:213— app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:213 · app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:228 — the two spans are one implementation copied and then locally edited — 891 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (131 matched lines × 2 locations) · ×1
Duplicated block with local edits (131 matched lines × 2 locations) app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts:99— app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts:99 · app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts:135 — the two spans are one implementation copied and then locally edited — 1086 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (85 matched lines × 2 locations) · ×1
Duplicated block with local edits (85 matched lines × 2 locations) app/buck2_trailcam/js/src/lib/load-events.ts:274— app/buck2_trailcam/js/src/lib/load-events.ts:274 · app/buck2_trailcam/js/src/lib/treemap-builder.ts:98 — the two spans are one implementation copied and then locally edited — 574 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (70 lines × 2 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:16888— app/buck2_trailcam/js/src/lib/proto/bundle.js:16888 · app/buck2_trailcam/js/src/lib/proto/bundle.js:46281 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (59 lines × 2 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:12418— app/buck2_trailcam/js/src/lib/proto/bundle.js:12418 · app/buck2_trailcam/js/src/lib/proto/bundle.js:12498 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (56 lines × 2 locations) app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:93— app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:93 · app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:117 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication· Duplicated block with local edits (54 matched lines × 2 locations) · ×1
Duplicated block with local edits (54 matched lines × 2 locations) app/buck2_trailcam/js/src/components/invocation/ActionTreemap.tsx:34— app/buck2_trailcam/js/src/components/invocation/ActionTreemap.tsx:34 · app/buck2_trailcam/js/src/components/invocation/AnalysisTreemap.tsx:34 — the two spans are one implementation copied and then locally edited — 288 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (52 identical lines × 2 files) app/buck2_explain/js/src/graph2/GraphViz2.tsx:12— app/buck2_explain/js/src/graph2/GraphViz2.tsx:12 · app/buck2_explain/output_format_js/src/graph2/GraphViz2.tsx:12 — these 2 files are line-for-line copies of one another — 52 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Duplicated block (48 lines × 2 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:30039— app/buck2_trailcam/js/src/lib/proto/bundle.js:30039 · app/buck2_trailcam/js/src/lib/proto/bundle.js:32870 — both copies are in the same file, so extract the 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 (46 lines × 2 locations) app/buck2_explain/js/src/App.tsx:26— app/buck2_explain/js/src/App.tsx:26 · app/buck2_explain/output_format_js/src/App.tsx:21 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication· Duplicated block with local edits (38 matched lines × 2 locations) · ×1
Duplicated block with local edits (38 matched lines × 2 locations) app/buck2_trailcam/js/src/components/invocation/AnalysisTreemap.tsx:31— app/buck2_trailcam/js/src/components/invocation/AnalysisTreemap.tsx:31 · app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:185 — the two spans are one implementation copied and then locally edited — 223 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (38 lines × 2 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:65103— app/buck2_trailcam/js/src/lib/proto/bundle.js:65103 · app/buck2_trailcam/js/src/lib/proto/bundle.js:65229 — both copies are in the same file, so extract the 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 (32 lines × 2 locations) app/buck2_trailcam/js/src/lib/event-log-decoder.ts:341— app/buck2_trailcam/js/src/lib/event-log-decoder.ts:341 · app/buck2_trailcam/js/src/lib/event-log-decoder.ts:452 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (31 lines × 2 locations) app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:338— app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:338 · app/buck2_trailcam/js/src/components/invocation/TestSummaryCard.tsx:112 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication· Duplicated block with local edits (31 matched lines × 2 locations) · ×1
Duplicated block with local edits (31 matched lines × 2 locations) app/buck2_trailcam/js/src/lib/event-log-cache.ts:297— app/buck2_trailcam/js/src/lib/event-log-cache.ts:297 · app/buck2_trailcam/js/src/lib/event-log-cache.ts:584 — the two spans are one implementation copied and then locally edited — 204 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (30 lines × 2 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:36583— app/buck2_trailcam/js/src/lib/proto/bundle.js:36583 · app/buck2_trailcam/js/src/lib/proto/bundle.js:36718 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (28 lines × 2 locations) app/buck2_trailcam/js/src/components/invocation/CriticalPathChart.tsx:61— app/buck2_trailcam/js/src/components/invocation/CriticalPathChart.tsx:61 · app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:378 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (27 lines × 2 locations) app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:189— app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:189 · app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:232 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication· Duplicated block with local edits (26 matched lines × 2 locations) · ×1
Duplicated block with local edits (26 matched lines × 2 locations) app/buck2_trailcam/js/src/lib/action-events.ts:142— app/buck2_trailcam/js/src/lib/action-events.ts:142 · app/buck2_trailcam/js/src/lib/streaming-collectors.ts:241 — the two spans are one implementation copied and then locally edited — 192 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (24 lines × 2 locations) app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:65— app/buck2_trailcam/js/src/components/invocation/GenericTreemapView.tsx:65 · app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:87 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (24 lines × 6 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:4457— app/buck2_trailcam/js/src/lib/proto/bundle.js:4457 · app/buck2_trailcam/js/src/lib/proto/bundle.js:4925 · app/buck2_trailcam/js/src/lib/proto/bundle.js:8506 · app/buck2_trailcam/js/src/lib/proto/bundle.js:8654 · +2 more site(s) not listed — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (24 lines × 4 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:33149— app/buck2_trailcam/js/src/lib/proto/bundle.js:33149 · app/buck2_trailcam/js/src/lib/proto/bundle.js:33173 · app/buck2_trailcam/js/src/lib/proto/bundle.js:33197 · app/buck2_trailcam/js/src/lib/proto/bundle.js:41145 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (23 lines × 8 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:12201— app/buck2_trailcam/js/src/lib/proto/bundle.js:12201 · app/buck2_trailcam/js/src/lib/proto/bundle.js:12603 · app/buck2_trailcam/js/src/lib/proto/bundle.js:31678 · app/buck2_trailcam/js/src/lib/proto/bundle.js:31739 · +4 more site(s) not listed — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (22 lines × 4 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:10403— app/buck2_trailcam/js/src/lib/proto/bundle.js:10403 · app/buck2_trailcam/js/src/lib/proto/bundle.js:33651 · app/buck2_trailcam/js/src/lib/proto/bundle.js:63565 · app/buck2_trailcam/js/src/lib/proto/bundle.js:64336 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (21 lines × 13 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:9285— app/buck2_trailcam/js/src/lib/proto/bundle.js:9285 · app/buck2_trailcam/js/src/lib/proto/bundle.js:14007 · app/buck2_trailcam/js/src/lib/proto/bundle.js:14773 · app/buck2_trailcam/js/src/lib/proto/bundle.js:16025 · +9 more site(s) not listed — all 13 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21 lines × 3 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:34791— app/buck2_trailcam/js/src/lib/proto/bundle.js:34791 · app/buck2_trailcam/js/src/lib/proto/bundle.js:56045 · app/buck2_trailcam/js/src/lib/proto/bundle.js:56119 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21 lines × 2 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:40983— app/buck2_trailcam/js/src/lib/proto/bundle.js:40983 · app/buck2_trailcam/js/src/lib/proto/bundle.js:41129 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (20 lines × 2 locations) app/buck2_trailcam/js/src/lib/action-events.ts:101— app/buck2_trailcam/js/src/lib/action-events.ts:101 · app/buck2_trailcam/js/src/lib/analysis-events.ts:88 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (19 lines × 3 locations) app/buck2_trailcam/js/src/lib/event-log-decoder.ts:224— app/buck2_trailcam/js/src/lib/event-log-decoder.ts:224 · app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts:157 · app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts:196 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (19 lines × 17 locations) app/buck2_trailcam/js/src/lib/proto/bundle.js:11108— app/buck2_trailcam/js/src/lib/proto/bundle.js:11108 · app/buck2_trailcam/js/src/lib/proto/bundle.js:11229 · app/buck2_trailcam/js/src/lib/proto/bundle.js:11907 · app/buck2_trailcam/js/src/lib/proto/bundle.js:13354 · +13 more site(s) not listed — all 17 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Complex function toObject (cyclomatic 946, cognitive 1634) app/buck2_trailcam/js/src/lib/proto/bundle.js:50325— toObject has cyclomatic complexity 946 and cognitive complexity 1634; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function toObject (cyclomatic 694, cognitive 1236) app/buck2_trailcam/js/src/lib/proto/bundle.js:19562— toObject has cyclomatic complexity 694 and cognitive complexity 1236; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fromObject (cyclomatic 640, cognitive 747) app/buck2_trailcam/js/src/lib/proto/bundle.js:48217— fromObject has cyclomatic complexity 640 and cognitive complexity 747; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fromObject (cyclomatic 576, cognitive 32) app/buck2_trailcam/js/src/lib/proto/bundle.js:56796— fromObject has cyclomatic complexity 576 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fromObject (cyclomatic 371, cognitive 437) app/buck2_trailcam/js/src/lib/proto/bundle.js:18374— fromObject has cyclomatic complexity 371 and cognitive complexity 437; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function encode (cyclomatic 361, cognitive 371) app/buck2_trailcam/js/src/lib/proto/bundle.js:46431— encode has cyclomatic complexity 361 and cognitive complexity 371; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function encode (cyclomatic 249, cognitive 249) app/buck2_trailcam/js/src/lib/proto/bundle.js:17142— encode has cyclomatic complexity 249 and cognitive complexity 249; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function decode (cyclomatic 203, cognitive 59) app/buck2_trailcam/js/src/lib/proto/bundle.js:47406— decode has cyclomatic complexity 203 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function toObject (cyclomatic 140, cognitive 185) app/buck2_trailcam/js/src/lib/proto/bundle.js:6715— toObject has cyclomatic complexity 140 and cognitive complexity 185; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fromObject (cyclomatic 135, cognitive 83) app/buck2_trailcam/js/src/lib/proto/bundle.js:32868— fromObject has cyclomatic complexity 135 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function decode (cyclomatic 132, cognitive 17) app/buck2_trailcam/js/src/lib/proto/bundle.js:17829— decode has cyclomatic complexity 132 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function toObject (cyclomatic 131, cognitive 230) app/buck2_trailcam/js/src/lib/proto/bundle.js:15100— toObject has cyclomatic complexity 131 and cognitive complexity 230; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function toObject (cyclomatic 127, cognitive 166) app/buck2_trailcam/js/src/lib/proto/bundle.js:3718— toObject has cyclomatic complexity 127 and cognitive complexity 166; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function toObject (cyclomatic 119, cognitive 157) app/buck2_trailcam/js/src/lib/proto/bundle.js:2138— toObject has cyclomatic complexity 119 and cognitive complexity 157; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function toObject (cyclomatic 113, cognitive 222) app/buck2_trailcam/js/src/lib/proto/bundle.js:27700— toObject has cyclomatic complexity 113 and cognitive complexity 222; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function toObject (cyclomatic 113, cognitive 151) app/buck2_trailcam/js/src/lib/proto/bundle.js:33235— toObject has cyclomatic complexity 113 and cognitive complexity 151; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fromObject (cyclomatic 94, cognitive 139) app/buck2_trailcam/js/src/lib/proto/bundle.js:6265— fromObject has cyclomatic complexity 94 and cognitive complexity 139; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function encode (cyclomatic 94, cognitive 93) app/buck2_trailcam/js/src/lib/proto/bundle.js:5521— encode has cyclomatic complexity 94 and cognitive complexity 93; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fromObject (cyclomatic 87, cognitive 92) app/buck2_trailcam/js/src/lib/proto/bundle.js:14815— fromObject has cyclomatic complexity 87 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fromObject (cyclomatic 86, cognitive 127) app/buck2_trailcam/js/src/lib/proto/bundle.js:3326— fromObject has cyclomatic complexity 86 and cognitive complexity 127; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· prelude/nodejs/tools/nodejs_test_adapter.cjs · ×1
prelude/nodejs/tools/nodejs_test_adapter.cjs: 1466 lines of code prelude/nodejs/tools/nodejs_test_adapter.cjs:1— prelude/nodejs/tools/nodejs_test_adapter.cjs has 1466 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· app/buck2_trailcam/js/src/components/invocation/EventLogProvider.tsx · ×1
app/buck2_trailcam/js/src/components/invocation/EventLogProvider.tsx: 824 lines of code app/buck2_trailcam/js/src/components/invocation/EventLogProvider.tsx:1— app/buck2_trailcam/js/src/components/invocation/EventLogProvider.tsx has 824 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx · ×1
app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx: 793 lines of code app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:1— app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx has 793 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts · ×1
app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts: 678 lines of code app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts:1— app/buck2_trailcam/js/src/lib/parallel-decode/dispatch-worker.ts has 678 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· app/buck2_trailcam/js/src/lib/event-log-cache.ts · ×1
app/buck2_trailcam/js/src/lib/event-log-cache.ts: 640 lines of code app/buck2_trailcam/js/src/lib/event-log-cache.ts:1— app/buck2_trailcam/js/src/lib/event-log-cache.ts has 640 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· app/buck2_trailcam/js/src/lib/event-log-decoder.ts · ×1
app/buck2_trailcam/js/src/lib/event-log-decoder.ts: 625 lines of code app/buck2_trailcam/js/src/lib/event-log-decoder.ts:1— app/buck2_trailcam/js/src/lib/event-log-decoder.ts has 625 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts · ×1
app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts: 625 lines of code app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts:1— app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts has 625 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· app/buck2_trailcam/js/src/components/invocation/BuildHistorySidebar.tsx · ×1
app/buck2_trailcam/js/src/components/invocation/BuildHistorySidebar.tsx: 568 lines of code app/buck2_trailcam/js/src/components/invocation/BuildHistorySidebar.tsx:1— app/buck2_trailcam/js/src/components/invocation/BuildHistorySidebar.tsx has 568 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx · ×1
app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx: 515 lines of code app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx:1— app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx has 515 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· app/buck2_trailcam/js/src/lib/event-summary-store.ts · ×1
app/buck2_trailcam/js/src/lib/event-summary-store.ts: 494 lines of code app/buck2_trailcam/js/src/lib/event-summary-store.ts:1— app/buck2_trailcam/js/src/lib/event-summary-store.ts has 494 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· app/buck2_trailcam/js/src/lib/critical-path.ts · ×1
app/buck2_trailcam/js/src/lib/critical-path.ts: 461 lines of code app/buck2_trailcam/js/src/lib/critical-path.ts:1— app/buck2_trailcam/js/src/lib/critical-path.ts has 461 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx · ×1
app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx: 426 lines of code app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx:1— app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx has 426 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· app/buck2_trailcam/js/src/components/invocation/event-log/useEventLogState.ts · ×1
app/buck2_trailcam/js/src/components/invocation/event-log/useEventLogState.ts: 404 lines of code app/buck2_trailcam/js/src/components/invocation/event-log/useEventLogState.ts:1— app/buck2_trailcam/js/src/components/invocation/event-log/useEventLogState.ts has 404 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~601 LoC) app/buck2_trailcam/js/src/components/invocation/BuildHistorySidebar.tsx— no import path from any entry point (12 application, 3 tooling, 2 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~133 LoC) REDACTED— no import path from any entry point (12 application, 3 tooling, 2 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~110 LoC) app/buck2_trailcam/js/src/components/invocation/event-log/columns.ts— no import path from any entry point (12 application, 3 tooling, 2 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~84 LoC) app/buck2_trailcam/js/src/components/ui/ResizablePanels.tsx— no import path from any entry point (12 application, 3 tooling, 2 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~78 LoC) app/buck2_trailcam/js/src/lib/event-log-worker.ts— no import path from any entry point (12 application, 3 tooling, 2 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~23 LoC) explorer/preload.js— no import path from any entry point (12 application, 3 tooling, 2 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Unused dependency 'flexsearch-ts' — Declared in app/buck2_explain/output_format_js/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'react-is' — Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@electron-forge/maker-deb' — Declared in explorer/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×1
Recursive walk over a caller-supplied document has no depth cap prelude/apple/tools/bundling/incremental_state.py:100— `default` is public and takes `o: object` from its caller, and it calls itself at line 100 (`self.default`) with a piece of `o` (and at line 105) — and nowhere in `default` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `default` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Orphaned file starlark-rust/starlark/src/typing/bindings.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 starlark-rust/starlark_lsp/src/inspect.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 starlark-rust/starlark/src/analysis/flow.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 games/src/games/jump.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 starlark-rust/starlark_syntax/src/syntax/payload_map.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 starlark-rust/starlark_lsp/src/bind.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 starlark-rust/starlark_derive/src/util.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 prelude/ide_integrations/visual_studio/vsgo.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/buck2_health_check/src/health_check_client.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 prelude/java/tools/utils.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file prelude/toolchains/msvc/vswhere.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/BytecodeTransformer.kt: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 prelude/toolchains/android/src/com/facebook/buck/util/zip/DirectoryJarBuilder.java: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 app/buck2_interpreter/src/extra/xcode.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 app/buck2_explain/js/src/graph2/GraphImpl2.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/buck2_explain/output_format_js/src/graph2/GraphImpl2.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/buck2_client_ctx/src/subscribers/test_id_writer.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 prelude/erlang/common_test/test_exec/src/ct_daemon_capture.erl: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 starlark-rust/starlark_syntax/src/dot_format_parser.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 starlark-rust/starlark/src/analysis.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 prelude/toolchains/conan/buckler/conanfile.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/buck2_server_starlark_debug/src/dap_api.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 app/buck2_explain/js/src/Target.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file app/buck2_client_ctx/src/file_tailers/tailer.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 app/buck2_event_observer/src/humanized.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.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/codesign_bundle.py:121— `warning` at line 121 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/codesign_bundle.py:127— `info` at line 127 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/codesign_bundle.py:207— `info` at line 207 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/codesign_bundle.py:233— `info` at line 233 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/codesign_bundle.py:580— `warning` at line 580 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/codesign_bundle.py:744— `info` at line 744 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/codesign_bundle.py:836— `warning` at line 836 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/fast_adhoc.py:59— `info` at line 59 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/fast_adhoc.py:67— `info` at line 67 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/fast_adhoc.py:69— `info` at line 69 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/fast_adhoc.py:74— `info` at line 74 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/fast_adhoc.py:96— `info` at line 96 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/fast_adhoc.py:129— `info` at line 129 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/fast_adhoc.py:179— `info` at line 179 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/fast_adhoc.py:216— `info` at line 216 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/fast_adhoc.py:221— `info` at line 221 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/provisioning_profile_selection.py:258— `info` at line 258 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/provisioning_profile_selection.py:339— `info` at line 339 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/code_signing/provisioning_profile_selection.py:385— `info` at line 385 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/bundling/assemble_bundle.py:85— `info` at line 85 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/bundling/assemble_bundle.py:190— `debug` at line 190 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/bundling/assemble_bundle.py:225— `info` at line 225 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/bundling/incremental_utils.py:103— `info` at line 103 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/bundling/main.py:588— `info` at line 588 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging prelude/apple/tools/bundling/main.py:590— `warning` at line 590 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Duplicated predicate REDACTED:261— `!outputDirectory.exists() && !outputDirectory.mkdirs()` appears character-identically in 2 files — REDACTED, prelude/toolchains/android/src/com/facebook/buck/testrunner/InstrumentationTestRunner.java. 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 prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java:395— `!singleResult.isSuccess() && "initializationError".equals(singleResult.testMethodName) && "org.junit.runner.manipulation.Filter".equals(sing…` appears character-identically in 2 files — prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java, prelude/toolchains/android/src/com/facebook/buck/testrunner/JupiterRunner.java. 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 prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java:317— `Modifier.isInterface(klassModifiers) || Modifier.isAbstract(klassModifiers)` appears character-identically in 2 files — prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitRunner.java, prelude/toolchains/android/src/com/facebook/buck/testrunner/JUnitSupport.java. 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 prelude/toolchains/android/src/com/facebook/buck/util/zip/AppendableCentralDirectory.java:95— `end64Pos <= 0 || readInt(buffer, end64Pos) != ZipConstants.ZIP64_LOCSIG` appears character-identically in 2 files — prelude/toolchains/android/src/com/facebook/buck/util/zip/AppendableCentralDirectory.java, prelude/toolchains/android/src/com/facebook/buck/util/zip/CentralDirectoryReader.java. 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 prelude/toolchains/android/src/com/facebook/buck/util/zip/AppendableCentralDirectory.java:63— `isZip64MagicVal(offset) || isZip64MagicVal(size) || isZip64MagicCount(count)` appears character-identically in 2 files — prelude/toolchains/android/src/com/facebook/buck/util/zip/AppendableCentralDirectory.java, prelude/toolchains/android/src/com/facebook/buck/util/zip/CentralDirectoryHeader.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:70— `mAndroidDevice != null && mAdbUtils != null && CrashCapturer.deviceHasCrashLogs(trace)` appears character-identically in 2 files — REDACTED, prelude/toolchains/android/src/com/facebook/buck/testrunner/InstrumentationTpxStandardOutputTestListener.java. 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 prelude/toolchains/android/src/com/facebook/buck/util/Escaper.java:60— `matcher.matchesAnyOf(str) || str.isEmpty()` appears character-identically in 2 files — prelude/toolchains/android/src/com/facebook/buck/util/Escaper.java, prelude/toolchains/android/src/com/facebook/buck/util/escaper/EscaperUtils.java. 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 prelude/toolchains/android/src/com/facebook/buck/android/IsolatedApkInfo.java:55— `obj == null || getClass() != obj.getClass()` appears character-identically in 4 files — prelude/toolchains/android/src/com/facebook/buck/android/IsolatedApkInfo.java, prelude/toolchains/android/src/com/facebook/buck/android/build_config/BuildConfigFields.java, prelude/toolchains/android/src/com/facebook/buck/installer/InstallId.java, prelude/toolchains/android/src/com/facebook/buck/util/zip/collect/ZipEntrySourceFromZip.java. 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 prelude/toolchains/android/src/com/facebook/buck/installer/InstallerServer.java:149— `parent.isPresent() && parent.get().pid() != 1 && parent.get().isAlive()` appears character-identically in 2 files — prelude/toolchains/android/src/com/facebook/buck/installer/InstallerServer.java, prelude/toolchains/android/src/com/facebook/buck/jvm/cd/workertool/grpc/WorkerGrpcServer.java. 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 app/buck2_trailcam/js/src/components/invocation/DecodeStatsPanel.tsx:20— `!isFinite(eventsPerSec) || eventsPerSec <= 0` appears character-identically in 2 files — app/buck2_trailcam/js/src/components/invocation/DecodeStatsPanel.tsx, app/buck2_trailcam/js/src/components/invocation/EventLogViewer.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/buck2_explain/js/src/graph2/GraphImpl2.tsx:121— `excludeContaining.length > 1 && excludeRegex.test(label)` appears character-identically in 2 files — app/buck2_explain/js/src/graph2/GraphImpl2.tsx, app/buck2_explain/output_format_js/src/graph2/GraphImpl2.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts:151— `inner != null && typeof inner === 'object'` appears character-identically in 2 files — app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts, app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/buck2_trailcam/js/src/components/invocation/ActionTreemap.tsx:76— `logState.status === 'error' || !treemapData` appears character-identically in 2 files — app/buck2_trailcam/js/src/components/invocation/ActionTreemap.tsx, app/buck2_trailcam/js/src/components/invocation/AnalysisTreemap.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx:115— `logState.status === 'idle' || logState.status === 'loading'` appears character-identically in 6 files — app/buck2_trailcam/js/src/components/invocation/ActionResultsTab.tsx, app/buck2_trailcam/js/src/components/invocation/CriticalPathChart.tsx, app/buck2_trailcam/js/src/components/invocation/CriticalPathView.tsx, app/buck2_trailcam/js/src/components/invocation/EventLogViewer.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/buck2_trailcam/js/src/components/invocation/ActionTreemap.tsx:59— `logState.status === 'idle' || logState.status === 'loading' || lazy.loading` appears character-identically in 3 files — app/buck2_trailcam/js/src/components/invocation/ActionTreemap.tsx, app/buck2_trailcam/js/src/components/invocation/AnalysisTreemap.tsx, app/buck2_trailcam/js/src/components/invocation/LoadTreemap.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/buck2_trailcam/js/src/components/invocation/TestResultsTab.tsx:60— `r.status === 'FATAL' || r.status === 'TIMEOUT' || r.status === 'INFRA_FAILURE'` appears character-identically in 2 files — app/buck2_trailcam/js/src/components/invocation/TestResultsTab.tsx, app/buck2_trailcam/js/src/components/invocation/TestSummaryCard.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts:139— `typeof obj.package === 'string' || typeof obj.name === 'string'` appears character-identically in 2 files — app/buck2_trailcam/js/src/lib/parallel-decode/decoder-worker.ts, app/buck2_trailcam/js/src/lib/streaming-decode-worker.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:145— `!shouldStripAnnotation(it) && !hasErrorType(it)` appears character-identically in 2 files — prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt. 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 prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:586— `(this is IrField || this is IrProperty) && (this as IrDeclarationWithName).name == backingFieldName` appears character-identically in 2 files — prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt. 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 prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:62— `annotationFqName == "kotlin.jvm.Throws" || annotationFqName == "kotlin.Throws"` appears character-identically in 2 files — prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt. 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 prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:72— `arg is IrGetEnumValue && arg.symbol.owner.name.asString() == "SOURCE"` appears character-identically in 2 files — prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt. 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 prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:319— `decl is IrSimpleFunction && !decl.isFakeOverride` appears character-identically in 2 files — prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt. 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 prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:548— `declaration is IrClass && this is IrClass` appears character-identically in 2 files — prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt. 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 prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:125— `element is IrClassReference && element.classType is IrErrorType` appears character-identically in 2 files — prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt. 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 prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt:110— `element is IrExpression && containsErrorType(element)` appears character-identically in 2 files — prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/IrNonAbiStripper.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/IrNonAbiStripper.kt. 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.
Classify ADR enforcement: RFC: labels -> metadata attribute docs/rfcs/attr-metadata.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: `buck2 audit visibility` command docs/rfcs/audit_visibility.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: [RFC][BXL] Streamed Output in BXL docs/rfcs/bxl-streaming.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Buck support to implement `configured_alias` docs/rfcs/configured-alias.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: @configuration syntax docs/rfcs/drafts/configuration-at-syntax.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Digest Kinds docs/rfcs/drafts/digest-kinds.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Observability for Buck2 OSS docs/rfcs/drafts/oss-observability.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Here we avoid `pulls_and_pushes` because we do not want to make these deps available to rdeps docs/rfcs/drafts/plugin-deps.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: RFC: TestInfo v2 docs/rfcs/drafts/test-info-v2.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: [RFC] Conditional Constraint docs/rfcs/drafts/unified_constraint_resolution/main.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Shortcomings with Existing Features docs/rfcs/drafts/unified_constraint_resolution/problems.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Use Cases docs/rfcs/drafts/unified_constraint_resolution/use_cases.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Universal Configuration Naming Function docs/rfcs/drafts/universal-cfg-naming.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Bxl Actions and Build API docs/rfcs/implemented/bxl-actions.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Bxl support for performing analysis on targets docs/rfcs/implemented/bxl-analysis.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Buck Extension Language (BXL) docs/rfcs/implemented/bxl.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: RFC: Execution Modifiers docs/rfcs/implemented/execution_modifiers.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: [RFC] `?modifier` syntax docs/rfcs/implemented/modifier_syntax.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: [RFC] Modifiers docs/rfcs/implemented/modifiers.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Return error in `ProviderCollection[]` on undeclared provider docs/rfcs/implemented/provider-collection-at.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: [RFC] Unified Constraint Rule with Defaults docs/rfcs/implemented/unified_constraint_rule.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Package-local values docs/rfcs/package-local-values.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 68 significant file(s) lose their only recent owner: dice/fuzzy_dice/src/execution.rs, starlark-rust/starlark/src/values/layout/heap/owned_frozen.rs, dice/dice_core/src/fuzz.rs, app/buck2_build_api_tests/src/interpreter/rule_defs/cmd_args/options.rs, shed/mini_vec/src/mini_box_slice.rs, shed/mini_vec/src/size_assert.rs, starlark-rust/starlark/src/values/layout/heap/unfrozen.rs, starlark-rust/starlark/src/values/layout/heap/module_heaps.rs (+60 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 15 significant file(s) lose their only recent owner: superconsole/src/components/splitting.rs, starlark-rust/starlark/src/values/types/list/methods.rs, superconsole/src/components/padding.rs, superconsole/src/components/bordering.rs, app/buck2_common/src/liveliness_observer.rs, starlark-rust/starlark/src/values/types/record/globals.rs, app/buck2_test/src/local_resource_api.rs, app/buck2_http/src/redirect.rs (+7 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 12 significant file(s) lose their only recent owner: app/buck2_node/src/modifiers.rs, app/buck2_cmd_log_client/src/snoop.rs, app/buck2_query_impls/src/aquery/mixed_graph.rs, app/buck2_event_log/src/tail.rs, allocative/allocative/src/visitor.rs, app/buck2_interpreter_for_build/src/attrs/coerce/attr_type.rs, starlark-rust/starlark_syntax/src/frame.rs, allocative/allocative/src/impls/std/collections.rs (+4 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 10 significant file(s) lose their only recent owner: prelude/toolchains/android/src/com/facebook/buck/android/aapt/ResourceSourceMapExecutableMain.kt, prelude/toolchains/android/src/com/facebook/buck/testresultsoutput/TestResultsOutputEvent.java, prelude/toolchains/android/src/com/facebook/buck/testrunner/BasePerTestCoverageRunListener.kt, prelude/toolchains/android/src/com/facebook/buck/testresultsoutput/TestResultsOutputSender.java, prelude/toolchains/android/src/com/facebook/buck/testrunner/RobolectricTimeoutEnforcingRunListener.kt, prelude/toolchains/android/src/com/facebook/buck/testrunner/InstrumentationTimeoutEnforcingRunListener.kt, prelude/toolchains/android/src/com/facebook/buck/testrunner/TpxTimeoutBufferManager.kt, prelude/toolchains/android/src/com/facebook/buck/android/aapt/ResourceSourceMapFormat.kt (+2 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 9 significant file(s) lose their only recent owner: starlark-rust/starlark_syntax/src/diagnostic.rs, starlark-rust/starlark/src/typing/tuple.rs, starlark-rust/starlark/src/eval/bc/stack_ptr.rs, app/buck2_common/src/legacy_configs/agent_context.rs, starlark-rust/starlark/src/typing/arc_ty.rs, app/buck2_cmd_docs_client/src/agent.rs, starlark-rust/starlark/src/typing/small_arc_vec.rs, app/buck2_build_api/src/interpreter/rule_defs/required_test_local_resource.rs (+1 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 8 significant file(s) lose their only recent owner: tools/starlark_fmt/lib/autofixes/sort_list_args.rs, app/buck2_interpreter_for_build_tests/src/super_package/package_function.rs, tools/starlark_fmt/lib/autofixes/sort_list_args/structural.rs, tools/starlark_fmt/lib/sort_key.rs, tools/starlark_fmt/lib/autofixes/parsed_module.rs, tools/starlark_fmt/lib/autofixes.rs, tools/starlark_fmt/lib/autofixes/fmt_suppression.rs, tools/starlark_fmt/lib/autofixes/sort_list_args/policy.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 8 significant file(s) lose their only recent owner: prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compose/ClassStabilityTransformer.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compose/ComposableTypeRewriter.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/stubsgen/generators/InterfaceStubsGenerator.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/stubsgen/generators/InnerClassStubsGenerator.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/stubsgen/generators/AnnotationStubsGenerator.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/stubsgen/generators/GenericStubsGenerator.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/parcelize/ParcelableCreatorEmulator.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/stubsgen/generators/ClassLevelFunctionStubsGenerator.kt. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #8 — If anonymized user #8 becomes unavailable, 7 significant file(s) lose their only recent owner: prelude/toolchains/android/src/com/facebook/buck/installer/android/AndroidInstallerManager.java, app/buck2_execute/src/dep_file_state.rs, prelude/toolchains/android/src/com/facebook/buck/installer/android/AndroidArtifacts.java, prelude/toolchains/android/src/com/facebook/buck/installer/android/InstallMetrics.java, app/buck2_node/src/attrs/configured_traversal.rs, prelude/toolchains/android/src/com/facebook/buck/installer/android/AdbHelperFactory.java, prelude/toolchains/android/src/com/facebook/buck/installer/android/InstallState.java. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #9 — If anonymized user #9 becomes unavailable, 7 significant file(s) lose their only recent owner: app/buck2_explain/js/src/graph2/GraphImpl2.tsx, app/buck2_explain/js/src/Target.tsx, app/buck2_client/src/commands/explain.rs, app/buck2_explain/js/src/App.tsx, app/buck2_explain/js/src/graph2/GraphViz2.tsx, app/buck2_explain/js/src/Router.tsx, app/buck2_explain/js/src/SearchView.tsx. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #10 — If anonymized user #10 becomes unavailable, 7 significant file(s) lose their only recent owner: prelude/toolchains/android/src/com/facebook/buck/io/filesystem/impl/ProjectFilesystemUtils.java, prelude/toolchains/android/src/com/facebook/buck/testrunner/BuckBlockJUnit4ClassRunner.java, prelude/toolchains/android/src/com/facebook/buck/jvm/java/plugin/adapter/PostEnterTaskListener.java, prelude/toolchains/android/src/com/facebook/buck/step/isolatedsteps/common/ZipIsolatedStep.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/java/AnnotationProcessorFactory.java, prelude/toolchains/android/src/com/facebook/buck/step/isolatedsteps/StepFailedException.java, prelude/toolchains/android/src/com/facebook/buck/core/build/execution/context/IsolatedExecutionContext.kt. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #11 — If anonymized user #11 becomes unavailable, 5 significant file(s) lose their only recent owner: prelude/apple/tools/code_signing/codesign_command_factory.py, prelude/apple/tools/code_signing/prepare_code_signing_entitlements.py, prelude/apple/tools/codesign_manifest_tree_postprocessor/main.py, prelude/apple/tools/signing_context_tree_postprocessor/main.py, prelude/apple/tools/dry_codesign_tool.py. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #12 — If anonymized user #12 becomes unavailable, 5 significant file(s) lose their only recent owner: starlark-rust/starlark/src/values/layout/heap/sealed.rs, app/buck2_client_ctx/src/subscribers/classify_server_stderr.rs, starlark-rust/starlark/src/pagable/starlark_deserialize_context/readiness.rs, starlark-rust/starlark/src/values/layout/heap/allocator/api.rs, starlark-rust/starlark/src/values/layout/heap/allocator/bumpalo.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #13 — If anonymized user #13 becomes unavailable, 4 significant file(s) lose their only recent owner: prelude/toolchains/android/src/com/facebook/buck/util/zip/ZipScrubber.java, prelude/toolchains/android/src/com/facebook/buck/jvm/java/ListenableFileManager.java, prelude/toolchains/android/src/com/facebook/buck/util/environment/Platform.java, prelude/toolchains/android/src/com/facebook/buck/jvm/cd/serialization/java/CompilerOutputPathsSerializer.java. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #14 — If anonymized user #14 becomes unavailable, 4 significant file(s) lose their only recent owner: app/buck2_critical_path/src/test_utils.rs, prelude/rust/tools/from_any_dir.py, starlark-rust/starlark_syntax/src/span_display.rs, allocative/allocative/src/impls/std/cell.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #15 — If anonymized user #15 becomes unavailable, 3 significant file(s) lose their only recent owner: games/src/games.rs, games/src/games/menu.rs, games/src/console.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #16 — If anonymized user #16 becomes unavailable, 3 significant file(s) lose their only recent owner: prelude/toolchains/android/src/com/facebook/buck/android/resources/ExoResourcesRewriter.java, prelude/toolchains/android/src/com/facebook/buck/android/resources/ResTableType.java, prelude/android/tools/sort_pre_dexed_files.py. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #17 — If anonymized user #17 becomes unavailable, 3 significant file(s) lose their only recent owner: prelude/go/tools/buildid.go, prelude/go/tools/gobuckify/lib/buck.go, prelude/go/tools/gobuckify/lib/render.go. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #18 — If anonymized user #18 becomes unavailable, 3 significant file(s) lose their only recent owner: prelude/apple/tools/bundling/signing_context_data.py, prelude/apple/tools/code_signing/signing_context_types.py, prelude/apple/tools/bundling/signing_info.py. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #19 — If anonymized user #19 becomes unavailable, 3 significant file(s) lose their only recent owner: prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/stubsgen/cli/Main.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/ksp/Ksp2NoOpDetector.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/stubsgen/cli/StubsGenParseOnlyEnvironment.kt. Pair on, review, or document these before any departure.
Fat interface: AndroidDevice (26 abstract methods) prelude/toolchains/android/src/com/facebook/buck/android/exopackage/AndroidDevice.java:24— `AndroidDevice` declares 26 abstract methods: `compareInstalledApk`, `deviceStartIntent`, `enableAppLinks`, `getApkManifestDigest`, `getContentHash`, `getDeviceAbis`, `getPackageInfo`, `getProperty`, `getSerialNumber`, `getWindowManagerProperty`, `installApexOnDevice`, `installApkOnDevice`, `installBuildUuidFile`, `installFiles`, `isEmulator`, `isOnline`, `killProcess`, `listDirRecursive`, `mkDirP`, `prepareForApexInstallation`, `rmFiles`, `rmStaleFiles`, `setDebugAppPackageName`, `stopPackage`, `uninstallApkFromDevice`, `uninstallPackage`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 19 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 (211 single-owned of 2366 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; 2366 of the 3805 production source files in this repository met that bar). They are anonymized user #20 (2 file(s)), anonymized user #21 (2 file(s)), anonymized user #22 (2 file(s)), anonymized user #23 (2 file(s)), anonymized user #24 (2 file(s)), anonymized user #25 (1 file(s)) (+13 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: starlark-rust/starlark_syntax/src/syntax/ast.rs, starlark-rust/starlark/src/values/recursive_repr_or_json_guard.rs, app/buck2_wrapper_common/src/cleanall/discovery.rs, app/buck2_wrapper_common/src/cleanall/stale.rs, app/buck2_core/src/target/label/arena.rs, app/buck2_server_ctx/src/stderr_output_guard.rs, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.2.0/FrontendPipelineCompat.kt, prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/k2-jvm-abi-gen/src/main/kotlin/compilercompat/2.3.0/FrontendPipelineCompat.kt (+16 more).
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 154 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: starlark-rust/starlark/src/typing/bindings.rs, starlark-rust/starlark_lsp/src/inspect.rs, starlark-rust/starlark/src/analysis/flow.rs, games/src/games/jump.rs, starlark-rust/starlark_syntax/src/syntax/payload_map.rs, starlark-rust/starlark_lsp/src/bind.rs, starlark-rust/starlark_derive/src/util.rs, prelude/ide_integrations/visual_studio/vsgo.py (and 146 more) (158 orphaned of 2367 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; 2367 of the 3805 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
Logging is not universal — Only 46/50 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `app/buck2_external_cells_bundled`, `app/buck2_grpc`, `app/buck2_miniperf`, `dice/read_dump`.
R7 · Dead Code· Unused export 'extractCriticalPathData' · ×1
Unused export 'extractCriticalPathData' app/buck2_trailcam/js/src/lib/critical-path.ts:449— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'clearAllCachedData' · ×1
Unused export 'clearAllCachedData' app/buck2_trailcam/js/src/lib/event-log-cache.ts:681— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'formatProtoDuration' · ×1
Unused export 'formatProtoDuration' app/buck2_trailcam/js/src/lib/format.ts:91— Nothing imports this binding — it is safe to review for removal.
Unused export 'google' app/buck2_trailcam/js/src/lib/proto/bundle.js:65040— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'THEME_INIT_SCRIPT' · ×1
Unused export 'THEME_INIT_SCRIPT' app/buck2_trailcam/js/src/lib/theme.ts:28— Nothing ultimately consumes this binding: its only referrer is the re-export in app/buck2_trailcam/js/src/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in app/buck2_trailcam/js/src/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'useUrlStateList' · ×1
Unused export 'useUrlStateList' app/buck2_trailcam/js/src/lib/url-state.ts:110— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'clearUrlState' · ×1
Unused export 'clearUrlState' app/buck2_trailcam/js/src/lib/url-state.ts:145— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'decompressZstdSync' · ×1
Unused export 'decompressZstdSync' app/buck2_trailcam/js/src/lib/zstd.ts:70— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CardDescription' · ×1
Unused export 'CardDescription' app/buck2_trailcam/js/src/ui/Card.tsx:47— Nothing ultimately consumes this binding: its only referrer is the re-export in app/buck2_trailcam/js/src/ui/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in app/buck2_trailcam/js/src/ui/index.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'CardFooter' app/buck2_trailcam/js/src/ui/Card.tsx:67— Nothing ultimately consumes this binding: its only referrer is the re-export in app/buck2_trailcam/js/src/ui/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in app/buck2_trailcam/js/src/ui/index.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'Switch' app/buck2_trailcam/js/src/ui/Switch.tsx:16— Nothing ultimately consumes this binding: its only referrer is the re-export in app/buck2_trailcam/js/src/ui/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in app/buck2_trailcam/js/src/ui/index.ts in the same commit, or the barrel will import a name that no longer exists.
X23 · Unguarded diagnostic materialisation· Diagnostic log message is built whether or not it is wanted · ×1
Diagnostic log message is built whether or not it is wanted prelude/toolchains/android/src/com/facebook/buck/android/exopackage/AndroidDeviceImpl.kt:540— `debug` at line 540 is called with an argument built by `installPaths.map { "…" it.value.parent it.key.parent }.distinct().joinToString(separator = "…", prefix = "…", postfix...` (line 546), whose cost grows with the collection it walks. Kotlin evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled` test, no `BuildConfig.DEBUG` flag, no trailing lambda (`logger.debug { … }`) the logger calls only when the level is on.
X5 · Nullable reference types· Java packages are not null-marked everywhere · ×1
Java packages are not null-marked everywhere — 0/84 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.
Outdated: async-compression — `async-compression` is locked at 0.4.50 but 0.4.51 is the current stable release on crates.io, and it already satisfies the `"0.4.50"` requirement declared in app/buck2_client_ctx/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p async-compression` and commit the updated REDACTED.
Outdated: backtrace — `backtrace` is locked at 0.3.76 but 0.3.77 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in app/buck2/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p backtrace` and commit the updated REDACTED.
Outdated: blake3 — `blake3` is locked at 1.8.6 but 1.8.7 is the current stable release on crates.io, and it already satisfies the `"1.8"` requirement declared in pagable/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p blake3` and commit the updated REDACTED.
Outdated: const_format — `const_format` is locked at 0.2.36 but 0.2.37 is the current stable release on crates.io, and it already satisfies the `"0.2.36"` requirement declared in app/buck2_log_common/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p const_format` and commit the updated REDACTED.
Outdated: erased-serde — `erased-serde` is locked at 0.4.10 but 0.4.11 is the current stable release on crates.io, and it already satisfies the `"0.4.10"` requirement declared in starlark-rust/starlark/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p erased-serde` and commit the updated REDACTED.
Outdated: globset — `globset` is locked at 0.4.20 but 0.4.21 is the current stable release on crates.io, and it already satisfies the `"0.4.20"` requirement declared in app/buck2_common/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p globset` and commit the updated REDACTED.
Outdated: jiff — `jiff` is locked at 0.2.37 but 0.2.38 is the current stable release on crates.io, and it already satisfies the `"0.2.37"` requirement declared in allocative/allocative/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p jiff` and commit the updated REDACTED.
Outdated: libc — `libc` is locked at 0.2.189 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2.186"` requirement declared in app/buck2/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
Outdated: memmap2 — `memmap2` is locked at 0.9.11 but 0.9.12 is the current stable release on crates.io, and it already satisfies the `"0.9.11"` requirement declared in app/buck2_client_ctx/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p memmap2` and commit the updated REDACTED.
Outdated: perf-event — `perf-event` is locked at 0.4.8 but 0.4.9 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in app/buck2_miniperf/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p perf-event` and commit the updated REDACTED.
Outdated: plist — `plist` is locked at 1.10.1 but 1.10.3 is the current stable release on crates.io, and it already satisfies the `"1.10.1"` requirement declared in app/buck2_interpreter/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p plist` and commit the updated REDACTED.
Outdated: rustls-native-certs — `rustls-native-certs` is locked at 0.8.3 but 0.8.5 is the current stable release on crates.io, and it already satisfies the `"0.8.3"` requirement declared in app/buck2_certs/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustls-native-certs` and commit the updated REDACTED.
Outdated: similar — `similar` is locked at 3.2.0 but 3.2.1 is the current stable release on crates.io, and it already satisfies the `"3.2.0"` requirement declared in app/buck2_cmd_log_client/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p similar` and commit the updated REDACTED.
Outdated: smallvec — `smallvec` is locked at 1.16.2 but 1.16.4 is the current stable release on crates.io, and it already satisfies the `"1.16.2"` requirement declared in pagable/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p smallvec` and commit the updated REDACTED.
Outdated: tokio — `tokio` is locked at 1.53.2 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1.53.2"` requirement declared in games/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
Outdated: tonic — `tonic` is locked at 0.14.6 but 0.14.8 is the current stable release on crates.io, and it already satisfies the `"0.14.6"` requirement declared in app/buck2_action_metadata_proto/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tonic` and commit the updated REDACTED.
Outdated: tonic-build — `tonic-build` is locked at 0.14.6 but 0.14.8 is the current stable release on crates.io, and it already satisfies the `"0.14.6"` requirement declared in shim/third-party/rust/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tonic-build` and commit the updated REDACTED.
Outdated: tonic-prost — `tonic-prost` is locked at 0.14.6 but 0.14.8 is the current stable release on crates.io, and it already satisfies the `"0.14.6"` requirement declared in app/buck2_action_metadata_proto/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tonic-prost` and commit the updated REDACTED.
Outdated: tonic-prost-build — `tonic-prost-build` is locked at 0.14.6 but 0.14.8 is the current stable release on crates.io, and it already satisfies the `"0.14.6"` requirement declared in app/buck2_protoc_dev/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tonic-prost-build` and commit the updated REDACTED.
Outdated: unicode-width — `unicode-width` is locked at 0.2.2 but 0.2.3 is the current stable release on crates.io, and it already satisfies the `"0.2.2"` requirement declared in superconsole/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p unicode-width` and commit the updated REDACTED.
Outdated: xattr — `xattr` is locked at 1.6.1 but 1.7.0 is the current stable release on crates.io, and it already satisfies the `"1.6.1"` requirement declared in app/buck2_common/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p xattr` and commit the updated REDACTED.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 14 file(s) — `app/buck2_trailcam/js/src/components/invocation/EventLogViewer.tsx`, `app/buck2_trailcam/js/src/lib/action-events.ts`, `app/buck2_trailcam/js/src/lib/analysis-events.ts`, `app/buck2_trailcam/js/src/lib/critical-path.ts`, `app/buck2_trailcam/js/src/lib/event-log-cache.ts`, … (+9 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a18329-f36e-78d3-a3c0-34bf6d8aa43c · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 115 · Warnings: 3139 · Recommendations: 292 · Info: 21 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 28-10-2026 @ 15:38 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.