Public report of xai-org/x-algorithm, published 26 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). Watchdog 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, 26 October 2026, 02:25 UTC · Survey ID cd_8539b47243f14084b9781fca6b0963ed
xai-org/x-algorithm
Measured 26 October 2026, 02:23 UTC, at code version 6258a15
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.
Knowledge freshness is not measured: History too condensed to judge knowledge freshness.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
No change since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 431,617 lines of product code in 17 projects, tests not counted · Estimated rebuild effort: about 3.0 person-years · Weakest lens: Production Readiness, 43
Findings by how serious they are
9 critical2567 serious114 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
26 October 2026, 02:23 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 ▸
68of 68 dimensions measured by tools.
2661of 2690 findings point to an exact file and line, so you can open each one in the code. The other 29 concern the repository as a whole, such as missing documentation.
68dimensions across 7 lenses, read from 431,617 lines of product code in 17 projects.
xai-org/x-algorithm falls short of our standard for a template or a sample because we found no working pipeline that builds or tests changes to the code and no automated security scanning of the code, its secrets or its dependencies. It scores 54 out of 100 and is rated Adequate, and eight of its nine critical findings are security problems.
Production Readiness, at 43, is the weakest lens and counts most in the score. The best first steps are adding an automated build and test pipeline and adding automated security scanning, each worth about 6 points. Raising Production Readiness to 52 would lift the score to about 58.
Four weaknesses in the code could be used by an attacker. Three settings leave the servers or containers unsafe, and one known security hole in a package the code depends on can be used by attackers. Fixing the weaknesses the scanner points to, correcting the unsafe settings and updating the vulnerable packages would close these risks. Moving the write out of the read operation would take care of the read operation that also writes data.
The product code is 431,617 lines, about €430,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 43 to 52, the lowest score rated Strong, the score would rise from 54 to about 58.
Code composition: what the lines of code are
Product code 98%Tests 2%
New since the last survey: 253 findings
These 253 critical or serious findings weren't in the previous survey, on 11 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · FileTooLong: src/action_control.rs abuse-enforcement-service/service-lib/src/action_control.rs
God Classes · MethodTooLong: ActionControl.set_rows abuse-enforcement-service/service-lib/src/action_control/levels.rs
God Classes · MethodTooLong: Hydrator.spec visibility-filtering/hydration/hydrator.rs
God Classes · MethodTooLong: KeyOrigin.spec visibility-filtering/hydration/store/key_origin.rs
God Classes · FunctionTooLong: crate::visibility-filtering::rules::golden_corpus::notifications::cases visibility-filtering/rules/golden_corpus/notifications.rs
God Classes · FileTooLong: action_control/levels.rs abuse-enforcement-service/service-lib/src/action_control/levels.rs
God Classes · FileTooLong: src/backfill.rs abuse-enforcement-service/service-lib/src/backfill.rs
God Classes · FileTooLong: models/recsys_reply_two_tower_v2_model.py phoenix/xrex/models/recsys_reply_two_tower_v2_model.py
God Classes · MethodTooLong: Backfill.change abuse-enforcement-service/service-lib/src/backfill.rs
God Classes · ClassTooLong: Backfill abuse-enforcement-service/service-lib/src/backfill.rs
God Classes · TooManyMethods: ActionControl abuse-enforcement-service/service-lib/src/action_control.rs
God Classes · FunctionTooLong: crate::visibility-filtering::rules::golden_corpus::article::rows visibility-filtering/rules/golden_corpus/article.rs
God Classes · MethodTooLong: Backfill.start abuse-enforcement-service/service-lib/src/backfill.rs
God Classes · FunctionTooLong: crate::visibility-filtering::rules::golden_corpus::label_interstitial::rows visibility-filtering/rules/golden_corpus/label_interstitial.rs
God Classes · FunctionTooLong: crate::visibility-filtering::rules::golden_corpus::relationship::rows visibility-filtering/rules/golden_corpus/relationship.rs
God Classes · FileTooLong: models/layers.py phoenix/xrex/models/layers.py
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: 116 findings
These 116 critical or serious findings were in the previous survey, on 11 October 2026, and are gone from this one. The first 100 are listed here.
€140,000 to €720,000, for 2,401 to 7,617 hours of work, about 3.0 person-years for 1 to 6 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.8 at a score of 54. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 431,617 lines of product code
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
Add a CI workflow that builds and runs the test suite on every push/PR.
Raises the score by about 6 points · Medium effort · CI/CD gates
2
Run what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
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 €430,000 to build again, about 3.0 person-years of work. Its weakest lens is Production Readiness, at 43 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Add a CI workflow that builds and runs the test suite on every push/PR. Of all the actions in this report, it raises the score most for the work it takes: about 6 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.1 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 609,038 lines over the last 90 days, which is about 2,469,987 lines a year. At that pace, the extra work comes to an estimated 143.7 to 862.4 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph 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.
1128 modules, with 1953 dependencies between them. 13 loops run through 94 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1088 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
com.twitter.botmaker uses com.twitter.botmaker.compiler.types, so a change to com.twitter.botmaker.compiler.types can break com.twitter.botmaker, while a change to com.twitter.botmaker can't break com.twitter.botmaker.compiler.types.
Position
Below the diagonal: com.twitter.botmaker uses a module listed above it, which is the healthy direction.
11→17 com.twitter.botmaker.rule uses com.twitter.botmaker.runtimepart of a loop✕
Connections
5 pairs of types, where a type in com.twitter.botmaker.rule uses a type in com.twitter.botmaker.runtime.
com.twitter.botmaker.rule uses com.twitter.botmaker.runtime, so a change to com.twitter.botmaker.runtime can break com.twitter.botmaker.rule, while a change to com.twitter.botmaker.rule can't break com.twitter.botmaker.runtime.
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.
2 pairs of types, where a type in crate.abuse-enforcement-service.service-lib.src.service uses a type in crate.abuse-enforcement-service.service-lib.src.action_control.
crate.abuse-enforcement-service.service-lib.src.service uses crate.abuse-enforcement-service.service-lib.src.action_control, so a change to crate.abuse-enforcement-service.service-lib.src.action_control can break crate.abuse-enforcement-service.service-lib.src.service, while a change to crate.abuse-enforcement-service.service-lib.src.service can't break crate.abuse-enforcement-service.service-lib.src.action_control.
Position
Below the diagonal: crate.abuse-enforcement-service.service-lib.src.service uses a module listed above it, which is the healthy direction.
12→18 crate.abuse-enforcement-service.service-lib.src.service uses crate.abuse-enforcement-service.service-lib.srcpart of a loop✕
Connections
1 pair of types, where a type in crate.abuse-enforcement-service.service-lib.src.service uses a type in crate.abuse-enforcement-service.service-lib.src.
crate.abuse-enforcement-service.service-lib.src.service uses crate.abuse-enforcement-service.service-lib.src, so a change to crate.abuse-enforcement-service.service-lib.src can break crate.abuse-enforcement-service.service-lib.src.service, while a change to crate.abuse-enforcement-service.service-lib.src.service can't break crate.abuse-enforcement-service.service-lib.src.
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 crate.candidate-pipeline.side_effect uses crate.candidate-pipeline.candidate_pipelinepart of a loop✕
Connections
1 pair of types, where a type in crate.candidate-pipeline.side_effect uses a type in crate.candidate-pipeline.candidate_pipeline.
crate.candidate-pipeline.side_effect uses crate.candidate-pipeline.candidate_pipeline, so a change to crate.candidate-pipeline.candidate_pipeline can break crate.candidate-pipeline.side_effect, while a change to crate.candidate-pipeline.side_effect can't break crate.candidate-pipeline.candidate_pipeline.
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.
crate.thunder.schema.user uses crate.thunder.schema.tweet, so a change to crate.thunder.schema.tweet can break crate.thunder.schema.user, while a change to crate.thunder.schema.user can't break crate.thunder.schema.tweet.
Position
Below the diagonal: crate.thunder.schema.user uses a module listed above it, which is the healthy direction.
grox.core.plans.plan uses grox.core.schedules.types, so a change to grox.core.schedules.types can break grox.core.plans.plan, while a change to grox.core.plans.plan can't break grox.core.schedules.types.
Position
Below the diagonal: grox.core.plans.plan uses a module listed above it, which is the healthy direction.
grox.core.tasks.task uses grox.core.data_loaders.data_types, so a change to grox.core.data_loaders.data_types can break grox.core.tasks.task, while a change to grox.core.tasks.task can't break grox.core.data_loaders.data_types.
Position
Below the diagonal: grox.core.tasks.task uses a module listed above it, which is the healthy direction.
grox.core.tasks.task uses grox.core.schedules.types, so a change to grox.core.schedules.types can break grox.core.tasks.task, while a change to grox.core.tasks.task can't break grox.core.schedules.types.
Position
Below the diagonal: grox.core.tasks.task uses a module listed above it, which is the healthy direction.
com.twitter.botmaker.runtime uses com.twitter.botmaker.rule, so a change to com.twitter.botmaker.rule can break com.twitter.botmaker.runtime, while a change to com.twitter.botmaker.runtime can't break com.twitter.botmaker.rule.
Position
Below the diagonal: com.twitter.botmaker.runtime uses a module listed above it, which is the healthy direction.
6 pairs of types, where a type in crate.abuse-enforcement-service.service-lib.src uses a type in crate.abuse-enforcement-service.service-lib.src.action_control.
crate.abuse-enforcement-service.service-lib.src uses crate.abuse-enforcement-service.service-lib.src.action_control, so a change to crate.abuse-enforcement-service.service-lib.src.action_control can break crate.abuse-enforcement-service.service-lib.src, while a change to crate.abuse-enforcement-service.service-lib.src can't break crate.abuse-enforcement-service.service-lib.src.action_control.
Position
Below the diagonal: crate.abuse-enforcement-service.service-lib.src uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in crate.abuse-enforcement-service.service-lib.src uses a type in crate.abuse-enforcement-service.service-lib.src.service.
crate.abuse-enforcement-service.service-lib.src uses crate.abuse-enforcement-service.service-lib.src.service, so a change to crate.abuse-enforcement-service.service-lib.src.service can break crate.abuse-enforcement-service.service-lib.src, while a change to crate.abuse-enforcement-service.service-lib.src can't break crate.abuse-enforcement-service.service-lib.src.service.
Position
Below the diagonal: crate.abuse-enforcement-service.service-lib.src uses a module listed above it, which is the healthy direction.
crate.candidate-pipeline.candidate_pipeline uses crate.candidate-pipeline.side_effect, so a change to crate.candidate-pipeline.side_effect can break crate.candidate-pipeline.candidate_pipeline, while a change to crate.candidate-pipeline.candidate_pipeline can't break crate.candidate-pipeline.side_effect.
Position
Below the diagonal: crate.candidate-pipeline.candidate_pipeline uses a module listed above it, which is the healthy direction.
com.twitter.botmaker.function uses com.twitter.botmaker.compiler.types, so a change to com.twitter.botmaker.compiler.types can break com.twitter.botmaker.function, while a change to com.twitter.botmaker.function can't break com.twitter.botmaker.compiler.types.
Position
Below the diagonal: com.twitter.botmaker.function uses a module listed above it, which is the healthy direction.
99 pairs of types, where a type in com.twitter.botmaker.function uses a type in com.twitter.botmaker. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
com.twitter.botmaker.function uses com.twitter.botmaker, so a change to com.twitter.botmaker can break com.twitter.botmaker.function, while a change to com.twitter.botmaker.function can't break com.twitter.botmaker.
Position
Below the diagonal: com.twitter.botmaker.function uses a module listed above it, which is the healthy direction.
com.twitter.botmaker.function uses com.twitter.botmaker.runtime, so a change to com.twitter.botmaker.runtime can break com.twitter.botmaker.function, while a change to com.twitter.botmaker.function can't break com.twitter.botmaker.runtime.
Position
Below the diagonal: com.twitter.botmaker.function uses a module listed above it, which is the healthy direction.
crate.candidate-pipeline.filter uses crate.candidate-pipeline.candidate_pipeline, so a change to crate.candidate-pipeline.candidate_pipeline can break crate.candidate-pipeline.filter, while a change to crate.candidate-pipeline.filter can't break crate.candidate-pipeline.candidate_pipeline.
Position
Below the diagonal: crate.candidate-pipeline.filter uses a module listed above it, which is the healthy direction.
crate.candidate-pipeline.hydrator uses crate.candidate-pipeline.candidate_pipeline, so a change to crate.candidate-pipeline.candidate_pipeline can break crate.candidate-pipeline.hydrator, while a change to crate.candidate-pipeline.hydrator can't break crate.candidate-pipeline.candidate_pipeline.
Position
Below the diagonal: crate.candidate-pipeline.hydrator uses a module listed above it, which is the healthy direction.
crate.candidate-pipeline.query_hydrator uses crate.candidate-pipeline.candidate_pipeline, so a change to crate.candidate-pipeline.candidate_pipeline can break crate.candidate-pipeline.query_hydrator, while a change to crate.candidate-pipeline.query_hydrator can't break crate.candidate-pipeline.candidate_pipeline.
Position
Below the diagonal: crate.candidate-pipeline.query_hydrator uses a module listed above it, which is the healthy direction.
crate.candidate-pipeline.source uses crate.candidate-pipeline.candidate_pipeline, so a change to crate.candidate-pipeline.candidate_pipeline can break crate.candidate-pipeline.source, while a change to crate.candidate-pipeline.source can't break crate.candidate-pipeline.candidate_pipeline.
Position
Below the diagonal: crate.candidate-pipeline.source uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.models uses crate.candidate-pipeline.hydrator, so a change to crate.candidate-pipeline.hydrator can break crate.visibility-filtering.models, while a change to crate.visibility-filtering.models can't break crate.candidate-pipeline.hydrator.
Position
Below the diagonal: crate.visibility-filtering.models uses a module listed above it, which is the healthy direction.
25→27 crate.visibility-filtering.models uses crate.visibility-filtering.hydration.hydratorpart of a loop✕
Connections
3 pairs of types, where a type in crate.visibility-filtering.models uses a type in crate.visibility-filtering.hydration.hydrator.
crate.visibility-filtering.models uses crate.visibility-filtering.hydration.hydrator, so a change to crate.visibility-filtering.hydration.hydrator can break crate.visibility-filtering.models, while a change to crate.visibility-filtering.models can't break crate.visibility-filtering.hydration.hydrator.
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.
crate.visibility-filtering.hydration.relation uses crate.candidate-pipeline.hydrator, so a change to crate.candidate-pipeline.hydrator can break crate.visibility-filtering.hydration.relation, while a change to crate.visibility-filtering.hydration.relation can't break crate.candidate-pipeline.hydrator.
Position
Below the diagonal: crate.visibility-filtering.hydration.relation uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration.relation uses crate.candidate-pipeline.source, so a change to crate.candidate-pipeline.source can break crate.visibility-filtering.hydration.relation, while a change to crate.visibility-filtering.hydration.relation can't break crate.candidate-pipeline.source.
Position
Below the diagonal: crate.visibility-filtering.hydration.relation uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration.relation uses crate.visibility-filtering.models, so a change to crate.visibility-filtering.models can break crate.visibility-filtering.hydration.relation, while a change to crate.visibility-filtering.hydration.relation can't break crate.visibility-filtering.models.
Position
Below the diagonal: crate.visibility-filtering.hydration.relation uses a module listed above it, which is the healthy direction.
26→27 crate.visibility-filtering.hydration.relation uses crate.visibility-filtering.hydration.hydratorpart of a loop✕
Connections
2 pairs of types, where a type in crate.visibility-filtering.hydration.relation uses a type in crate.visibility-filtering.hydration.hydrator.
crate.visibility-filtering.hydration.relation uses crate.visibility-filtering.hydration.hydrator, so a change to crate.visibility-filtering.hydration.hydrator can break crate.visibility-filtering.hydration.relation, while a change to crate.visibility-filtering.hydration.relation can't break crate.visibility-filtering.hydration.hydrator.
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.
crate.visibility-filtering.hydration.hydrator uses crate.visibility-filtering.hydration.inventory, so a change to crate.visibility-filtering.hydration.inventory can break crate.visibility-filtering.hydration.hydrator, while a change to crate.visibility-filtering.hydration.hydrator can't break crate.visibility-filtering.hydration.inventory.
Position
Below the diagonal: crate.visibility-filtering.hydration.hydrator uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration.hydrator uses crate.candidate-pipeline.hydrator, so a change to crate.candidate-pipeline.hydrator can break crate.visibility-filtering.hydration.hydrator, while a change to crate.visibility-filtering.hydration.hydrator can't break crate.candidate-pipeline.hydrator.
Position
Below the diagonal: crate.visibility-filtering.hydration.hydrator uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration.hydrator uses crate.candidate-pipeline.source, so a change to crate.candidate-pipeline.source can break crate.visibility-filtering.hydration.hydrator, while a change to crate.visibility-filtering.hydration.hydrator can't break crate.candidate-pipeline.source.
Position
Below the diagonal: crate.visibility-filtering.hydration.hydrator uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration.hydrator uses crate.visibility-filtering.hydration.relation, so a change to crate.visibility-filtering.hydration.relation can break crate.visibility-filtering.hydration.hydrator, while a change to crate.visibility-filtering.hydration.hydrator can't break crate.visibility-filtering.hydration.relation.
Position
Below the diagonal: crate.visibility-filtering.hydration.hydrator uses a module listed above it, which is the healthy direction.
crate.home-mixer.models.candidate uses crate.visibility-filtering.models, so a change to crate.visibility-filtering.models can break crate.home-mixer.models.candidate, while a change to crate.home-mixer.models.candidate can't break crate.visibility-filtering.models.
Position
Below the diagonal: crate.home-mixer.models.candidate uses a module listed above it, which is the healthy direction.
crate.home-mixer.models.candidate uses crate.visibility-filtering.hydration.hydrator, so a change to crate.visibility-filtering.hydration.hydrator can break crate.home-mixer.models.candidate, while a change to crate.home-mixer.models.candidate can't break crate.visibility-filtering.hydration.hydrator.
Position
Below the diagonal: crate.home-mixer.models.candidate uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.rule_spec uses crate.visibility-filtering.models.viewer, so a change to crate.visibility-filtering.models.viewer can break crate.visibility-filtering.rules.rule_spec, while a change to crate.visibility-filtering.rules.rule_spec can't break crate.visibility-filtering.models.viewer.
Position
Below the diagonal: crate.visibility-filtering.rules.rule_spec uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.rule_spec uses crate.visibility-filtering.hydration.hydrator, so a change to crate.visibility-filtering.hydration.hydrator can break crate.visibility-filtering.rules.rule_spec, while a change to crate.visibility-filtering.rules.rule_spec can't break crate.visibility-filtering.hydration.hydrator.
Position
Below the diagonal: crate.visibility-filtering.rules.rule_spec uses a module listed above it, which is the healthy direction.
29→33 crate.visibility-filtering.rules.rule_spec uses crate.visibility-filtering.models.verdictpart of a loop✕
Connections
6 pairs of types, where a type in crate.visibility-filtering.rules.rule_spec uses a type in crate.visibility-filtering.models.verdict.
crate.visibility-filtering.rules.rule_spec uses crate.visibility-filtering.models.verdict, so a change to crate.visibility-filtering.models.verdict can break crate.visibility-filtering.rules.rule_spec, while a change to crate.visibility-filtering.rules.rule_spec can't break crate.visibility-filtering.models.verdict.
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.
crate.visibility-filtering.rules.safety_level uses crate.visibility-filtering.hydration.hydrator, so a change to crate.visibility-filtering.hydration.hydrator can break crate.visibility-filtering.rules.safety_level, while a change to crate.visibility-filtering.rules.safety_level can't break crate.visibility-filtering.hydration.hydrator.
Position
Below the diagonal: crate.visibility-filtering.rules.safety_level uses a module listed above it, which is the healthy direction.
crate.home-mixer.models.query uses crate.thunder.schema.user, so a change to crate.thunder.schema.user can break crate.home-mixer.models.query, while a change to crate.home-mixer.models.query can't break crate.thunder.schema.user.
Position
Below the diagonal: crate.home-mixer.models.query uses a module listed above it, which is the healthy direction.
crate.home-mixer.models.query uses crate.candidate-pipeline.candidate_pipeline, so a change to crate.candidate-pipeline.candidate_pipeline can break crate.home-mixer.models.query, while a change to crate.home-mixer.models.query can't break crate.candidate-pipeline.candidate_pipeline.
Position
Below the diagonal: crate.home-mixer.models.query uses a module listed above it, which is the healthy direction.
crate.home-mixer.models.query uses crate.home-mixer.models.candidate, so a change to crate.home-mixer.models.candidate can break crate.home-mixer.models.query, while a change to crate.home-mixer.models.query can't break crate.home-mixer.models.candidate.
Position
Below the diagonal: crate.home-mixer.models.query uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration uses crate.visibility-filtering.models.viewer, so a change to crate.visibility-filtering.models.viewer can break crate.visibility-filtering.hydration, while a change to crate.visibility-filtering.hydration can't break crate.visibility-filtering.models.viewer.
Position
Below the diagonal: crate.visibility-filtering.hydration uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration uses crate.visibility-filtering.models, so a change to crate.visibility-filtering.models can break crate.visibility-filtering.hydration, while a change to crate.visibility-filtering.hydration can't break crate.visibility-filtering.models.
Position
Below the diagonal: crate.visibility-filtering.hydration uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration uses crate.visibility-filtering.hydration.relation, so a change to crate.visibility-filtering.hydration.relation can break crate.visibility-filtering.hydration, while a change to crate.visibility-filtering.hydration can't break crate.visibility-filtering.hydration.relation.
Position
Below the diagonal: crate.visibility-filtering.hydration uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration uses crate.visibility-filtering.hydration.hydrator, so a change to crate.visibility-filtering.hydration.hydrator can break crate.visibility-filtering.hydration, while a change to crate.visibility-filtering.hydration can't break crate.visibility-filtering.hydration.hydrator.
Position
Below the diagonal: crate.visibility-filtering.hydration uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration uses crate.home-mixer.models.candidate, so a change to crate.home-mixer.models.candidate can break crate.visibility-filtering.hydration, while a change to crate.visibility-filtering.hydration can't break crate.home-mixer.models.candidate.
Position
Below the diagonal: crate.visibility-filtering.hydration uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.models.verdict uses crate.visibility-filtering.hydration.hydrator, so a change to crate.visibility-filtering.hydration.hydrator can break crate.visibility-filtering.models.verdict, while a change to crate.visibility-filtering.models.verdict can't break crate.visibility-filtering.hydration.hydrator.
Position
Below the diagonal: crate.visibility-filtering.models.verdict uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.models.verdict uses crate.visibility-filtering.rules.rule_spec, so a change to crate.visibility-filtering.rules.rule_spec can break crate.visibility-filtering.models.verdict, while a change to crate.visibility-filtering.models.verdict can't break crate.visibility-filtering.rules.rule_spec.
Position
Below the diagonal: crate.visibility-filtering.models.verdict uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.context uses crate.visibility-filtering.models.viewer, so a change to crate.visibility-filtering.models.viewer can break crate.visibility-filtering.rules.context, while a change to crate.visibility-filtering.rules.context can't break crate.visibility-filtering.models.viewer.
Position
Below the diagonal: crate.visibility-filtering.rules.context uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.context uses crate.candidate-pipeline.hydrator, so a change to crate.candidate-pipeline.hydrator can break crate.visibility-filtering.rules.context, while a change to crate.visibility-filtering.rules.context can't break crate.candidate-pipeline.hydrator.
Position
Below the diagonal: crate.visibility-filtering.rules.context uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.context uses crate.visibility-filtering.models, so a change to crate.visibility-filtering.models can break crate.visibility-filtering.rules.context, while a change to crate.visibility-filtering.rules.context can't break crate.visibility-filtering.models.
Position
Below the diagonal: crate.visibility-filtering.rules.context uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.context uses crate.visibility-filtering.hydration.hydrator, so a change to crate.visibility-filtering.hydration.hydrator can break crate.visibility-filtering.rules.context, while a change to crate.visibility-filtering.rules.context can't break crate.visibility-filtering.hydration.hydrator.
Position
Below the diagonal: crate.visibility-filtering.rules.context uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.context uses crate.home-mixer.models.candidate, so a change to crate.home-mixer.models.candidate can break crate.visibility-filtering.rules.context, while a change to crate.visibility-filtering.rules.context can't break crate.home-mixer.models.candidate.
Position
Below the diagonal: crate.visibility-filtering.rules.context uses a module listed above it, which is the healthy direction.
crate.home-mixer.server uses crate.candidate-pipeline.candidate_pipeline, so a change to crate.candidate-pipeline.candidate_pipeline can break crate.home-mixer.server, while a change to crate.home-mixer.server can't break crate.candidate-pipeline.candidate_pipeline.
Position
Below the diagonal: crate.home-mixer.server uses a module listed above it, which is the healthy direction.
crate.home-mixer.server uses crate.home-mixer.models.query, so a change to crate.home-mixer.models.query can break crate.home-mixer.server, while a change to crate.home-mixer.server can't break crate.home-mixer.models.query.
Position
Below the diagonal: crate.home-mixer.server uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration.store uses crate.thunder.schema.tweet, so a change to crate.thunder.schema.tweet can break crate.visibility-filtering.hydration.store, while a change to crate.visibility-filtering.hydration.store can't break crate.thunder.schema.tweet.
Position
Below the diagonal: crate.visibility-filtering.hydration.store uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration.store uses crate.visibility-filtering.hydration.inventory, so a change to crate.visibility-filtering.hydration.inventory can break crate.visibility-filtering.hydration.store, while a change to crate.visibility-filtering.hydration.store can't break crate.visibility-filtering.hydration.inventory.
Position
Below the diagonal: crate.visibility-filtering.hydration.store uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration.store uses crate.visibility-filtering.models.viewer, so a change to crate.visibility-filtering.models.viewer can break crate.visibility-filtering.hydration.store, while a change to crate.visibility-filtering.hydration.store can't break crate.visibility-filtering.models.viewer.
Position
Below the diagonal: crate.visibility-filtering.hydration.store uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration.store uses crate.candidate-pipeline.hydrator, so a change to crate.candidate-pipeline.hydrator can break crate.visibility-filtering.hydration.store, while a change to crate.visibility-filtering.hydration.store can't break crate.candidate-pipeline.hydrator.
Position
Below the diagonal: crate.visibility-filtering.hydration.store uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration.store uses crate.visibility-filtering.models, so a change to crate.visibility-filtering.models can break crate.visibility-filtering.hydration.store, while a change to crate.visibility-filtering.hydration.store can't break crate.visibility-filtering.models.
Position
Below the diagonal: crate.visibility-filtering.hydration.store uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration.store uses crate.visibility-filtering.hydration.relation, so a change to crate.visibility-filtering.hydration.relation can break crate.visibility-filtering.hydration.store, while a change to crate.visibility-filtering.hydration.store can't break crate.visibility-filtering.hydration.relation.
Position
Below the diagonal: crate.visibility-filtering.hydration.store uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration.store uses crate.visibility-filtering.hydration.hydrator, so a change to crate.visibility-filtering.hydration.hydrator can break crate.visibility-filtering.hydration.store, while a change to crate.visibility-filtering.hydration.store can't break crate.visibility-filtering.hydration.hydrator.
Position
Below the diagonal: crate.visibility-filtering.hydration.store uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration.store uses crate.home-mixer.models.candidate, so a change to crate.home-mixer.models.candidate can break crate.visibility-filtering.hydration.store, while a change to crate.visibility-filtering.hydration.store can't break crate.home-mixer.models.candidate.
Position
Below the diagonal: crate.visibility-filtering.hydration.store uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.hydration.store uses crate.visibility-filtering.hydration, so a change to crate.visibility-filtering.hydration can break crate.visibility-filtering.hydration.store, while a change to crate.visibility-filtering.hydration.store can't break crate.visibility-filtering.hydration.
Position
Below the diagonal: crate.visibility-filtering.hydration.store uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.engine uses crate.visibility-filtering.hydration.inventory, so a change to crate.visibility-filtering.hydration.inventory can break crate.visibility-filtering.rules.engine, while a change to crate.visibility-filtering.rules.engine can't break crate.visibility-filtering.hydration.inventory.
Position
Below the diagonal: crate.visibility-filtering.rules.engine uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.engine uses crate.visibility-filtering.models.viewer, so a change to crate.visibility-filtering.models.viewer can break crate.visibility-filtering.rules.engine, while a change to crate.visibility-filtering.rules.engine can't break crate.visibility-filtering.models.viewer.
Position
Below the diagonal: crate.visibility-filtering.rules.engine uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.engine uses crate.thunder.schema.user, so a change to crate.thunder.schema.user can break crate.visibility-filtering.rules.engine, while a change to crate.visibility-filtering.rules.engine can't break crate.thunder.schema.user.
Position
Below the diagonal: crate.visibility-filtering.rules.engine uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.engine uses crate.visibility-filtering.models, so a change to crate.visibility-filtering.models can break crate.visibility-filtering.rules.engine, while a change to crate.visibility-filtering.rules.engine can't break crate.visibility-filtering.models.
Position
Below the diagonal: crate.visibility-filtering.rules.engine uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.engine uses crate.visibility-filtering.hydration.hydrator, so a change to crate.visibility-filtering.hydration.hydrator can break crate.visibility-filtering.rules.engine, while a change to crate.visibility-filtering.rules.engine can't break crate.visibility-filtering.hydration.hydrator.
Position
Below the diagonal: crate.visibility-filtering.rules.engine uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.engine uses crate.home-mixer.models.candidate, so a change to crate.home-mixer.models.candidate can break crate.visibility-filtering.rules.engine, while a change to crate.visibility-filtering.rules.engine can't break crate.home-mixer.models.candidate.
Position
Below the diagonal: crate.visibility-filtering.rules.engine uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.engine uses crate.visibility-filtering.rules.rule_spec, so a change to crate.visibility-filtering.rules.rule_spec can break crate.visibility-filtering.rules.engine, while a change to crate.visibility-filtering.rules.engine can't break crate.visibility-filtering.rules.rule_spec.
Position
Below the diagonal: crate.visibility-filtering.rules.engine uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.engine uses crate.visibility-filtering.rules.safety_level, so a change to crate.visibility-filtering.rules.safety_level can break crate.visibility-filtering.rules.engine, while a change to crate.visibility-filtering.rules.engine can't break crate.visibility-filtering.rules.safety_level.
Position
Below the diagonal: crate.visibility-filtering.rules.engine uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.engine uses crate.visibility-filtering.hydration, so a change to crate.visibility-filtering.hydration can break crate.visibility-filtering.rules.engine, while a change to crate.visibility-filtering.rules.engine can't break crate.visibility-filtering.hydration.
Position
Below the diagonal: crate.visibility-filtering.rules.engine uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.engine uses crate.visibility-filtering.models.verdict, so a change to crate.visibility-filtering.models.verdict can break crate.visibility-filtering.rules.engine, while a change to crate.visibility-filtering.rules.engine can't break crate.visibility-filtering.models.verdict.
Position
Below the diagonal: crate.visibility-filtering.rules.engine uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.engine uses crate.visibility-filtering.rules.context, so a change to crate.visibility-filtering.rules.context can break crate.visibility-filtering.rules.engine, while a change to crate.visibility-filtering.rules.engine can't break crate.visibility-filtering.rules.context.
Position
Below the diagonal: crate.visibility-filtering.rules.engine uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.rules.rule_spec.features.request uses crate.visibility-filtering.rules.context, so a change to crate.visibility-filtering.rules.context can break crate.visibility-filtering.rules.rule_spec.features.request, while a change to crate.visibility-filtering.rules.rule_spec.features.request can't break crate.visibility-filtering.rules.context.
Position
Below the diagonal: crate.visibility-filtering.rules.rule_spec.features.request uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.post_evaluator uses crate.visibility-filtering.models.viewer, so a change to crate.visibility-filtering.models.viewer can break crate.visibility-filtering.post_evaluator, while a change to crate.visibility-filtering.post_evaluator can't break crate.visibility-filtering.models.viewer.
Position
Below the diagonal: crate.visibility-filtering.post_evaluator uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.post_evaluator uses crate.visibility-filtering.models, so a change to crate.visibility-filtering.models can break crate.visibility-filtering.post_evaluator, while a change to crate.visibility-filtering.post_evaluator can't break crate.visibility-filtering.models.
Position
Below the diagonal: crate.visibility-filtering.post_evaluator uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.post_evaluator uses crate.visibility-filtering.rules.safety_level, so a change to crate.visibility-filtering.rules.safety_level can break crate.visibility-filtering.post_evaluator, while a change to crate.visibility-filtering.post_evaluator can't break crate.visibility-filtering.rules.safety_level.
Position
Below the diagonal: crate.visibility-filtering.post_evaluator uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.post_evaluator uses crate.visibility-filtering.hydration, so a change to crate.visibility-filtering.hydration can break crate.visibility-filtering.post_evaluator, while a change to crate.visibility-filtering.post_evaluator can't break crate.visibility-filtering.hydration.
Position
Below the diagonal: crate.visibility-filtering.post_evaluator uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.post_evaluator uses crate.visibility-filtering.models.verdict, so a change to crate.visibility-filtering.models.verdict can break crate.visibility-filtering.post_evaluator, while a change to crate.visibility-filtering.post_evaluator can't break crate.visibility-filtering.models.verdict.
Position
Below the diagonal: crate.visibility-filtering.post_evaluator uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.post_evaluator uses crate.visibility-filtering.rules.engine, so a change to crate.visibility-filtering.rules.engine can break crate.visibility-filtering.post_evaluator, while a change to crate.visibility-filtering.post_evaluator can't break crate.visibility-filtering.rules.engine.
Position
Below the diagonal: crate.visibility-filtering.post_evaluator uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.explain uses crate.visibility-filtering.models.viewer, so a change to crate.visibility-filtering.models.viewer can break crate.visibility-filtering.explain, while a change to crate.visibility-filtering.explain can't break crate.visibility-filtering.models.viewer.
Position
Below the diagonal: crate.visibility-filtering.explain uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.explain uses crate.candidate-pipeline.hydrator, so a change to crate.candidate-pipeline.hydrator can break crate.visibility-filtering.explain, while a change to crate.visibility-filtering.explain can't break crate.candidate-pipeline.hydrator.
Position
Below the diagonal: crate.visibility-filtering.explain uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.explain uses crate.visibility-filtering.models, so a change to crate.visibility-filtering.models can break crate.visibility-filtering.explain, while a change to crate.visibility-filtering.explain can't break crate.visibility-filtering.models.
Position
Below the diagonal: crate.visibility-filtering.explain uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.explain uses crate.visibility-filtering.hydration.hydrator, so a change to crate.visibility-filtering.hydration.hydrator can break crate.visibility-filtering.explain, while a change to crate.visibility-filtering.explain can't break crate.visibility-filtering.hydration.hydrator.
Position
Below the diagonal: crate.visibility-filtering.explain uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.explain uses crate.visibility-filtering.rules.safety_level, so a change to crate.visibility-filtering.rules.safety_level can break crate.visibility-filtering.explain, while a change to crate.visibility-filtering.explain can't break crate.visibility-filtering.rules.safety_level.
Position
Below the diagonal: crate.visibility-filtering.explain uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.explain uses crate.visibility-filtering.hydration, so a change to crate.visibility-filtering.hydration can break crate.visibility-filtering.explain, while a change to crate.visibility-filtering.explain can't break crate.visibility-filtering.hydration.
Position
Below the diagonal: crate.visibility-filtering.explain uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.explain uses crate.visibility-filtering.models.verdict, so a change to crate.visibility-filtering.models.verdict can break crate.visibility-filtering.explain, while a change to crate.visibility-filtering.explain can't break crate.visibility-filtering.models.verdict.
Position
Below the diagonal: crate.visibility-filtering.explain uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.explain uses crate.visibility-filtering.rules.engine, so a change to crate.visibility-filtering.rules.engine can break crate.visibility-filtering.explain, while a change to crate.visibility-filtering.explain can't break crate.visibility-filtering.rules.engine.
Position
Below the diagonal: crate.visibility-filtering.explain uses a module listed above it, which is the healthy direction.
crate.visibility-filtering.explain uses crate.visibility-filtering.post_evaluator, so a change to crate.visibility-filtering.post_evaluator can break crate.visibility-filtering.explain, while a change to crate.visibility-filtering.explain can't break crate.visibility-filtering.post_evaluator.
Position
Below the diagonal: crate.visibility-filtering.explain uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 52% · Adequate · gated by 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
17
High / Critical
A03:2025 — Software Supply Chain Failures
14
High / Critical
A02:2025 — Security Misconfiguration
5
High / Critical
Roadmap
First, establish a CI pipeline that builds and tests every change, integrating security and dependency scanning to fail the build on regressions. Second, implement manual approval gates for releases to prevent bad builds from reaching users. Third, enforce strict null safety in Scala by enabling explicit null checks and eliminating unsafe null assertions at API boundaries. Finally, document key architectural decisions in a dedicated folder to preserve design context and rationale.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Add a CI workflow that builds and runs the test suite on every push/PR.
Run what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
On Scala 3, add `-Yexplicit-nulls` to `scalacOptions` so `String` and `String | Null` mean different things, and type each Java API's result as nullable where it can return null; on Scala 2 (or as a first step), enable WartRemover's `Null` wart (`wartremoverErrors += Wart.Null`) or Scalafix's `DisableSyntax.noNulls = true` so the code holds absence in `Option`. Then pay the assertions down rather than adding to them: each `.nn` is a null the compiler could not rule out — wrap the Java value in `Option(…)` at the boundary, pattern-match on `null` once there, or change the API so the null cannot arrive; an `unsafeNulls` import switches the checking off for everything after it.
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Raise allocation-aware density on the hot paths — currently 114 use(s) across 110,858 production line(s) (~1.0/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
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 — 9
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 — 2567
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 — 114
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. 68 of 68 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.8 — 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 — 68 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, 2661 of 2690 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.
D8 Code Coverage — 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. Coverage NOT MEASURED: test source is present (.rs, .scala, .py) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or `addSbtPlugin("org.scoverage" % "sbt-scoverage" % "<version>")` in `project/plugins.sbt`, then `sbt clean coverage test coverageReport`, or `coverage run -m pytest` then `coverage xml`) 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. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or `addSbtPlugin("org.scoverage" % "sbt-scoverage" % "<version>")` in `project/plugins.sbt`, then `sbt clean coverage test coverageReport`, or `coverage run -m pytest` then `coverage xml`) 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 — then the real number is read on the next scan.
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 source is present (.rs, .scala, .py) and this repository declares a Cargo test suite (phoenix, 24 test files), but it was not re-run: the analyzer environment could not run it. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D14 License Compliance — measured, with a gap in what it reached — 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 a Python REDACTED/requirements.txt (pip/uv/Poetry), but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Python dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (3 contributor(s) across 56 commit(s) sampled, automation and bot accounts excluded). One of them holds 96% of the history; the other 2 hold 2% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D19 Documentation Quality — measured, with a gap in what it reached — 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. 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.
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. Checkov ran but its report could not be read (checkov produced no output — not a clean result). Every misconfiguration only checkov reports — most of its Terraform, CloudFormation, Bicep and Ansible policies — is absent from this card, so its absence here is not evidence those resources are configured correctly.
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. `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala`, `grox/core/lm/convo.py`, `grox/core/processors.py`, `grox/core/registry.py`, `grox/core/schedules/context.py`, … (+5 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.
D34 Knowledge Freshness — git history too condensed for a reliable signal — The history looks squashed or freshly imported, so per-file ownership reflects those commits rather than real maintenance. This dimension is reported as a low-confidence advisory and is not scored.
AX1 Captive dependencies — 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 Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository's container is Guice, whose lifetimes are not modelled 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.
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 ToolchainServer (bdsm/rust/accumulator). the service did not build — `cargo build --locked --bin 'abuse-score-accumulator'` exited 101: * Have you installed the libsasl2 development package for your platform?
On Debian-based systems, try libsasl2-dev. On RHEL-based systems, try
cyrus-sasl-devel. On macOS with Homebrew, try…; runtime evidence skipped (launch chosen because 'axum' dependency in bdsm/rust/accumulator/Cargo.toml, binary 'abuse-score-accumulator').
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 Java, Python, Rust, c, cpp 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 Python, Rust, c, cpp 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 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). 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.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
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.
X3 Exception handling — 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. 32 further occurrence(s) are not listed individually; the score already reflects all 72.
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. 886 further occurrence(s) are not listed individually; the score already reflects all 926.
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.
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.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
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.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
M4 Documentation accuracy: 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".
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.
244 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was batch_prefetcher.prefetcher_loop at 110. A further 41 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 TopicIdExpansion::category_ids at 91 — they are counted neither in the figure above nor in this dimension's score. 19 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: home-mixer/filters/topic_ids_filter.rs (TopicIdExpansion::category_ids at 91), phoenix/crates/serving/xai-recsys-proto/src/installed_apps.rs (InstalledApp::from_slug at 85), thunder/schema/media_common.rs (MediaCategory::from at 51), visibility-filtering/hydration/hydrator.rs (Hydrator::spec at 41), botmaker/src/scala/com/twitter/botmaker/rule/function/ResponseCodes.scala (ResponseCodes.toTiredAction at 38), and 14 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.
+ 206 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 12 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with batch_prefetcher.prefetcher_loop (cyclomatic 110), RankingBatchPrep::compute_batch_inputs_rust_quick (cyclomatic 103), recsys_batch.from_record_batch (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 12 together lifts Cyclomatic Complexity from 5.9 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Stand up a CI pipeline, then gate Cyclomatic Complexity in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. 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.
+ 359 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 240 down to 240 or less in Cognitive Complexity — start with batch_prefetcher.prefetcher_loop (cognitive 305). — Refactoring it lifts Cognitive Complexity from 4.0 to about 4.3/10.
Stand up a CI pipeline, then gate Cognitive Complexity in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. 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.5 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 91 MethodTooLong finding(s) in God Classes — start with FunctionUnitGen.scala (40), user.rs (13), util.rs (5). — One of this dimension's main actionable groups (91 warning-level).
Resolve the 86 FileTooLong finding(s) in God Classes — start with lib.rs (3), events.rs (2), action_control.rs (2). — One of this dimension's main actionable groups (86 warning-level).
Resolve the 40 FunctionTooLong finding(s) in God Classes — start with storage_util.rs (5), emb_table.rs (3), main.rs (2). — One of this dimension's main actionable groups (40 warning-level).
Stand up a CI pipeline, then gate God Classes in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. 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.
1401 duplicated block group(s) detected. A further 81 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 1 of the 1482 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.
+ 335 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 124 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with FunctionUnitGen.scala (71), action_control.rs (4), tweet.rs (4). — One of this dimension's main actionable groups (124 warning-level).
Resolve the 86 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with FunctionUnitGen.scala (27), user.rs (7), events.rs (3). — One of this dimension's main actionable groups (86 warning-level).
Resolve the 76 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with FunctionUnitGen.scala (20), action_control.rs (3), multi_risk_blender.rs (2). — One of this dimension's main actionable groups (76 warning-level).
Stand up a CI pipeline, then gate Code Duplication in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. 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 · Coupling7.2 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
17 production modules (Cargo+Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 6 module(s) off the main sequence, with abstractness counted on 15 of the 17 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: xai-checkpointing · ×6
What to do
Resolve the 6 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (6 warning-level).
Stand up a CI pipeline, then gate Coupling in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with action_control.rs, python.rs. — One of this dimension's main actionable groups (2 warning-level).
Stand up a CI pipeline, then gate Cohesion (LCOM4) in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. 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.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 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.
2114 test methods: 2114 unit, 0 integration, 0 BDD, 0 e2e. The Rust suite contributes 2033 `#[test]` function(s) across 267 file(s) declaring at least one; its unit/integration split is Cargo's own — 0 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 39 test function(s) across 8 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 Scala suite contributes 42 test case(s) across 17 file(s) in a test source set declaring at least one — every `test("…")`, `it("…")`, `property("…")` and `"…" in {…}` registration and every JUnit `@Test`, which is how munit, ScalaTest, utest, ZIO Test and specs2 declare a case; a case registered under a computed name is not counted, so this is a floor. Its tier split is INFERRED from paths and file names, except sbt's src/it source set, which the build declares.
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.
19 outdated, 0 yanked direct Cargo dependencies. 61 of 69 direct crates were graded against crates.io (0 not published there, 8 not resolved by a committed REDACTED). Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.
Outdated: arc-swap · ×19
What to do
Stand up a CI pipeline, then gate Dependency Hygiene in it to reach Verified (currently Documented). — This repository has no CI pipeline, so there is nothing to add a gate to yet — the pipeline comes first. 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.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 503 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 2 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. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares a Python REDACTED/requirements.txt (pip/uv/Poetry), and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 54 Hotspot finding(s) in Churn × Complexity Hotspots — start with recsys_batch.py, recsys_model.py, trainer_recsys.py. — One of this dimension's main actionable groups (54 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
0 deducted task-comment markers across 431617 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
17 finding(s): 0 critical, 4 high, 10 medium, 3 low. semgrep hit a parse error in 14 file(s) — `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala`, `grox/core/lm/convo.py` (line 232), `grox/core/processors.py` (line 19), `grox/core/registry.py` (line 8), `grox/core/schedules/context.py` (line 7), … (+9 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.
REDACTED
REDACTED
REDACTED
REDACTED
What to do
Resolve the 7 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 warning-level).
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.
Resolve the 1 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 6 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (6). — One of this dimension's main actionable groups (6 warning-level).
Resolve the 3 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 3 High IaC finding(s) in IaC & Container Security — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 2 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d31_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.
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.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 16 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
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 singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
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.
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.
`mm_embedding_client$module.get_mm_client` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command. — phoenix/crates/serving/xai-recsys-mm-server/src/mm_embedding_client.rs:294
What to do
Keep query handlers read-only — move the writes/event-publishes into a command handler so reads stay safe to retry, cache, and route to a read replica.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
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
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
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 a README to the 15 of 17 project(s) that lack one — worth up to 1.8 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the 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.
README.md links to `visibility-filtering/rules/registry.rs`, but `visibility-filtering/rules/registry.rs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README.md:315
What to do
Reconcile the README with reality: README.md links to `visibility-filtering/rules/registry.rs`, but `visibility-filtering/rules/registry.rs` does not exist.
Do you agree with this assessment?
P1 · CI/CD gates0.0 / 10Critical✓ Tool-verified
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.
No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
What to do
Add a CI workflow that builds and runs the test suite on every push/PR.
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.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add cargo-audit / cargo-deny (or clippy) (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
What to do
Run what this repository's stack ships: cargo-audit / cargo-deny (or clippy) — or `semgrep --config=auto`, which runs on any language — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
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.
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 114 use(s) across 110,858 production line(s) (~1.0/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
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).
Scala: on hot paths, make small wrappers value classes (extends AnyVal), @specialized generic code over primitives, use primitive collections, and presize builders.
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.
`start` is async and calls Await.result — a blocking call inside async code stalls the execution-context thread, and every future or fiber scheduled on it for as long as it runs. — botmaker/src/scala/com/twitter/botmaker/loader/Scheduler.scala:39
What to do
Scala: compose the Future or effect (map/flatMap, a for-comprehension) instead of Await.result or unsafeRunSync, and wrap unavoidable blocking calls in blocking { } (Future), IO.blocking or ZIO.attemptBlocking.
Do you agree with this assessment?
R1 · Type Safety10.0 / 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.
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.
under-the-hood/jetfuel/routes/index.tsx:67 · under-the-hood/jetfuel/routes/report.tsx:185 — the two spans are one implementation copied and then locally edited — 102 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. — under-the-hood/jetfuel/routes/index.tsx:67
under-the-hood/jetfuel/routes/_lib/report.ts:38 · under-the-hood/jetfuel/routes/_lib/report.ts:50 — 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. — under-the-hood/jetfuel/routes/_lib/report.ts:38
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.
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files10.0 / 10Exemplary✓ 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.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · 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.
The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception. (×3) — grox/core/engine.py:147, grox/core/schedules/init.py:23, grox/core/data_loaders/media_processor.py:84
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 document2.7 / 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.
`from_dict` is public and takes `value: Any` from its caller, and it calls itself at line 168 (`from_dict`) with a piece of `value` (and at line 175, line 213, line 224, line 250) — and nowhere in `from_dict` 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 `from_dict` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py:168
`to_dict` is public and takes `obj: Any` from its caller, and it calls itself at line 266 (`to_dict`) with a piece of `obj` (and at line 268, line 270, line 288) — and nowhere in `to_dict` 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 `to_dict` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py:266
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.
`scala.io.Source.fromFile(…)` opens something that has to be given back — a file descriptor, a socket, a directory handle — and its only use reads `.getLines` through it and drops it, so this expression both creates the value and is the last place that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it: `Too many open files` under load, and on Windows a file that cannot be replaced or deleted while it is held. Open it with `scala.util.Using.resource(scala.io.Source.fromFile(…)) { r => … }`, which releases it on every path including a throw, or hold it and call `.close()` in a `finally`. (×3) — botmaker/src/scala/com/twitter/botmaker/util/FileUtil.scala:42, botmaker/src/scala/com/twitter/botmaker/util/ThriftUtil.scala:98, botmaker/src/scala/com/twitter/botmaker/util/ThriftUtil.scala:106
What to do
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
Other · Code Health — Whether a 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 2007 is called with an argument built by `sorted(dropped_by_partition.keys())` (line 2009), whose cost grows with the collection it walks. Python 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 `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — phoenix/xrex/data/streaming/kafkaconsumer.py:2007
What to do
In Python, put the construction behind the logger's own check (`if logger.isEnabledFor(logging.DEBUG):`), or pass the collection itself with a `%s` placeholder (`logger.debug("Items %s", items)`) so the logging module renders it only when the record is emitted. The placeholder alone is not the fix when the argument is still built first: it defers the formatting, not a `json.dumps`, a `join` or a comprehension in the argument, and an f-string defers nothing at all.
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 `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` comprehension or `foreach` leaves the mutable collection it is walking alone — an `ArrayBuffer` or `ListBuffer` counts its changes and its iterator checks the count, an `ArrayDeque` (and `mutable.Queue`/`mutable.Stack`) is walked by index up to its starting length, and a `java.util` collection walked through `asScala` is fail-fast, so a body that adds to or removes from the very collection the loop is walking makes a later step throw `ConcurrentModificationException` (`IndexOutOfBoundsException` for a deque) 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.
`case NonFatal(_)` 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. — under-the-hood/scalding/GizmoduckLabelDiff.scala:21
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. (×24) — simclusters/simclustersann/SimclustersAnnWarmupHandler.scala:68, REDACTED:500, REDACTED:630, …
`case _: 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. — simclusters/simclustersann/controllers/GetTweetCandidatesGrpcController.scala:39
`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. (×14) — phoenix/xrex/utils/launch_env.py:41, phoenix/xrex/utils/launch_env.py:54, phoenix/xrex/pallas/ranker_attention_varlen.py:1362, …
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`info` at line 595 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. — REDACTED:595
`info` at line 620 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. — REDACTED:620
`info` at line 627 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. — REDACTED:627
`info` at line 629 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. — REDACTED:629
`error` at line 663 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog. — REDACTED:663
`info` at line 696 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. — REDACTED:696
`info` at line 101 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. — phoenix/xrex/utils/gpu.py:101
`error` 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog. — phoenix/xrex/utils/gpu.py:103
`error` at line 166 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog. — phoenix/xrex/utils/gpu.py:166
`warning` at line 211 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. — phoenix/xrex/utils/gpu.py:211
`warning` at line 298 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. — phoenix/xrex/utils/gpu.py:298
`warning` at line 303 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. — phoenix/xrex/utils/gpu.py:303
`info` at line 306 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. — phoenix/xrex/utils/gpu.py:306
`warning` at line 308 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. — phoenix/xrex/utils/gpu.py:308
`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. — phoenix/xrex/utils/jax_extensions.py:59
`info` at line 76 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. — phoenix/xrex/utils/jax_extensions.py:76
`info` at line 80 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. — phoenix/xrex/utils/jax_extensions.py:80
`info` at line 83 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. — phoenix/xrex/utils/jax_extensions.py:83
`info` at line 84 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. — phoenix/xrex/utils/jax_extensions.py:84
`info` at line 102 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. — phoenix/xrex/utils/jax_extensions.py:102
`info` at line 75 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. — phoenix/xrex/utils/log_timer.py:75
`error` 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog. — phoenix/xrex/utils/metadata.py:96
`error` at line 106 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog. — phoenix/xrex/utils/metadata.py:106
`info` at line 499 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. — phoenix/xrex/utils/metadata.py:499
`info` at line 508 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. — phoenix/xrex/utils/metadata.py:508
`info` at line 551 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. — phoenix/xrex/utils/metadata.py:551
`info` at line 565 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. — phoenix/xrex/utils/metadata.py:565
`info` at line 597 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. — phoenix/xrex/utils/metadata.py:597
`info` at line 18 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. — phoenix/xrex/utils/nsys.py:18
`info` at line 24 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. — phoenix/xrex/utils/nsys.py:24
`info` at line 26 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. — phoenix/xrex/utils/nsys.py:26
`info` at line 36 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. — phoenix/xrex/utils/pyspy_profiler.py:36
`error` at line 70 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog. — phoenix/xrex/utils/pyspy_profiler.py:70
`info` at line 73 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. — phoenix/xrex/utils/pyspy_profiler.py:73
`debug` at line 49 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. — phoenix/xrex/utils/utils.py:49
`info` at line 219 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. — phoenix/xrex/utils/utils.py:219
`info` at line 240 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. — phoenix/xrex/utils/utils.py:240
`info` at line 255 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. — phoenix/xrex/utils/utils.py:255
`warning` at line 311 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. — phoenix/xrex/utils/utils.py:311
`warning` at line 312 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. — phoenix/xrex/utils/utils.py:312
Other · Code Health — Whether Scala's null is held to the type system and not undermined by assertions — a file compiled with `-Yexplicit-nulls` is one where `String` excludes null and `String | Null` admits it, a file under WartRemover's `Null` wart or Scalafix's `DisableSyntax.noNulls` is one whose code cannot write `null` and must say `Option`, and each `.nn`, `import scala.language.unsafeNulls` or null-lint suppression is the author overruling that.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
No build over this repository's 547 Scala product file(s) passes `-Yexplicit-nulls`, enables WartRemover's `Null` wart or runs Scalafix's `DisableSyntax.noNulls`, so every reference type admits null and nothing reports a `null` written into the code or returned from a Java API — the first one to reach a method call is a `NullPointerException`. `Option` by convention is a habit no tool here holds the code to.
What to do
On Scala 3, add `-Yexplicit-nulls` to `scalacOptions` so `String` and `String | Null` mean different things, and type each Java API's result as nullable where it can return null; on Scala 2 (or as a first step), enable WartRemover's `Null` wart (`wartremoverErrors += Wart.Null`) or Scalafix's `DisableSyntax.noNulls = true` so the code holds absence in `Option`. Then pay the assertions down rather than adding to them: each `.nn` is a null the compiler could not rule out — wrap the Java value in `Option(…)` at the boundary, pattern-match on `null` once there, or change the API so the null cannot arrive; an `unsafeNulls` import switches the checking off for everything after it.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 7 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 15 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 5 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
P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
Not included — 61 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 — Frontend below the scale floor (0 DOM element(s) < 25) — too little surface to assess accessibility.
AC2 Forms & labels — Frontend below the scale floor (0 DOM element(s) < 25) — too little surface to assess accessibility.
AC3 Page structure — Frontend below the scale floor (0 DOM element(s) < 25) — too little surface to assess accessibility.
AC4 Keyboard semantics — Frontend below the scale floor (0 DOM element(s) < 25) — too little surface to assess accessibility.
AC5 ARIA correctness — Frontend below the scale floor (0 DOM element(s) < 25) — too little surface to assess accessibility.
AC6 Visual & motion safety — Frontend below the scale floor (0 DOM element(s) < 25) — too little surface to assess accessibility.
AC7 A11y enforcement — Frontend below the scale floor (0 DOM element(s) < 25) — too little surface to assess accessibility.
AX1 Captive dependencies — 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
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
AX8 Test isolation — no test/production split to check
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the service did not build — `cargo build --locked --bin 'abuse-score-accumulator'` exited 101: * Have you installed the libsasl2 development package for your platform?
On Debian-based systems, try libsasl2-dev. On RHEL-based systems, try
cyrus-sasl-devel. On macOS with Homebrew, try…; runtime evidence skipped (launch chosen because 'axum' dependency in bdsm/rust/accumulator/Cargo.toml, binary 'abuse-score-accumulator') 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.
D10 Test Quality — ~9915 lines of test source are present (.rs, .scala, .py) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D20 ADR Quality — N/A — this repo declares itself a template / kata / sample / demo; a formal ADR log is deferred to a real application built from it.
D21 Naming Consistency — Naming consistency is measured on C# only; Java, Python, Rust, Scala, TypeScript not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Python, 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 .java, .py, .rs, .scala, .ts, .tsx, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — D26 measured no build unit over this repository's .cc, .java, .rs, .scala, .ts, .tsx source. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D27 Navigability — D27 reads resolved call sites in the languages it reads only — this repository's production source is .cc, .java, .py, .scala, .ts, .tsx, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 10 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D34 Knowledge Freshness — history too condensed to judge knowledge freshness
D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
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.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM1 Aggregate boundaries — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM6 Domain ↔ infrastructure boundary — this Rust crate maps no type to a persistence framework (diesel/sea-orm/sqlx), so DM6's domain↔infrastructure fusion read has no population to be taken over
DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
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 — no CI workflow found
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
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `#[bench]`, criterion's `bench_function`/`bench_with_input`, `#[divan::bench]` or `#[library_benchmark]` in any `.rs` file, or criterion, divan, iai or a `[[bench]]` target in a Cargo.toml, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
R4 Test Coverage — the JS/TS workspace (7 production file(s)) has no JavaScript/TypeScript test, but it is 0.13% of this repository's production source and the other 99.87% carries 9,915 line(s) of test code this pass cannot read — an incidental frontend's reachability is not the repository's test posture, so it is not scored as one
R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
R6 Tooling — no package.json in the repository — test/lint/typecheck wiring is read from package.json scripts (corroborated against CI), so this project's own toolchain isn't measured here
R7 Dead Code — Not measured — no application, tooling or test entry point was detected, so no file can be shown to be reachable or unreachable. Declare an entry (package.json main/module/exports, src/index.*, or an index.html script) to enable reachability.
R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
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.
X2 Cancellation propagation — no C# was loaded; this repository's Scala, Java, Python and Rust were read, and no request in it can be cancelled by a caller — a Scala request takes no token: a Future cannot be cancelled, and cats-effect, ZIO and Monix interrupt the fiber that made the request from outside the call, not through a parameter; a Java request off Android takes no token: it is cancelled through the handle it returns (Future.cancel, Call.cancel, a Disposable), ambiently (io.grpc.Context) or by interrupting its thread, not through a parameter; a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
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.
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.
AX9 · CQS / query purity· Query writes persistent state on the read path · ×1
Query writes persistent state on the read path: mm_embedding_client$module.get_mm_client phoenix/crates/serving/xai-recsys-mm-server/src/mm_embedding_client.rs:294— `mm_embedding_client$module.get_mm_client` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command.
D30 · Dependency Vulnerabilities· High vulnerability · ×1
Duplicated block (8 lines × 2) abuse-enforcement-service/service-lib/src/action_control.rs:1186— abuse-enforcement-service/service-lib/src/action_control.rs:1186-1193 | abuse-enforcement-service/service-lib/src/head_guard.rs:488-495 — before extracting anything, compare `abuse-enforcement-service/service-lib/src/action_control.rs` and `abuse-enforcement-service/service-lib/src/head_guard.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) abuse-enforcement-service/service-lib/src/action_control.rs:1465— abuse-enforcement-service/service-lib/src/action_control.rs:1465-1472 | abuse-enforcement-service/service-lib/src/off_switch.rs:391-398 — before extracting anything, compare `abuse-enforcement-service/service-lib/src/action_control.rs` and `abuse-enforcement-service/service-lib/src/off_switch.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) abuse-enforcement-service/service-lib/src/action_control.rs:1858— abuse-enforcement-service/service-lib/src/action_control.rs:1858-1865 | abuse-enforcement-service/service-lib/src/head_guard.rs:732-739 — before extracting anything, compare `abuse-enforcement-service/service-lib/src/action_control.rs` and `abuse-enforcement-service/service-lib/src/head_guard.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) home-mixer/ads/partition_organic_blender.rs:70— home-mixer/ads/partition_organic_blender.rs:70-77 | home-mixer/ads/time_gap_blender.rs:88-95 — before extracting anything, compare `home-mixer/ads/partition_organic_blender.rs` and `home-mixer/ads/time_gap_blender.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) home-mixer/ads/partition_organic_blender.rs:192— home-mixer/ads/partition_organic_blender.rs:192-199 | home-mixer/ads/time_gap_blender.rs:170-177 — before extracting anything, compare `home-mixer/ads/partition_organic_blender.rs` and `home-mixer/ads/time_gap_blender.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:1039— home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:1039-1046 | home-mixer/candidate_pipeline/phoenix_scores_pipeline.rs:385-392 — before extracting anything, compare `home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/phoenix_scores_pipeline.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) home-mixer/util/urt/mod.rs:144— home-mixer/util/urt/mod.rs:144-151 | home-mixer/util/urt/reverse_chron_following/mod.rs:95-103 — 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) phoenix/crates/serving/xai-recsys-engine/src/python.rs:2304— phoenix/crates/serving/xai-recsys-engine/src/python.rs:2304-2311 | phoenix/crates/serving/xai-recsys-engine/src/request_metrics.rs:543-550 — 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) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:420— phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:420-427 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:523-530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:712— phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:712-719 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:986-993 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:135— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:135-142 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:644-651 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:384— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:384-391 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:566-573 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:850— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:850-857 | thunder/schema/tweet.rs:3789-3796 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 293 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) thunder/schema/tweet.rs:1204— thunder/schema/tweet.rs:1204-1211 | thunder/schema/tweet.rs:1535-1542 — both copies are in the same file, so extract the block into 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) thunder/schema/tweet.rs:2299— thunder/schema/tweet.rs:2299-2306 | thunder/schema/tweet_events.rs:795-802 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:2755— thunder/schema/tweet.rs:2755-2762 | thunder/schema/user.rs:4532-4539 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:3175— thunder/schema/tweet.rs:3175-3182 | thunder/schema/user.rs:4323-4330 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/user.rs:4177— thunder/schema/user.rs:4177-4184 | thunder/schema/user.rs:8018-8025 — both copies are in the same file, so extract the block into 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) thunder/schema/user.rs:4187— thunder/schema/user.rs:4187-4194 | thunder/schema/user.rs:14693-14700 — both copies are in the same file, so extract the block into 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) thunder/schema/user.rs:10988— thunder/schema/user.rs:10988-10995 | thunder/schema/user.rs:10998-11005 — both copies are in the same file, so extract the block into 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) home-mixer/query_hydrators/impressed_posts_query_hydrator.rs:13— home-mixer/query_hydrators/impressed_posts_query_hydrator.rs:13-20 | home-mixer/query_hydrators/past_request_timestamps_query_hydrator.rs:24-31 — 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) phoenix/crates/serving/xai-recsys-mm-server/src/o2.rs:99— phoenix/crates/serving/xai-recsys-mm-server/src/o2.rs:99-106 | thunder/o2/mod.rs:71-78 — 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) abuse-enforcement-service/service-lib/src/action_control.rs:309— abuse-enforcement-service/service-lib/src/action_control.rs:309-316 | abuse-enforcement-service/service-lib/src/off_switch.rs:199-206 — before extracting anything, compare `abuse-enforcement-service/service-lib/src/action_control.rs` and `abuse-enforcement-service/service-lib/src/off_switch.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:394— botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:394-401 | botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:451-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:449` calls `get` and `botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:392` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:41— botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:41-48 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:42-49 — before extracting anything, compare `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala` and `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:41` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `MemCachedClientConfig` in one and `MemCachedCounterConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
MethodTooLong: RankingBatchPrep.compute_batch_inputs_rust_quick phoenix/crates/serving/xai-recsys-engine/src/python.rs:1587— MethodTooLong — compute_batch_inputs_rust_quick runs 604 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 504 over it, 6.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: FunctionUnit2O11.fingerprint botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11237— MethodTooLong — fingerprint runs 449 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 349 over it, 4.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: InputBuffer.compute_from_columnar_bytes phoenix/crates/common/xai-recsys/src/util.rs:1221— MethodTooLong — compute_from_columnar_bytes runs 371 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 271 over it, 3.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: PhoenixCandidatePipeline.prod home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:553— MethodTooLong — prod runs 366 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 266 over it, 3.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AnnotationValue.read_from_in_protocol thunder/schema/user.rs:4926— MethodTooLong — read_from_in_protocol runs 354 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 254 over it, 3.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Account.read_from_in_protocol thunder/schema/user.rs:6052— MethodTooLong — read_from_in_protocol runs 354 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 254 over it, 3.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FunctionUnit2O9.fingerprint botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9233— MethodTooLong — fingerprint runs 350 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 250 over it, 3.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.
MethodTooLong: FunctionUnit3O8.fingerprint botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12269— MethodTooLong — fingerprint runs 334 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 234 over it, 3.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FunctionUnit4O7.fingerprint botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9657— MethodTooLong — fingerprint runs 315 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 215 over it, 3.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ActionControl.set_rows abuse-enforcement-service/service-lib/src/action_control/levels.rs:888— MethodTooLong — set_rows runs 308 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 208 over it, 3.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: FunctionUnit2O8.fingerprint botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10855— MethodTooLong — fingerprint runs 305 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 205 over it, 3.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Hydrator.spec visibility-filtering/hydration/hydrator.rs:207— MethodTooLong — spec runs 289 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 189 over it, 2.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FunctionUnit7O5.fingerprint botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8875— MethodTooLong — fingerprint runs 288 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 188 over it, 2.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Safety.read_from_in_protocol thunder/schema/user.rs:9009— MethodTooLong — read_from_in_protocol runs 284 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 184 over it, 2.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: InputBuffer.compute_for_item phoenix/crates/common/xai-recsys/src/util.rs:876— MethodTooLong — compute_for_item runs 279 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 179 over it, 2.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: Account.write_to_out_protocol thunder/schema/user.rs:6480— MethodTooLong — write_to_out_protocol runs 277 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 177 over it, 2.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: KeyOrigin.spec visibility-filtering/hydration/store/key_origin.rs:74— MethodTooLong — spec runs 277 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 177 over it, 2.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: FunctionUnit6O5.fingerprint botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7394— MethodTooLong — fingerprint runs 268 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 168 over it, 2.68× 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: RetrievalBatchPrep.compute_batch_inputs_rust_quick phoenix/crates/serving/xai-recsys-engine/src/python.rs:2406— MethodTooLong — compute_batch_inputs_rust_quick runs 266 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 166 over it, 2.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FunctionUnit2O7.fingerprint botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10524— MethodTooLong — fingerprint runs 263 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 163 over it, 2.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FunctionUnit5O5.fingerprint botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6015— MethodTooLong — fingerprint runs 248 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FunctionUnit7O4.fingerprint botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8575— MethodTooLong — fingerprint runs 240 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 140 over it, 2.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AnnotationValue.write_to_out_protocol thunder/schema/user.rs:5387— MethodTooLong — write_to_out_protocol runs 240 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 140 over it, 2.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Event.read_from_in_protocol thunder/schema/events.rs:4137— MethodTooLong — read_from_in_protocol runs 234 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 134 over it, 2.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FunctionUnit4O5.fingerprint botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4722— MethodTooLong — fingerprint runs 228 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 128 over it, 2.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FileTooLong: schema/user.rs thunder/schema/user.rs— FileTooLong — 10959 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 10459 over it, 21.92× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: botmaker/FunctionUnitGen.scala botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala— FileTooLong — 10741 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 10241 over it, 21.48× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: inference/model_runner.py phoenix/xrex/inference/model_runner.py— FileTooLong — 4667 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4167 over it, 9.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: models/recsys_model.py phoenix/xrex/models/recsys_model.py— FileTooLong — 4346 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3846 over it, 8.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: schema/tweet.rs thunder/schema/tweet.rs— FileTooLong — 3935 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 3435 over it, 7.87× 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: schema/events.rs thunder/schema/events.rs— FileTooLong — 3484 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 2984 over it, 6.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: train/trainer_recsys.py phoenix/xrex/train/trainer_recsys.py— FileTooLong — 3457 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2957 over it, 6.91× 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/python.rs phoenix/crates/serving/xai-recsys-engine/src/python.rs— FileTooLong — 2982 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 2482 over it, 5.96× 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 abuse-enforcement-service/service-lib/src/lib.rs— FileTooLong — 2631 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 58 free functions. The bar is 500 significant lines; this is 2131 over it, 5.26× 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: ranker_fa4/flash_fwd_sm100.py phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py— FileTooLong — 2519 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2019 over it, 5.04× 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: models/recsys_two_tower_model.py phoenix/xrex/models/recsys_two_tower_model.py— FileTooLong — 2486 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1986 over it, 4.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/service.rs abuse-enforcement-service/service-lib/src/service.rs— FileTooLong — 2348 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 68 free functions. The bar is 500 significant lines; this is 1848 over it, 4.70× 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: data/parquet_recsys.py phoenix/xrex/data/parquet_recsys.py— FileTooLong — 2304 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1804 over it, 4.61× 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: recsys/recsys_batch.py phoenix/xrex/data/recsys/recsys_batch.py— FileTooLong — 1934 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1434 over it, 3.87× 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: pallas/ranker_attention_varlen.py phoenix/xrex/pallas/ranker_attention_varlen.py— FileTooLong — 1857 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1357 over it, 3.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/action_control.rs abuse-enforcement-service/service-lib/src/action_control.rs— FileTooLong — 1760 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 1260 over it, 3.52× 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: streaming/kafkaconsumer.py phoenix/xrex/data/streaming/kafkaconsumer.py— FileTooLong — 1703 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1203 over it, 3.41× 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: streaming/kafkaloader.py phoenix/xrex/data/streaming/kafkaloader.py— FileTooLong — 1578 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1078 over it, 3.16× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/storage_util.rs phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs— FileTooLong — 1509 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 1009 over it, 3.02× 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: REDACTED REDACTED— FileTooLong — 1451 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 951 over it, 2.90× 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/overturn_hold.rs abuse-enforcement-service/service-lib/src/overturn_hold.rs— FileTooLong — 1367 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 867 over it, 2.73× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/util.rs phoenix/crates/common/xai-recsys/src/util.rs— FileTooLong — 1347 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 76% of them inside a single declaration: InputBuffer (3 blocks, 433-1733). The bar is 500 significant lines; this is 847 over it, 2.69× 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: compiler/Serializer.java botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java— FileTooLong — 1312 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Serializer (49-1903). The bar is 500 significant lines; this is 812 over it, 2.62× 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: train/trainer.py phoenix/xrex/train/trainer.py— FileTooLong — 1306 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 806 over it, 2.61× 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: compiler/Compiler.java botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java— FileTooLong — 1282 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: Compiler (79-1617). The bar is 500 significant lines; this is 782 over it, 2.56× 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.
Duplicated block (10 lines × 2) abuse-enforcement-service/service-lib/src/action_control.rs:89— abuse-enforcement-service/service-lib/src/action_control.rs:89-98 | abuse-enforcement-service/service-lib/src/action_control.rs:101-110 — both copies are in the same file, so extract the block into 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) home-mixer/clients/impressed_posts_client.rs:34— home-mixer/clients/impressed_posts_client.rs:34-43 | home-mixer/clients/simclusters_ann_cache_client.rs:67-76 — 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) home-mixer/side_effects/phoenix_experiments_side_effect.rs:305— home-mixer/side_effects/phoenix_experiments_side_effect.rs:305-314 | home-mixer/side_effects/phoenix_experiments_side_effect.rs:518-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 (10 lines × 2) home-mixer/sources/sid_source.rs:99— home-mixer/sources/sid_source.rs:99-108 | home-mixer/sources/simclusters_source.rs:263-272 — 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) home-mixer/util/urt/feedback.rs:134— home-mixer/util/urt/feedback.rs:134-143 | home-mixer/util/urt/feedback.rs:182-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) phoenix-rankall/src/processor/gen/scored_candidate.rs:64— phoenix-rankall/src/processor/gen/scored_candidate.rs:64-73 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:421-430 — before extracting anything, compare `phoenix-rankall/src/processor/gen/scored_candidate.rs` and `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) phoenix/crates/common/xai-recsys/src/util.rs:1275— phoenix/crates/common/xai-recsys/src/util.rs:1275-1284 | phoenix/crates/serving/xai-recsys-engine/src/util.rs:275-284 — before extracting anything, compare `phoenix/crates/common/xai-recsys/src/util.rs` and `phoenix/crates/serving/xai-recsys-engine/src/util.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 139 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1347— phoenix/crates/serving/xai-recsys-engine/src/python.rs:1347-1356 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:3071-3080 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-engine/src/util.rs:74— phoenix/crates/serving/xai-recsys-engine/src/util.rs:74-83 | phoenix/crates/serving/xai-recsys-engine/src/util.rs:256-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 (10 lines × 2) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:255— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:255-264 | thunder/schema/events.rs:1631-1640 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 214 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) thunder/schema/events.rs:1854— thunder/schema/events.rs:1854-1863 | thunder/schema/events.rs:2019-2028 — both copies are in the same file, so extract the block into 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) thunder/schema/events.rs:2936— thunder/schema/events.rs:2936-2945 | thunder/schema/user.rs:6120-6129 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 49 separate duplicated blocks between them, totalling at least 510 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/media_common.rs:346— thunder/schema/media_common.rs:346-355 | thunder/schema/media_entity.rs:357-366 — before extracting anything, compare `thunder/schema/media_common.rs` and `thunder/schema/media_entity.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 (10 lines × 2) thunder/schema/media_entity.rs:221— thunder/schema/media_entity.rs:221-230 | thunder/schema/tweet.rs:1471-1480 — before extracting anything, compare `thunder/schema/media_entity.rs` and `thunder/schema/tweet.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) thunder/schema/media_entity.rs:344— thunder/schema/media_entity.rs:344-353 | thunder/schema/tweet.rs:802-811 — before extracting anything, compare `thunder/schema/media_entity.rs` and `thunder/schema/tweet.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) thunder/schema/tweet.rs:2161— thunder/schema/tweet.rs:2161-2170 | thunder/schema/tweet_media.rs:408-417 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_media.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:3607— thunder/schema/tweet.rs:3607-3616 | thunder/schema/user.rs:3953-3962 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:3683— thunder/schema/tweet.rs:3683-3692 | thunder/schema/tweet.rs:3815-3824 — both copies are in the same file, so extract the block into 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) thunder/schema/tweet_events.rs:931— thunder/schema/tweet_events.rs:931-940 | thunder/schema/user.rs:12248-12257 — before extracting anything, compare `thunder/schema/tweet_events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 353 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet_events.rs:1025— thunder/schema/tweet_events.rs:1025-1034 | thunder/schema/user.rs:4694-4703 — before extracting anything, compare `thunder/schema/tweet_events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 353 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet_media.rs:241— thunder/schema/tweet_media.rs:241-250 | thunder/schema/user.rs:7000-7009 — before extracting anything, compare `thunder/schema/tweet_media.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 172 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet_media.rs:606— thunder/schema/tweet_media.rs:606-615 | thunder/schema/tweet_media.rs:686-695 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) thunder/schema/user.rs:3320— thunder/schema/user.rs:3320-3329 | thunder/schema/user.rs:4188-4197 — both copies are in the same file, so extract the block into 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) thunder/schema/user.rs:5760— thunder/schema/user.rs:5760-5769 | thunder/schema/user.rs:10844-10853 — both copies are in the same file, so extract the block into 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) thunder/schema/user.rs:8145— thunder/schema/user.rs:8145-8154 | thunder/schema/user.rs:12333-12342 — both copies are in the same file, so extract the block into 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) abuse-enforcement-service/service-lib/src/action_control.rs:1236— abuse-enforcement-service/service-lib/src/action_control.rs:1236-1243 | abuse-enforcement-service/service-lib/src/off_switch.rs:585-590 — before extracting anything, compare `abuse-enforcement-service/service-lib/src/action_control.rs` and `abuse-enforcement-service/service-lib/src/off_switch.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) home-mixer/ads/multi_risk_blender.rs:136— home-mixer/ads/multi_risk_blender.rs:136-141 | home-mixer/ads/multi_risk_blender.rs:176-181 — both copies are in the same file, so extract the block into 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) home-mixer/candidate_hydrators/ai_trend_feedback_context_hydrator.rs:70— home-mixer/candidate_hydrators/ai_trend_feedback_context_hydrator.rs:70-75 | home-mixer/candidate_hydrators/topic_feedback_context_hydrator.rs:128-133 — 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) home-mixer/dark_traffic_setup.rs:24— home-mixer/dark_traffic_setup.rs:24-29 | visibility-filtering/dark_traffic_setup.rs:183-188 — 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) home-mixer/filters/previously_seen_posts_backup_filter.rs:24— home-mixer/filters/previously_seen_posts_backup_filter.rs:24-29 | home-mixer/filters/previously_served_posts_filter.rs:28-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) phoenix-rankall/src/processor/gen/scored_candidate.rs:158— phoenix-rankall/src/processor/gen/scored_candidate.rs:158-163 | phoenix-rankall/src/processor/gen/scored_candidate.rs:379-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 (6 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1629— phoenix/crates/serving/xai-recsys-engine/src/python.rs:1629-1634 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:2441-2446 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:441— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:441-446 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:708-713 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-proto/src/grok_topics.rs:173— phoenix/crates/serving/xai-recsys-proto/src/grok_topics.rs:173-178 | phoenix/crates/serving/xai-recsys-proto/src/starter_packs.rs:51-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) thunder/schema/events.rs:1019— thunder/schema/events.rs:1019-1024 | thunder/schema/events.rs:2932-2937 — both copies are in the same file, so extract the block into 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) abuse-enforcement-service/service-lib/src/action_control.rs:1457— abuse-enforcement-service/service-lib/src/action_control.rs:1457-1462 | abuse-enforcement-service/service-lib/src/off_switch.rs:383-388 — before extracting anything, compare `abuse-enforcement-service/service-lib/src/action_control.rs` and `abuse-enforcement-service/service-lib/src/off_switch.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) abuse-enforcement-service/service-lib/src/allowlist.rs:25— abuse-enforcement-service/service-lib/src/allowlist.rs:25-30 | abuse-enforcement-service/service-lib/src/dedup_cache.rs:245-250 — 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) home-mixer/ads/multi_risk_blender.rs:278— home-mixer/ads/multi_risk_blender.rs:278-283 | home-mixer/ads/partition_organic_blender.rs:216-221 — before extracting anything, compare `home-mixer/ads/multi_risk_blender.rs` and `home-mixer/ads/partition_organic_blender.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) home-mixer/candidate_hydrators/ai_trend_feedback_context_hydrator.rs:19— home-mixer/candidate_hydrators/ai_trend_feedback_context_hydrator.rs:19-24 | home-mixer/candidate_hydrators/topic_feedback_context_hydrator.rs:24-29 — 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) home-mixer/filters/ad_adjacent_served_filter.rs:153— home-mixer/filters/ad_adjacent_served_filter.rs:153-158 | home-mixer/side_effects/funnel_trace_side_effect.rs:147-152 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) home-mixer/side_effects/ads_injection_logging_side_effect.rs:167— home-mixer/side_effects/ads_injection_logging_side_effect.rs:167-172 | home-mixer/util/feed_log.rs:14-19 — 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) home-mixer/side_effects/ads_injection_logging_side_effect.rs:174— home-mixer/side_effects/ads_injection_logging_side_effect.rs:174-179 | home-mixer/util/feed_log.rs:21-26 — 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) phoenix/crates/serving/xai-recsys-engine/src/grpc_compression.rs:46— phoenix/crates/serving/xai-recsys-engine/src/grpc_compression.rs:46-51 | phoenix/crates/serving/xai-recsys-engine/src/grpc_server_latency.rs:32-37 — 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) abuse-enforcement-service/service-lib/src/action_control.rs:415— abuse-enforcement-service/service-lib/src/action_control.rs:415-420 | abuse-enforcement-service/service-lib/src/sliding_window.rs:171-176 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) abuse-enforcement-service/service-lib/src/lib.rs:2599— abuse-enforcement-service/service-lib/src/lib.rs:2599-2604 | phoenix/crates/serving/xai-recsys-engine/src/request_metrics.rs:225-230 — 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) bdsm/rust/accumulator/src/trace.rs:362— bdsm/rust/accumulator/src/trace.rs:362-367 | vm-ranker/scoring/value_model.rs:290-295 — 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) thunder/schema/tweet_media.rs:576— thunder/schema/tweet_media.rs:576-581 | thunder/schema/tweet_media.rs:811-816 — both copies are in the same file, so extract the block into 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) home-mixer/candidate_hydrators/ads_brand_safety_vf_hydrator.rs:97— home-mixer/candidate_hydrators/ads_brand_safety_vf_hydrator.rs:97-102 | home-mixer/candidate_hydrators/new_user_soft_nsfw_label_hydrator.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) abuse-enforcement-service/service-lib/src/dedup_cache.rs:427— abuse-enforcement-service/service-lib/src/dedup_cache.rs:427-432 | abuse-enforcement-service/service-lib/src/dedup_cache.rs:451-456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) home-mixer/selectors/blender_selector.rs:228— home-mixer/selectors/blender_selector.rs:228-233 | home-mixer/selectors/following_blender_selector.rs:102-107 — before extracting anything, compare `home-mixer/selectors/blender_selector.rs` and `home-mixer/selectors/following_blender_selector.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) abuse-enforcement-service/service-lib/src/action_control.rs:740— abuse-enforcement-service/service-lib/src/action_control.rs:740-748 | abuse-enforcement-service/service-lib/src/dedup_cache.rs:144-152 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) abuse-enforcement-service/service-lib/src/action_control.rs:1423— abuse-enforcement-service/service-lib/src/action_control.rs:1423-1431 | abuse-enforcement-service/service-lib/src/off_switch.rs:344-352 — before extracting anything, compare `abuse-enforcement-service/service-lib/src/action_control.rs` and `abuse-enforcement-service/service-lib/src/off_switch.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) abuse-enforcement-service/service-lib/src/service.rs:1205— abuse-enforcement-service/service-lib/src/service.rs:1205-1213 | abuse-enforcement-service/service-lib/src/service.rs:1251-1259 — both copies are in the same file, so extract the block into 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) abuse-enforcement-service/service-lib/src/service.rs:1534— abuse-enforcement-service/service-lib/src/service.rs:1534-1542 | abuse-enforcement-service/service-lib/src/service.rs:1985-1993 — both copies are in the same file, so extract the block into 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) abuse-enforcement-service/service-lib/src/service.rs:1613— abuse-enforcement-service/service-lib/src/service.rs:1613-1621 | abuse-enforcement-service/service-lib/src/service.rs:2085-2093 — both copies are in the same file, so extract the block into 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) home-mixer/ads/partition_organic_blender.rs:117— home-mixer/ads/partition_organic_blender.rs:117-125 | home-mixer/ads/time_gap_blender.rs:130-138 — before extracting anything, compare `home-mixer/ads/partition_organic_blender.rs` and `home-mixer/ads/time_gap_blender.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) home-mixer/clients/vm_ranker_client.rs:124— home-mixer/clients/vm_ranker_client.rs:124-132 | home-mixer/clients/vm_ranker_client.rs:329-337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) home-mixer/side_effects/response_diversity_stats_side_effect.rs:41— home-mixer/side_effects/response_diversity_stats_side_effect.rs:41-49 | home-mixer/side_effects/serendipity_stats_side_effect.rs:54-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 (9 lines × 2) home-mixer/util/popular_authors.rs:171— home-mixer/util/popular_authors.rs:171-179 | home-mixer/util/popular_posts.rs:208-216 — 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) home-mixer/util/urt/client_event.rs:128— home-mixer/util/urt/client_event.rs:128-136 | home-mixer/util/urt/client_event.rs:145-153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) phoenix-rankall/src/processor/metadata_processor.rs:27— phoenix-rankall/src/processor/metadata_processor.rs:27-35 | phoenix-rankall/src/processor/sid_tail_processor.rs:46-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.
Duplicated block (9 lines × 2) phoenix-rankall/src/processor/record.rs:85— phoenix-rankall/src/processor/record.rs:85-93 | phoenix-rankall/src/processor/record.rs:96-104 — both copies are in the same file, so extract the block into 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) phoenix-rankall/src/store/base.rs:1196— phoenix-rankall/src/store/base.rs:1196-1204 | phoenix-rankall/src/store/base.rs:1213-1221 — both copies are in the same file, so extract the block into 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) phoenix/crates/common/xai-recsys/src/util.rs:1482— phoenix/crates/common/xai-recsys/src/util.rs:1482-1490 | phoenix/crates/serving/xai-recsys-engine/src/util.rs:396-404 — before extracting anything, compare `phoenix/crates/common/xai-recsys/src/util.rs` and `phoenix/crates/serving/xai-recsys-engine/src/util.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 139 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 (9 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1362— phoenix/crates/serving/xai-recsys-engine/src/python.rs:1362-1370 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:3085-3093 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1595— phoenix/crates/serving/xai-recsys-engine/src/python.rs:1595-1603 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:2414-2422 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1900— phoenix/crates/serving/xai-recsys-engine/src/python.rs:1900-1908 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:2515-2523 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1916— phoenix/crates/serving/xai-recsys-engine/src/python.rs:1916-1924 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:2527-2535 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:623— phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:623-631 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:907-915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:652— phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:652-660 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:936-944 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:264— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:264-272 | thunder/schema/user.rs:3780-3788 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 357 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 (9 lines × 2) thunder/schema/events.rs:295— thunder/schema/events.rs:295-303 | thunder/schema/user.rs:3757-3765 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 49 separate duplicated blocks between them, totalling at least 510 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:5385— thunder/schema/tweet.rs:5385-5393 | thunder/schema/user.rs:4398-4406 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/user.rs:3275— thunder/schema/user.rs:3275-3283 | thunder/schema/user.rs:4133-4141 — both copies are in the same file, so extract the block into 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) home-mixer/filters/inventory_holdout_filter.rs:17— home-mixer/filters/inventory_holdout_filter.rs:17-25 | home-mixer/side_effects/author_served_metrics_side_effect.rs:33-41 — 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) abuse-enforcement-service/service-lib/src/action_control.rs:1216— abuse-enforcement-service/service-lib/src/action_control.rs:1216-1222 | abuse-enforcement-service/service-lib/src/head_guard.rs:521-527 — before extracting anything, compare `abuse-enforcement-service/service-lib/src/action_control.rs` and `abuse-enforcement-service/service-lib/src/head_guard.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) abuse-enforcement-service/service-lib/src/action_control.rs:2287— abuse-enforcement-service/service-lib/src/action_control.rs:2287-2293 | abuse-enforcement-service/service-lib/src/head_guard.rs:815-821 — before extracting anything, compare `abuse-enforcement-service/service-lib/src/action_control.rs` and `abuse-enforcement-service/service-lib/src/head_guard.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) abuse-enforcement-service/service-lib/src/service.rs:1599— abuse-enforcement-service/service-lib/src/service.rs:1599-1605 | abuse-enforcement-service/service-lib/src/service.rs:2061-2067 — both copies are in the same file, so extract the block into 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) home-mixer/ads/following_ad_blender.rs:182— home-mixer/ads/following_ad_blender.rs:182-188 | home-mixer/ads/util.rs:270-278 — 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) home-mixer/candidate_hydrators/ai_trend_feedback_context_hydrator.rs:134— home-mixer/candidate_hydrators/ai_trend_feedback_context_hydrator.rs:134-140 | home-mixer/candidate_hydrators/topic_feedback_context_hydrator.rs:164-170 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:1025— home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:1025-1031 | home-mixer/candidate_pipeline/phoenix_scores_pipeline.rs:378-384 — before extracting anything, compare `home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/phoenix_scores_pipeline.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) home-mixer/util/urt/mod.rs:194— home-mixer/util/urt/mod.rs:194-200 | home-mixer/util/urt/reverse_chron_following/mod.rs:127-133 — 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) phoenix-rankall/src/processor/gen/scored_candidate.rs:167— phoenix-rankall/src/processor/gen/scored_candidate.rs:167-173 | phoenix-rankall/src/processor/gen/scored_candidate.rs:261-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 (7 lines × 2) phoenix-rankall/src/processor/gen/scored_candidate.rs:177— phoenix-rankall/src/processor/gen/scored_candidate.rs:177-183 | phoenix-rankall/src/processor/gen/scored_candidate.rs:383-389 — both copies are in the same file, so extract the block into 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) phoenix/crates/common/xai-recsys/src/util.rs:918— phoenix/crates/common/xai-recsys/src/util.rs:918-924 | phoenix/crates/common/xai-recsys/src/util.rs:1257-1263 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:967— phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:967-973 | phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:984-990 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:412— phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:412-418 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:516-522 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:710— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:710-716 | thunder/schema/user.rs:12968-12974 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 357 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 (7 lines × 2) thunder/schema/events.rs:1092— thunder/schema/events.rs:1092-1098 | thunder/schema/events.rs:1348-1354 — both copies are in the same file, so extract the block into 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) thunder/schema/events.rs:1708— thunder/schema/events.rs:1708-1714 | thunder/schema/tweet_events.rs:983-989 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/events.rs:2027— thunder/schema/events.rs:2027-2033 | thunder/schema/tweet_events.rs:350-356 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:3173— thunder/schema/tweet.rs:3173-3179 | thunder/schema/user.rs:13400-13406 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:3795— thunder/schema/tweet.rs:3795-3801 | thunder/schema/user.rs:6546-6552 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:4914— thunder/schema/tweet.rs:4914-4920 | thunder/schema/tweet.rs:4967-4973 — both copies are in the same file, so extract the block into 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) thunder/schema/tweet_events.rs:841— thunder/schema/tweet_events.rs:841-847 | thunder/schema/user.rs:5032-5038 — before extracting anything, compare `thunder/schema/tweet_events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 353 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/user.rs:5045— thunder/schema/user.rs:5045-5051 | thunder/schema/user.rs:5329-5335 — both copies are in the same file, so extract the block into 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) thunder/schema/user.rs:9359— thunder/schema/user.rs:9359-9365 | thunder/schema/user.rs:12834-12840 — both copies are in the same file, so extract the block into 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) thunder/schema/user.rs:11751— thunder/schema/user.rs:11751-11757 | thunder/schema/user.rs:13128-13134 — both copies are in the same file, so extract the block into 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) thunder/schema/user.rs:12849— thunder/schema/user.rs:12849-12855 | thunder/schema/user.rs:13178-13184 — both copies are in the same file, so extract the block into 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) visibility-filtering/hydration/store/key_origin.rs:380— visibility-filtering/hydration/store/key_origin.rs:380-386 | visibility-filtering/hydration/store/key_origin.rs:392-398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Hotspot: phoenix/xrex/data/recsys/recsys_batch.py phoenix/xrex/data/recsys/recsys_batch.py:710— phoenix/xrex/data/recsys/recsys_batch.py changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 103 in recsys_batch.from_record_batch at line 710. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/data/recsys/recsys_batch.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: phoenix/xrex/models/recsys_model.py phoenix/xrex/models/recsys_model.py:3512— phoenix/xrex/models/recsys_model.py changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in RecsysAggregatedModel.build_inputs at line 3512. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/models/recsys_model.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: phoenix/xrex/train/trainer_recsys.py phoenix/xrex/train/trainer_recsys.py:2497— phoenix/xrex/train/trainer_recsys.py changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in RecsysTrainer.create_executable at line 2497. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/train/trainer_recsys.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: abuse-enforcement-service/service-lib/src/lib.rs abuse-enforcement-service/service-lib/src/lib.rs:354— abuse-enforcement-service/service-lib/src/lib.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in crate::abuse-enforcement-service::service-lib::src::run_enforcement_inner at line 354. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- abuse-enforcement-service/service-lib/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: phoenix/crates/serving/xai-recsys-engine/src/python.rs phoenix/crates/serving/xai-recsys-engine/src/python.rs:1587— phoenix/crates/serving/xai-recsys-engine/src/python.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 103 in RankingBatchPrep::compute_batch_inputs_rust_quick at line 1587. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/crates/serving/xai-recsys-engine/src/python.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: phoenix/xrex/train/recsys_bundle_export.py phoenix/xrex/train/recsys_bundle_export.py:1074— phoenix/xrex/train/recsys_bundle_export.py changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in recsys_bundle_export.build_bundle at line 1074. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/train/recsys_bundle_export.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: phoenix/xrex/data/parquet_recsys.py phoenix/xrex/data/parquet_recsys.py:736— phoenix/xrex/data/parquet_recsys.py changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in InterleavingRecordBatchProvider.__init__ at line 736. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/data/parquet_recsys.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: phoenix/xrex/inference/model_runner.py phoenix/xrex/inference/model_runner.py:3235— phoenix/xrex/inference/model_runner.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in BaseModelRunner.handle_requests at line 3235. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/inference/model_runner.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: phoenix/xrex/train/trainer.py phoenix/xrex/train/trainer.py:1163— phoenix/xrex/train/trainer.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in Trainer.maybe_load_checkpoint at line 1163. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/train/trainer.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: phoenix/crates/common/xai-recsys/src/util.rs phoenix/crates/common/xai-recsys/src/util.rs:1221— phoenix/crates/common/xai-recsys/src/util.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in InputBuffer::compute_from_columnar_bytes at line 1221. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/crates/common/xai-recsys/src/util.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: visibility-filtering/hydration/execute.rs visibility-filtering/hydration/execute.rs:242— visibility-filtering/hydration/execute.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in HydrationPlan::send at line 242. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- visibility-filtering/hydration/execute.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: visibility-filtering/hydration/store.rs visibility-filtering/hydration/store.rs:518— visibility-filtering/hydration/store.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in Store::land 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- visibility-filtering/hydration/store.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: phoenix/xrex/data/streaming/kafkaloader.py phoenix/xrex/data/streaming/kafkaloader.py:1344— phoenix/xrex/data/streaming/kafkaloader.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in PhoenixKafkaDataset.make at line 1344. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/data/streaming/kafkaloader.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: phoenix/xrex/eval/recsys_eval.py phoenix/xrex/eval/recsys_eval.py:150— phoenix/xrex/eval/recsys_eval.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in RecsysTwoTowerEval.run at line 150. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/eval/recsys_eval.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: visibility-filtering/treatment.rs visibility-filtering/treatment.rs:440— visibility-filtering/treatment.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in crate::visibility-filtering::treatment::limited_action_type at line 440. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- visibility-filtering/treatment.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: visibility-filtering/rules/engine.rs visibility-filtering/rules/engine.rs:310— visibility-filtering/rules/engine.rs changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in Decision::step at line 310. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- visibility-filtering/rules/engine.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: phoenix/xrex/data/rust_kafka_recsys.py phoenix/xrex/data/rust_kafka_recsys.py:109— phoenix/xrex/data/rust_kafka_recsys.py changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in RustKafkaDataset._async_kafka_consumer_arrow at line 109. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/data/rust_kafka_recsys.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: phoenix/xrex/models/recsys_two_tower_model.py phoenix/xrex/models/recsys_two_tower_model.py:2225— phoenix/xrex/models/recsys_two_tower_model.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in RecsysTwoTowerModel.forward at line 2225. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/models/recsys_two_tower_model.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: phoenix/xrex/data/recsys/sequence_packing.py phoenix/xrex/data/recsys/sequence_packing.py:315— phoenix/xrex/data/recsys/sequence_packing.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in sequence_packing.pack_batch at line 315. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/data/recsys/sequence_packing.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: phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:30— phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in ranker_attention_varlen_fa4._build_packed_block_sparse at line 30. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.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: phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:2240— phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in FlashAttentionForwardSm100.correction_loop at line 2240. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.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: phoenix/xrex/models/transformer.py phoenix/xrex/models/transformer.py:686— phoenix/xrex/models/transformer.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Transformer.__call__ at line 686. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/xrex/models/transformer.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: phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:1310— phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in xai_recsys_engine::emb_table::load_tensor_into at line 1310. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- phoenix/crates/serving/xai-recsys-engine/src/emb_table.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: abuse-enforcement-service/service-lib/src/action_control/levels.rs abuse-enforcement-service/service-lib/src/action_control/levels.rs:888— abuse-enforcement-service/service-lib/src/action_control/levels.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in ActionControl::set_rows at line 888. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- abuse-enforcement-service/service-lib/src/action_control/levels.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: grox/core/data_loaders/media_loader.py grox/core/data_loaders/media_loader.py:385— grox/core/data_loaders/media_loader.py changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in MediaLoader.hydrate_video at line 385. 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-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 03:22:45 +00:00' --until='2026-10-24 03:22:45 +00:00' --full-history --no-merges -- grox/core/data_loaders/media_loader.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.
Duplicated block (5 lines × 2) home-mixer/candidate_hydrators/gizmoduck_hydrator.rs:94— home-mixer/candidate_hydrators/gizmoduck_hydrator.rs:94-98 | home-mixer/candidate_hydrators/gizmoduck_hydrator.rs:103-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 (5 lines × 2) home-mixer/filters/drop_duplicates_filter.rs:15— home-mixer/filters/drop_duplicates_filter.rs:15-19 | home-mixer/filters/retweet_deduplication_filter.rs:15-19 — 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) phoenix-rankall/src/processor/gen/hydra.rs:198— phoenix-rankall/src/processor/gen/hydra.rs:198-202 | thunder/schema/tweet.rs:2870-2874 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 128 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) phoenix-rankall/src/store/analysis.rs:166— phoenix-rankall/src/store/analysis.rs:166-170 | phoenix-rankall/src/store/analysis.rs:194-198 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:1467— phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:1467-1471 | phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:1250-1254 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs` and `phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/mem_util.rs:100— phoenix/crates/serving/xai-recsys-engine/src/mem_util.rs:100-104 | phoenix/crates/serving/xai-recsys-engine/src/mem_util.rs:122-126 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:705— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:705-709 | thunder/schema/user.rs:12971-12975 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) thunder/schema/tweet.rs:3165— thunder/schema/tweet.rs:3165-3169 | thunder/schema/user.rs:4318-4322 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet_events.rs:128— thunder/schema/tweet_events.rs:128-132 | thunder/schema/tweet_events.rs:402-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 (5 lines × 2) home-mixer/popular_authors_job.rs:94— home-mixer/popular_authors_job.rs:94-98 | home-mixer/popular_posts_job.rs:55-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) home-mixer/popular_authors_job.rs:100— home-mixer/popular_authors_job.rs:100-104 | home-mixer/popular_posts_job.rs:61-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) phoenix-rankall/src/processor/gen/hydra.rs:284— phoenix-rankall/src/processor/gen/hydra.rs:284-288 | thunder/schema/tweet.rs:2944-2948 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 128 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) thunder/schema/tweet.rs:2738— thunder/schema/tweet.rs:2738-2742 | thunder/schema/tweet.rs:4126-4130 — both copies are in the same file, so extract the block into 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) abuse-enforcement-service/service-lib/src/overturn_hold.rs:274— abuse-enforcement-service/service-lib/src/overturn_hold.rs:274-278 | abuse-enforcement-service/service-lib/src/overturn_hold.rs:354-358 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:838— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:838-842 | thunder/schema/tweet_events.rs:1073-1077 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) thunder/schema/tweet.rs:1115— thunder/schema/tweet.rs:1115-1119 | thunder/schema/user.rs:13171-13175 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) bdsm/rust/abuse-v3-features/src/lib.rs:347— bdsm/rust/abuse-v3-features/src/lib.rs:347-351 | bdsm/rust/abuse-v3-features/src/lib.rs:355-359 — both copies are in the same file, so extract the block into 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) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:537— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:537-541 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:544-548 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:537` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1208— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1208-1212 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1215-1219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1208` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2781— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2781-2785 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2816-2820 — both copies are in the same file, so extract the block into 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) simclusters/simclusters_v2/scalding/tweet_similarity/TrainingDataCollectionUtil.scala:61— simclusters/simclusters_v2/scalding/tweet_similarity/TrainingDataCollectionUtil.scala:61-65 | simclusters/simclusters_v2/scalding/tweet_similarity/TrainingDataCollectionUtil.scala:81-85 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) simclusters/simclusters_v2/scalding/tweet_similarity/TweetPairLabelCollectionUtil.scala:222— simclusters/simclusters_v2/scalding/tweet_similarity/TweetPairLabelCollectionUtil.scala:222-228 | simclusters/simclusters_v2/scalding/tweet_similarity/TweetPairLabelCollectionUtil.scala:310-314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/scalding/tweet_similarity/TweetPairLabelCollectionUtil.scala:222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:52— simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:52-56 | simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:114-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:52` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) botmaker/src/java/com/twitter/botmaker/compiler/Mock.java:74— botmaker/src/java/com/twitter/botmaker/compiler/Mock.java:74-78 | botmaker/src/java/com/twitter/botmaker/compiler/Mock.java:147-151 — both copies are in the same file, so extract the block into 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) botmaker/src/java/com/twitter/botmaker/function/logic/Conjunction.java:117— botmaker/src/java/com/twitter/botmaker/function/logic/Conjunction.java:117-121 | botmaker/src/java/com/twitter/botmaker/function/logic/Disjunction.java:118-122 — before extracting anything, compare `botmaker/src/java/com/twitter/botmaker/function/logic/Conjunction.java` and `botmaker/src/java/com/twitter/botmaker/function/logic/Disjunction.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/java/com/twitter/botmaker/function/logic/Conjunction.java:117` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) home-mixer/ads/partition_organic_blender.rs:103— home-mixer/ads/partition_organic_blender.rs:103-115 | home-mixer/ads/time_gap_blender.rs:117-129 — before extracting anything, compare `home-mixer/ads/partition_organic_blender.rs` and `home-mixer/ads/time_gap_blender.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) home-mixer/candidate_hydrators/conversation_gap_ancestor_hydrator.rs:30— home-mixer/candidate_hydrators/conversation_gap_ancestor_hydrator.rs:30-42 | home-mixer/candidate_hydrators/quoted_post_text_hydrator.rs:29-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 (13 lines × 2) phoenix-rankall/src/processor/gen/hydra.rs:523— phoenix-rankall/src/processor/gen/hydra.rs:523-535 | phoenix-rankall/src/processor/gen/scored_candidate.rs:343-355 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix-rankall/src/processor/gen/scored_candidate.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:359— phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:359-371 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:573-585 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:1732— phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:1732-1744 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:1808-1820 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-engine/src/util.rs:185— phoenix/crates/serving/xai-recsys-engine/src/util.rs:185-197 | phoenix/crates/serving/xai-recsys-engine/src/util.rs:417-429 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:269— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:269-281 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:726-738 — both copies are in the same file, so extract the block into 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) thunder/schema/events.rs:1587— thunder/schema/events.rs:1587-1599 | thunder/schema/tweet_events.rs:937-949 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:2796— thunder/schema/tweet.rs:2796-2808 | thunder/schema/tweet_events.rs:1583-1595 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:3012— thunder/schema/tweet.rs:3012-3024 | thunder/schema/tweet.rs:4098-4110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) thunder/schema/tweet.rs:3020— thunder/schema/tweet.rs:3020-3032 | thunder/schema/user.rs:9183-9195 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:5413— thunder/schema/tweet.rs:5413-5425 | thunder/schema/user.rs:4468-4480 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet_media.rs:349— thunder/schema/tweet_media.rs:349-361 | thunder/schema/user.rs:7831-7843 — before extracting anything, compare `thunder/schema/tweet_media.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 172 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/user.rs:3289— thunder/schema/user.rs:3289-3301 | thunder/schema/user.rs:4151-4163 — both copies are in the same file, so extract the block into 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) thunder/schema/user.rs:4290— thunder/schema/user.rs:4290-4302 | thunder/schema/user.rs:13351-13363 — both copies are in the same file, so extract the block into 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) thunder/schema/user.rs:7341— thunder/schema/user.rs:7341-7353 | thunder/schema/user.rs:7628-7640 — both copies are in the same file, so extract the block into 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) thunder/metrics.rs:229— thunder/metrics.rs:229-241 | vm-ranker/metrics.rs:251-263 — 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) botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:62— botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:62-74 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:171-183 — before extracting anything, compare `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala` and `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:62` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4134— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4134-4146 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4217-4229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4134` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4304— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4304-4316 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4410-4422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4304` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4511— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4511-4523 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4642-4654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4511` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4758— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4758-4770 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4916-4928 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4758` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9697— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9697-9709 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9915-9927 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9697` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:528— simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:528-540 | simclusters/simclusters_v2/scalding/update_known_for/UpdateKnownForSBFRunner.scala:274-286 — 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 `simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:528` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) simclusters/simclusters_v2/scalding/embedding/twice/InterestedInTwiceBaseApp.scala:313— simclusters/simclusters_v2/scalding/embedding/twice/InterestedInTwiceBaseApp.scala:313-325 | simclusters/simclusters_v2/scalding/embedding/twice/InterestedInTwiceBaseApp.scala:364-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/scalding/embedding/twice/InterestedInTwiceBaseApp.scala:313` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) abuse-enforcement-service/service-lib/src/action_control.rs:2172— abuse-enforcement-service/service-lib/src/action_control.rs:2172-2182 | abuse-enforcement-service/service-lib/src/action_control/levels.rs:1171-1181 — 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) abuse-enforcement-service/service-lib/src/service.rs:1536— abuse-enforcement-service/service-lib/src/service.rs:1536-1546 | abuse-enforcement-service/service-lib/src/service.rs:1615-1625 — both copies are in the same file, so extract the block into 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) abuse-enforcement-service/service-lib/src/service.rs:1987— abuse-enforcement-service/service-lib/src/service.rs:1987-1997 | abuse-enforcement-service/service-lib/src/service.rs:2087-2097 — both copies are in the same file, so extract the block into 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) candidate-pipeline/candidate_pipeline.rs:242— candidate-pipeline/candidate_pipeline.rs:242-252 | candidate-pipeline/candidate_pipeline.rs:269-279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) home-mixer/dark_traffic_setup.rs:57— home-mixer/dark_traffic_setup.rs:57-67 | visibility-filtering/dark_traffic_setup.rs:214-224 — 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) phoenix/crates/common/xai-recsys/src/util.rs:1471— phoenix/crates/common/xai-recsys/src/util.rs:1471-1481 | phoenix/crates/serving/xai-recsys-engine/src/util.rs:384-394 — before extracting anything, compare `phoenix/crates/common/xai-recsys/src/util.rs` and `phoenix/crates/serving/xai-recsys-engine/src/util.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 139 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 × 2) phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:152— phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:152-162 | phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:229-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) thunder/kafka/tweet_events_listener.rs:132— thunder/kafka/tweet_events_listener.rs:132-142 | thunder/kafka/tweet_events_listener_v2.rs:54-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) thunder/kafka/tweet_events_listener.rs:287— thunder/kafka/tweet_events_listener.rs:287-297 | thunder/kafka/tweet_events_listener.rs:306-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 (11 lines × 2) thunder/schema/tweet_media.rs:445— thunder/schema/tweet_media.rs:445-455 | thunder/schema/tweet_media.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 lines × 2) thunder/schema/user.rs:10948— thunder/schema/user.rs:10948-10958 | thunder/schema/user.rs:10959-10969 — both copies are in the same file, so extract the block into 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) home-mixer/ads/multi_risk_blender.rs:301— home-mixer/ads/multi_risk_blender.rs:301-311 | home-mixer/ads/partition_organic_blender.rs:231-241 — before extracting anything, compare `home-mixer/ads/multi_risk_blender.rs` and `home-mixer/ads/partition_organic_blender.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) home-mixer/selectors/blender_selector.rs:107— home-mixer/selectors/blender_selector.rs:107-117 | home-mixer/selectors/following_blender_selector.rs:64-74 — before extracting anything, compare `home-mixer/selectors/blender_selector.rs` and `home-mixer/selectors/following_blender_selector.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/strato_client.rs:107— thunder/strato_client.rs:107-117 | thunder/strato_client.rs:171-181 — both copies are in the same file, so extract the block into 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) home-mixer/popular_authors_job.rs:319— home-mixer/popular_authors_job.rs:319-329 | home-mixer/popular_posts_job.rs:216-226 — 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) abuse-enforcement-service/service-lib/src/overturn_hold.rs:1695— abuse-enforcement-service/service-lib/src/overturn_hold.rs:1695-1705 | abuse-enforcement-service/service-lib/src/overturn_hold.rs:1713-1723 — both copies are in the same file, so extract the block into 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) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:644— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:644-654 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:740-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. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:644` it begins part-way through the construct above it, so those exact lines 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) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3333— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3333-3343 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3452-3462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3333` it does not close everything it opens, so those exact lines 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) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3559— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3559-3569 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3703-3713 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3559` it does not close everything it opens, so those exact lines 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) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12309— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12309-12319 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12540-12550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12309` it does not close everything it opens, so those exact lines 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) botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:162— botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:162-172 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:209-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:162` it does not close everything it opens, so those exact lines 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) simclusters/simclusters_v2/scalding/embedding/EntityEmbeddingFromProducerEmbeddingJob.scala:46— simclusters/simclusters_v2/scalding/embedding/EntityEmbeddingFromProducerEmbeddingJob.scala:46-56 | simclusters/simclusters_v2/scalding/embedding/EntityEmbeddingFromProducerEmbeddingJob.scala: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 (11 lines × 2) botmaker/src/java/com/twitter/botmaker/compiler/CompilerBuilder.java:248— botmaker/src/java/com/twitter/botmaker/compiler/CompilerBuilder.java:248-258 | botmaker/src/java/com/twitter/botmaker/compiler/CompilerScope.java:118-128 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `context` to `CompilerContext<E>` in one and `CompilerContext` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) botmaker/src/java/com/twitter/botmaker/function/DerivedFeatureCall.java:138— botmaker/src/java/com/twitter/botmaker/function/DerivedFeatureCall.java:138-149 | botmaker/src/java/com/twitter/botmaker/function/DerivedFeatureCall.java:155-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/java/com/twitter/botmaker/function/DerivedFeatureCall.java:138` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) botmaker/src/java/com/twitter/botmaker/function/exception/Try.java:66— botmaker/src/java/com/twitter/botmaker/function/exception/Try.java:66-76 | botmaker/src/java/com/twitter/botmaker/function/exception/TryWithStack.java:70-80 — 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 `botmaker/src/java/com/twitter/botmaker/function/exception/Try.java:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
FunctionTooLong: crate::visibility-filtering::rules::golden_corpus::age_verification::rows visibility-filtering/rules/golden_corpus/age_verification.rs:115— FunctionTooLong — crate::visibility-filtering::rules::golden_corpus::age_verification::rows 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: abuse_score_accumulator::main bdsm/rust/accumulator/src/main.rs:314— FunctionTooLong — abuse_score_accumulator::main runs 346 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 246 over it, 3.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: abuse_v3_features::extract_batch bdsm/rust/abuse-v3-features/src/lib.rs:328— FunctionTooLong — abuse_v3_features::extract_batch runs 264 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 164 over it, 2.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: crate::visibility-filtering::rules::golden_corpus::tweet_label::rows visibility-filtering/rules/golden_corpus/tweet_label.rs:31— FunctionTooLong — crate::visibility-filtering::rules::golden_corpus::tweet_label::rows runs 260 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 160 over it, 2.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: crate::visibility-filtering::rules::golden_corpus::interstitial::rows visibility-filtering/rules/golden_corpus/interstitial.rs:13— FunctionTooLong — crate::visibility-filtering::rules::golden_corpus::interstitial::rows runs 240 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 140 over it, 2.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: crate::visibility-filtering::rules::golden_corpus::oon_tweet_label::rows visibility-filtering/rules/golden_corpus/oon_tweet_label.rs:16— FunctionTooLong — crate::visibility-filtering::rules::golden_corpus::oon_tweet_label::rows runs 223 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 123 over it, 2.23× 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: crate::visibility-filtering::rules::golden_corpus::notifications::cases visibility-filtering/rules/golden_corpus/notifications.rs:104— FunctionTooLong — crate::visibility-filtering::rules::golden_corpus::notifications::cases runs 212 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 112 over it, 2.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: xai_recsys_engine::storage_util::remove_old_from_storage_async phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:897— FunctionTooLong — xai_recsys_engine::storage_util::remove_old_from_storage_async 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.
FunctionTooLong: crate::phoenix-rankall::src::main phoenix-rankall/src/main.rs:31— FunctionTooLong — crate::phoenix-rankall::src::main runs 183 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 83 over it, 1.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: crate::visibility-filtering::rules::golden_corpus::conversation_control::rows visibility-filtering/rules/golden_corpus/conversation_control.rs:19— FunctionTooLong — crate::visibility-filtering::rules::golden_corpus::conversation_control::rows runs 183 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 83 over it, 1.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: crate::visibility-filtering::rules::golden_corpus::age_gating::rows visibility-filtering/rules/golden_corpus/age_gating.rs:18— FunctionTooLong — crate::visibility-filtering::rules::golden_corpus::age_gating::rows 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.
FunctionTooLong: crate::home-mixer::util::urt::feedback::build_dont_like_feedback home-mixer/util/urt/feedback.rs:33— FunctionTooLong — crate::home-mixer::util::urt::feedback::build_dont_like_feedback 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.
FunctionTooLong: crate::visibility-filtering::rules::golden_corpus::article::rows visibility-filtering/rules/golden_corpus/article.rs:41— FunctionTooLong — crate::visibility-filtering::rules::golden_corpus::article::rows runs 173 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 73 over it, 1.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: crate::home-mixer::ads::multi_risk_blender::blend_with_drops home-mixer/ads/multi_risk_blender.rs:39— FunctionTooLong — crate::home-mixer::ads::multi_risk_blender::blend_with_drops runs 167 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 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: xai_recsys_engine::storage_util::load_reshard_row_to_col phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:1848— FunctionTooLong — xai_recsys_engine::storage_util::load_reshard_row_to_col runs 166 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 66 over it, 1.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: xai_recsys_engine::emb_table::load_tensor_no_resharding phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:1095— FunctionTooLong — xai_recsys_engine::emb_table::load_tensor_no_resharding runs 164 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 64 over it, 1.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: crate::visibility-filtering::rules::golden_corpus::oon_media::rows visibility-filtering/rules/golden_corpus/oon_media.rs:12— FunctionTooLong — crate::visibility-filtering::rules::golden_corpus::oon_media::rows runs 162 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 62 over it, 1.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: crate::visibility-filtering::rules::golden_corpus::author_state::rows visibility-filtering/rules/golden_corpus/author_state.rs:32— FunctionTooLong — crate::visibility-filtering::rules::golden_corpus::author_state::rows runs 161 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 61 over it, 1.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: crate::visibility-filtering::rules::golden_corpus::oon_user_label::rows visibility-filtering/rules/golden_corpus/oon_user_label.rs:7— FunctionTooLong — crate::visibility-filtering::rules::golden_corpus::oon_user_label::rows runs 161 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 61 over it, 1.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: xai_recsys_engine::emb_table::load_tensor_into phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:1310— FunctionTooLong — xai_recsys_engine::emb_table::load_tensor_into runs 159 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 59 over it, 1.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: xai_recsys_engine::proto_parser::parse phoenix/crates/serving/xai-recsys-engine/src/proto_parser.rs:336— FunctionTooLong — xai_recsys_engine::proto_parser::parse runs 159 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 59 over it, 1.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: xai_recsys_engine::storage_util::load_single_array phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:1207— FunctionTooLong — xai_recsys_engine::storage_util::load_single_array runs 158 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: crate::visibility-filtering::server_deps::prod_sources visibility-filtering/server_deps.rs:281— FunctionTooLong — crate::visibility-filtering::server_deps::prod_sources runs 157 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: xai_recsys_engine::storage_util::reshard_col_to_row_and_upload phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:1425— FunctionTooLong — xai_recsys_engine::storage_util::reshard_col_to_row_and_upload runs 152 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 52 over it, 1.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.
FunctionTooLong: crate::visibility-filtering::rules::golden_corpus::takedown::rows visibility-filtering/rules/golden_corpus/takedown.rs:10— FunctionTooLong — crate::visibility-filtering::rules::golden_corpus::takedown::rows runs 152 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 52 over it, 1.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.
Duplicated block (12 lines × 2) abuse-enforcement-service/service-lib/src/action_control.rs:1201— abuse-enforcement-service/service-lib/src/action_control.rs:1201-1212 | abuse-enforcement-service/service-lib/src/head_guard.rs:506-517 — before extracting anything, compare `abuse-enforcement-service/service-lib/src/action_control.rs` and `abuse-enforcement-service/service-lib/src/head_guard.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) abuse-enforcement-service/service-lib/src/action_control.rs:1236— abuse-enforcement-service/service-lib/src/action_control.rs:1236-1247 | abuse-enforcement-service/service-lib/src/head_guard.rs:543-554 — before extracting anything, compare `abuse-enforcement-service/service-lib/src/action_control.rs` and `abuse-enforcement-service/service-lib/src/head_guard.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) home-mixer/ads/partition_organic_blender.rs:81— home-mixer/ads/partition_organic_blender.rs:81-92 | home-mixer/ads/time_gap_blender.rs:97-108 — before extracting anything, compare `home-mixer/ads/partition_organic_blender.rs` and `home-mixer/ads/time_gap_blender.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) home-mixer/clients/prompts_client.rs:95— home-mixer/clients/prompts_client.rs:95-106 | home-mixer/clients/simclusters_ann_client.rs:98-109 — before extracting anything, compare `home-mixer/clients/prompts_client.rs` and `home-mixer/clients/simclusters_ann_client.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) home-mixer/selectors/blender_selector.rs:89— home-mixer/selectors/blender_selector.rs:89-100 | home-mixer/selectors/following_blender_selector.rs:46-57 — before extracting anything, compare `home-mixer/selectors/blender_selector.rs` and `home-mixer/selectors/following_blender_selector.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) home-mixer/selectors/blender_selector.rs:120— home-mixer/selectors/blender_selector.rs:120-131 | home-mixer/selectors/following_blender_selector.rs:77-88 — before extracting anything, compare `home-mixer/selectors/blender_selector.rs` and `home-mixer/selectors/following_blender_selector.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) phoenix-rankall/src/processor/gen/hydra.rs:77— phoenix-rankall/src/processor/gen/hydra.rs:77-88 | phoenix-rankall/src/processor/gen/scored_candidate.rs:337-348 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix-rankall/src/processor/gen/scored_candidate.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) phoenix-rankall/src/processor/gen/scored_candidate.rs:224— phoenix-rankall/src/processor/gen/scored_candidate.rs:224-235 | thunder/schema/user.rs:4285-4296 — before extracting anything, compare `phoenix-rankall/src/processor/gen/scored_candidate.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) phoenix-rankall/src/processor/sid_processor.rs:77— phoenix-rankall/src/processor/sid_processor.rs:77-88 | phoenix-rankall/src/processor/sid_tail_processor.rs:99-110 — 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 (12 lines × 2) phoenix/crates/common/xai-recsys/src/util.rs:615— phoenix/crates/common/xai-recsys/src/util.rs:615-626 | phoenix/crates/serving/xai-recsys-engine/src/util.rs:424-435 — before extracting anything, compare `phoenix/crates/common/xai-recsys/src/util.rs` and `phoenix/crates/serving/xai-recsys-engine/src/util.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 139 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) thunder/schema/events.rs:2120— thunder/schema/events.rs:2120-2131 | thunder/schema/events.rs:2218-2229 — both copies are in the same file, so extract the block into 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) thunder/schema/tweet.rs:1570— thunder/schema/tweet.rs:1570-1581 | thunder/schema/user.rs:12874-12885 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:1704— thunder/schema/tweet.rs:1704-1715 | thunder/schema/user.rs:11097-11108 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet_media.rs:645— thunder/schema/tweet_media.rs:645-656 | thunder/schema/tweet_media.rs:735-746 — both copies are in the same file, so extract the block into 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) thunder/schema/user.rs:12824— thunder/schema/user.rs:12824-12835 | thunder/schema/user.rs:13138-13149 — both copies are in the same file, so extract the block into 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) bdsm/rust/accumulator/src/trace.rs:277— bdsm/rust/accumulator/src/trace.rs:277-288 | bdsm/rust/accumulator/src/trace.rs:336-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 (12 lines × 2) abuse-enforcement-service/service-lib/src/lib.rs:1018— abuse-enforcement-service/service-lib/src/lib.rs:1018-1029 | abuse-enforcement-service/service-lib/src/lib.rs:1045-1056 — both copies are in the same file, so extract the block into 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) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1841— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1841-1852 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1891-1902 — both copies are in the same file, so extract the block into 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) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2865— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2865-2876 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2921-2932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2865` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) botmaker/src/scala/com/twitter/botmaker/rule/RuleAst.scala:175— botmaker/src/scala/com/twitter/botmaker/rule/RuleAst.scala:175-186 | botmaker/src/scala/com/twitter/botmaker/rule/RuleAst.scala:190-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. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/rule/RuleAst.scala:175` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) botmaker/src/scala/com/twitter/botmaker/rule/RuleAst.scala:207— botmaker/src/scala/com/twitter/botmaker/rule/RuleAst.scala:207-218 | botmaker/src/scala/com/twitter/botmaker/rule/RuleAst.scala:220-231 — both copies are in the same file, so extract the block into 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) botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:171— botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:171-182 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:214-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:171` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:515— simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:515-526 | simclusters/simclusters_v2/scalding/update_known_for/UpdateKnownForSBFRunner.scala:261-272 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:515` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) simclusters/simclusters_v2/scalding/UserUserNormalizedGraph.scala:297— simclusters/simclusters_v2/scalding/UserUserNormalizedGraph.scala:297-308 | simclusters/simclusters_v2/scalding/UserUserNormalizedGraph.scala:330-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. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/scalding/UserUserNormalizedGraph.scala:297` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) simclusters/simclusters_v2/summingbird/common/Monoids.scala:120— simclusters/simclusters_v2/summingbird/common/Monoids.scala:120-131 | simclusters/simclusters_v2/summingbird/common/Monoids.scala:153-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/common/Monoids.scala:120` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
crate::abuse-enforcement-service::service-lib::src::run_enforcement_inner (cognitive 99) abuse-enforcement-service/service-lib/src/lib.rs:354— crate::abuse-enforcement-service::service-lib::src::run_enforcement_inner has cognitive complexity 99 (threshold 15). Drivers by points: if/else 40 (77 pts), match/switch 9 (12 pts), boolean chains 10 (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.
crate::abuse-enforcement-service::service-lib::src::start_kafka_consumers (cognitive 66) abuse-enforcement-service/service-lib/src/lib.rs:2898— crate::abuse-enforcement-service::service-lib::src::start_kafka_consumers has cognitive complexity 66 (threshold 15). Drivers by points: if/else 17 (36 pts), match/switch 7 (15 pts), loops 9 (14 pts), boolean chains 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.
crate::home-mixer::ads::multi_risk_blender::blend_with_drops (cognitive 47) home-mixer/ads/multi_risk_blender.rs:39— crate::home-mixer::ads::multi_risk_blender::blend_with_drops has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (31 pts), boolean chains 7, loops 5 (6 pts), match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crate::visibility-filtering::rules::golden_corpus::article::rows (cognitive 43) visibility-filtering/rules/golden_corpus/article.rs:41— crate::visibility-filtering::rules::golden_corpus::article::rows has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (37 pts), loops 2 (3 pts), match/switch 1 (3 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.
crate::thunder::kafka::tweet_events_listener_v2::process_tweet_events_v2 (cognitive 39) thunder/kafka/tweet_events_listener_v2.rs:163— crate::thunder::kafka::tweet_events_listener_v2::process_tweet_events_v2 has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (32 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crate::home-mixer::ads::partition_organic_blender::blend_impl (cognitive 37) home-mixer/ads/partition_organic_blender.rs:21— crate::home-mixer::ads::partition_organic_blender::blend_impl has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (29 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crate::abuse-enforcement-service::types::src::allowlist::parse_bulk_input (cognitive 33) abuse-enforcement-service/types/src/allowlist.rs:109— crate::abuse-enforcement-service::types::src::allowlist::parse_bulk_input has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 3 (8 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crate::vm-ranker::dpp::greedy_dpp (cognitive 31) vm-ranker/dpp.rs:223— crate::vm-ranker::dpp::greedy_dpp has cognitive complexity 31 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 6 (13 pts), match/switch 2, boolean chains 1 (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.
crate::abuse-enforcement-service::service-lib::src::service::enforce_action (cognitive 28) abuse-enforcement-service/service-lib/src/service.rs:817— crate::abuse-enforcement-service::service-lib::src::service::enforce_action has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 1 (3 pts), boolean chains 2, 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.
crate::abuse-enforcement-service::service-lib::src::action_control::levels::resolve_rows (cognitive 27) abuse-enforcement-service/service-lib/src/action_control/levels.rs:202— crate::abuse-enforcement-service::service-lib::src::action_control::levels::resolve_rows has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 5, match/switch 3 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
crate::thunder::kafka::tweet_events_listener::process_message_batch (cognitive 27) thunder/kafka/tweet_events_listener.rs:189— crate::thunder::kafka::tweet_events_listener::process_message_batch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crate::home-mixer::ads::time_gap_blender::blend_impl (cognitive 25) home-mixer/ads/time_gap_blender.rs:48— crate::home-mixer::ads::time_gap_blender::blend_impl has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 3, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crate::home-mixer::util::viewer_history::engaged_history_topics (cognitive 25) home-mixer/util/viewer_history.rs:62— crate::home-mixer::util::viewer_history::engaged_history_topics has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crate::abuse-enforcement-service::service-lib::src::action_control::levels::record_problem (cognitive 24) abuse-enforcement-service/service-lib/src/action_control/levels.rs:795— crate::abuse-enforcement-service::service-lib::src::action_control::levels::record_problem has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 8 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
crate::phoenix-rankall::src::sid::backfill::run_backfill_loop (cognitive 24) phoenix-rankall/src/sid/backfill.rs:42— crate::phoenix-rankall::src::sid::backfill::run_backfill_loop has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts), match/switch 2 (6 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.
crate::home-mixer::side_effects::scored_stats_side_effect::record_retrieval_source_contribution (cognitive 23) home-mixer/side_effects/scored_stats_side_effect.rs:224— crate::home-mixer::side_effects::scored_stats_side_effect::record_retrieval_source_contribution has cognitive complexity 23 (threshold 15). Drivers by points: loops 8 (17 pts), if/else 3 (4 pts), boolean chains 2 (nesting depth added 10). 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.
crate::abuse-enforcement-service::service-lib::src::action_control::levels::validate_confidence (cognitive 22) abuse-enforcement-service/service-lib/src/action_control/levels.rs:707— crate::abuse-enforcement-service::service-lib::src::action_control::levels::validate_confidence has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, loops 1 (3 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crate::home-mixer::util::urt::new_tweets_pill::extract_pill_user_ids (cognitive 22) home-mixer/util/urt/new_tweets_pill.rs:96— crate::home-mixer::util::urt::new_tweets_pill::extract_pill_user_ids has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
crate::home-mixer::util::conversation_grouping::select_conversation_modules (cognitive 21) home-mixer/util/conversation_grouping.rs:6— crate::home-mixer::util::conversation_grouping::select_conversation_modules has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4, boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crate::abuse-enforcement-service::service-lib::src::kafka_health_watchdog (cognitive 20) abuse-enforcement-service/service-lib/src/lib.rs:2654— crate::abuse-enforcement-service::service-lib::src::kafka_health_watchdog has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, 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.
crate::home-mixer::ads::following_ad_blender::blend_with_spacing (cognitive 20) home-mixer/ads/following_ad_blender.rs:122— crate::home-mixer::ads::following_ad_blender::blend_with_spacing has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 8, loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crate::home-mixer::ads::time_gap_blender::assemble_time_gap (cognitive 20) home-mixer/ads/time_gap_blender.rs:193— crate::home-mixer::ads::time_gap_blender::assemble_time_gap has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 2 (4 pts), boolean chains 2 (nesting depth added 10). 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.
crate::visibility-filtering-client::vf_client::plan_evaluate_chunks (cognitive 20) visibility-filtering-client/vf_client.rs:440— crate::visibility-filtering-client::vf_client::plan_evaluate_chunks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (6 pts), match/switch 2 (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.
crate::abuse-enforcement-service::service-lib::src::gated_actions (cognitive 19) abuse-enforcement-service/service-lib/src/lib.rs:217— crate::abuse-enforcement-service::service-lib::src::gated_actions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crate::abuse-enforcement-service::service-lib::src::backfill::validate_start (cognitive 19) abuse-enforcement-service/service-lib/src/backfill.rs:1241— crate::abuse-enforcement-service::service-lib::src::backfill::validate_start has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Duplicated block (14 lines × 2) abuse-enforcement-service/service-lib/src/service.rs:1946— abuse-enforcement-service/service-lib/src/service.rs:1946-1959 | abuse-enforcement-service/service-lib/src/service.rs:2053-2066 — both copies are in the same file, so extract the block into 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) home-mixer/candidate_pipeline/following_candidate_pipeline.rs:122— home-mixer/candidate_pipeline/following_candidate_pipeline.rs:122-135 | home-mixer/candidate_pipeline/for_you_candidate_pipeline.rs:115-128 — before extracting anything, compare `home-mixer/candidate_pipeline/following_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/for_you_candidate_pipeline.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) home-mixer/candidate_pipeline/for_you_candidate_pipeline.rs:200— home-mixer/candidate_pipeline/for_you_candidate_pipeline.rs:200-213 | home-mixer/candidate_pipeline/ranked_following_candidate_pipeline.rs:123-136 — before extracting anything, compare `home-mixer/candidate_pipeline/for_you_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/ranked_following_candidate_pipeline.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/checkpoint_store.rs:357— phoenix/crates/serving/xai-recsys-engine/src/checkpoint_store.rs:357-370 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:90-103 — 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) phoenix/crates/serving/xai-recsys-mm-server/src/o2.rs:84— phoenix/crates/serving/xai-recsys-mm-server/src/o2.rs:84-97 | thunder/o2/mod.rs:56-69 — 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) thunder/schema/tweet.rs:3619— thunder/schema/tweet.rs:3619-3632 | thunder/schema/tweet.rs:3749-3762 — both copies are in the same file, so extract the block into 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) thunder/schema/user.rs:9891— thunder/schema/user.rs:9891-9904 | thunder/schema/user.rs:10697-10710 — both copies are in the same file, so extract the block into 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) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1047— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1047-1060 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1101-1114 — both copies are in the same file, so extract the block into 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) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3150— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3150-3163 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3246-3259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3150` it begins part-way through the construct above it, so those exact lines 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) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3998— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3998-4011 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4060-4073 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3998` it does not close everything it opens, so those exact lines 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) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:47— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:47-60 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala:47-60 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:65— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:65-78 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala:65-78 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:65` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) under-the-hood/scalding/UthReferenceMonthMhPublisherJob.scala:52— under-the-hood/scalding/UthReferenceMonthMhPublisherJob.scala:52-65 | under-the-hood/scalding/UthUserMonthMhPublisherJob.scala:38-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `under-the-hood/scalding/UthReferenceMonthMhPublisherJob.scala:52` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) under-the-hood/scalding/UthReferenceMonthMhPublisherJob.scala:489— under-the-hood/scalding/UthReferenceMonthMhPublisherJob.scala:489-502 | under-the-hood/scalding/UthUserMonthMhPublisherJob.scala:383-396 — 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) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1014— botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1014-1027 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1096-1109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1014` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) grox/flows/mm_emb/renderer_v82.py:54— grox/flows/mm_emb/renderer_v82.py:54-67 | grox/flows/mm_emb/renderer_v8_search.py:69-82 — before extracting anything, compare `grox/flows/mm_emb/renderer_v82.py` and `grox/flows/mm_emb/renderer_v8_search.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) grox/flows/mm_emb/renderer_v82.py:299— grox/flows/mm_emb/renderer_v82.py:299-312 | grox/flows/mm_emb/renderer_v8_search.py:354-367 — before extracting anything, compare `grox/flows/mm_emb/renderer_v82.py` and `grox/flows/mm_emb/renderer_v8_search.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `grox/flows/mm_emb/renderer_v82.py:299` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) grox/flows/mm_emb/task_multimodal_post_embedding.py:64— grox/flows/mm_emb/task_multimodal_post_embedding.py:64-77 | grox/flows/mm_emb/task_multimodal_post_embedding.py:90-103 — both copies are in the same file, so extract the block into 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) grox/libs/embed/embed_http.py:173— grox/libs/embed/embed_http.py:173-186 | grox/libs/embed/embed_http.py:224-237 — both copies are in the same file, so extract the block into 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) phoenix/xrex/configs/xrecsys.py:75— phoenix/xrex/configs/xrecsys.py:75-88 | phoenix/xrex/configs/xrecsys_two_tower.py:71-84 — before extracting anything, compare `phoenix/xrex/configs/xrecsys.py` and `phoenix/xrex/configs/xrecsys_two_tower.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/configs/xrecsys.py:75` it does not close everything it opens, so those exact lines 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) phoenix/xrex/configs/xrecsys.py:609— phoenix/xrex/configs/xrecsys.py:609-622 | phoenix/xrex/data/recsys/recsys_batch.py:2347-2360 — 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 `phoenix/xrex/configs/xrecsys.py:609` it does not close everything it opens, so those exact lines 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) phoenix/xrex/data/recsys/recsys_batch.py:1651— phoenix/xrex/data/recsys/recsys_batch.py:1651-1664 | phoenix/xrex/data/recsys/recsys_batch.py:1998-2011 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `phoenix/xrex/data/recsys/recsys_batch.py:1650` calls `get` and `phoenix/xrex/data/recsys/recsys_batch.py:1997` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) phoenix/xrex/data/recsys/recsys_batch.py:1883— phoenix/xrex/data/recsys/recsys_batch.py:1883-1896 | phoenix/xrex/data/recsys/recsys_batch.py:1903-1916 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) phoenix/xrex/data/streaming/kafkaconsumer.py:832— phoenix/xrex/data/streaming/kafkaconsumer.py:832-845 | phoenix/xrex/data/streaming/kafkaconsumer.py:1541-1554 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `phoenix/xrex/data/streaming/kafkaconsumer.py:1555` calls `force_kafka_metadata_update` and `phoenix/xrex/data/streaming/kafkaconsumer.py:846` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) phoenix/xrex/eval/recsys_eval.py:442— phoenix/xrex/eval/recsys_eval.py:442-455 | phoenix/xrex/eval/recsys_eval.py:457-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. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/eval/recsys_eval.py:442` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 2) home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:687— home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:687-702 | home-mixer/candidate_pipeline/reverse_chron_posts_pipeline.rs:79-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) home-mixer/util/urt/convo_marshaller.rs:97— home-mixer/util/urt/convo_marshaller.rs:97-112 | home-mixer/util/urt/push_to_home_marshaller.rs:73-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:429— phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:429-444 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:532-547 — both copies are in the same file, so extract the block into 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) thunder/main.rs:67— thunder/main.rs:67-82 | vm-ranker/main.rs:108-123 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (16 lines × 2) thunder/schema/user.rs:12810— thunder/schema/user.rs:12810-12825 | thunder/schema/user.rs:13114-13129 — both copies are in the same file, so extract the block into 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) vm-ranker/helpers.rs:73— vm-ranker/helpers.rs:73-88 | vm-ranker/helpers.rs:137-152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) candidate-pipeline/hydrator.rs:44— candidate-pipeline/hydrator.rs:44-59 | candidate-pipeline/scorer.rs:31-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.
Duplicated block (16 lines × 2) agatha/scalding/data/loaders/HashtagTweetsDataLoader.scala:42— agatha/scalding/data/loaders/HashtagTweetsDataLoader.scala:42-57 | agatha/scalding/data/loaders/TweetAuthorEngagementGraph.scala:49-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `agatha/scalding/data/loaders/HashtagTweetsDataLoader.scala:42` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2264— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2264-2279 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2371-2386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2264` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2469— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2469-2484 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2599-2614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2469` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9273— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9273-9288 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9515-9530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9273` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10277— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10277-10292 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10432-10447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10277` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10560— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10560-10575 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10742-10757 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10560` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10893— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10893-10908 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11104-11119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10893` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11281— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11281-11296 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11591-11606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11281` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala:98— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala:98-113 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala:107-122 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:81— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:81-96 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala:81-96 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:997— botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:997-1012 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1079-1094 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:997` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) botmaker/src/java/com/twitter/botmaker/function/FunctionNode1O1.java:30— botmaker/src/java/com/twitter/botmaker/function/FunctionNode1O1.java:30-45 | botmaker/src/java/com/twitter/botmaker/function/FunctionNode1O1.java:61-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 (16 lines × 2) botmaker/src/java/com/twitter/botmaker/function/FunctionNode2O1.java:30— botmaker/src/java/com/twitter/botmaker/function/FunctionNode2O1.java:30-45 | botmaker/src/java/com/twitter/botmaker/function/FunctionNode2O1.java:62-77 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) grox/flows/mm_emb/renderer_v82.py:352— grox/flows/mm_emb/renderer_v82.py:352-367 | grox/flows/mm_emb/renderer_v8_search.py:439-454 — before extracting anything, compare `grox/flows/mm_emb/renderer_v82.py` and `grox/flows/mm_emb/renderer_v8_search.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `grox/flows/mm_emb/renderer_v82.py:352` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) phoenix/xrex/configs/data_feeds.py:220— phoenix/xrex/configs/data_feeds.py:220-235 | phoenix/xrex/configs/data_feeds.py:243-258 — both copies are in the same file, so extract the block into 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) phoenix/xrex/data/recsys/recsys_batch.py:1748— phoenix/xrex/data/recsys/recsys_batch.py:1748-1763 | phoenix/xrex/data/recsys/recsys_batch.py:2085-2100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/data/recsys/recsys_batch.py:1748` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) phoenix/xrex/models/recsys_model.py:1676— phoenix/xrex/models/recsys_model.py:1676-1691 | phoenix/xrex/models/recsys_model.py:1696-1711 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/models/recsys_model.py:1676` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) phoenix/xrex/pallas/ranker_attention_varlen.py:265— phoenix/xrex/pallas/ranker_attention_varlen.py:265-280 | phoenix/xrex/pallas/ranker_attention_varlen.py:778-793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_varlen.py:265` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:700— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:700-704 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:707-711 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:716-720 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:700` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1179— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1179-1183 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1216-1220 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1250-1254 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1179` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1363— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1363-1367 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1370-1374 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1379-1383 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1363` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1965— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1965-1969 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2000-2004 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2032-2036 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1965` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2872— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2872-2876 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2901-2905 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2928-2932 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2872` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3191— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3191-3195 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3198-3202 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3207-3211 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3191` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2693— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2693-2697 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2713-2717 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2732-2736 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2693` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3806— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3806-3810 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3827-3831 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3847-3851 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3806` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3899— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3899-3903 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3919-3923 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3938-3942 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3899` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5036— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5036-5040 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5058-5062 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5079-5083 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5036` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5134— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5134-5138 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5155-5159 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5175-5179 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5134` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6352— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6352-6356 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6375-6379 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6397-6401 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6352` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6455— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6455-6459 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6477-6481 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6498-6502 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6455` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7755— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7755-7759 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7779-7783 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7802-7806 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7755` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7873— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7873-7877 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7896-7900 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7918-7922 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7873` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12172— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12172-12176 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12196-12200 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12219-12223 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12172` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsBlockGraphEvent.java:37— botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsBlockGraphEvent.java:37-42 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsFollowGraphEvent.java:38-42 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsMuteGraphEvent.java:39-44 — 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) botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:912— botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:912-916 | botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:949-953 | botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:998-1002 — 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) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:528— botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:528-532 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:778-782 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:842-846 — 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 `botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:528` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) grox/libs/kafka_cli/consumer.py:62— grox/libs/kafka_cli/consumer.py:62-67 | grox/libs/kafka_cli/mtls.py:21-25 | grox/libs/kafka_cli/producer.py:33-38 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `grox/libs/kafka_cli/consumer.py:69` calls `info` and `grox/libs/kafka_cli/mtls.py:27` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) phoenix/reference/sid_codebook.py:811— phoenix/reference/sid_codebook.py:811-815 | phoenix/reference/sid_codebook.py:817-825 | phoenix/reference/sid_codebook.py:843-850 — 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 `phoenix/reference/sid_codebook.py:843` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 3) phoenix/xrex/pallas/ranker_attention_v2.py:86— phoenix/xrex/pallas/ranker_attention_v2.py:86-90 | phoenix/xrex/pallas/ranker_attention_v2.py:210-214 | phoenix/xrex/pallas/ranker_attention_varlen.py:220-224 — before extracting anything, compare `phoenix/xrex/pallas/ranker_attention_v2.py` and `phoenix/xrex/pallas/ranker_attention_varlen.py` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 287 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `phoenix/xrex/pallas/ranker_attention_varlen.py:219` calls `program_id` and `phoenix/xrex/pallas/ranker_attention_v2.py:85` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) phoenix/xrex/pallas/ranker_attention_varlen.py:288— phoenix/xrex/pallas/ranker_attention_varlen.py:288-293 | phoenix/xrex/pallas/ranker_attention_varlen.py:803-807 | phoenix/xrex/pallas/ranker_attention_varlen.py:976-980 — 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) grox/flows/ptos/task_safety_ptos_adult_content_leading_frames_filter.py:87— grox/flows/ptos/task_safety_ptos_adult_content_leading_frames_filter.py:87-91 | grox/flows/ptos/task_safety_ptos_key_frames_filter.py:78-82 | grox/flows/ptos/task_safety_ptos_media_injected_adult_infrared_video_spam_detection_filter.py:51-55 — 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. 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.
Swallowed exception (empty catch) simclusters/simclustersann/SimclustersAnnWarmupHandler.scala:68— 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) REDACTED:500— 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) REDACTED:630— 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) REDACTED:667— 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) phoenix/xrex/utils/checkpointing.py:74— 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) phoenix/xrex/utils/log_util.py:218— 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) REDACTED:530— 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) REDACTED:552— 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) REDACTED:566— 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) phoenix/xrex/inference/model_runner.py:412— 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) phoenix/xrex/inference/model_runner.py:424— 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) phoenix/xrex/inference/model_runner.py:1590— 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) phoenix/xrex/inference/model_runner.py:1596— 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) phoenix/xrex/inference/model_runner.py:3146— 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) phoenix/xrex/inference/model_runner.py:3518— 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) phoenix/xrex/inference/model_runner.py:3918— 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) phoenix/xrex/inference/model_runner.py:3940— 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) phoenix/xrex/inference/model_runner.py:3954— 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) phoenix/xrex/driver/run.py:46— 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) phoenix/xrex/driver/run.py:140— 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) phoenix/xrex/cutedsl/ranker_fa4/utils.py:99— 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) phoenix/python/training/xai-checkpointing/xai_checkpointing/load.py:147— 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) grox/flows/reply_spam/classifier_reply_ranking.py:133— 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) grox/flows/reply_spam/classifier_simple_reply_scorer.py:111— 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.
Duplicated block (15 lines × 2) abuse-enforcement-service/service-lib/src/service.rs:341— abuse-enforcement-service/service-lib/src/service.rs:341-355 | abuse-enforcement-service/service-lib/src/service.rs:385-399 — both copies are in the same file, so extract the block into 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) home-mixer/candidate_pipeline/following_candidate_pipeline.rs:135— home-mixer/candidate_pipeline/following_candidate_pipeline.rs:135-149 | home-mixer/candidate_pipeline/ranked_following_candidate_pipeline.rs:84-98 — before extracting anything, compare `home-mixer/candidate_pipeline/following_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/ranked_following_candidate_pipeline.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) home-mixer/candidate_pipeline/following_candidate_pipeline.rs:253— home-mixer/candidate_pipeline/following_candidate_pipeline.rs:253-267 | home-mixer/candidate_pipeline/ranked_following_candidate_pipeline.rs:183-197 — before extracting anything, compare `home-mixer/candidate_pipeline/following_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/ranked_following_candidate_pipeline.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) phoenix-rankall/src/store/writer.rs:52— phoenix-rankall/src/store/writer.rs:52-66 | phoenix-rankall/src/store/writer.rs:84-98 — both copies are in the same file, so extract the block into 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) thunder/schema/tweet.rs:1672— thunder/schema/tweet.rs:1672-1686 | thunder/schema/user.rs:11066-11080 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:1791— thunder/schema/tweet.rs:1791-1805 | thunder/schema/user.rs:11259-11273 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:3143— thunder/schema/tweet.rs:3143-3157 | thunder/schema/user.rs:4297-4311 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:3532— thunder/schema/tweet.rs:3532-3546 | thunder/schema/tweet.rs:3936-3950 — both copies are in the same file, so extract the block into 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) botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:211— botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:211-225 | botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:255-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:227` calls `Option`, `unbox`, `resolve` and `botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:271` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5239— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5239-5253 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5305-5319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5239` it does not close everything it opens, so those exact lines 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) simclusters/simclusters_v2/scalding/UserUserNormalizedGraph.scala:55— simclusters/simclusters_v2/scalding/UserUserNormalizedGraph.scala:55-69 | simclusters/simclusters_v2/scalding/embedding/common/ExternalDataSources.scala:402-416 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) simclusters/simclusters_v2/scalding/embedding/EntityToSimClustersEmbeddingsJob.scala:103— simclusters/simclusters_v2/scalding/embedding/EntityToSimClustersEmbeddingsJob.scala:103-117 | simclusters/simclusters_v2/scalding/embedding/LocaleEntitySimClustersEmbeddingsJob.scala:107-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/scalding/embedding/EntityToSimClustersEmbeddingsJob.scala: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.
Duplicated block (15 lines × 2) simclusters/simclusters_v2/scalding/embedding/tfg/InferredLanguageTfgBasedTopicEmbeddingsBaseApp.scala:117— simclusters/simclusters_v2/scalding/embedding/tfg/InferredLanguageTfgBasedTopicEmbeddingsBaseApp.scala:117-131 | simclusters/simclusters_v2/scalding/embedding/tfg/TfgBasedTopicEmbeddingsBaseApp.scala:84-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) under-the-hood/scalding/UthDailyPostsBackfillJob.scala:104— under-the-hood/scalding/UthDailyPostsBackfillJob.scala:104-118 | under-the-hood/scalding/UthDailyPostsJob.scala:111-125 — before extracting anything, compare `under-the-hood/scalding/UthDailyPostsBackfillJob.scala` and `under-the-hood/scalding/UthDailyPostsJob.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `under-the-hood/scalding/UthDailyPostsBackfillJob.scala:104` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1493— botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1493-1507 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1527-1541 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1493` it begins part-way through the construct above it, so those 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, `botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1491` calls `indent` and `botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1525` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) botmaker/src/java/com/twitter/botmaker/function/conversion/Cast.java:60— botmaker/src/java/com/twitter/botmaker/function/conversion/Cast.java:60-74 | botmaker/src/java/com/twitter/botmaker/function/conversion/Cast.java:81-95 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) botmaker/src/java/com/twitter/botmaker/compiler/thrift/TEnumMetaData.java:11— botmaker/src/java/com/twitter/botmaker/compiler/thrift/TEnumMetaData.java:11-25 | botmaker/src/java/com/twitter/botmaker/compiler/thrift/ThriftEnumMetaData.java:10-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `sClass` to `Class<? extends TEnum>` in one and `Class<? extends ThriftEnum>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 2) grox/flows/mm_emb/renderer_v82.py:324— grox/flows/mm_emb/renderer_v82.py:324-338 | grox/flows/mm_emb/renderer_v8_search.py:413-427 — before extracting anything, compare `grox/flows/mm_emb/renderer_v82.py` and `grox/flows/mm_emb/renderer_v8_search.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) grox/flows/reply_spam/classifier_coordinated_spam.py:205— grox/flows/reply_spam/classifier_coordinated_spam.py:205-219 | grox/flows/reply_spam/classifier_multi_step_reply_spam.py:209-223 — before extracting anything, compare `grox/flows/reply_spam/classifier_coordinated_spam.py` and `grox/flows/reply_spam/classifier_multi_step_reply_spam.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `grox/flows/reply_spam/classifier_coordinated_spam.py:205` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) grox/libs/kafka_cli/producer.py:66— grox/libs/kafka_cli/producer.py:66-80 | grox/libs/kafka_cli/producer.py:148-162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `grox/libs/kafka_cli/producer.py:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) phoenix/xrex/cutedsl/ranker_attention_fa4.py:209— phoenix/xrex/cutedsl/ranker_attention_fa4.py:209-223 | phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:481-495 — before extracting anything, compare `phoenix/xrex/cutedsl/ranker_attention_fa4.py` and `phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 258 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/cutedsl/ranker_attention_fa4.py:209` it begins part-way through the construct above it, so those exact lines 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) phoenix/xrex/models/recsys_feature_prep.py:777— phoenix/xrex/models/recsys_feature_prep.py:777-791 | phoenix/xrex/models/recsys_model.py:1632-1646 — 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 `phoenix/xrex/models/recsys_feature_prep.py:777` it begins part-way through the construct above it, so those exact lines 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) phoenix/xrex/models/recsys_model.py:1815— phoenix/xrex/models/recsys_model.py:1815-1829 | phoenix/xrex/models/recsys_model.py:1925-1939 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
xai_recsys_engine::proto_parser::parse (cognitive 238) phoenix/crates/serving/xai-recsys-engine/src/proto_parser.rs:336— xai_recsys_engine::proto_parser::parse has cognitive complexity 238 (threshold 15). Drivers by points: if/else 36 (193 pts), match/switch 6 (21 pts), loops 4 (17 pts), boolean chains 7 (nesting depth added 185). 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.
xai_recsys_engine::storage_util::load_single_array (cognitive 86) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:1207— xai_recsys_engine::storage_util::load_single_array has cognitive complexity 86 (threshold 15). Drivers by points: if/else 25 (68 pts), match/switch 3 (9 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 53). 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.
xai_recsys_engine::storage_util::remove_old_from_storage_async (cognitive 81) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:897— xai_recsys_engine::storage_util::remove_old_from_storage_async has cognitive complexity 81 (threshold 15). Drivers by points: if/else 38 (66 pts), loops 6 (10 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai_recsys_engine::emb_table::load_tensor_into (cognitive 68) phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:1310— xai_recsys_engine::emb_table::load_tensor_into has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (36 pts), loops 11 (24 pts), boolean chains 4, match/switch 1 (4 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai_recsys_engine::storage_util::find_latest_storage_checkpoint_async (cognitive 56) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:617— xai_recsys_engine::storage_util::find_latest_storage_checkpoint_async has cognitive complexity 56 (threshold 15). Drivers by points: if/else 23 (45 pts), loops 4 (7 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai_recsys_engine::emb_table::maybe_load_fully_replicated_tensors (cognitive 45) phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:875— xai_recsys_engine::emb_table::maybe_load_fully_replicated_tensors has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (33 pts), loops 6 (8 pts), boolean chains 3, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai_recsys_engine::emb_table::load_tensor_no_resharding (cognitive 27) phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:1095— xai_recsys_engine::emb_table::load_tensor_no_resharding has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 3 (4 pts), match/switch 4, boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
xai_recsys_engine::storage_util::load_reshard_row_to_col (cognitive 26) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:1848— xai_recsys_engine::storage_util::load_reshard_row_to_col has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (6 pts), match/switch 1 (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.
xai_recsys_engine::storage_util::upload_files_to_storage (cognitive 24) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:208— xai_recsys_engine::storage_util::upload_files_to_storage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), match/switch 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.
xai_recsys_engine::bin::checkpoint_server::main (cognitive 20) phoenix/crates/serving/xai-recsys-engine/src/bin/checkpoint_server.rs:84— xai_recsys_engine::bin::checkpoint_server::main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 3 (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.
xai_recsys_engine::checkpoint_store::get_checkpoint_store (cognitive 20) phoenix/crates/serving/xai-recsys-engine/src/checkpoint_store.rs:275— xai_recsys_engine::checkpoint_store::get_checkpoint_store has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 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.
xai_recsys_engine::copy_port_client::spawn_sharded_downloads (cognitive 20) phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:1371— xai_recsys_engine::copy_port_client::spawn_sharded_downloads has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (3 pts), match/switch 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai_recsys_engine::copy::rdma (cognitive 19) phoenix/crates/serving/xai-recsys-engine/src/copy.rs:121— xai_recsys_engine::copy::rdma has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 4 (8 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.
xai_recsys_engine::copy_port_client::join_rate_limited (cognitive 19) phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:352— xai_recsys_engine::copy_port_client::join_rate_limited has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 2 (5 pts), boolean chains 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai_recsys_engine::copy_port_client::download_sharded_with_channels (cognitive 19) phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:645— xai_recsys_engine::copy_port_client::download_sharded_with_channels has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai_recsys_engine::python::handle_request (cognitive 19) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1201— xai_recsys_engine::python::handle_request has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 6 (10 pts), if/else 7 (9 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.
xai_recsys_engine::storage_util::reshard_col_to_row_and_upload (cognitive 19) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:1425— xai_recsys_engine::storage_util::reshard_col_to_row_and_upload has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (5 pts), match/switch 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.
xai_recsys_engine::copy_port_client::classify_shard_ownership (cognitive 18) phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:1054— xai_recsys_engine::copy_port_client::classify_shard_ownership has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (4 pts), boolean chains 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.
xai_recsys_engine::copy_port_client::spawn_striped_trainer_downloads (cognitive 18) phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:1247— xai_recsys_engine::copy_port_client::spawn_striped_trainer_downloads has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 4 (7 pts), boolean chains 2, match/switch 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai_recsys_engine::storage_util::download_prefix_to_local_async (cognitive 18) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:350— xai_recsys_engine::storage_util::download_prefix_to_local_async has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai_recsys_engine::checkpoint_proxy::download_channel_files (cognitive 16) phoenix/crates/serving/xai-recsys-engine/src/checkpoint_proxy.rs:547— xai_recsys_engine::checkpoint_proxy::download_channel_files has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (5 pts), match/switch 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.
ClassTooLong: Serializer botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:49— ClassTooLong — 1269 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 869 over it, 3.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Compiler botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:79— ClassTooLong — 1209 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 400 significant lines; this is 809 over it, 3.02× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: InputBuffer phoenix/crates/common/xai-recsys/src/util.rs:433— ClassTooLong — 1022 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, 3 blocks, lines 433-1733. The bar is 400 significant lines; this is 622 over it, 2.56× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RankingBatchPrep phoenix/crates/serving/xai-recsys-engine/src/python.rs:1394— ClassTooLong — 789 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 3 blocks, lines 1394-2315. The bar is 400 significant lines; this is 389 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Account thunder/schema/user.rs:5905— ClassTooLong — 772 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 3 blocks, lines 5905-6826. The bar is 400 significant lines; this is 372 over it, 1.93× 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: PhoenixCandidatePipeline home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:221— ClassTooLong — 747 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 3 methods, 3 blocks, lines 221-1145. The bar is 400 significant lines; this is 347 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: Backfill abuse-enforcement-service/service-lib/src/backfill.rs:314— ClassTooLong — 713 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 27 methods, 2 blocks, lines 314-1239. The bar is 400 significant lines; this is 313 over it, 1.78× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AnnotationValue thunder/schema/user.rs:4889— 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), 0 methods, 2 blocks, lines 4889-5691. 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: Safety thunder/schema/user.rs:8890— ClassTooLong — 618 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 3 blocks, lines 8890-9629. The bar is 400 significant lines; this is 218 over it, 1.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: HoldGate abuse-enforcement-service/service-lib/src/overturn_hold.rs:1116— ClassTooLong — 605 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, 2 blocks, lines 1116-1983. The bar is 400 significant lines; this is 205 over it, 1.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: Store visibility-filtering/hydration/store.rs:94— ClassTooLong — 535 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 67 methods, 2 blocks, lines 94-809. The bar is 400 significant lines; this is 135 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: ThriftStructType botmaker/src/java/com/twitter/botmaker/compiler/types/ThriftStructType.java:56— ClassTooLong — 524 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 124 over it, 1.31× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FunctionUnit2O11 botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11200— ClassTooLong — 484 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 84 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.
ClassTooLong: User thunder/schema/user.rs:14179— ClassTooLong — 475 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 3 blocks, lines 14179-14749. The bar is 400 significant lines; this is 75 over it, 1.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: TopicIdExpansion home-mixer/filters/topic_ids_filter.rs:108— ClassTooLong — 468 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 6 methods. The bar is 400 significant lines; this is 68 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.
ClassTooLong: Type botmaker/src/java/com/twitter/botmaker/compiler/types/Type.java:37— ClassTooLong — 464 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 400 significant lines; this is 64 over it, 1.16× 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: Event thunder/schema/events.rs:4092— ClassTooLong — 447 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 0 methods, 2 blocks, lines 4092-4678. The bar is 400 significant lines; this is 47 over it, 1.12× 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: BaseSnapshotStore phoenix-rankall/src/store/base.rs:100— ClassTooLong — 417 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 5 methods, 3 blocks, lines 100-677. The bar is 400 significant lines; this is 17 over it, 1.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: OffSwitch abuse-enforcement-service/service-lib/src/off_switch.rs:274— ClassTooLong — 411 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 274-848. The bar is 400 significant lines; this is 11 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: HeadGuard abuse-enforcement-service/service-lib/src/head_guard.rs:258— ClassTooLong — 411 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 2 blocks, lines 258-822. The bar is 400 significant lines; this is 11 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PostStore thunder/posts/post_store.rs:88— ClassTooLong — 402 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, 3 blocks, lines 88-650. The bar is 400 significant lines; this is 2 over it, 1.01× 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 × 3) phoenix/crates/common/xai-recsys/src/util.rs:905— phoenix/crates/common/xai-recsys/src/util.rs:905-910 | phoenix/crates/common/xai-recsys/src/util.rs:1248-1253 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:2520-2525 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) thunder/schema/tweet.rs:1532— thunder/schema/tweet.rs:1532-1537 | thunder/schema/user.rs:11958-11963 | thunder/schema/user.rs:12038-12043 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) thunder/schema/media_common.rs:599— thunder/schema/media_common.rs:599-604 | thunder/schema/tweet_media.rs:445-450 | thunder/schema/tweet_media.rs:517-522 — before extracting anything, compare `thunder/schema/media_common.rs` and `thunder/schema/tweet_media.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1549— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1549-1554 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1556-1561 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1564-1570 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1549` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2321— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2321-2326 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2328-2333 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2336-2342 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2321` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2329— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2329-2334 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2338-2343 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2348-2353 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2329` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3198— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3198-3203 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3207-3212 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3217-3222 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3198` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3673— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3673-3678 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4612-4617 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10402-10407 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3673` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4175— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4175-4180 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4184-4189 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4194-4199 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4175` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4885— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4885-4890 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5898-5903 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10711-10716 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4885` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5428— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5428-5433 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5438-5443 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5449-5454 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5428` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6191— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6191-6196 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7270-7275 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11072-11077 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6191` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6767— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6767-6772 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6778-6783 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6790-6795 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6767` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8205— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8205-8210 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8217-8222 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8230-8235 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8205` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:139— botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:139-144 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:309-314 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:484-490 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:491` calls `isSetFromSessionHash`, `put`, `getFromSessionHash` and `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:145` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:521— botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:521-526 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:771-776 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:835-840 — 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 `botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:521` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsBlockGraphEvent.java:28— botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsBlockGraphEvent.java:28-33 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsFollowGraphEvent.java:29-34 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsMuteGraphEvent.java:30-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsBlockGraphEvent.java:28` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) phoenix/xrex/inference/model_runner.py:4349— phoenix/xrex/inference/model_runner.py:4349-4354 | phoenix/xrex/inference/model_runner.py:5442-5447 | phoenix/xrex/train/recsys_bundle_export.py:603-608 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) phoenix/xrex/pallas/ranker_attention_fa3.py:257— phoenix/xrex/pallas/ranker_attention_fa3.py:257-262 | phoenix/xrex/pallas/ranker_attention_fa3.py:1113-1118 | phoenix/xrex/pallas/ranker_attention_fa3.py:1377-1382 — 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) home-mixer/ads/multi_risk_blender.rs:203— home-mixer/ads/multi_risk_blender.rs:203-212 | home-mixer/ads/partition_organic_blender.rs:139-148 | home-mixer/ads/time_gap_blender.rs:146-155 — before extracting anything, compare `home-mixer/ads/multi_risk_blender.rs` and `home-mixer/ads/partition_organic_blender.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1788— phoenix/crates/serving/xai-recsys-engine/src/python.rs:1788-1797 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:1813-1822 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:1870-1879 — 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) thunder/schema/events.rs:303— thunder/schema/events.rs:303-312 | thunder/schema/tweet_events.rs:682-691 | thunder/schema/tweet_events.rs:1231-1240 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) thunder/schema/events.rs:1420— thunder/schema/events.rs:1420-1429 | thunder/schema/events.rs:3683-3692 | thunder/schema/events.rs:3854-3863 — 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) thunder/schema/media_common.rs:544— thunder/schema/media_common.rs:544-553 | thunder/schema/user.rs:13223-13232 | thunder/schema/user.rs:13415-13424 — before extracting anything, compare `thunder/schema/media_common.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) thunder/schema/tweet.rs:2830— thunder/schema/tweet.rs:2830-2839 | thunder/schema/tweet_events.rs:729-738 | thunder/schema/tweet_events.rs:1290-1299 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) thunder/schema/tweet.rs:3530— thunder/schema/tweet.rs:3530-3539 | thunder/schema/user.rs:12559-12568 | thunder/schema/user.rs:13893-13902 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) thunder/schema/tweet_events.rs:211— thunder/schema/tweet_events.rs:211-220 | thunder/schema/tweet_events.rs:342-351 | thunder/schema/tweet_events.rs:472-481 — 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) home-mixer/clients/prompts_client.rs:72— home-mixer/clients/prompts_client.rs:72-81 | home-mixer/clients/simclusters_ann_client.rs:75-84 | home-mixer/clients/who_to_follow_client.rs:74-85 — before extracting anything, compare `home-mixer/clients/prompts_client.rs` and `home-mixer/clients/simclusters_ann_client.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:766— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:766-775 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1427-1436 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2203-2212 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:766` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1635— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1635-1644 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2405-2414 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3269-3278 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1635` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2644— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2644-2653 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3492-3501 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4444-4453 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2644` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:873— botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:873-882 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:953-962 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1034-1043 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `Collection` in one and `List` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 3) grox/flows/mm_emb/renderer_v82.py:165— grox/flows/mm_emb/renderer_v82.py:165-175 | grox/flows/mm_emb/renderer_v8_search.py:181-190 | grox/flows/mm_emb/renderer_v8_search.py:209-218 — before extracting anything, compare `grox/flows/mm_emb/renderer_v82.py` and `grox/flows/mm_emb/renderer_v8_search.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `grox/flows/mm_emb/renderer_v8_search.py:220` calls `_quoted_block` and `grox/flows/mm_emb/renderer_v82.py:177` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 3) phoenix/xrex/data/recsys/recsys_batch.py:1688— phoenix/xrex/data/recsys/recsys_batch.py:1688-1697 | phoenix/xrex/data/recsys/recsys_batch.py:1712-1721 | phoenix/xrex/data/recsys/recsys_batch.py:2017-2026 — 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 `phoenix/xrex/data/recsys/recsys_batch.py:1688` it begins part-way through the construct above it, so those 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, `phoenix/xrex/data/recsys/recsys_batch.py:2026` calls `zeros` and `phoenix/xrex/data/recsys/recsys_batch.py:1697` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 3) phoenix/xrex/models/recsys_gen_recs_model.py:129— phoenix/xrex/models/recsys_gen_recs_model.py:129-138 | phoenix/xrex/models/recsys_gen_recs_model.py:149-158 | phoenix/xrex/models/recsys_gen_recs_model.py:169-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `phoenix/xrex/models/recsys_gen_recs_model.py:161` calls `sqrt`, `sum`, `square` and `phoenix/xrex/models/recsys_gen_recs_model.py:180` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 3) phoenix/xrex/pallas/attention.py:638— phoenix/xrex/pallas/attention.py:638-647 | phoenix/xrex/pallas/ranker_attention_v2.py:1029-1038 | phoenix/xrex/pallas/ranker_attention_varlen.py:1226-1235 — before extracting anything, compare `phoenix/xrex/pallas/attention.py` and `phoenix/xrex/pallas/ranker_attention_v2.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/attention.py:638` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) phoenix/xrex/pallas/ranker_attention_varlen.py:733— phoenix/xrex/pallas/ranker_attention_varlen.py:733-743 | phoenix/xrex/pallas/ranker_attention_varlen.py:765-774 | phoenix/xrex/pallas/ranker_attention_varlen.py:934-943 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `phoenix/xrex/pallas/ranker_attention_varlen.py:744` calls `load`, `ds` and `phoenix/xrex/pallas/ranker_attention_varlen.py:775` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 3) abuse-enforcement-service/service-lib/src/service.rs:2219— abuse-enforcement-service/service-lib/src/service.rs:2219-2227 | abuse-enforcement-service/service-lib/src/service.rs:2366-2374 | abuse-enforcement-service/service-lib/src/service.rs:2605-2613 — 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) phoenix-rankall/src/main.rs:80— phoenix-rankall/src/main.rs:80-88 | phoenix-rankall/src/main.rs:103-111 | phoenix-rankall/src/main.rs:125-133 — 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) phoenix-rankall/src/main.rs:90— phoenix-rankall/src/main.rs:90-98 | phoenix-rankall/src/main.rs:113-121 | phoenix-rankall/src/main.rs:135-143 — 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) phoenix/crates/serving/xai-recsys-engine/src/python.rs:514— phoenix/crates/serving/xai-recsys-engine/src/python.rs:514-522 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:543-551 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:571-579 — 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) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:358— phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:358-366 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:495-503 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:572-580 — 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) thunder/schema/events.rs:1588— thunder/schema/events.rs:1588-1596 | thunder/schema/tweet_events.rs:938-946 | thunder/schema/user.rs:5004-5012 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) thunder/schema/media_common.rs:508— thunder/schema/media_common.rs:508-516 | thunder/schema/user.rs:5790-5798 | thunder/schema/user.rs:10941-10949 — before extracting anything, compare `thunder/schema/media_common.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) thunder/schema/tweet.rs:2310— thunder/schema/tweet.rs:2310-2318 | thunder/schema/tweet.rs:2424-2432 | thunder/schema/user.rs:11298-11306 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) thunder/schema/tweet.rs:2682— thunder/schema/tweet.rs:2682-2690 | thunder/schema/tweet_events.rs:828-836 | thunder/schema/tweet_events.rs:923-931 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) thunder/schema/tweet.rs:2795— thunder/schema/tweet.rs:2795-2803 | thunder/schema/tweet_events.rs:674-682 | thunder/schema/tweet_events.rs:1215-1223 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) thunder/schema/tweet_events.rs:1519— thunder/schema/tweet_events.rs:1519-1527 | thunder/schema/user.rs:3877-3885 | thunder/schema/user.rs:7001-7009 — before extracting anything, compare `thunder/schema/tweet_events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 353 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) under-the-hood/scalding/UthDailyPostTakedownLabelsJob.scala:146— under-the-hood/scalding/UthDailyPostTakedownLabelsJob.scala:146-154 | under-the-hood/scalding/UthDailyPostsBackfillJob.scala:104-112 | under-the-hood/scalding/UthDailyPostsJob.scala:111-119 — before extracting anything, compare `under-the-hood/scalding/UthDailyPostsBackfillJob.scala` and `under-the-hood/scalding/UthDailyPostsJob.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `under-the-hood/scalding/UthDailyPostTakedownLabelsJob.scala:146` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) botmaker/src/java/com/twitter/botmaker/function/collection/MapOperator.java:61— botmaker/src/java/com/twitter/botmaker/function/collection/MapOperator.java:61-69 | botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java:47-55 | botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftStructOperator.java:46-54 — before extracting anything, compare `botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java` and `botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftStructOperator.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) botmaker/src/java/com/twitter/botmaker/function/FunctionNode.java:68— botmaker/src/java/com/twitter/botmaker/function/FunctionNode.java:68-76 | botmaker/src/java/com/twitter/botmaker/function/FunctionNode1.java:62-70 | botmaker/src/java/com/twitter/botmaker/function/FunctionNode1O1.java:97-105 — before extracting anything, compare `botmaker/src/java/com/twitter/botmaker/function/FunctionNode1.java` and `botmaker/src/java/com/twitter/botmaker/function/FunctionNode1O1.java` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/java/com/twitter/botmaker/function/FunctionNode.java:68` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/src/java/com/twitter/botmaker/function/FunctionNode1O1.java:93` calls `apply` and `botmaker/src/java/com/twitter/botmaker/function/FunctionNode1.java:59` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 3) botmaker/src/java/com/twitter/botmaker/function/FunctionNode1O1.java:82— botmaker/src/java/com/twitter/botmaker/function/FunctionNode1O1.java:82-91 | botmaker/src/java/com/twitter/botmaker/function/FunctionNode2.java:65-73 | botmaker/src/java/com/twitter/botmaker/function/FunctionNode2O1.java:97-105 — before extracting anything, compare `botmaker/src/java/com/twitter/botmaker/function/FunctionNode1O1.java` and `botmaker/src/java/com/twitter/botmaker/function/FunctionNode2O1.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/java/com/twitter/botmaker/function/FunctionNode1O1.java:82` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/src/java/com/twitter/botmaker/function/FunctionNode2O1.java:93` calls `apply` and `botmaker/src/java/com/twitter/botmaker/function/FunctionNode1O1.java:79` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 3) grox/flows/mm_emb/embedder.py:75— grox/flows/mm_emb/embedder.py:75-83 | grox/flows/mm_emb/embedder_v82.py:81-89 | grox/flows/mm_emb/embedder_v8_search.py:74-82 — before extracting anything, compare `grox/flows/mm_emb/embedder_v82.py` and `grox/flows/mm_emb/embedder_v8_search.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (9 lines × 3) phoenix/xrex/configs/data_feeds.py:129— phoenix/xrex/configs/data_feeds.py:129-137 | phoenix/xrex/configs/data_feeds.py:160-168 | phoenix/xrex/configs/data_feeds.py:189-197 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `phoenix/xrex/configs/data_feeds.py:138` calls `get` and `phoenix/xrex/configs/data_feeds.py:198` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 3) phoenix/xrex/models/transformer.py:295— phoenix/xrex/models/transformer.py:295-303 | phoenix/xrex/models/transformer.py:314-322 | phoenix/xrex/models/transformer.py:325-333 — 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 `phoenix/xrex/models/transformer.py:295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) home-mixer/candidate_pipeline/following_candidate_pipeline.rs:247— home-mixer/candidate_pipeline/following_candidate_pipeline.rs:247-254 | home-mixer/candidate_pipeline/for_you_candidate_pipeline.rs:267-274 | home-mixer/candidate_pipeline/ranked_following_candidate_pipeline.rs:177-184 — before extracting anything, compare `home-mixer/candidate_pipeline/following_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/for_you_candidate_pipeline.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) home-mixer/following_feed_server.rs:60— home-mixer/following_feed_server.rs:60-67 | home-mixer/for_you_server.rs:56-63 | home-mixer/ranked_following_feed_server.rs:48-55 — 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 (8 lines × 3) phoenix-rankall/src/processor/gen/hydra.rs:119— phoenix-rankall/src/processor/gen/hydra.rs:119-126 | phoenix-rankall/src/processor/gen/hydra.rs:554-561 | phoenix-rankall/src/processor/gen/scored_candidate.rs:161-168 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix-rankall/src/processor/gen/scored_candidate.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) thunder/schema/events.rs:1693— thunder/schema/events.rs:1693-1700 | thunder/schema/tweet.rs:3667-3674 | thunder/schema/tweet.rs:3804-3811 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) thunder/schema/media_entity.rs:287— thunder/schema/media_entity.rs:287-294 | thunder/schema/tweet.rs:1701-1708 | thunder/schema/user.rs:11094-11101 — before extracting anything, compare `thunder/schema/media_entity.rs` and `thunder/schema/tweet.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 (8 lines × 3) thunder/schema/tweet.rs:1711— thunder/schema/tweet.rs:1711-1718 | thunder/schema/tweet.rs:2760-2767 | thunder/schema/user.rs:11104-11111 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) thunder/schema/user.rs:4527— thunder/schema/user.rs:4527-4534 | thunder/schema/user.rs:13182-13189 | thunder/schema/user.rs:14164-14171 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) home-mixer/clients/prompts_client.rs:58— home-mixer/clients/prompts_client.rs:58-66 | home-mixer/clients/simclusters_ann_client.rs:62-69 | home-mixer/clients/who_to_follow_client.rs:61-68 — before extracting anything, compare `home-mixer/clients/prompts_client.rs` and `home-mixer/clients/simclusters_ann_client.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:670— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:670-677 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1337-1344 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2117-2124 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:670` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1524— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1524-1531 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2298-2305 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3173-3180 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1524` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2514— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2514-2521 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3373-3380 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4338-4345 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2514` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) simclusters/simclusters_v2/scalding/offline_data_conversion/ClusterDetails20M145K2020FlattenJob.scala:82— simclusters/simclusters_v2/scalding/offline_data_conversion/ClusterDetails20M145K2020FlattenJob.scala:82-89 | simclusters/simclusters_v2/scalding/offline_data_conversion/InterestedIn20M145K2020FlattenJob.scala:74-81 | simclusters/simclusters_v2/scalding/offline_data_conversion/KnownFor20M145K2020FlattenJob.scala:75-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 all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) grox/libs/kafka_cli/consumer.py:85— grox/libs/kafka_cli/consumer.py:85-92 | grox/libs/kafka_cli/producer.py:56-63 | grox/libs/kafka_cli/producer.py:136-143 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 3) phoenix/xrex/configs/data_feeds.py:207— phoenix/xrex/configs/data_feeds.py:207-214 | phoenix/xrex/configs/data_feeds.py:230-237 | phoenix/xrex/configs/data_feeds.py:253-260 — 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 `phoenix/xrex/configs/data_feeds.py:207` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) phoenix/xrex/configs/data_feeds.py:222— phoenix/xrex/configs/data_feeds.py:222-229 | phoenix/xrex/configs/data_feeds.py:245-252 | phoenix/xrex/configs/xrecsys.py:215-222 — 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) phoenix/xrex/pallas/ranker_attention_varlen.py:227— phoenix/xrex/pallas/ranker_attention_varlen.py:227-234 | phoenix/xrex/pallas/ranker_attention_varlen.py:726-733 | phoenix/xrex/pallas/ranker_attention_varlen.py:896-903 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `phoenix/xrex/pallas/ranker_attention_varlen.py:905` calls `zeros` and `phoenix/xrex/pallas/ranker_attention_varlen.py:236` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) phoenix/xrex/pallas/ranker_attention_varlen.py:1551— phoenix/xrex/pallas/ranker_attention_varlen.py:1551-1558 | phoenix/xrex/pallas/ranker_attention_varlen.py:1705-1712 | phoenix/xrex/pallas/ranker_attention_varlen.py:1806-1813 — 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.
crate::abuse-enforcement-service::service-lib::src::run_enforcement_inner (cyclomatic 58) abuse-enforcement-service/service-lib/src/lib.rs:354— crate::abuse-enforcement-service::service-lib::src::run_enforcement_inner has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crate::abuse-enforcement-service::service-lib::src::start_kafka_consumers (cyclomatic 34) abuse-enforcement-service/service-lib/src/lib.rs:2898— crate::abuse-enforcement-service::service-lib::src::start_kafka_consumers 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.
crate::home-mixer::ads::multi_risk_blender::blend_with_drops (cyclomatic 30) home-mixer/ads/multi_risk_blender.rs:39— crate::home-mixer::ads::multi_risk_blender::blend_with_drops 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.
crate::abuse-enforcement-service::service-lib::src::action_control::levels::resolve_rows (cyclomatic 24) abuse-enforcement-service/service-lib/src/action_control/levels.rs:202— crate::abuse-enforcement-service::service-lib::src::action_control::levels::resolve_rows has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
crate::abuse-enforcement-service::service-lib::src::action_control::levels::record_problem (cyclomatic 23) abuse-enforcement-service/service-lib/src/action_control/levels.rs:795— crate::abuse-enforcement-service::service-lib::src::action_control::levels::record_problem 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.
crate::home-mixer::ads::partition_organic_blender::blend_impl (cyclomatic 22) home-mixer/ads/partition_organic_blender.rs:21— crate::home-mixer::ads::partition_organic_blender::blend_impl 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.
crate::abuse-enforcement-service::service-lib::src::backfill::validate_start (cyclomatic 20) abuse-enforcement-service/service-lib/src/backfill.rs:1241— crate::abuse-enforcement-service::service-lib::src::backfill::validate_start 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.
crate::abuse-enforcement-service::service-lib::src::action_control::levels::validate_confidence (cyclomatic 19) abuse-enforcement-service/service-lib/src/action_control/levels.rs:707— crate::abuse-enforcement-service::service-lib::src::action_control::levels::validate_confidence 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.
crate::home-mixer::ads::following_ad_blender::blend_with_spacing (cyclomatic 17) home-mixer/ads/following_ad_blender.rs:122— crate::home-mixer::ads::following_ad_blender::blend_with_spacing 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.
crate::home-mixer::ads::time_gap_blender::blend_impl (cyclomatic 17) home-mixer/ads/time_gap_blender.rs:48— crate::home-mixer::ads::time_gap_blender::blend_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.
crate::home-mixer::util::urt::make_urt_timeline (cyclomatic 17) home-mixer/util/urt/mod.rs:30— crate::home-mixer::util::urt::make_urt_timeline 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.
crate::visibility-filtering::rules::golden_corpus::article::rows (cyclomatic 17) visibility-filtering/rules/golden_corpus/article.rs:41— crate::visibility-filtering::rules::golden_corpus::article::rows 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.
crate::vm-ranker::dpp::greedy_dpp (cyclomatic 17) vm-ranker/dpp.rs:223— crate::vm-ranker::dpp::greedy_dpp 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.
crate::abuse-enforcement-service::service-lib::src::action_control::harsher_because (cyclomatic 16) abuse-enforcement-service/service-lib/src/action_control.rs:767— crate::abuse-enforcement-service::service-lib::src::action_control::harsher_because 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.
crate::abuse-enforcement-service::service-lib::src::action_control::levels::row_problem (cyclomatic 16) abuse-enforcement-service/service-lib/src/action_control/levels.rs:615— crate::abuse-enforcement-service::service-lib::src::action_control::levels::row_problem 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.
crate::thunder::kafka::tweet_events_listener::process_message_batch (cyclomatic 16) thunder/kafka/tweet_events_listener.rs:189— crate::thunder::kafka::tweet_events_listener::process_message_batch has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1325— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1325-1329 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1333-1337 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1371-1375 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1380-1384 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1415-1419 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1423-1427 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1325` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1495— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1495-1499 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1501-1505 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1508-1513 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1606-1610 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1612-1616 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1619-1624 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1495` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2105— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2105-2109 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2113-2117 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2149-2153 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2158-2162 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2191-2195 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2199-2203 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2269— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2269-2273 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2275-2279 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2282-2287 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2376-2380 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2382-2386 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2389-2394 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2269` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2996— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2996-3000 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3004-3008 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3034-3038 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3043-3047 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3071-3075 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3079-3083 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2996` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3999— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3999-4003 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4007-4011 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4030-4034 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4039-4043 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4061-4065 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4069-4073 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3999` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4029` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3998` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5240— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5240-5244 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5249-5253 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5273-5277 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5283-5287 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5306-5310 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5315-5319 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5240` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5272` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5239` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5581— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5581-5585 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5695-5699 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5803-5807 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5944-5948 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6068-6072 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6238-6242 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5581` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6567— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6567-6571 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6577-6581 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6602-6606 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6613-6617 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6637-6641 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6647-6651 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6567` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6601` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6566` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6931— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6931-6935 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7053-7057 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7168-7172 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7319-7323 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7451-7455 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7633-7637 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6931` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7992— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7992-7996 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8003-8007 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8029-8033 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8041-8045 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8066-8070 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8077-8081 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7992` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8028` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7991` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8381— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8381-8385 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8511-8515 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8634-8638 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8795-8799 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8936-8940 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9130-9134 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8381` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10094— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10094-10098 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10109-10113 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10139-10143 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10155-10159 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10184-10188 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10199-10203 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10094` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10138` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10093` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11802— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11802-11806 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11814-11818 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11841-11845 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11854-11858 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11880-11884 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11892-11896 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11802` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11840` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11801` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11987— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11987-11991 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12001-12005 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12030-12034 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12045-12049 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12073-12077 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12087-12091 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11987` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12029` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11986` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 6) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberAddRequestResult.java:34— botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberAddRequestResult.java:34-39 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberRemoveRequestResult.java:34-39 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListRemoveRequestResult.java:34-39 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListSubscribeRequestResult.java:34-39 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListUnsubscribeRequestResult.java:34-39 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListUpdateRequestResult.java:38-42 — 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 6 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberAddRequestResult.java:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListUpdateRequestResult.java:43` calls `putValue`, `getResult`, `getList_id` and `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberAddRequestResult.java:39` 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.
Swallowed exception (caught, then discarded) under-the-hood/scalding/GizmoduckLabelDiff.scala:21— `case NonFatal(_)` 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) simclusters/simclustersann/controllers/GetTweetCandidatesGrpcController.scala:39— `case _: 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) phoenix/xrex/utils/launch_env.py:41— `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) phoenix/xrex/utils/launch_env.py:54— `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) phoenix/xrex/pallas/ranker_attention_varlen.py:1362— `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) phoenix/xrex/pallas/ranker_attention_varlen.py:1370— `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) REDACTED:308— `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) REDACTED:593— `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) phoenix/xrex/inference/model_runner.py:210— `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) phoenix/xrex/inference/model_runner.py:3212— `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) phoenix/xrex/inference/model_runner.py:3284— `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) phoenix/xrex/data/recsys/history_id_lists.py:387— `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) phoenix/xrex/cutedsl/quack/cute_dsl_elf_fix.py:56— `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) phoenix/xrex/cutedsl/quack/cute_dsl_mlir_threading.py:31— `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) grox/flows/reply_spam/classifier_coordinated_spam.py:192— `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) grox/flows/reply_spam/classifier_multi_step_reply_spam.py:196— `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.
Duplicated block (13 lines × 3) home-mixer/clients/prompts_client.rs:108— home-mixer/clients/prompts_client.rs:108-120 | home-mixer/clients/simclusters_ann_client.rs:111-123 | home-mixer/clients/who_to_follow_client.rs:105-117 — before extracting anything, compare `home-mixer/clients/prompts_client.rs` and `home-mixer/clients/simclusters_ann_client.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) phoenix-rankall/src/processor/gen/hydra.rs:215— phoenix-rankall/src/processor/gen/hydra.rs:215-227 | phoenix-rankall/src/processor/gen/scored_candidate.rs:94-106 | phoenix-rankall/src/processor/gen/scored_candidate.rs:333-345 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix-rankall/src/processor/gen/scored_candidate.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:466— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:466-478 | thunder/schema/user.rs:13031-13043 | thunder/schema/user.rs:14029-14041 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) thunder/schema/events.rs:2135— thunder/schema/events.rs:2135-2147 | thunder/schema/events.rs:2321-2333 | thunder/schema/events.rs:2414-2426 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) thunder/schema/media_common.rs:412— thunder/schema/media_common.rs:412-424 | thunder/schema/tweet.rs:1776-1788 | thunder/schema/user.rs:11248-11260 — before extracting anything, compare `thunder/schema/media_common.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 235 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) thunder/schema/tweet.rs:2806— thunder/schema/tweet.rs:2806-2818 | thunder/schema/tweet_events.rs:693-705 | thunder/schema/tweet_events.rs:1242-1254 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) thunder/schema/tweet.rs:3024— thunder/schema/tweet.rs:3024-3036 | thunder/schema/tweet_events.rs:310-322 | thunder/schema/user.rs:9203-9215 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) thunder/schema/user.rs:3957— thunder/schema/user.rs:3957-3969 | thunder/schema/user.rs:4136-4148 | thunder/schema/user.rs:7977-7989 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) thunder/schema/user.rs:6169— thunder/schema/user.rs:6169-6181 | thunder/schema/user.rs:7009-7021 | thunder/schema/user.rs:12576-12588 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) thunder/schema/user.rs:6180— thunder/schema/user.rs:6180-6192 | thunder/schema/user.rs:6200-6212 | thunder/schema/user.rs:9179-9191 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) thunder/schema/user.rs:6236— thunder/schema/user.rs:6236-6248 | thunder/schema/user.rs:11706-11718 | thunder/schema/user.rs:12736-12748 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) thunder/schema/user.rs:7012— thunder/schema/user.rs:7012-7024 | thunder/schema/user.rs:12579-12591 | thunder/schema/user.rs:14021-14033 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala:72— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala:72-84 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala:71-83 | simclusters/simclusters_v2/summingbird/storm/TwhinTweetJob.scala:62-74 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala:72` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 3) simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala:66— simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala:66-78 | simclusters/simclusters_v2/summingbird/storm/TwhinTweetJob.scala:57-69 | simclusters/simclusters_v2/summingbird/storm/TwhinTweetJob.scala:99-111 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinTweetJob.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala:66` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 3) grox/flows/reply_spam/task_filter.py:122— grox/flows/reply_spam/task_filter.py:122-134 | grox/flows/reply_spam/task_filter.py:199-211 | grox/flows/reply_spam/task_multi_step_reply_spam.py:55-67 — before extracting anything, compare `grox/flows/reply_spam/task_filter.py` and `grox/flows/reply_spam/task_multi_step_reply_spam.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `grox/flows/reply_spam/task_filter.py:122` it begins part-way through the construct above it, so those 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 × 4) phoenix-rankall/src/processor/gen/scored_candidate.rs:257— phoenix-rankall/src/processor/gen/scored_candidate.rs:257-262 | thunder/schema/tweet.rs:1196-1201 | thunder/schema/user.rs:4504-4509 | thunder/schema/user.rs:4654-4659 — before extracting anything, compare `phoenix-rankall/src/processor/gen/scored_candidate.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) thunder/schema/tweet.rs:1265— thunder/schema/tweet.rs:1265-1270 | thunder/schema/tweet.rs:1532-1537 | thunder/schema/user.rs:11958-11963 | thunder/schema/user.rs:12038-12043 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2537— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2537-2542 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2544-2549 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2552-2558 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2562-2568 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2537` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2545— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2545-2550 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2554-2559 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2564-2569 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2575-2580 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2545` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3398— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3398-3403 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3407-3412 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3417-3422 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3428-3433 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3398` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4311— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4311-4316 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4320-4325 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4417-4422 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4426-4431 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4311` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4356— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4356-4361 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4365-4370 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4375-4380 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4386-4391 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4356` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5574— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5574-5579 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5584-5589 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5688-5693 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5698-5703 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5574` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5622— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5622-5627 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5632-5637 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5643-5648 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5655-5660 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5622` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6923— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6923-6928 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6934-6939 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7045-7050 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7056-7061 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6923` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6974— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6974-6979 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6985-6990 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6997-7002 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7010-7015 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6974` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8372— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8372-8377 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8384-8389 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8502-8507 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8514-8519 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8372` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8426— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8426-8431 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8438-8443 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8451-8456 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8465-8470 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8426` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) phoenix/xrex/models/recsys_feature_prep.py:826— phoenix/xrex/models/recsys_feature_prep.py:826-831 | phoenix/xrex/models/recsys_model.py:1549-1554 | phoenix/xrex/models/recsys_model.py:1716-1721 | phoenix/xrex/models/recsys_model.py:3075-3080 — 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 `phoenix/xrex/models/recsys_feature_prep.py:826` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) phoenix/xrex/pallas/ranker_attention_v2.py:708— phoenix/xrex/pallas/ranker_attention_v2.py:708-713 | phoenix/xrex/pallas/ranker_attention_v2.py:836-841 | phoenix/xrex/pallas/ranker_attention_varlen.py:805-810 | phoenix/xrex/pallas/ranker_attention_varlen.py:978-983 — before extracting anything, compare `phoenix/xrex/pallas/ranker_attention_v2.py` and `phoenix/xrex/pallas/ranker_attention_varlen.py` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 287 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `phoenix/xrex/pallas/ranker_attention_varlen.py:977` calls `logical_and` and `phoenix/xrex/pallas/ranker_attention_v2.py:835` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2) home-mixer/ads/partition_organic_blender.rs:52— home-mixer/ads/partition_organic_blender.rs:52-69 | home-mixer/ads/time_gap_blender.rs:70-87 — before extracting anything, compare `home-mixer/ads/partition_organic_blender.rs` and `home-mixer/ads/time_gap_blender.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) thunder/schema/user.rs:11959— thunder/schema/user.rs:11959-11976 | thunder/schema/user.rs:12039-12056 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:340— botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:340-357 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:106-123 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:340` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `ManhattanClientConfig` in one and `MemCachedClientConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (18 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:490— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:490-507 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:567-584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:490` it begins part-way through the construct above it, so those exact lines 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) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1488— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1488-1505 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1599-1616 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1488` it does not close everything it opens, so those exact lines 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) botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:949— botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:949-966 | botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:998-1015 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) grox/core/data_loaders/data_types.py:836— grox/core/data_loaders/data_types.py:836-853 | grox/core/data_loaders/post_mapper.py:153-170 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `post_metadata` to `t.PostMetadataV2` in one and `StratoPostMetadata` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (18 lines × 2) grox/libs/blobstore_http/cdn_downloader.py:29— grox/libs/blobstore_http/cdn_downloader.py:29-46 | grox/libs/blobstore_http/cdn_downloader.py:53-70 — both copies are in the same file, so extract the 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 (18 lines × 2) phoenix/xrex/configs/data_feeds.py:129— phoenix/xrex/configs/data_feeds.py:129-146 | phoenix/xrex/configs/data_feeds.py:160-177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) phoenix/xrex/data/streaming/kafkaconsumer.py:1333— phoenix/xrex/data/streaming/kafkaconsumer.py:1333-1350 | phoenix/xrex/data/streaming/kafkaconsumer.py:1845-1862 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) phoenix/xrex/inference/model_runner.py:5008— phoenix/xrex/inference/model_runner.py:5008-5025 | phoenix/xrex/inference/sid_retrieval_runner.py:194-211 — before extracting anything, compare `phoenix/xrex/inference/model_runner.py` and `phoenix/xrex/inference/sid_retrieval_runner.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/inference/model_runner.py:5008` it begins part-way through the construct above it, so those exact lines 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) phoenix/xrex/pallas/ranker_attention_fa3.py:347— phoenix/xrex/pallas/ranker_attention_fa3.py:347-364 | phoenix/xrex/pallas/ranker_attention_fa3.py:1507-1524 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) phoenix/xrex/pallas/ranker_attention_varlen.py:1941— phoenix/xrex/pallas/ranker_attention_varlen.py:1941-1958 | phoenix/xrex/pallas/ranker_attention_varlen.py:1980-1997 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_varlen.py:1941` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) home-mixer/ads/multi_risk_blender.rs:215— home-mixer/ads/multi_risk_blender.rs:215-221 | home-mixer/ads/partition_organic_blender.rs:150-156 | home-mixer/ads/time_gap_blender.rs:157-163 — before extracting anything, compare `home-mixer/ads/multi_risk_blender.rs` and `home-mixer/ads/partition_organic_blender.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) phoenix-rankall/src/processor/gen/hydra.rs:401— phoenix-rankall/src/processor/gen/hydra.rs:401-407 | phoenix-rankall/src/processor/gen/hydra.rs:410-416 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:831-837 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:804— phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:804-810 | phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:999-1005 | phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:1015-1021 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs` and `phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) thunder/schema/tweet.rs:1205— thunder/schema/tweet.rs:1205-1211 | thunder/schema/tweet.rs:1536-1542 | thunder/schema/user.rs:11741-11747 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:1570— thunder/schema/tweet.rs:1570-1576 | thunder/schema/user.rs:6686-6692 | thunder/schema/user.rs:12874-12880 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:5455— thunder/schema/tweet.rs:5455-5461 | thunder/schema/tweet_events.rs:234-240 | thunder/schema/tweet_events.rs:495-501 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/user.rs:8145— thunder/schema/user.rs:8145-8151 | thunder/schema/user.rs:12324-12330 | thunder/schema/user.rs:12333-12339 — 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) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4582— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4582-4588 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4592-4598 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4603-4609 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4582` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5865— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5865-5871 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5876-5882 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5888-5894 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5865` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7234— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7234-7240 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7246-7252 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7259-7265 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7234` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8704— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8704-8710 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8717-8723 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8731-8737 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8704` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:124— botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:124-130 | botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:150-156 | botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:184-190 — 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) phoenix/xrex/inference/gen_recs_runner.py:179— phoenix/xrex/inference/gen_recs_runner.py:179-185 | phoenix/xrex/inference/model_runner.py:5007-5013 | phoenix/xrex/inference/sid_retrieval_runner.py:193-199 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (6 lines × 6) thunder/schema/events.rs:1853— thunder/schema/events.rs:1853-1858 | thunder/schema/events.rs:1935-1940 | thunder/schema/events.rs:2018-2023 | thunder/schema/tweet_events.rs:210-215 | thunder/schema/tweet_events.rs:341-346 | thunder/schema/tweet_events.rs:471-476 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 6) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:823— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:823-828 | thunder/schema/tweet.rs:953-958 | thunder/schema/tweet_events.rs:568-573 | thunder/schema/tweet_events.rs:716-721 | thunder/schema/tweet_events.rs:970-975 | thunder/schema/tweet_events.rs:1067-1072 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 293 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4518— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4518-4523 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4527-4532 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4537-4542 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4649-4654 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4658-4663 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4668-4673 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4518` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4835— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4835-4840 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4844-4849 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4854-4859 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4865-4870 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4877-4882 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4890-4895 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4835` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5796— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5796-5801 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5806-5811 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5817-5822 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5937-5942 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5947-5952 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5958-5963 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5796` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6136— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6136-6141 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6146-6151 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6157-6162 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6169-6174 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6182-6187 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6196-6201 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6136` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7160— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7160-7165 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7171-7176 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7183-7188 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7311-7316 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7322-7327 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7334-7339 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7160` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7523— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7523-7528 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7534-7539 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7546-7551 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7559-7564 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7573-7578 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7588-7593 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7523` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8625— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8625-8630 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8637-8642 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8650-8655 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8786-8791 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8798-8803 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8811-8816 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8625` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9012— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9012-9017 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9024-9029 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9037-9042 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9051-9056 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9066-9071 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9082-9087 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9012` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10653— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10653-10658 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10660-10665 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10668-10674 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10678-10684 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10689-10695 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10701-10707 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10653` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10661— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10661-10666 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10670-10675 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10680-10685 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10691-10696 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10703-10708 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10716-10721 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10661` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 5) thunder/schema/events.rs:2119— thunder/schema/events.rs:2119-2124 | thunder/schema/events.rs:2217-2222 | thunder/schema/events.rs:2310-2315 | thunder/schema/events.rs:2403-2408 | thunder/schema/events.rs:2496-2501 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 5) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3028— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3028-3033 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3193-3198 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3393-3398 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3631-3636 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12423-12428 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3028` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 5) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3636— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3636-3641 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3645-3650 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3655-3660 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3666-3671 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3678-3683 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3636` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 5) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4575— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4575-4580 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4584-4589 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4594-4599 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4605-4610 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4617-4622 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4575` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 5) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5857— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5857-5862 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5867-5872 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5878-5883 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5890-5895 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5903-5908 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5857` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 5) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7225— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7225-7230 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7236-7241 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7248-7253 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7261-7266 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7275-7280 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7225` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 5) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7583— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7583-7588 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8743-8748 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9482-9487 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9882-9887 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12507-12512 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7583` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 5) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8694— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8694-8699 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8706-8711 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8719-8724 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8733-8738 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8748-8753 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8694` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 5) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10357— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10357-10362 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10364-10369 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10372-10378 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10382-10388 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10393-10399 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10357` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 5) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10365— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10365-10370 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10374-10379 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10384-10389 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10395-10400 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10407-10412 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10365` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 5) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberAddRequestResult.java:25— botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberAddRequestResult.java:25-30 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberRemoveRequestResult.java:25-30 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListRemoveRequestResult.java:25-30 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListSubscribeRequestResult.java:25-30 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListUnsubscribeRequestResult.java:25-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 all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberAddRequestResult.java:25` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `requestResult` to `ListAddMemberRequestResult` in one and `ListRemoveMemberRequestResult` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 5) phoenix/xrex/models/recsys_model.py:1551— phoenix/xrex/models/recsys_model.py:1551-1556 | phoenix/xrex/models/recsys_model.py:1949-1957 | phoenix/xrex/models/recsys_model.py:1964-1971 | phoenix/xrex/models/recsys_model.py:3077-3082 | phoenix/xrex/models/recsys_model.py:3098-3103 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/models/recsys_model.py:1551` it begins part-way through the construct above it, so those 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.
TooManyMethods: RecsysTrainer phoenix/xrex/train/trainer_recsys.py:437— TooManyMethods — 90 methods. The bar is 30 methods; this is 60 over it, 3.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BaseModelRunner phoenix/xrex/inference/model_runner.py:507— TooManyMethods — 74 methods. The bar is 30 methods; this is 44 over it, 2.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: Store visibility-filtering/hydration/store.rs:94— TooManyMethods — 67 methods, declared across 5 files: hydration/store.rs (40), store/resolve.rs (11), store/quotes.rs (9), store/key_origin.rs (4), +1 more file(s). The bar is 30 methods; this is 37 over it, 2.23× 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: Compiler botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:79— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 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.
TooManyMethods: Type botmaker/src/java/com/twitter/botmaker/compiler/types/Type.java:37— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 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.
TooManyMethods: ActionControl abuse-enforcement-service/service-lib/src/action_control.rs:712— TooManyMethods — 53 methods, declared across 2 files: src/action_control.rs (47), action_control/levels.rs (6). The bar is 30 methods; this is 23 over it, 1.77× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TBotMakerMapProtocol botmaker/src/java/com/twitter/botmaker/compiler/types/ThriftStructType.java:383— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TFingerprintProtocol botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1666— 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: Trainer phoenix/xrex/train/trainer.py:163— 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: CompilerContext botmaker/src/java/com/twitter/botmaker/compiler/CompilerContext.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: ASTNode botmaker/src/java/com/twitter/botmaker/ASTNode.java:25— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFields: PostCandidate home-mixer/models/candidate.rs:14— TooManyFields — 84 stored fields. The bar is 30 stored fields; this is 54 over it, 2.80× 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: ScoredPostsQuery home-mixer/models/query.rs:45— TooManyFields — 73 stored fields beside 4 methods. The bar is 30 stored fields; this is 43 over it, 2.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: Account thunder/schema/user.rs:5905— TooManyFields — 68 stored fields beside 1 method. The bar is 30 stored fields; this is 38 over it, 2.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Safety thunder/schema/user.rs:8890— TooManyFields — 54 stored fields beside 1 method. The bar is 30 stored fields; this is 24 over it, 1.80× 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: InputBuffer phoenix/crates/common/xai-recsys/src/util.rs:433— TooManyFields — 47 stored fields beside 13 methods. The bar is 30 stored fields; this is 17 over it, 1.57× 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: Args home-mixer/main.rs:16— TooManyFields — 47 stored fields. The bar is 30 stored fields; this is 17 over it, 1.57× 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: RankingBatchPrep phoenix/crates/serving/xai-recsys-engine/src/python.rs:1394— TooManyFields — 44 stored fields beside 1 method. The bar is 30 stored fields; this is 14 over it, 1.47× 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: User thunder/schema/user.rs:14179— TooManyFields — 41 stored fields beside 1 method. The bar is 30 stored fields; this is 11 over it, 1.37× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ValueModelWeights xai-value-model/weights.rs:7— TooManyFields — 39 stored fields beside 8 methods. The bar is 30 stored fields; this is 9 over it, 1.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: UserArrowFeatures bdsm/rust/abuse-v3-features/src/lib.rs:197— TooManyFields — 37 stored fields. The bar is 30 stored fields; this is 7 over it, 1.23× 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: Store visibility-filtering/hydration/store.rs:94— TooManyFields — 33 stored fields beside 67 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
Duplicated block (11 lines × 4) home-mixer/server.rs:375— home-mixer/server.rs:375-385 | home-mixer/server.rs:474-484 | home-mixer/server.rs:537-547 | home-mixer/server.rs:640-650 — 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 (11 lines × 4) phoenix-rankall/src/processor/gen/hydra.rs:217— phoenix-rankall/src/processor/gen/hydra.rs:217-227 | phoenix-rankall/src/processor/gen/scored_candidate.rs:96-106 | phoenix-rankall/src/processor/gen/scored_candidate.rs:112-122 | phoenix-rankall/src/processor/gen/scored_candidate.rs:331-341 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix-rankall/src/processor/gen/scored_candidate.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:465— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:465-475 | thunder/schema/user.rs:6175-6185 | thunder/schema/user.rs:13030-13040 | thunder/schema/user.rs:14028-14038 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) thunder/schema/tweet.rs:3532— thunder/schema/tweet.rs:3532-3542 | thunder/schema/tweet.rs:3936-3946 | thunder/schema/tweet_events.rs:1520-1530 | thunder/schema/tweet_media.rs:688-698 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:3945— thunder/schema/tweet.rs:3945-3955 | thunder/schema/user.rs:13010-13020 | thunder/schema/user.rs:13912-13922 | thunder/schema/user.rs:14024-14034 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/user.rs:6171— thunder/schema/user.rs:6171-6181 | thunder/schema/user.rs:7011-7021 | thunder/schema/user.rs:12578-12588 | thunder/schema/user.rs:14020-14030 — 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 (11 lines × 4) thunder/schema/user.rs:6195— thunder/schema/user.rs:6195-6205 | thunder/schema/user.rs:6235-6245 | thunder/schema/user.rs:11705-11715 | thunder/schema/user.rs:12735-12745 — 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 (11 lines × 4) botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:62— botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:62-72 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:63-73 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:118-128 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:171-181 — before extracting anything, compare `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala` and `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:62` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `MemCachedClientConfig` in one and `MemCachedCounterConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 4) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:78— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:78-88 | simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:137-147 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala:77-87 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala:135-145 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) grox/flows/reply_spam/classifier_coordinated_spam.py:141— grox/flows/reply_spam/classifier_coordinated_spam.py:141-151 | grox/flows/reply_spam/classifier_multi_step_reply_spam.py:145-155 | grox/flows/reply_spam/classifier_reply_ranking.py:97-107 | grox/flows/reply_spam/classifier_simple_reply_scorer.py:75-85 — before extracting anything, compare `grox/flows/reply_spam/classifier_coordinated_spam.py` and `grox/flows/reply_spam/classifier_multi_step_reply_spam.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 4) phoenix/xrex/inference/gen_recs_runner.py:108— phoenix/xrex/inference/gen_recs_runner.py:108-118 | phoenix/xrex/inference/model_runner.py:4444-4454 | phoenix/xrex/inference/model_runner.py:5532-5542 | phoenix/xrex/inference/sid_retrieval_runner.py:123-133 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/inference/gen_recs_runner.py:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1165— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1165-1183 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1236-1254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1165` it does not close everything it opens, so those exact lines 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) botmaker/src/scala/com/twitter/botmaker/rule/RuleEvaluator.scala:138— botmaker/src/scala/com/twitter/botmaker/rule/RuleEvaluator.scala:138-156 | botmaker/src/scala/com/twitter/botmaker/rule/RuleEvaluator.scala:183-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. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/rule/RuleEvaluator.scala:138` it does not close everything it opens, so those exact lines 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) botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:186— botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:186-204 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:148-166 — before extracting anything, compare `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala` and `botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `LocalCounterConfig` in one and `LocalStoreConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (19 lines × 2) botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:373— botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:373-391 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:294-312 — before extracting anything, compare `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala` and `botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:373` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `LocalCounterConfig` in one and `LocalStoreConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (19 lines × 2) botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:414— botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:414-432 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:334-352 — before extracting anything, compare `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala` and `botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:414` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `LocalCounterConfig` in one and `LocalStoreConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (19 lines × 2) grox/flows/mm_emb/renderer_v82.py:247— grox/flows/mm_emb/renderer_v82.py:247-265 | grox/flows/mm_emb/renderer_v8_search.py:292-310 — before extracting anything, compare `grox/flows/mm_emb/renderer_v82.py` and `grox/flows/mm_emb/renderer_v8_search.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) phoenix/xrex/configs/xrecsys.py:98— phoenix/xrex/configs/xrecsys.py:98-116 | phoenix/xrex/configs/xrecsys_two_tower.py:85-103 — before extracting anything, compare `phoenix/xrex/configs/xrecsys.py` and `phoenix/xrex/configs/xrecsys_two_tower.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/configs/xrecsys.py:98` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) phoenix/xrex/data/recsys/recsys_batch.py:1953— phoenix/xrex/data/recsys/recsys_batch.py:1953-1971 | phoenix/xrex/data/recsys/recsys_batch.py:2213-2231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/data/recsys/recsys_batch.py:1953` it begins part-way through the construct above it, so those exact lines 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) phoenix/xrex/pallas/ranker_attention_fa3.py:309— phoenix/xrex/pallas/ranker_attention_fa3.py:309-327 | phoenix/xrex/pallas/ranker_attention_fa3.py:1469-1487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_fa3.py:309` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) phoenix/xrex/pallas/ranker_attention_varlen.py:1553— phoenix/xrex/pallas/ranker_attention_varlen.py:1553-1571 | phoenix/xrex/pallas/ranker_attention_varlen.py:1707-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 (19 lines × 2) phoenix/xrex/train/trainer_recsys.py:787— phoenix/xrex/train/trainer_recsys.py:787-805 | phoenix/xrex/train/trainer_recsys.py:3057-3075 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) abuse-enforcement-service/service-lib/src/service.rs:1507— abuse-enforcement-service/service-lib/src/service.rs:1507-1529 | abuse-enforcement-service/service-lib/src/service.rs:1954-1976 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) phoenix/crates/common/xai-recsys/src/util.rs:887— phoenix/crates/common/xai-recsys/src/util.rs:887-909 | phoenix/crates/common/xai-recsys/src/util.rs:1230-1252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) phoenix/crates/common/xai-recsys/src/util.rs:1113— phoenix/crates/common/xai-recsys/src/util.rs:1113-1135 | phoenix/crates/common/xai-recsys/src/util.rs:1574-1596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:196— botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:196-218 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:383-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. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:196` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (23 lines × 2) botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:239— botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:239-261 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:424-446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:239` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (23 lines × 2) botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:158— botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:158-180 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:304-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:158` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (23 lines × 2) botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:201— botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:201-223 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:344-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:201` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (23 lines × 2) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:164— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:164-186 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala:164-186 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala:60— simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala:60-82 | simclusters/simclusters_v2/summingbird/storm/TwhinTweetJob.scala:51-73 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinTweetJob.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala:60` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) botmaker/src/java/com/twitter/botmaker/function/DerivedFeatureCall.java:205— botmaker/src/java/com/twitter/botmaker/function/DerivedFeatureCall.java:205-227 | botmaker/src/java/com/twitter/botmaker/function/With.java:116-138 — 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 `botmaker/src/java/com/twitter/botmaker/function/DerivedFeatureCall.java:205` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) home-mixer/candidate_hydrators/vf_candidate_hydrator.rs:112— home-mixer/candidate_hydrators/vf_candidate_hydrator.rs:112-131 | home-mixer/candidate_hydrators/vf_following_candidate_hydrator.rs:67-86 — 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) home-mixer/util/urt/feedback.rs:70— home-mixer/util/urt/feedback.rs:70-89 | home-mixer/util/urt/feedback.rs:106-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) thunder/schema/tweet.rs:1818— thunder/schema/tweet.rs:1818-1837 | thunder/schema/user.rs:11285-11304 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) thunder/schema/tweet_media.rs:615— thunder/schema/tweet_media.rs:615-634 | thunder/schema/tweet_media.rs:699-718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) thunder/schema/user.rs:13443— thunder/schema/user.rs:13443-13462 | thunder/schema/user.rs:13564-13583 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2989— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2989-3008 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3064-3083 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2989` it does not close everything it opens, so those exact lines 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) botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:271— botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:271-290 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:239-258 — before extracting anything, compare `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala` and `botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:271` it does not close everything it opens, so those exact lines 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) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:57— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:57-76 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJobRunner.scala:63-82 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJobRunner.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:57` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20 lines × 2) botmaker/src/java/com/twitter/botmaker/function/conversion/ThriftFromDict.java:63— botmaker/src/java/com/twitter/botmaker/function/conversion/ThriftFromDict.java:63-82 | botmaker/src/java/com/twitter/botmaker/function/conversion/ToThrift.java:58-77 — before extracting anything, compare `botmaker/src/java/com/twitter/botmaker/function/conversion/ThriftFromDict.java` and `botmaker/src/java/com/twitter/botmaker/function/conversion/ToThrift.java` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/java/com/twitter/botmaker/function/conversion/ThriftFromDict.java:63` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) phoenix/xrex/cuda/async_emb/async_emb.py:222— phoenix/xrex/cuda/async_emb/async_emb.py:222-241 | phoenix/xrex/cuda/row_emb/row_emb.py:218-237 — `phoenix/xrex/cuda/async_emb/async_emb.py` and `phoenix/xrex/cuda/row_emb/row_emb.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 99 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `ctx` to `AsyncEmbContextHandle` in one and `RowEmbContextHandle` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×9
Members sharing a duplicated core (4 members, 50+ identical tokens) home-mixer/clients/author_brand_safety_client.rs:47— home-mixer/clients/author_brand_safety_client.rs:47-82 | home-mixer/clients/post_v8_search_embedding_client.rs:38-52 | home-mixer/clients/recent_search_queries_store_client.rs:31-46 | home-mixer/clients/resurrection_date_client.rs:74-89 — 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) phoenix-rankall/src/store/base.rs:1088— phoenix-rankall/src/store/base.rs:1088-1108 | phoenix-rankall/src/store/base.rs:1110-1123 | phoenix-rankall/src/store/base.rs:1125-1151 | phoenix-rankall/src/store/base.rs:1153-1192 — 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) thunder/schema/events.rs:1218— thunder/schema/events.rs:1218-1228 | thunder/schema/events.rs:1272-1282 | thunder/schema/events.rs:4013-4023 | thunder/schema/tweet.rs:4062-4072 — 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) simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:46— simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:46-59 | simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:65-79 | simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:84-102 | simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:108-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.
Members sharing a duplicated core (4 members, 50+ identical tokens) botmaker/src/java/com/twitter/botmaker/compiler/Parser.java:26— botmaker/src/java/com/twitter/botmaker/compiler/Parser.java:26-55 | botmaker/src/java/com/twitter/botmaker/compiler/Parser.java:58-102 | botmaker/src/java/com/twitter/botmaker/compiler/Parser.java:122-164 | botmaker/src/java/com/twitter/botmaker/compiler/Parser.java:196-229 — 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) grox/flows/reply_spam/classifier_coordinated_spam.py:141— grox/flows/reply_spam/classifier_coordinated_spam.py:141-151 | grox/flows/reply_spam/classifier_multi_step_reply_spam.py:145-155 | grox/flows/reply_spam/classifier_reply_ranking.py:97-107 | grox/flows/reply_spam/classifier_simple_reply_scorer.py:75-85 — 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) phoenix/reference/sid_assign.py:24— phoenix/reference/sid_assign.py:24-35 | phoenix/reference/sid_codebook.py:575-592 | phoenix/reference/sid_codebook.py:603-674 | phoenix/reference/sid_io.py:187-231 — 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) phoenix/xrex/configs/xrecsys.py:143— phoenix/xrex/configs/xrecsys.py:143-184 | phoenix/xrex/configs/xrecsys_gen_recs.py:42-68 | phoenix/xrex/configs/xrecsys_two_tower.py:150-199 | phoenix/xrex/data/recsys/recsys_batch.py:2295-2375 — 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) phoenix/xrex/inference/gen_recs_runner.py:63— phoenix/xrex/inference/gen_recs_runner.py:63-164 | phoenix/xrex/inference/model_runner.py:4341-4523 | phoenix/xrex/inference/model_runner.py:5430-5608 | phoenix/xrex/inference/sid_retrieval_runner.py:74-167 — 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 (12 lines × 3) home-mixer/clients/prompts_client.rs:36— home-mixer/clients/prompts_client.rs:36-47 | home-mixer/clients/simclusters_ann_client.rs:39-50 | home-mixer/clients/who_to_follow_client.rs:38-49 — before extracting anything, compare `home-mixer/clients/prompts_client.rs` and `home-mixer/clients/simclusters_ann_client.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) home-mixer/util/urt/feedback.rs:78— home-mixer/util/urt/feedback.rs:78-89 | home-mixer/util/urt/feedback.rs:114-125 | home-mixer/util/urt/feedback.rs:190-201 — 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) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:1608— phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:1608-1619 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:1739-1750 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:1815-1826 — 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) thunder/schema/events.rs:2623— thunder/schema/events.rs:2623-2634 | thunder/schema/media_common.rs:409-420 | thunder/schema/user.rs:12236-12247 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/media_common.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) thunder/schema/tweet.rs:3532— thunder/schema/tweet.rs:3532-3543 | thunder/schema/tweet.rs:3936-3947 | thunder/schema/tweet_media.rs:688-699 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_media.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) thunder/schema/tweet.rs:3943— thunder/schema/tweet.rs:3943-3954 | thunder/schema/user.rs:13012-13023 | thunder/schema/user.rs:13914-13925 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) thunder/schema/user.rs:11746— thunder/schema/user.rs:11746-11757 | thunder/schema/user.rs:11962-11973 | thunder/schema/user.rs:12042-12053 — 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) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:933— botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:933-944 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1014-1025 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1096-1107 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 3) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:1651— phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:1651-1662 | phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:1962-1973 | phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:2345-2356 — 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 × 4) phoenix-rankall/src/processor/gen/scored_candidate.rs:191— phoenix-rankall/src/processor/gen/scored_candidate.rs:191-200 | thunder/schema/tweet_media.rs:652-661 | thunder/schema/tweet_media.rs:742-751 | thunder/schema/tweet_media.rs:819-828 — 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 (10 lines × 4) phoenix-rankall/src/processor/gen/scored_candidate.rs:314— phoenix-rankall/src/processor/gen/scored_candidate.rs:314-323 | thunder/schema/events.rs:2851-2860 | thunder/schema/user.rs:5857-5866 | thunder/schema/user.rs:11232-11241 — before extracting anything, compare `phoenix-rankall/src/processor/gen/scored_candidate.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) thunder/schema/events.rs:3073— thunder/schema/events.rs:3073-3082 | thunder/schema/events.rs:3150-3159 | thunder/schema/events.rs:3227-3236 | thunder/schema/events.rs:3304-3313 — 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 lines × 4) thunder/schema/tweet.rs:727— thunder/schema/tweet.rs:727-736 | thunder/schema/tweet.rs:1021-1030 | thunder/schema/tweet.rs:2302-2311 | thunder/schema/tweet.rs:2416-2425 — 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 lines × 4) thunder/schema/tweet.rs:957— thunder/schema/tweet.rs:957-966 | thunder/schema/tweet_events.rs:572-581 | thunder/schema/tweet_events.rs:796-805 | thunder/schema/tweet_events.rs:885-894 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3755— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3755-3764 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4688-4697 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5718-5727 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10489-10498 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3755` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4975— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4975-4984 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5980-5989 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7078-7087 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10812-10821 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4975` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6288— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6288-6297 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7358-7367 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8538-8547 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11188-11197 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6288` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) grox/core/data_loaders/asr_processor.py:268— grox/core/data_loaders/asr_processor.py:268-277 | grox/core/data_loaders/media_processor.py:109-118 | grox/core/dispatcher.py:35-44 | grox/core/engine.py:37-46 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 4) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:851— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:851-857 | thunder/schema/events.rs:1752-1758 | thunder/schema/tweet.rs:2212-2218 | thunder/schema/tweet.rs:3790-3796 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 214 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 (7 lines × 4) thunder/schema/tweet.rs:1546— thunder/schema/tweet.rs:1546-1552 | thunder/schema/tweet.rs:1831-1837 | thunder/schema/tweet.rs:2751-2757 | thunder/schema/user.rs:10839-10845 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 4) thunder/schema/tweet.rs:2830— thunder/schema/tweet.rs:2830-2836 | thunder/schema/tweet_events.rs:729-735 | thunder/schema/tweet_events.rs:1290-1296 | thunder/schema/tweet_events.rs:1632-1638 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 4) thunder/schema/user.rs:4178— thunder/schema/user.rs:4178-4184 | thunder/schema/user.rs:8019-8025 | thunder/schema/user.rs:8559-8565 | thunder/schema/user.rs:14549-14555 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) thunder/schema/user.rs:8554— thunder/schema/user.rs:8554-8560 | thunder/schema/user.rs:12315-12321 | thunder/schema/user.rs:13689-13695 | thunder/schema/user.rs:14544-14550 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4842— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4842-4848 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4852-4858 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4863-4869 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4875-4881 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4842` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6144— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6144-6150 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6155-6161 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6167-6173 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6180-6186 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6144` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7532— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7532-7538 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7544-7550 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7557-7563 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7571-7577 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7532` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9022— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9022-9028 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9035-9041 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9049-9055 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9064-9070 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9022` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 8) thunder/schema/tweet.rs:5437— thunder/schema/tweet.rs:5437-5442 | thunder/schema/user.rs:3311-3316 | thunder/schema/user.rs:10665-10670 | thunder/schema/user.rs:10830-10835 | thunder/schema/user.rs:11737-11742 | thunder/schema/user.rs:12296-12301 | thunder/schema/user.rs:13685-13690 | thunder/schema/user.rs:14540-14545 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4765— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4765-4770 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4774-4779 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4784-4789 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4795-4800 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4923-4928 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4932-4937 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4942-4947 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4953-4958 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4765` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6061— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6061-6066 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6071-6076 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6082-6087 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6094-6099 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6231-6236 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6241-6246 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6252-6257 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6264-6269 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6061` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7443— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7443-7448 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7454-7459 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7466-7471 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7479-7484 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7625-7630 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7636-7641 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7648-7653 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7661-7666 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7443` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8927— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8927-8932 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8939-8944 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8952-8957 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8966-8971 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9121-9126 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9133-9138 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9146-9151 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9160-9165 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8927` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9395— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9395-9400 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9402-9407 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9410-9416 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9420-9426 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9431-9437 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9443-9449 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9456-9462 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9470-9476 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9395` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9403— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9403-9408 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9412-9417 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9422-9427 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9433-9438 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9445-9450 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9458-9463 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9472-9477 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9487-9492 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9403` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9803— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9803-9808 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9812-9817 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9822-9827 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9833-9838 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9845-9850 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9858-9863 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9872-9877 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9887-9892 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9803` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12428— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12428-12433 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12437-12442 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12447-12452 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12458-12463 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12470-12475 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12483-12488 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12497-12502 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12512-12517 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12428` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28 lines × 2) home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:662— home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:662-689 | home-mixer/candidate_pipeline/phoenix_scores_pipeline.rs:232-259 — before extracting anything, compare `home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/phoenix_scores_pipeline.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (28 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1171— phoenix/crates/serving/xai-recsys-engine/src/python.rs:1171-1198 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:2960-2987 — both copies are in the same file, so extract the block into 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) thunder/schema/user.rs:11919— thunder/schema/user.rs:11919-11946 | thunder/schema/user.rs:11999-12026 — both copies are in the same file, so extract the block into 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) botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:365— botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:365-392 | botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:421-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:365` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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, `botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:449` calls `get` and `botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:394` 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 (28 lines × 2) botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:114— botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:114-141 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:219-246 — before extracting anything, compare `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala` and `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:114` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (28 lines × 2) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:127— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:127-154 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala:125-152 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:127` 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 (28 lines × 2) botmaker/src/java/com/twitter/botmaker/compiler/BotMakerDoc.java:77— botmaker/src/java/com/twitter/botmaker/compiler/BotMakerDoc.java:77-104 | botmaker/src/java/com/twitter/botmaker/compiler/BotMakerDoc.java:128-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 `botmaker/src/java/com/twitter/botmaker/compiler/BotMakerDoc.java:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (28 lines × 2) phoenix/xrex/cuda/async_emb/async_emb.py:104— phoenix/xrex/cuda/async_emb/async_emb.py:104-131 | phoenix/xrex/cuda/row_emb/row_emb.py:105-132 — `phoenix/xrex/cuda/async_emb/async_emb.py` and `phoenix/xrex/cuda/row_emb/row_emb.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 99 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 (17 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:1432— phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:1432-1448 | phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:1206-1222 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs` and `phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) thunder/schema/media_entity.rs:88— thunder/schema/media_entity.rs:88-104 | thunder/schema/user.rs:3225-3241 — before extracting anything, compare `thunder/schema/media_entity.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) thunder/schema/tweet.rs:3663— thunder/schema/tweet.rs:3663-3679 | thunder/schema/tweet.rs:3800-3816 — both copies are in the same file, so extract the block into 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) botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:284— botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:284-300 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:164-180 — before extracting anything, compare `botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala` and `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:284` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1953— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1953-1969 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2020-2036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1953` it does not close everything it opens, so those exact lines 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) grox/flows/reply_spam/classifier_coordinated_spam.py:155— grox/flows/reply_spam/classifier_coordinated_spam.py:155-171 | grox/flows/reply_spam/classifier_multi_step_reply_spam.py:159-175 — before extracting anything, compare `grox/flows/reply_spam/classifier_coordinated_spam.py` and `grox/flows/reply_spam/classifier_multi_step_reply_spam.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (17 lines × 2) phoenix/xrex/eval/recsys_eval.py:464— phoenix/xrex/eval/recsys_eval.py:464-480 | phoenix/xrex/eval/recsys_eval.py:483-499 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/eval/recsys_eval.py:464` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) phoenix/xrex/pallas/attention.py:151— phoenix/xrex/pallas/attention.py:151-167 | phoenix/xrex/pallas/attention.py:230-246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/attention.py:151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) home-mixer/clients/author_brand_safety_client.rs:61— home-mixer/clients/author_brand_safety_client.rs:61-69 | home-mixer/clients/post_v8_search_embedding_client.rs:39-47 | home-mixer/clients/recent_search_queries_store_client.rs:32-40 | home-mixer/clients/resurrection_date_client.rs:75-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (9 lines × 4) thunder/schema/events.rs:774— thunder/schema/events.rs:774-782 | thunder/schema/events.rs:971-979 | thunder/schema/events.rs:3678-3686 | thunder/schema/events.rs:3849-3857 — 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) thunder/schema/events.rs:1220— thunder/schema/events.rs:1220-1228 | thunder/schema/events.rs:1274-1282 | thunder/schema/events.rs:4015-4023 | thunder/schema/tweet.rs:4064-4072 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) thunder/schema/events.rs:2073— thunder/schema/events.rs:2073-2081 | thunder/schema/events.rs:2269-2277 | thunder/schema/events.rs:2362-2370 | thunder/schema/tweet.rs:1062-1070 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) thunder/schema/tweet.rs:3531— thunder/schema/tweet.rs:3531-3539 | thunder/schema/user.rs:4618-4626 | thunder/schema/user.rs:12560-12568 | thunder/schema/user.rs:13894-13902 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) thunder/schema/events.rs:1789— thunder/schema/events.rs:1789-1797 | thunder/schema/events.rs:2055-2063 | thunder/schema/tweet_events.rs:277-285 | thunder/schema/tweet_events.rs:1197-1205 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) phoenix/xrex/configs/xrecsys.py:171— phoenix/xrex/configs/xrecsys.py:171-179 | phoenix/xrex/configs/xrecsys_gen_recs.py:58-66 | phoenix/xrex/configs/xrecsys_two_tower.py:186-194 | phoenix/xrex/data/recsys/recsys_batch.py:2337-2345 — before extracting anything, compare `phoenix/xrex/configs/xrecsys.py` and `phoenix/xrex/configs/xrecsys_two_tower.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `phoenix/xrex/configs/xrecsys_two_tower.py:183` calls `get` and `phoenix/xrex/configs/xrecsys.py:168` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 4) phoenix/xrex/pallas/ranker_attention_v2.py:722— phoenix/xrex/pallas/ranker_attention_v2.py:722-731 | phoenix/xrex/pallas/ranker_attention_v2.py:852-860 | phoenix/xrex/pallas/ranker_attention_varlen.py:817-826 | phoenix/xrex/pallas/ranker_attention_varlen.py:993-1001 — before extracting anything, compare `phoenix/xrex/pallas/ranker_attention_v2.py` and `phoenix/xrex/pallas/ranker_attention_varlen.py` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 287 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `phoenix/xrex/pallas/ranker_attention_v2.py:849` calls `load`, `ds` and `phoenix/xrex/pallas/ranker_attention_v2.py:717` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 4) phoenix/crates/common/xai-recsys/src/util.rs:905— phoenix/crates/common/xai-recsys/src/util.rs:905-912 | phoenix/crates/common/xai-recsys/src/util.rs:1248-1255 | phoenix/crates/serving/xai-recsys-engine/src/util.rs:51-58 | phoenix/crates/serving/xai-recsys-engine/src/util.rs:247-254 — before extracting anything, compare `phoenix/crates/common/xai-recsys/src/util.rs` and `phoenix/crates/serving/xai-recsys-engine/src/util.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 139 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) thunder/schema/events.rs:2137— thunder/schema/events.rs:2137-2144 | thunder/schema/events.rs:2323-2330 | thunder/schema/events.rs:2416-2423 | thunder/schema/events.rs:2504-2511 — 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 lines × 4) thunder/schema/tweet.rs:2312— thunder/schema/tweet.rs:2312-2319 | thunder/schema/tweet.rs:2426-2433 | thunder/schema/user.rs:4877-4884 | thunder/schema/user.rs:11300-11307 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) thunder/schema/tweet.rs:2805— thunder/schema/tweet.rs:2805-2812 | thunder/schema/tweet_events.rs:692-699 | thunder/schema/tweet_events.rs:1241-1248 | thunder/schema/tweet_events.rs:1592-1599 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) thunder/schema/user.rs:5759— thunder/schema/user.rs:5759-5766 | thunder/schema/user.rs:12314-12321 | thunder/schema/user.rs:13688-13695 | thunder/schema/user.rs:14543-14550 — 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 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3611— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3611-3618 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4557-4564 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5604-5611 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10334-10341 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3611` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4817— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4817-4824 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5839-5846 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6956-6963 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10630-10637 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4817` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6118— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6118-6125 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7207-7214 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8408-8415 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10977-10984 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6118` 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.
xai_recsys_engine::proto_parser::parse (cyclomatic 61) phoenix/crates/serving/xai-recsys-engine/src/proto_parser.rs:336— xai_recsys_engine::proto_parser::parse has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
xai_recsys_engine::storage_util::remove_old_from_storage_async (cyclomatic 35) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:897— xai_recsys_engine::storage_util::remove_old_from_storage_async has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
xai_recsys_engine::emb_table::load_tensor_into (cyclomatic 34) phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:1310— xai_recsys_engine::emb_table::load_tensor_into 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.
xai_recsys_engine::emb_table::maybe_load_fully_replicated_tensors (cyclomatic 28) phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:875— xai_recsys_engine::emb_table::maybe_load_fully_replicated_tensors 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.
xai_recsys_engine::storage_util::load_single_array (cyclomatic 27) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:1207— xai_recsys_engine::storage_util::load_single_array has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
xai_recsys_engine::storage_util::find_latest_storage_checkpoint_async (cyclomatic 23) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:617— xai_recsys_engine::storage_util::find_latest_storage_checkpoint_async 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.
xai_recsys_engine::emb_table::load_tensor_no_resharding (cyclomatic 20) phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:1095— xai_recsys_engine::emb_table::load_tensor_no_resharding 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.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×7
Members sharing a duplicated core (6 members, 50+ identical tokens) thunder/schema/events.rs:1121— thunder/schema/events.rs:1121-1134 | thunder/schema/events.rs:1155-1168 | thunder/schema/tweet.rs:2334-2347 | thunder/schema/tweet.rs:3304-3317 | thunder/schema/tweet.rs:3392-3405 | thunder/schema/tweet.rs:3489-3502 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) thunder/schema/events.rs:3332— thunder/schema/events.rs:3332-3358 | thunder/schema/events.rs:3385-3411 | thunder/schema/events.rs:3881-3907 | thunder/schema/events.rs:3934-3960 | thunder/schema/tweet.rs:3928-3984 | thunder/schema/tweet.rs:5318-5344 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) thunder/schema/events.rs:4137— thunder/schema/events.rs:4137-4464 | thunder/schema/tweet.rs:4735-4824 | thunder/schema/tweet.rs:5228-5282 | thunder/schema/tweet_events.rs:1319-1436 | thunder/schema/tweet_media.rs:841-909 | thunder/schema/user.rs:4926-5386 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) thunder/schema/tweet.rs:4206— thunder/schema/tweet.rs:4206-4226 | thunder/schema/tweet.rs:4294-4314 | thunder/schema/tweet.rs:4382-4402 | thunder/schema/tweet.rs:4470-4490 | thunder/schema/tweet.rs:4558-4578 | thunder/schema/tweet.rs:4646-4666 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) agatha/hub/agatha/job/AgathaJobTemplates.scala:118— agatha/hub/agatha/job/AgathaJobTemplates.scala:118-129 | agatha/hub/agatha/job/AgathaJobTemplates.scala:168-179 | agatha/scalding/blink/BlinkScoreJobTemplate.scala:261-272 | agatha/scalding/data/FeatureExtractionTemplate.scala:41-56 | agatha/scalding/labels/LabelExtractionTemplate.scala:57-71 | agatha/scalding/quantile/QuantileFeatureExport.scala:198-209 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) simclusters/simclusters_v2/scalding/mbcg/TweetEmbeddingGenerationJob.scala:313— simclusters/simclusters_v2/scalding/mbcg/TweetEmbeddingGenerationJob.scala:313-328 | simclusters/simclusters_v2/scalding/mbcg/TweetEmbeddingGenerationJob.scala:336-351 | simclusters/simclusters_v2/scalding/mbcg/TweetEmbeddingGenerationJob.scala:359-374 | simclusters/simclusters_v2/scalding/mbcg/UserEmbeddingGenerationJob.scala:200-215 | simclusters/simclusters_v2/scalding/mbcg/UserEmbeddingGenerationJob.scala:223-238 | simclusters/simclusters_v2/scalding/mbcg/UserEmbeddingGenerationJob.scala:246-261 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberAddRequestResult.java:33— botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberAddRequestResult.java:33-48 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberRemoveRequestResult.java:33-48 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListRemoveRequestResult.java:33-46 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListSubscribeRequestResult.java:33-48 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListUnsubscribeRequestResult.java:33-48 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListUpdateRequestResult.java:37-57 — 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 (21 lines × 2) home-mixer/candidate_pipeline/following_candidate_pipeline.rs:73— home-mixer/candidate_pipeline/following_candidate_pipeline.rs:73-93 | home-mixer/candidate_pipeline/for_you_candidate_pipeline.rs:78-98 — before extracting anything, compare `home-mixer/candidate_pipeline/following_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/for_you_candidate_pipeline.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) thunder/schema/tweet_events.rs:1160— thunder/schema/tweet_events.rs:1160-1180 | thunder/schema/tweet_events.rs:1267-1287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) simclusters/simclusters_v2/scalding/embedding/LocaleEntitySimClustersEmbeddingsJob.scala:83— simclusters/simclusters_v2/scalding/embedding/LocaleEntitySimClustersEmbeddingsJob.scala:83-103 | simclusters/simclusters_v2/scalding/embedding/LocaleEntitySimClustersEmbeddingsJob.scala:257-277 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) botmaker/src/java/com/twitter/botmaker/function/collection/Fold.java:152— botmaker/src/java/com/twitter/botmaker/function/collection/Fold.java:152-172 | botmaker/src/java/com/twitter/botmaker/function/collection/Sort.java:98-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 `botmaker/src/java/com/twitter/botmaker/function/collection/Fold.java:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 2) adult-content/scripts/train_model.py:65— adult-content/scripts/train_model.py:65-85 | clip/training.py:89-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `adult-content/scripts/train_model.py:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:693— phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:693-713 | phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:728-748 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:693` it begins part-way through the construct above it, so those 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 lines × 2) phoenix/xrex/pallas/ranker_attention_fa3.py:258— phoenix/xrex/pallas/ranker_attention_fa3.py:258-278 | phoenix/xrex/pallas/ranker_attention_fa3.py:1378-1398 — both copies are in the same file, so extract the block into 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 × 4) thunder/schema/events.rs:252— thunder/schema/events.rs:252-263 | thunder/schema/events.rs:419-430 | thunder/schema/events.rs:499-510 | thunder/schema/events.rs:579-590 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 4) thunder/schema/events.rs:316— thunder/schema/events.rs:316-327 | thunder/schema/tweet.rs:3444-3455 | thunder/schema/tweet.rs:5124-5135 | thunder/schema/tweet.rs:5187-5198 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 4) thunder/schema/tweet_events.rs:138— thunder/schema/tweet_events.rs:138-149 | thunder/schema/tweet_events.rs:296-307 | thunder/schema/tweet_events.rs:411-422 | thunder/schema/tweet_events.rs:762-773 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 4) botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:364— botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:364-375 | botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:420-431 | botmaker/botmaker_thrift/src/main/scala/com/twitter/botmaker/runtime/ScribePublisher.scala:49-60 | botmaker/botmaker_thrift/src/main/scala/com/twitter/botmaker/runtime/ThriftEndpoint.scala:306-317 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:364` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `AppClientConfig` in one and `ScribePublisherConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `botmaker/botmaker_thrift/src/main/scala/com/twitter/botmaker/runtime/ThriftEndpoint.scala:318` calls `ArgsNode` and `botmaker/botmaker_app/src/main/scala/com/twitter/botmaker/app/client/AppClient.scala:377` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 4) botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:290— botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:290-301 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:62-73 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:117-128 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:170-181 — before extracting anything, compare `botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala` and `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:290` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `ManhattanClientConfig` in one and `MemCachedCounterConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 4) botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:347— botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:347-358 | botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:407-418 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:113-124 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:218-229 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:347` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `ManhattanClientConfig` in one and `MemCachedClientConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 4) phoenix/xrex/pallas/ranker_attention_v2.py:691— phoenix/xrex/pallas/ranker_attention_v2.py:691-702 | phoenix/xrex/pallas/ranker_attention_v2.py:818-829 | phoenix/xrex/pallas/ranker_attention_varlen.py:789-800 | phoenix/xrex/pallas/ranker_attention_varlen.py:962-973 — before extracting anything, compare `phoenix/xrex/pallas/ranker_attention_v2.py` and `phoenix/xrex/pallas/ranker_attention_varlen.py` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 287 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `phoenix/xrex/pallas/ranker_attention_v2.py:831` calls `load`, `dslice` and `phoenix/xrex/pallas/ranker_attention_varlen.py:975` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 12) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2481— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2481-2485 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2489-2493 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2498-2502 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2508-2512 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2546-2550 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2555-2559 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2565-2569 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2576-2580 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2611-2615 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2619-2623 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2628-2632 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2638-2642 — all 12 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2481` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 12) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3340— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3340-3344 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3348-3352 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3357-3361 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3367-3371 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3399-3403 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3408-3412 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3418-3422 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3429-3433 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3459-3463 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3467-3471 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3476-3480 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3486-3490 — all 12 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3340` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 12) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4305— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4305-4309 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4313-4317 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4322-4326 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4332-4336 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4357-4361 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4366-4370 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4376-4380 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4387-4391 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4411-4415 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4419-4423 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4428-4432 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4438-4442 — all 12 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4305` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4356` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4304` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 12) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5567— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5567-5571 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5576-5580 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5586-5590 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5597-5601 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5623-5627 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5633-5637 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5644-5648 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5656-5660 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5681-5685 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5690-5694 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5700-5704 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5711-5715 — all 12 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5567` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5622` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5566` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 12) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6915— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6915-6919 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6925-6929 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6936-6940 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6948-6952 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6975-6979 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6986-6990 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6998-7002 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7011-7015 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7037-7041 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7047-7051 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7058-7062 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7070-7074 — all 12 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6915` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6974` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6914` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 12) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8363— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8363-8367 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8374-8378 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8386-8390 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8399-8403 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8427-8431 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8439-8443 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8452-8456 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8466-8470 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8493-8497 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8504-8508 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8516-8520 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8529-8533 — all 12 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8363` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8426` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8362` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 12) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10565— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10565-10569 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10571-10575 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10578-10583 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10587-10592 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10597-10602 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10608-10613 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10747-10751 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10753-10757 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10760-10765 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10769-10774 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10779-10784 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10790-10795 — all 12 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10565` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 9) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1502— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1502-1506 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1510-1514 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1519-1523 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1558-1562 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1567-1571 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1577-1581 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1613-1617 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1621-1625 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1630-1634 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1502` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 9) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2276— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2276-2280 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2284-2288 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2293-2297 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2330-2334 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2339-2343 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2349-2353 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2383-2387 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2391-2395 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2400-2404 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2276` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 9) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3151— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3151-3155 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3159-3163 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3168-3172 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3199-3203 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3208-3212 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3218-3222 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3247-3251 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3255-3259 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3264-3268 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 9) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4135— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4135-4139 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4143-4147 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4152-4156 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4176-4180 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4185-4189 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4195-4199 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4218-4222 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4226-4230 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4235-4239 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4135` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4175` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4134` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 9) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5385— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5385-5389 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5394-5398 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5404-5408 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5429-5433 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5439-5443 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5450-5454 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5474-5478 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5483-5487 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5493-5497 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5385` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5428` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5384` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 9) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6721— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6721-6725 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6731-6735 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6742-6746 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6768-6772 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6779-6783 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6791-6795 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6816-6820 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6826-6830 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6837-6841 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6721` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6767` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6720` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 9) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8156— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8156-8160 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8167-8171 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8179-8183 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8206-8210 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8218-8222 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8231-8235 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8257-8261 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8268-8272 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8280-8284 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8156` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8205` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8155` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2474— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2474-2478 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2480-2484 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2487-2492 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2496-2501 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2604-2608 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2610-2614 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2617-2622 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2626-2631 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2474` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3154— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3154-3158 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3250-3254 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3343-3347 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3462-3466 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3569-3573 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3713-3717 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12319-12323 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12550-12554 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3154` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4317— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4317-4321 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4423-4427 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4524-4528 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4655-4659 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4771-4775 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4929-4933 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9710-9714 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9928-9932 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4317` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5389— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5389-5393 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5478-5482 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5571-5575 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5685-5689 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5793-5797 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5934-5938 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6058-6062 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6228-6232 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5389` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6726— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6726-6730 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6821-6825 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6920-6924 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7042-7046 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7157-7161 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7308-7312 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7440-7444 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7622-7626 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6726` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8162— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8162-8166 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8263-8267 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8369-8373 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8499-8503 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8622-8626 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8783-8787 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8924-8928 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9118-9122 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8162` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12421— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12421-12425 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12428-12432 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12437-12441 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12447-12451 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12458-12462 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12470-12474 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12483-12487 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12497-12501 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12421` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×6
Duplicated block (22 lines × 2) home-mixer/ads/multi_risk_blender.rs:315— home-mixer/ads/multi_risk_blender.rs:315-336 | home-mixer/ads/partition_organic_blender.rs:245-266 — before extracting anything, compare `home-mixer/ads/multi_risk_blender.rs` and `home-mixer/ads/partition_organic_blender.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (22 lines × 2) home-mixer/candidate_pipeline/for_you_candidate_pipeline.rs:229— home-mixer/candidate_pipeline/for_you_candidate_pipeline.rs:229-251 | home-mixer/candidate_pipeline/ranked_following_candidate_pipeline.rs:137-158 — before extracting anything, compare `home-mixer/candidate_pipeline/for_you_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/ranked_following_candidate_pipeline.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (22 lines × 2) botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:274— botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:274-295 | botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:331-352 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:274` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala:75— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala:75-96 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala:74-95 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala:75` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22 lines × 2) grox/flows/ptos/classifier.py:668— grox/flows/ptos/classifier.py:668-689 | grox/flows/ptos/classifier.py:693-714 — both copies are in the same file, so extract the 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 (22 lines × 2) phoenix/xrex/pallas/ranker_attention_fa3.py:137— phoenix/xrex/pallas/ranker_attention_fa3.py:137-158 | phoenix/xrex/pallas/ranker_attention_fa3.py:1285-1306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) phoenix-rankall/src/processor/metadata_processor.rs:38— phoenix-rankall/src/processor/metadata_processor.rs:38-52 | phoenix-rankall/src/processor/sid_tail_processor.rs:58-71 — 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–15 lines × 2) phoenix-rankall/src/store/base.rs:909— phoenix-rankall/src/store/base.rs:909-922 | phoenix-rankall/src/store/base.rs:925-939 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:488— phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:488-502 | phoenix/crates/serving/xai-recsys-engine/src/copy_port_client.rs:532-545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAudioSpaceUserBannedEvent.java:34— botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAudioSpaceUserBannedEvent.java:34-47 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAudioSpaceUserUnbannedEvent.java:34-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAudioSpaceUserBannedEvent.java:34` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAudioSpaceUserBannedEvent.java:48` calls `isSetPolicy_in_violation`, `putValue`, `getPolicy_in_violation` and `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAudioSpaceUserUnbannedEvent.java:49` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14–15 lines × 2) botmaker/src/java/com/twitter/botmaker/compiler/types/StructTupleType.java:138— botmaker/src/java/com/twitter/botmaker/compiler/types/StructTupleType.java:138-152 | botmaker/src/java/com/twitter/botmaker/compiler/types/TupleType.java:55-68 — 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 `botmaker/src/java/com/twitter/botmaker/compiler/types/StructTupleType.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.
Duplicated block (14–15 lines × 2) phoenix/xrex/pallas/ranker_attention_varlen.py:769— phoenix/xrex/pallas/ranker_attention_varlen.py:769-782 | phoenix/xrex/pallas/ranker_attention_varlen.py:910-924 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_varlen.py:769` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) abuse-enforcement-service/service-lib/src/service.rs:2909— abuse-enforcement-service/service-lib/src/service.rs:2909-2922 | abuse-enforcement-service/service-lib/src/service.rs:3010-3023 | abuse-enforcement-service/service-lib/src/service.rs:3096-3109 — 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 lines × 3) home-mixer/server.rs:429— home-mixer/server.rs:429-442 | home-mixer/server.rs:592-605 | home-mixer/server.rs:695-708 — 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 lines × 3) thunder/schema/media_common.rs:518— thunder/schema/media_common.rs:518-531 | thunder/schema/user.rs:13071-13084 | thunder/schema/user.rs:13371-13384 — before extracting anything, compare `thunder/schema/media_common.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) thunder/schema/tweet.rs:3132— thunder/schema/tweet.rs:3132-3145 | thunder/schema/user.rs:11925-11938 | thunder/schema/user.rs:12005-12018 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) thunder/schema/tweet_events.rs:140— thunder/schema/tweet_events.rs:140-153 | thunder/schema/tweet_events.rs:298-311 | thunder/schema/tweet_events.rs:413-426 — 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 lines × 3) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:916— botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:916-929 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:997-1010 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1079-1092 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 6) phoenix-rankall/src/processor/gen/scored_candidate.rs:191— phoenix-rankall/src/processor/gen/scored_candidate.rs:191-197 | thunder/schema/media_entity.rs:327-333 | thunder/schema/tweet.rs:1565-1571 | thunder/schema/tweet_media.rs:652-658 | thunder/schema/tweet_media.rs:742-748 | thunder/schema/tweet_media.rs:819-825 — before extracting anything, compare `phoenix-rankall/src/processor/gen/scored_candidate.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 6) thunder/schema/events.rs:1722— thunder/schema/events.rs:1722-1728 | thunder/schema/tweet.rs:1593-1599 | thunder/schema/user.rs:9947-9953 | thunder/schema/user.rs:9956-9962 | thunder/schema/user.rs:9965-9971 | thunder/schema/user.rs:10742-10748 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:2804— thunder/schema/tweet.rs:2804-2810 | thunder/schema/tweet_events.rs:691-697 | thunder/schema/tweet_events.rs:1240-1246 | thunder/schema/tweet_events.rs:1591-1597 | thunder/schema/user.rs:5097-5103 | thunder/schema/user.rs:5289-5295 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) agatha/hub/agatha/job/AgathaJobTemplates.scala:119— agatha/hub/agatha/job/AgathaJobTemplates.scala:119-125 | agatha/hub/agatha/job/AgathaJobTemplates.scala:169-175 | agatha/scalding/blink/BlinkScoreJobTemplate.scala:262-268 | agatha/scalding/data/FeatureExtractionTemplate.scala:42-48 | agatha/scalding/labels/LabelExtractionTemplate.scala:58-64 | agatha/scalding/quantile/QuantileFeatureExport.scala:199-205 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `agatha/hub/agatha/job/AgathaJobTemplates.scala:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9810— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9810-9816 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9820-9826 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9831-9837 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9843-9849 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9856-9862 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9870-9876 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9810` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 6) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAudioSpaceCoHostJoinEvent.java:22— botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAudioSpaceCoHostJoinEvent.java:22-28 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAudioSpaceCoHostLeaveEvent.java:22-28 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAudioSpaceEndEvent.java:22-28 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAudioSpaceListenerJoinEvent.java:22-28 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAudioSpaceListenerLeaveEvent.java:22-28 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAudioSpacePublishEvent.java:22-28 — 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 6 call sites, so a change lands once.
Duplicated block (7 lines × 5) thunder/schema/events.rs:749— thunder/schema/events.rs:749-755 | thunder/schema/events.rs:946-952 | thunder/schema/events.rs:3658-3664 | thunder/schema/events.rs:3829-3835 | thunder/schema/tweet.rs:3079-3085 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 5) thunder/schema/events.rs:3000— thunder/schema/events.rs:3000-3006 | thunder/schema/events.rs:3077-3083 | thunder/schema/events.rs:3154-3160 | thunder/schema/events.rs:3231-3237 | thunder/schema/events.rs:3308-3314 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 5) thunder/schema/media_entity.rs:288— thunder/schema/media_entity.rs:288-294 | thunder/schema/tweet.rs:1702-1708 | thunder/schema/tweet.rs:2756-2762 | thunder/schema/user.rs:4533-4539 | thunder/schema/user.rs:11095-11101 — before extracting anything, compare `thunder/schema/media_entity.rs` and `thunder/schema/tweet.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 × 5) thunder/schema/tweet.rs:1821— thunder/schema/tweet.rs:1821-1827 | thunder/schema/tweet.rs:2305-2311 | thunder/schema/tweet.rs:2419-2425 | thunder/schema/user.rs:4508-4514 | thunder/schema/user.rs:11288-11294 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 5) media-model-proxy/src/main/scala/com/twitter/media_understanding/model_proxy/model_descriptors/CategoryClassificationEmbeddingsModelDescriptor.scala:41— media-model-proxy/src/main/scala/com/twitter/media_understanding/model_proxy/model_descriptors/CategoryClassificationEmbeddingsModelDescriptor.scala:41-47 | media-model-proxy/src/main/scala/com/twitter/media_understanding/model_proxy/model_descriptors/CategoryClassificationModelDescriptor.scala:38-45 | media-model-proxy/src/main/scala/com/twitter/media_understanding/model_proxy/model_descriptors/FingerprintingModelDescriptor.scala:51-58 | media-model-proxy/src/main/scala/com/twitter/media_understanding/model_proxy/model_descriptors/FingerprintingV2ModelDescriptor.scala:51-58 | media-model-proxy/src/main/scala/com/twitter/media_understanding/model_proxy/model_descriptors/HatefulSymbolRecognitionModelDescriptor.scala:33-40 — before extracting anything, compare `media-model-proxy/src/main/scala/com/twitter/media_understanding/model_proxy/model_descriptors/FingerprintingModelDescriptor.scala` and `media-model-proxy/src/main/scala/com/twitter/media_understanding/model_proxy/model_descriptors/FingerprintingV2ModelDescriptor.scala` as WHOLE FILES: 94% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `media-model-proxy/src/main/scala/com/twitter/media_understanding/model_proxy/model_descriptors/CategoryClassificationEmbeddingsModelDescriptor.scala:41` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 5) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberAddRequestResult.java:37— botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberAddRequestResult.java:37-43 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberRemoveRequestResult.java:37-43 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListRemoveRequestResult.java:37-43 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListSubscribeRequestResult.java:37-43 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListUnsubscribeRequestResult.java:37-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberAddRequestResult.java:37` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListMemberAddRequestResult.java:45` calls `putValue`, `getMember_id` and `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfSgsListRemoveRequestResult.java:45` 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 × 15) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3566— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3566-3570 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3574-3578 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3583-3587 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3593-3597 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3604-3608 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3637-3641 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3646-3650 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3656-3660 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3667-3671 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3679-3683 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3710-3714 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3718-3722 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3727-3731 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3737-3741 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3748-3752 — all 15 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3566` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 15) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4512— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4512-4516 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4520-4524 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4529-4533 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4539-4543 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4550-4554 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4576-4580 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4585-4589 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4595-4599 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4606-4610 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4618-4622 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4643-4647 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4651-4655 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4660-4664 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4670-4674 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4681-4685 — all 15 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4512` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4575` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4511` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 15) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5789— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5789-5793 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5798-5802 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5808-5812 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5819-5823 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5831-5835 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5858-5862 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5868-5872 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5879-5883 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5891-5895 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5904-5908 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5930-5934 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5939-5943 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5949-5953 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5960-5964 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5972-5976 — all 15 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5789` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5857` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5788` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 15) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7152— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7152-7156 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7162-7166 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7173-7177 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7185-7189 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7198-7202 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7226-7230 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7237-7241 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7249-7253 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7262-7266 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7276-7280 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7303-7307 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7313-7317 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7324-7328 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7336-7340 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7349-7353 — all 15 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7152` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7225` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7151` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 15) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8616— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8616-8620 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8627-8631 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8639-8643 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8652-8656 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8666-8670 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8695-8699 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8707-8711 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8720-8724 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8734-8738 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8749-8753 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8777-8781 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8788-8792 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8800-8804 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8813-8817 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8827-8831 — all 15 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8616` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8694` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8615` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 15) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10289— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10289-10293 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10297-10301 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10306-10310 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10316-10320 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10327-10331 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10366-10370 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10375-10379 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10385-10389 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10396-10400 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10408-10412 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10444-10448 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10452-10456 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10461-10465 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10471-10475 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10482-10486 — all 15 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10289` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Off the main sequence: xai-checkpointing — xai-checkpointing: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: xai-configlib — xai-configlib: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: xai-gimmick — xai-gimmick: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: xai-proto — xai-proto: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: xai-recsys-proto — xai-recsys-proto: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: xai-recsys-server — xai-recsys-server: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (5 members, 50+ identical tokens) phoenix/crates/common/xai-recsys/src/util.rs:531— phoenix/crates/common/xai-recsys/src/util.rs:531-778 | phoenix/crates/common/xai-recsys/src/util.rs:884-1219 | phoenix/crates/common/xai-recsys/src/util.rs:1229-1680 | phoenix/crates/serving/xai-recsys-engine/src/util.rs:48-237 | phoenix/crates/serving/xai-recsys-engine/src/util.rs:246-469 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) thunder/schema/events.rs:1678— thunder/schema/events.rs:1678-1775 | thunder/schema/tweet.rs:1530-1607 | thunder/schema/user.rs:5387-5690 | thunder/schema/user.rs:9942-9974 | thunder/schema/user.rs:10737-10760 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) thunder/schema/media_common.rs:538— thunder/schema/media_common.rs:538-553 | thunder/schema/tweet.rs:1530-1607 | thunder/schema/user.rs:5387-5690 | thunder/schema/user.rs:13112-13232 | thunder/schema/user.rs:13394-13424 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) thunder/schema/tweet.rs:2825— thunder/schema/tweet.rs:2825-2839 | thunder/schema/tweet_events.rs:714-738 | thunder/schema/tweet_events.rs:1265-1299 | thunder/schema/tweet_events.rs:1627-1656 | thunder/schema/user.rs:5387-5690 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) phoenix/xrex/data/grpc_recsys.py:51— phoenix/xrex/data/grpc_recsys.py:51-197 | phoenix/xrex/inference/gen_recs_runner.py:313-349 | phoenix/xrex/inference/model_runner.py:4218-4291 | phoenix/xrex/inference/model_runner.py:5352-5412 | phoenix/xrex/inference/sid_retrieval_runner.py:376-430 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (26 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1658— phoenix/crates/serving/xai-recsys-engine/src/python.rs:1658-1683 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:2446-2471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1311— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1311-1336 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1401-1426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1311` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) botmaker/src/java/com/twitter/botmaker/function/logic/Conjunction.java:89— botmaker/src/java/com/twitter/botmaker/function/logic/Conjunction.java:89-114 | botmaker/src/java/com/twitter/botmaker/function/logic/Disjunction.java:90-115 — before extracting anything, compare `botmaker/src/java/com/twitter/botmaker/function/logic/Conjunction.java` and `botmaker/src/java/com/twitter/botmaker/function/logic/Disjunction.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 2) grox/flows/reply_spam/task_multi_step_reply_spam.py:160— grox/flows/reply_spam/task_multi_step_reply_spam.py:160-185 | grox/flows/reply_spam/task_write.py:167-192 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26 lines × 2) phoenix/xrex/pallas/ranker_attention_utils.py:31— phoenix/xrex/pallas/ranker_attention_utils.py:31-56 | phoenix/xrex/pallas/ranker_attention_utils.py:74-99 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (24 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1690— phoenix/crates/serving/xai-recsys-engine/src/python.rs:1690-1713 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:2478-2501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) simclusters/simclusters_v2/summingbird/storm/TweetJob.scala:185— simclusters/simclusters_v2/summingbird/storm/TweetJob.scala:185-208 | simclusters/simclusters_v2/summingbird/storm/TweetJob.scala:226-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 `simclusters/simclusters_v2/summingbird/storm/TweetJob.scala:185` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) grox/flows/upa/task_write.py:46— grox/flows/upa/task_write.py:46-69 | grox/flows/upa/task_write.py:213-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) phoenix/reference/sid_codebook.py:261— phoenix/reference/sid_codebook.py:261-284 | phoenix/reference/sid_codebook.py:649-672 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) phoenix/xrex/cuda/async_emb/async_emb.py:257— phoenix/xrex/cuda/async_emb/async_emb.py:257-280 | phoenix/xrex/cuda/row_emb/row_emb.py:253-276 — `phoenix/xrex/cuda/async_emb/async_emb.py` and `phoenix/xrex/cuda/row_emb/row_emb.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 99 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `ctx` to `AsyncEmbContextHandle` in one and `RowEmbContextHandle` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12–13 lines × 2) abuse-enforcement-service/service-lib/src/lib.rs:478— abuse-enforcement-service/service-lib/src/lib.rs:478-489 | abuse-enforcement-service/service-lib/src/lib.rs:503-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 (12–13 lines × 2) thunder/schema/tweet_events.rs:1076— thunder/schema/tweet_events.rs:1076-1087 | thunder/schema/user.rs:9378-9390 — before extracting anything, compare `thunder/schema/tweet_events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 353 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–13 lines × 2) botmaker/src/scala/com/twitter/botmaker/rule/ConfigContainer.scala:54— botmaker/src/scala/com/twitter/botmaker/rule/ConfigContainer.scala:54-65 | botmaker/src/scala/com/twitter/botmaker/rule/RuleContainer.scala:97-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/rule/ConfigContainer.scala:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) simclusters/simclusters_v2/scalding/UserUserNormalizedGraph.scala:334— simclusters/simclusters_v2/scalding/UserUserNormalizedGraph.scala:334-345 | simclusters/simclusters_v2/scalding/UserUserNormalizedGraph.scala:370-382 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/scalding/UserUserNormalizedGraph.scala:334` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `simclusters/simclusters_v2/scalding/UserUserNormalizedGraph.scala:369` calls `args` and `simclusters/simclusters_v2/scalding/UserUserNormalizedGraph.scala:333` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 2) under-the-hood/scalding/UthUserMonthMhPublisherJob.scala:187— under-the-hood/scalding/UthUserMonthMhPublisherJob.scala:187-198 | under-the-hood/scalding/UthUserMonthMhPublisherJob.scala:317-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `under-the-hood/scalding/UthUserMonthMhPublisherJob.scala:187` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 5) thunder/schema/events.rs:738— thunder/schema/events.rs:738-745 | thunder/schema/events.rs:935-942 | thunder/schema/events.rs:1096-1103 | thunder/schema/events.rs:3647-3654 | thunder/schema/events.rs:3818-3825 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 5) thunder/schema/events.rs:2127— thunder/schema/events.rs:2127-2134 | thunder/schema/events.rs:2225-2232 | thunder/schema/events.rs:2313-2320 | thunder/schema/events.rs:2406-2413 | thunder/schema/events.rs:2499-2506 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 5) thunder/schema/tweet.rs:1545— thunder/schema/tweet.rs:1545-1552 | thunder/schema/tweet.rs:2309-2316 | thunder/schema/tweet.rs:2423-2430 | thunder/schema/tweet.rs:2750-2757 | thunder/schema/user.rs:10838-10845 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 5) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7505— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7505-7512 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8676-8683 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9372-9379 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9785-9792 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12403-12410 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7505` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 5) phoenix/xrex/models/recsys_model.py:1549— phoenix/xrex/models/recsys_model.py:1549-1556 | phoenix/xrex/models/recsys_model.py:1716-1723 | phoenix/xrex/models/recsys_model.py:3075-3082 | phoenix/xrex/models/recsys_model.py:3096-3103 | phoenix/xrex/models/recsys_sid.py:176-183 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 4) thunder/schema/user.rs:7242— thunder/schema/user.rs:7242-7246 | thunder/schema/user.rs:8327-8331 | thunder/schema/user.rs:10320-10324 | thunder/schema/user.rs:12369-12373 — 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) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:651— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:651-655 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:657-661 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:747-751 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:753-757 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:651` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1550— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1550-1554 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1557-1561 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1566-1570 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1576-1580 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1550` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3391— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3391-3395 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3398-3402 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3407-3411 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3417-3421 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3391` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:47— simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:47-51 | simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:66-70 | simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:85-89 | simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:109-113 — 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 `simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (32 lines × 2) thunder/schema/tweet_events.rs:1676— thunder/schema/tweet_events.rs:1676-1707 | thunder/schema/user.rs:4217-4248 — before extracting anything, compare `thunder/schema/tweet_events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 353 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (32 lines × 2) simclusters/simclusters_v2/common/clustering/LouvainClusteringMethod.scala:33— simclusters/simclusters_v2/common/clustering/LouvainClusteringMethod.scala:33-64 | simclusters/simclusters_v2/common/clustering/LouvainClusteringMethod.scala:109-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/common/clustering/LouvainClusteringMethod.scala:33` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `simclusters/simclusters_v2/common/clustering/LouvainClusteringMethod.scala:105` calls `similarityFnForSil`, `put` and `simclusters/simclusters_v2/common/clustering/LouvainClusteringMethod.scala:31` 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 (32 lines × 2) simclusters/simclusters_v2/scalding/InterestedInFromKnownFor.scala:211— simclusters/simclusters_v2/scalding/InterestedInFromKnownFor.scala:211-242 | simclusters/simclusters_v2/scalding/InterestedInFromKnownForLite.scala:204-235 — 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 `simclusters/simclusters_v2/scalding/InterestedInFromKnownFor.scala:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (32 lines × 2) grox/libs/kafka_cli/consumer.py:46— grox/libs/kafka_cli/consumer.py:46-77 | grox/libs/kafka_cli/producer.py:17-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (32 lines × 2) phoenix/xrex/data/recsys/recsys_batch.py:1212— phoenix/xrex/data/recsys/recsys_batch.py:1212-1243 | phoenix/xrex/data/recsys/recsys_batch.py:1346-1377 — both copies are in the same file, so extract the block into 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 × 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4759— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4759-4763 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4767-4771 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4776-4780 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4786-4790 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4797-4801 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4809-4813 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4836-4840 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4845-4849 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4855-4859 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4866-4870 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4878-4882 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4891-4895 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4917-4921 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4925-4929 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4934-4938 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4944-4948 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4955-4959 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4967-4971 — all 18 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4759` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4835` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4758` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6054— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6054-6058 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6063-6067 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6073-6077 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6084-6088 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6096-6100 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6109-6113 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6137-6141 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6147-6151 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6158-6162 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6170-6174 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6183-6187 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6197-6201 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6224-6228 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6233-6237 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6243-6247 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6254-6258 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6266-6270 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6279-6283 — all 18 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6054` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6136` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6053` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7435— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7435-7439 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7445-7449 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7456-7460 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7468-7472 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7481-7485 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7495-7499 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7524-7528 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7535-7539 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7547-7551 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7560-7564 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7574-7578 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7589-7593 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7617-7621 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7627-7631 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7638-7642 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7650-7654 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7663-7667 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7677-7681 — all 18 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7435` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7523` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7434` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8918— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8918-8922 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8929-8933 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8941-8945 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8954-8958 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8968-8972 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8983-8987 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9013-9017 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9025-9029 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9038-9042 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9052-9056 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9067-9071 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9083-9087 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9112-9116 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9123-9127 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9135-9139 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9148-9152 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9162-9166 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9177-9181 — all 18 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8918` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9012` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8917` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10572— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10572-10576 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10580-10584 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10589-10593 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10599-10603 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10610-10614 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10622-10626 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10662-10666 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10671-10675 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10681-10685 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10692-10696 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10704-10708 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10717-10721 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10754-10758 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10762-10766 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10771-10775 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10781-10785 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10792-10796 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10804-10808 — all 18 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10572` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
ActionControl::set_rows (cognitive 78) abuse-enforcement-service/service-lib/src/action_control/levels.rs:888— ActionControl::set_rows has cognitive complexity 78 (threshold 15). Drivers by points: if/else 23 (38 pts), boolean chains 18, loops 10 (15 pts), match/switch 5 (7 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActionControl::set_unlocked (cognitive 41) abuse-enforcement-service/service-lib/src/action_control.rs:1988— ActionControl::set_unlocked has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 8 (12 pts), boolean chains 5, 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.
ActionControl::validate (cognitive 31) abuse-enforcement-service/service-lib/src/action_control.rs:1674— ActionControl::validate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 10, loops 1, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ActionControl::spawn_refresh_with (cognitive 20) abuse-enforcement-service/service-lib/src/action_control.rs:1305— ActionControl::spawn_refresh_with has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, 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.
abuse_v3_features::extract_batch (cognitive 47) bdsm/rust/abuse-v3-features/src/lib.rs:328— abuse_v3_features::extract_batch has cognitive complexity 47 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 6 (11 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
abuse_v3_features::get_i32 (cognitive 41) bdsm/rust/abuse-v3-features/src/lib.rs:13— abuse_v3_features::get_i32 has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (40 pts), match/switch 1 (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
abuse_v3_features::derived::compute_derived (cognitive 34) bdsm/rust/abuse-v3-features/src/derived.rs:4— abuse_v3_features::derived::compute_derived has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 7, loops 3 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
abuse_v3_features::get_i64 (cognitive 19) bdsm/rust/abuse-v3-features/src/lib.rs:64— abuse_v3_features::get_i64 has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 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.
Store::join (cognitive 29) visibility-filtering/hydration/store.rs:610— Store::join has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (14 pts), match/switch 3 (9 pts), boolean chains 3, loops 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.
Store::land (cognitive 18) visibility-filtering/hydration/store.rs:518— Store::land has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Store::assemble (cognitive 18) visibility-filtering/hydration/store.rs:665— Store::assemble has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 3 (5 pts), loops 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Store::failed (cognitive 17) visibility-filtering/hydration/store.rs:760— Store::failed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (30 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:667— phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:667-696 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:944-973 — both copies are in the same file, so extract the block into 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) thunder/schema/tweet_events.rs:216— thunder/schema/tweet_events.rs:216-245 | thunder/schema/tweet_events.rs:477-506 — both copies are in the same file, so extract the block into 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) botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:142— botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:142-171 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:331-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:142` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 (30 lines × 2) grox/flows/reply_spam/classifier_coordinated_spam.py:174— grox/flows/reply_spam/classifier_coordinated_spam.py:174-203 | grox/flows/reply_spam/classifier_multi_step_reply_spam.py:178-207 — before extracting anything, compare `grox/flows/reply_spam/classifier_coordinated_spam.py` and `grox/flows/reply_spam/classifier_multi_step_reply_spam.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 3) phoenix/crates/common/xai-recsys/src/util.rs:1129— phoenix/crates/common/xai-recsys/src/util.rs:1129-1148 | phoenix/crates/common/xai-recsys/src/util.rs:1295-1314 | phoenix/crates/common/xai-recsys/src/util.rs:1590-1609 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (20 lines × 3) thunder/schema/tweet.rs:1292— thunder/schema/tweet.rs:1292-1311 | thunder/schema/tweet.rs:3254-3273 | thunder/schema/user.rs:10151-10170 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 3) REDACTED:56— REDACTED:56-75 | REDACTED:25-44 | REDACTED:29-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 3) phoenix/xrex/cutedsl/ranker_attention_fa4.py:481— phoenix/xrex/cutedsl/ranker_attention_fa4.py:481-500 | phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:484-503 | phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:638-657 — before extracting anything, compare `phoenix/xrex/cutedsl/ranker_attention_fa4.py` and `phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 258 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/cutedsl/ranker_attention_fa4.py:481` it does not close everything it opens, so those exact lines 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 × 4) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1676— phoenix/crates/serving/xai-recsys-engine/src/python.rs:1676-1690 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:1728-1742 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:2464-2478 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:2500-2514 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 4) thunder/schema/tweet.rs:2176— thunder/schema/tweet.rs:2176-2190 | thunder/schema/tweet_media.rs:419-433 | thunder/schema/user.rs:3887-3901 | thunder/schema/user.rs:4628-4642 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_media.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 4) home-mixer/query_hydrators/blocked_user_ids_query_hydrator.rs:14— home-mixer/query_hydrators/blocked_user_ids_query_hydrator.rs:14-28 | home-mixer/query_hydrators/followed_user_ids_query_hydrator.rs:18-32 | home-mixer/query_hydrators/muted_user_ids_query_hydrator.rs:14-28 | home-mixer/query_hydrators/subscribed_user_ids_query_hydrator.rs:14-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (15 lines × 4) phoenix/xrex/inference/gen_recs_runner.py:330— phoenix/xrex/inference/gen_recs_runner.py:330-344 | phoenix/xrex/inference/model_runner.py:4251-4265 | phoenix/xrex/inference/model_runner.py:5373-5387 | phoenix/xrex/inference/sid_retrieval_runner.py:396-410 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 3) home-mixer/clients/author_brand_safety_client.rs:62— home-mixer/clients/author_brand_safety_client.rs:62-72 | home-mixer/clients/recent_search_queries_store_client.rs:33-43 | home-mixer/clients/resurrection_date_client.rs:76-86 — 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 (11 lines × 3) thunder/schema/events.rs:1575— thunder/schema/events.rs:1575-1585 | thunder/schema/tweet.rs:3618-3628 | thunder/schema/tweet.rs:3748-3758 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) thunder/schema/tweet.rs:1449— thunder/schema/tweet.rs:1449-1459 | thunder/schema/user.rs:13062-13072 | thunder/schema/user.rs:13362-13372 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) phoenix/xrex/pallas/ranker_attention_fa3.py:172— phoenix/xrex/pallas/ranker_attention_fa3.py:172-182 | phoenix/xrex/pallas/ranker_attention_fa3.py:300-310 | phoenix/xrex/pallas/ranker_attention_fa3.py:1084-1094 — 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 × 5) phoenix-rankall/src/processor/gen/hydra.rs:134— phoenix-rankall/src/processor/gen/hydra.rs:134-143 | thunder/schema/events.rs:4078-4087 | thunder/schema/tweet.rs:1900-1909 | thunder/schema/tweet.rs:1964-1973 | thunder/schema/user.rs:3842-3851 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 5) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:244— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:244-253 | thunder/schema/media_common.rs:392-401 | thunder/schema/tweet.rs:1641-1650 | thunder/schema/user.rs:7890-7899 | thunder/schema/user.rs:10788-10797 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/media_common.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 139 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 5) thunder/schema/events.rs:687— thunder/schema/events.rs:687-696 | thunder/schema/events.rs:884-893 | thunder/schema/tweet.rs:3630-3639 | thunder/schema/tweet_events.rs:309-318 | thunder/schema/user.rs:6391-6400 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 5) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7687— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7687-7696 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8837-8846 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9614-9623 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10003-10012 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12634-12643 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7687` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:77— botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:77-93 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:132-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) grox/flows/reply_spam/classifier_coordinated_spam.py:112— grox/flows/reply_spam/classifier_coordinated_spam.py:112-128 | grox/flows/reply_spam/classifier_multi_step_reply_spam.py:113-130 — before extracting anything, compare `grox/flows/reply_spam/classifier_coordinated_spam.py` and `grox/flows/reply_spam/classifier_multi_step_reply_spam.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `grox/flows/reply_spam/classifier_coordinated_spam.py:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–18 lines × 2) phoenix/xrex/cutedsl/ranker_attention_fa4.py:535— phoenix/xrex/cutedsl/ranker_attention_fa4.py:535-552 | phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:688-704 — before extracting anything, compare `phoenix/xrex/cutedsl/ranker_attention_fa4.py` and `phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 258 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/cutedsl/ranker_attention_fa4.py:535` it begins part-way through the construct above it, so those 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–18 lines × 2) phoenix/xrex/models/recsys_model.py:3845— phoenix/xrex/models/recsys_model.py:3845-3861 | phoenix/xrex/models/recsys_two_tower_model.py:1688-1705 — 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–8 lines × 2) agatha/scalding/data/FeatureExtractionTemplate.scala:44— agatha/scalding/data/FeatureExtractionTemplate.scala:44-51 | agatha/scalding/labels/LabelExtractionTemplate.scala:60-66 — 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 `agatha/scalding/data/FeatureExtractionTemplate.scala:44` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3197— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3197-3203 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3205-3212 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3197` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) botmaker/src/java/com/twitter/botmaker/compiler/tuples/StructTuple.java:55— botmaker/src/java/com/twitter/botmaker/compiler/tuples/StructTuple.java:55-62 | botmaker/src/java/com/twitter/botmaker/compiler/types/StructTupleType.java:59-65 — 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 `botmaker/src/java/com/twitter/botmaker/compiler/tuples/StructTuple.java:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) grox/flows/ptos/classifier.py:273— grox/flows/ptos/classifier.py:273-279 | grox/flows/ptos/classifier.py:317-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `grox/flows/ptos/classifier.py:317` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (4–5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:721— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:721-725 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1384-1388 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2163-2166 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:721` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1582— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1582-1586 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2354-2358 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3224-3227 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1582` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2582— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2582-2586 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3435-3439 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4394-4397 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2582` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10120— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10120-10124 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10164-10167 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10210-10214 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10120` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10119` calls `toScala9`, `get`, `toScala10` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10164` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–13 lines × 2) phoenix/xrex/data/streaming/kafkaconsumer.py:1380— phoenix/xrex/data/streaming/kafkaconsumer.py:1380-1390 | phoenix/xrex/data/streaming/kafkaconsumer.py:1896-1908 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/data/streaming/kafkaconsumer.py:1380` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 2) phoenix/xrex/models/recsys_model.py:2051— phoenix/xrex/models/recsys_model.py:2051-2061 | phoenix/xrex/models/recsys_model.py:2066-2078 — both copies are in the same file, so extract the block into 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–13 lines × 2) phoenix/xrex/models/recsys_sid_retrieval_model.py:205— phoenix/xrex/models/recsys_sid_retrieval_model.py:205-215 | phoenix/xrex/models/recsys_two_tower_model.py:1621-1633 — 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 `phoenix/xrex/models/recsys_sid_retrieval_model.py:205` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 2) phoenix/xrex/models/transformer.py:518— phoenix/xrex/models/transformer.py:518-530 | phoenix/xrex/models/transformer.py:566-576 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/models/transformer.py:518` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
ActionControl::set_rows (cyclomatic 55) abuse-enforcement-service/service-lib/src/action_control/levels.rs:888— ActionControl::set_rows has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ActionControl::validate (cyclomatic 32) abuse-enforcement-service/service-lib/src/action_control.rs:1674— ActionControl::validate has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ActionControl::set_unlocked (cyclomatic 32) abuse-enforcement-service/service-lib/src/action_control.rs:1988— ActionControl::set_unlocked has cyclomatic complexity 32 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Backfill::change (cyclomatic 33) abuse-enforcement-service/service-lib/src/backfill.rs:1009— Backfill::change 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.
Backfill::start (cyclomatic 22) abuse-enforcement-service/service-lib/src/backfill.rs:716— Backfill::start 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.
Backfill::set_settings (cyclomatic 16) abuse-enforcement-service/service-lib/src/backfill.rs:420— Backfill::set_settings 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.
InputBuffer::compute_from_columnar_bytes (cyclomatic 31) phoenix/crates/common/xai-recsys/src/util.rs:1221— InputBuffer::compute_from_columnar_bytes 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.
InputBuffer::compute_for_item (cyclomatic 18) phoenix/crates/common/xai-recsys/src/util.rs:876— InputBuffer::compute_for_item 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.
InputBuffer::new_with_candidates (cyclomatic 16) phoenix/crates/common/xai-recsys/src/util.rs:527— InputBuffer::new_with_candidates 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.
BaseSnapshotStore::start (cognitive 52) phoenix-rankall/src/store/base.rs:464— BaseSnapshotStore::start has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (28 pts), match/switch 5 (16 pts), loops 3 (7 pts), boolean chains 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.
BaseSnapshotStore::load_existing_data (cognitive 46) phoenix-rankall/src/store/base.rs:130— BaseSnapshotStore::load_existing_data has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 3 (10 pts), match/switch 3 (10 pts), boolean chains 1 (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.
BaseSnapshotStore::dump_all_windows (cognitive 23) phoenix-rankall/src/store/base.rs:322— BaseSnapshotStore::dump_all_windows has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputBuffer::compute_from_columnar_bytes (cognitive 52) phoenix/crates/common/xai-recsys/src/util.rs:1221— InputBuffer::compute_from_columnar_bytes has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 7 (16 pts), boolean chains 7, match/switch 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputBuffer::compute_for_item (cognitive 41) phoenix/crates/common/xai-recsys/src/util.rs:876— InputBuffer::compute_for_item has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 5 (11 pts), match/switch 3 (6 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.
InputBuffer::new_with_candidates (cognitive 25) phoenix/crates/common/xai-recsys/src/util.rs:527— InputBuffer::new_with_candidates has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PostStore::insert_posts_internal (cognitive 40) thunder/posts/post_store.rs:156— PostStore::insert_posts_internal has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 5 (12 pts), boolean chains 3 (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.
PostStore::trim_old_posts (cognitive 26) thunder/posts/post_store.rs:501— PostStore::trim_old_posts has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 6 (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.
PostStore::get_posts_from_map (cognitive 20) thunder/posts/post_store.rs:288— PostStore::get_posts_from_map has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Backfill::change (cognitive 34) abuse-enforcement-service/service-lib/src/backfill.rs:1009— Backfill::change has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (23 pts), match/switch 4 (6 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.
Backfill::start (cognitive 30) abuse-enforcement-service/service-lib/src/backfill.rs:716— Backfill::start has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 8, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Backfill::finish_start (cognitive 16) abuse-enforcement-service/service-lib/src/backfill.rs:892— Backfill::finish_start has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HoldGate::evaluate (cognitive 33) abuse-enforcement-service/service-lib/src/overturn_hold.rs:1595— HoldGate::evaluate has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (22 pts), match/switch 7 (9 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.
HoldGate::breaker_after_probe (cognitive 22) abuse-enforcement-service/service-lib/src/overturn_hold.rs:1323— HoldGate::breaker_after_probe has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HoldGate::check_timed (cognitive 18) abuse-enforcement-service/service-lib/src/overturn_hold.rs:1502— HoldGate::check_timed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 6 (7 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D4 · Code Duplication· Near-duplicate member family (4 members, 22 shared lines) · ×3
Near-duplicate member family (4 members, 22 shared lines) thunder/schema/events.rs:2067— thunder/schema/events.rs:2067-2116 | thunder/schema/events.rs:2264-2307 | thunder/schema/events.rs:2357-2400 | thunder/schema/tweet.rs:1057-1100 — These 4 members are variants of one another: a block of 22 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Near-duplicate member family (4 members, 22 shared lines) thunder/schema/events.rs:2848— thunder/schema/events.rs:2848-2886 | thunder/schema/tweet.rs:986-1017 | thunder/schema/tweet.rs:2375-2412 | thunder/schema/user.rs:5855-5888 — These 4 members are variants of one another: a block of 22 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Near-duplicate member family (4 members, 22 shared lines) thunder/schema/tweet.rs:3528— thunder/schema/tweet.rs:3528-3561 | thunder/schema/user.rs:4614-4651 | thunder/schema/user.rs:12553-12608 | thunder/schema/user.rs:13887-13945 — These 4 members are variants of one another: a block of 22 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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 (31 lines × 2) home-mixer/candidate_pipeline/following_candidate_pipeline.rs:78— home-mixer/candidate_pipeline/following_candidate_pipeline.rs:78-108 | home-mixer/candidate_pipeline/ranked_following_candidate_pipeline.rs:54-84 — before extracting anything, compare `home-mixer/candidate_pipeline/following_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/ranked_following_candidate_pipeline.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (31 lines × 2) phoenix/crates/common/xai-recsys/src/util.rs:1081— phoenix/crates/common/xai-recsys/src/util.rs:1081-1111 | phoenix/crates/common/xai-recsys/src/util.rs:1542-1572 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31 lines × 2) thunder/schema/events.rs:681— thunder/schema/events.rs:681-711 | thunder/schema/events.rs:878-908 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2) home-mixer/candidate_pipeline/following_candidate_pipeline.rs:204— home-mixer/candidate_pipeline/following_candidate_pipeline.rs:204-230 | home-mixer/candidate_pipeline/ranked_following_candidate_pipeline.rs:141-167 — before extracting anything, compare `home-mixer/candidate_pipeline/following_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/ranked_following_candidate_pipeline.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (27 lines × 2) thunder/schema/tweet_events.rs:144— thunder/schema/tweet_events.rs:144-170 | thunder/schema/tweet_events.rs:417-443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2) grox/flows/reply_spam/task_filter.py:156— grox/flows/reply_spam/task_filter.py:156-182 | grox/flows/reply_spam/task_multi_step_reply_spam.py:98-124 — before extracting anything, compare `grox/flows/reply_spam/task_filter.py` and `grox/flows/reply_spam/task_multi_step_reply_spam.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `grox/flows/reply_spam/task_filter.py:156` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 4) phoenix-rankall/src/processor/gen/hydra.rs:70— phoenix-rankall/src/processor/gen/hydra.rs:70-85 | phoenix-rankall/src/processor/gen/hydra.rs:208-223 | phoenix-rankall/src/processor/gen/hydra.rs:486-501 | phoenix-rankall/src/processor/gen/scored_candidate.rs:87-102 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix-rankall/src/processor/gen/scored_candidate.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 4) botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:190— botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:190-205 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:377-392 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:152-167 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:298-313 — before extracting anything, compare `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala` and `botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:190` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `LocalCounterConfig` in one and `LocalStoreConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (16 lines × 4) botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:233— botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:233-248 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:418-433 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:195-210 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:338-353 — before extracting anything, compare `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala` and `botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:233` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `LocalCounterConfig` in one and `LocalStoreConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:194` calls `of` and `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:232` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15–16 lines × 2) abuse-enforcement-service/service-lib/src/service.rs:2908— abuse-enforcement-service/service-lib/src/service.rs:2908-2922 | abuse-enforcement-service/service-lib/src/service.rs:3094-3109 — both copies are in the same file, so extract the block into 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) phoenix/crates/serving/xai-recsys-mm-server/src/o2.rs:183— phoenix/crates/serving/xai-recsys-mm-server/src/o2.rs:183-197 | phoenix/crates/serving/xai-recsys-mm-server/src/o2.rs:201-216 — both copies are in the same file, so extract the block into 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) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:887— botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:887-901 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:967-982 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:887` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `Collection` in one and `List` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 6) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:299— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:299-313 | thunder/schema/media_common.rs:419-433 | thunder/schema/tweet.rs:1664-1678 | thunder/schema/tweet.rs:2708-2722 | thunder/schema/user.rs:7901-7915 | thunder/schema/user.rs:10803-10817 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/media_common.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 139 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 6) thunder/schema/events.rs:4433— thunder/schema/events.rs:4433-4447 | thunder/schema/tweet.rs:4793-4807 | thunder/schema/tweet.rs:5251-5265 | thunder/schema/tweet_events.rs:1405-1419 | thunder/schema/tweet_media.rs:878-892 | thunder/schema/user.rs:5355-5369 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 6) thunder/schema/tweet.rs:4175— thunder/schema/tweet.rs:4175-4189 | thunder/schema/tweet.rs:4263-4277 | thunder/schema/tweet.rs:4351-4365 | thunder/schema/tweet.rs:4439-4453 | thunder/schema/tweet.rs:4527-4541 | thunder/schema/tweet.rs:4615-4629 — 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 (15 lines × 3) home-mixer/server.rs:372— home-mixer/server.rs:372-386 | home-mixer/server.rs:534-548 | home-mixer/server.rs:637-651 — 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 (15 lines × 3) thunder/schema/events.rs:1808— thunder/schema/events.rs:1808-1822 | thunder/schema/events.rs:1905-1919 | thunder/schema/events.rs:1978-1992 — 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 (15 lines × 3) botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:282— botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:282-296 | botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:339-353 | botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:396-410 — 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 `botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:282` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) thunder/schema/user.rs:7321— thunder/schema/user.rs:7321-7334 | thunder/schema/user.rs:7582-7594 — both copies are in the same file, so extract the block into 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) simclusters/simclusters_v2/scalding/UserUserGraph.scala:59— simclusters/simclusters_v2/scalding/UserUserGraph.scala:59-71 | simclusters/simclusters_v2/scalding/UserUserNormalizedGraph.scala:154-167 — 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 `simclusters/simclusters_v2/scalding/UserUserGraph.scala:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) phoenix/xrex/pallas/ranker_attention_fa3.py:664— phoenix/xrex/pallas/ranker_attention_fa3.py:664-676 | phoenix/xrex/pallas/ranker_attention_fa3.py:894-907 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_fa3.py:894` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 6) thunder/schema/events.rs:314— thunder/schema/events.rs:314-326 | thunder/schema/events.rs:4054-4066 | thunder/schema/tweet.rs:1876-1888 | thunder/schema/tweet.rs:1940-1952 | thunder/schema/tweet.rs:5185-5197 | thunder/schema/user.rs:3790-3802 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 6) thunder/schema/events.rs:688— thunder/schema/events.rs:688-700 | thunder/schema/events.rs:885-897 | thunder/schema/events.rs:1044-1056 | thunder/schema/events.rs:1612-1624 | thunder/schema/media_entity.rs:229-241 | thunder/schema/user.rs:9143-9155 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/media_entity.rs` as WHOLE FILES: this scan already matched 6 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 × 6) thunder/schema/events.rs:1040— thunder/schema/events.rs:1040-1052 | thunder/schema/events.rs:2466-2478 | thunder/schema/events.rs:2952-2964 | thunder/schema/user.rs:9139-9151 | thunder/schema/user.rs:9199-9211 | thunder/schema/user.rs:9247-9259 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 49 separate duplicated blocks between them, totalling at least 510 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 6) thunder/schema/events.rs:679— thunder/schema/events.rs:679-689 | thunder/schema/events.rs:876-886 | thunder/schema/events.rs:3598-3608 | thunder/schema/events.rs:3769-3779 | thunder/schema/tweet_events.rs:147-157 | thunder/schema/tweet_events.rs:420-430 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 6) thunder/schema/media_entity.rs:224— thunder/schema/media_entity.rs:224-234 | thunder/schema/user.rs:4440-4450 | thunder/schema/user.rs:6179-6189 | thunder/schema/user.rs:6199-6209 | thunder/schema/user.rs:6291-6301 | thunder/schema/user.rs:9178-9188 — before extracting anything, compare `thunder/schema/media_entity.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 6) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:65— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:65-75 | simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:124-134 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala:64-74 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala:122-132 | simclusters/simclusters_v2/summingbird/storm/TwhinUserJob.scala:55-65 | simclusters/simclusters_v2/summingbird/storm/TwhinUserJob.scala:93-103 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:65` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9–11 lines × 2) home-mixer/ads/following_ad_blender.rs:39— home-mixer/ads/following_ad_blender.rs:39-49 | home-mixer/ads/util.rs:60-68 — 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–11 lines × 2) agatha/scalding/data/loaders/FavGraphDataLoader.scala:20— agatha/scalding/data/loaders/FavGraphDataLoader.scala:20-28 | agatha/scalding/data/loaders/FavedTweetsDataLoader.scala: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. Read the line range as the matched WINDOW rather than a finished unit: at `agatha/scalding/data/loaders/FavGraphDataLoader.scala:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–11 lines × 2) phoenix/xrex/inference/model_runner.py:2366— phoenix/xrex/inference/model_runner.py:2366-2376 | phoenix/xrex/inference/model_runner.py:2521-2529 — both copies are in the same file, so extract the block into 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 × 7) thunder/schema/events.rs:731— thunder/schema/events.rs:731-740 | thunder/schema/events.rs:928-937 | thunder/schema/events.rs:1681-1690 | thunder/schema/events.rs:2742-2751 | thunder/schema/events.rs:3640-3649 | thunder/schema/events.rs:3811-3820 | thunder/schema/media_common.rs:450-459 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/media_common.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 7) thunder/schema/events.rs:3606— thunder/schema/events.rs:3606-3615 | thunder/schema/events.rs:3777-3786 | thunder/schema/tweet.rs:2594-2603 | thunder/schema/user.rs:5726-5735 | thunder/schema/user.rs:8080-8089 | thunder/schema/user.rs:8514-8523 | thunder/schema/user.rs:12727-12736 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 7) thunder/schema/tweet.rs:4163— thunder/schema/tweet.rs:4163-4172 | thunder/schema/tweet.rs:4251-4260 | thunder/schema/tweet.rs:4339-4348 | thunder/schema/tweet.rs:4427-4436 | thunder/schema/tweet.rs:4515-4524 | thunder/schema/tweet.rs:4603-4612 | thunder/schema/tweet_events.rs:294-303 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 6) thunder/schema/events.rs:1122— thunder/schema/events.rs:1122-1131 | thunder/schema/events.rs:1156-1165 | thunder/schema/tweet.rs:2335-2344 | thunder/schema/tweet.rs:3305-3314 | thunder/schema/tweet.rs:3393-3402 | thunder/schema/tweet.rs:3490-3499 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 6) thunder/schema/events.rs:4139— thunder/schema/events.rs:4139-4148 | thunder/schema/tweet.rs:4737-4746 | thunder/schema/tweet.rs:5230-5239 | thunder/schema/tweet_events.rs:1321-1330 | thunder/schema/tweet_media.rs:843-852 | thunder/schema/user.rs:4928-4937 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 6) thunder/schema/events.rs:3344— thunder/schema/events.rs:3344-3353 | thunder/schema/events.rs:3397-3406 | thunder/schema/events.rs:3893-3902 | thunder/schema/events.rs:3946-3955 | thunder/schema/tweet.rs:3965-3974 | thunder/schema/tweet.rs:5330-5339 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 5) phoenix-rankall/src/processor/gen/hydra.rs:69— phoenix-rankall/src/processor/gen/hydra.rs:69-77 | thunder/schema/events.rs:295-303 | thunder/schema/tweet.rs:1865-1873 | thunder/schema/tweet.rs:1929-1937 | thunder/schema/tweet.rs:5174-5182 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 95 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 (9 lines × 5) thunder/schema/media_common.rs:515— thunder/schema/media_common.rs:515-523 | thunder/schema/tweet.rs:1455-1463 | thunder/schema/user.rs:5179-5187 | thunder/schema/user.rs:13068-13076 | thunder/schema/user.rs:13368-13376 — before extracting anything, compare `thunder/schema/media_common.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 235 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 5) botmaker/src/java/com/twitter/botmaker/function/FunctionNode1.java:34— botmaker/src/java/com/twitter/botmaker/function/FunctionNode1.java:34-42 | botmaker/src/java/com/twitter/botmaker/function/FunctionNode1O1.java:42-50 | botmaker/src/java/com/twitter/botmaker/function/FunctionNode2.java:35-43 | botmaker/src/java/com/twitter/botmaker/function/FunctionNode2O1.java:42-50 | botmaker/src/java/com/twitter/botmaker/function/FunctionNode3.java:36-44 — before extracting anything, compare `botmaker/src/java/com/twitter/botmaker/function/FunctionNode1.java` and `botmaker/src/java/com/twitter/botmaker/function/FunctionNode1O1.java` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/java/com/twitter/botmaker/function/FunctionNode1.java:34` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `botmaker/src/java/com/twitter/botmaker/function/FunctionNode1O1.java:51` calls `size`, `apply` and `botmaker/src/java/com/twitter/botmaker/function/FunctionNode2.java:44` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 7) thunder/schema/events.rs:778— thunder/schema/events.rs:778-785 | thunder/schema/events.rs:975-982 | thunder/schema/events.rs:1419-1426 | thunder/schema/events.rs:3682-3689 | thunder/schema/events.rs:3853-3860 | thunder/schema/tweet_events.rs:1168-1175 | thunder/schema/tweet_events.rs:1275-1282 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 7) thunder/schema/events.rs:1603— thunder/schema/events.rs:1603-1610 | thunder/schema/tweet.rs:1494-1501 | thunder/schema/user.rs:5018-5025 | thunder/schema/user.rs:9898-9905 | thunder/schema/user.rs:9908-9915 | thunder/schema/user.rs:9918-9925 | thunder/schema/user.rs:10704-10711 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 7) thunder/schema/tweet.rs:956— thunder/schema/tweet.rs:956-963 | thunder/schema/tweet_events.rs:571-578 | thunder/schema/tweet_events.rs:719-726 | thunder/schema/tweet_events.rs:973-980 | thunder/schema/tweet_events.rs:1070-1077 | thunder/schema/user.rs:12813-12820 | thunder/schema/user.rs:13117-13124 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 7) thunder/schema/tweet.rs:5437— thunder/schema/tweet.rs:5437-5442 | thunder/schema/user.rs:3311-3316 | thunder/schema/user.rs:10830-10835 | thunder/schema/user.rs:11737-11742 | thunder/schema/user.rs:12296-12301 | thunder/schema/user.rs:13685-13690 | thunder/schema/user.rs:14540-14545 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 7) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11000— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11000-11005 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11007-11012 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11015-11021 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11025-11031 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11036-11042 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11048-11054 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11061-11067 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11000` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 7) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11008— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11008-11013 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11017-11022 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11027-11032 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11038-11043 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11050-11055 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11063-11068 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11077-11082 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11008` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 10) thunder/schema/media_entity.rs:279— thunder/schema/media_entity.rs:279-284 | thunder/schema/tweet.rs:1693-1698 | thunder/schema/tweet.rs:1812-1817 | thunder/schema/tweet.rs:2035-2040 | thunder/schema/tweet.rs:2115-2120 | thunder/schema/tweet.rs:2203-2208 | thunder/schema/user.rs:11086-11091 | thunder/schema/user.rs:11279-11284 | thunder/schema/user.rs:11433-11438 | thunder/schema/user.rs:11577-11582 — before extracting anything, compare `thunder/schema/media_entity.rs` and `thunder/schema/tweet.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 (6 lines × 10) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11436— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11436-11441 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11443-11448 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11451-11457 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11461-11467 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11472-11478 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11484-11490 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11497-11503 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11511-11517 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11526-11532 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11542-11548 — all 10 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11436` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 10) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11444— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11444-11449 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11453-11458 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11463-11468 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11474-11479 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11486-11491 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11499-11504 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11513-11518 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11528-11533 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11544-11549 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11561-11566 — all 10 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11444` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 2) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:137— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:137-165 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJobRunner.scala:168-196 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJobRunner.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:137` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (29 lines × 2) botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java:63— botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java:63-91 | botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftStructOperator.java:62-90 — before extracting anything, compare `botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java` and `botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftStructOperator.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `type` to `ThriftType` in one and `ThriftStructType` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (29 lines × 2) phoenix/xrex/pallas/ranker_attention_fa3.py:189— phoenix/xrex/pallas/ranker_attention_fa3.py:189-217 | phoenix/xrex/pallas/ranker_attention_fa3.py:1324-1352 — both copies are in the same file, so extract the block into 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 × 2) botmaker/src/scala/com/twitter/botmaker/rule/BotMaker.scala:850— botmaker/src/scala/com/twitter/botmaker/rule/BotMaker.scala:850-872 | botmaker/src/scala/com/twitter/botmaker/rule/BotMaker.scala:876-899 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/rule/BotMaker.scala:850` it begins part-way through the construct above it, so those 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–24 lines × 2) phoenix/xrex/inference/model_runner.py:4440— phoenix/xrex/inference/model_runner.py:4440-4462 | phoenix/xrex/inference/model_runner.py:5527-5550 — both copies are in the same file, so extract the block into 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 × 2) phoenix/xrex/pallas/ranker_attention_varlen.py:436— phoenix/xrex/pallas/ranker_attention_varlen.py:436-459 | phoenix/xrex/pallas/ranker_attention_varlen.py:572-594 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_varlen.py: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 (11–12 lines × 2) botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:305— botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:305-316 | botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:362-372 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:305` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–12 lines × 2) botmaker/src/java/com/twitter/botmaker/ASTNode.java:143— botmaker/src/java/com/twitter/botmaker/ASTNode.java:143-154 | botmaker/src/java/com/twitter/botmaker/function/DerivedFeatureCall.java:225-235 — 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 `botmaker/src/java/com/twitter/botmaker/ASTNode.java:143` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–12 lines × 2) phoenix/xrex/models/recsys_model.py:3830— phoenix/xrex/models/recsys_model.py:3830-3840 | phoenix/xrex/models/recsys_model.py:3983-3994 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/models/recsys_model.py:3830` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–6 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3922— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3922-3925 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4179-4184 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4360-4365 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4579-4584 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4839-4844 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9807-9812 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3922` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–6 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6482— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6482-6485 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6607-6610 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6773-6778 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6980-6985 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7231-7236 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7529-7534 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6482` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–6 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7902— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7902-7905 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8035-8038 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8212-8217 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8433-8438 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8701-8706 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9019-9024 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7902` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 24) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9285— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9285-9289 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9293-9297 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9302-9306 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9312-9316 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9323-9327 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9335-9339 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9348-9352 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9362-9366 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9404-9408 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9413-9417 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9423-9427 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9434-9438 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9446-9450 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9459-9463 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9473-9477 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9488-9492 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9527-9531 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9535-9539 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9544-9548 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9554-9558 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9565-9569 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9577-9581 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9590-9594 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9604-9608 — all 24 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9285` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 24) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9698— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9698-9702 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9706-9710 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9715-9719 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9725-9729 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9736-9740 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9748-9752 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9761-9765 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9775-9779 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9804-9808 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9813-9817 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9823-9827 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9834-9838 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9846-9850 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9859-9863 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9873-9877 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9888-9892 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9916-9920 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9924-9928 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9933-9937 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9943-9947 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9954-9958 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9966-9970 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9979-9983 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9993-9997 — all 24 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9698` it does not close everything it opens, so those 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9803` calls `Future` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9697` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 24) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12316— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12316-12320 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12324-12328 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12333-12337 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12343-12347 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12354-12358 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12366-12370 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12379-12383 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12393-12397 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12429-12433 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12438-12442 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12448-12452 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12459-12463 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12471-12475 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12484-12488 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12498-12502 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12513-12517 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12547-12551 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12555-12559 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12564-12568 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12574-12578 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12585-12589 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12597-12601 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12610-12614 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12624-12628 — all 24 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12316` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 10) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2991— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2991-2995 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3066-3070 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3146-3150 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3242-3246 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3335-3339 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3454-3458 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3561-3565 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3705-3709 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12311-12315 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12542-12546 — all 10 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2991` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 10) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4138— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4138-4142 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4221-4225 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4308-4312 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4414-4418 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4515-4519 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4646-4650 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4762-4766 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4920-4924 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9701-9705 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9919-9923 — all 10 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4138` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 10) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10282— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10282-10286 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10288-10292 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10295-10300 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10304-10309 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10314-10319 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10437-10441 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10443-10447 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10450-10455 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10459-10464 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10469-10474 — all 10 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10282` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–5 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3686— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3686-3690 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4625-4629 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5664-5667 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10415-10419 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3686` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–5 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4899— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4899-4903 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5912-5916 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7020-7023 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10725-10729 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4899` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–5 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6206— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6206-6210 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7285-7289 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8476-8479 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11087-11091 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6206` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (3–5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11413— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11413-11417 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11573-11575 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11723-11727 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11413` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11413` calls `Option`, `toScala11`, `get` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11573` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11822— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11822-11826 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11861-11863 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11900-11904 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11822` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11822` calls `toScala7`, `get` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11861` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–5 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12011— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12011-12015 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12054-12056 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12097-12101 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12011` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12011` calls `toScala9`, `get` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12054` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (26–27 lines × 2) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:134— botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:134-159 | botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:304-330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:160` calls `isSetSelectionDenied`, `put`, `valueOf` and `botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:331` 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 (26–27 lines × 2) phoenix/xrex/cutedsl/ranker_attention_fa4.py:540— phoenix/xrex/cutedsl/ranker_attention_fa4.py:540-565 | phoenix/xrex/cutedsl/ranker_attention_fa4.py:584-610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/cutedsl/ranker_attention_fa4.py:540` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (26–27 lines × 2) phoenix/xrex/pallas/ranker_attention_v2.py:467— phoenix/xrex/pallas/ranker_attention_v2.py:467-493 | phoenix/xrex/pallas/ranker_attention_v2.py:556-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_v2.py:467` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–11 lines × 3) phoenix/xrex/inference/model_runner.py:4102— phoenix/xrex/inference/model_runner.py:4102-4112 | phoenix/xrex/inference/model_runner.py:5014-5022 | phoenix/xrex/inference/sid_retrieval_runner.py:200-208 — before extracting anything, compare `phoenix/xrex/inference/model_runner.py` and `phoenix/xrex/inference/sid_retrieval_runner.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/inference/model_runner.py:4102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–11 lines × 3) phoenix/xrex/pallas/ranker_attention_v2.py:137— phoenix/xrex/pallas/ranker_attention_v2.py:137-145 | phoenix/xrex/pallas/ranker_attention_v2.py:243-252 | phoenix/xrex/pallas/ranker_attention_varlen.py:295-305 — before extracting anything, compare `phoenix/xrex/pallas/ranker_attention_v2.py` and `phoenix/xrex/pallas/ranker_attention_varlen.py` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 287 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_varlen.py:295` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–11 lines × 3) phoenix/xrex/pallas/ranker_attention_varlen.py:735— phoenix/xrex/pallas/ranker_attention_varlen.py:735-743 | phoenix/xrex/pallas/ranker_attention_varlen.py:766-776 | phoenix/xrex/pallas/ranker_attention_varlen.py:907-917 — 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 `phoenix/xrex/pallas/ranker_attention_varlen.py:766` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `phoenix/xrex/pallas/ranker_attention_varlen.py:905` calls `zeros` and `phoenix/xrex/pallas/ranker_attention_varlen.py:733` 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.
X1 · Async correctness· Task from `asyncio.create_task` is not kept · ×3
Task from `asyncio.create_task` is not kept grox/core/engine.py:147— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
Task from `asyncio.create_task` is not kept grox/core/schedules/init.py:23— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
Task from `asyncio.create_task` is not kept grox/core/data_loaders/media_processor.py:84— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
X18 · Disposal-pattern correctness· Disposable created and abandoned in the function that made it · ×3
Disposable created and abandoned in the function that made it botmaker/src/scala/com/twitter/botmaker/util/FileUtil.scala:42— `scala.io.Source.fromFile(…)` opens something that has to be given back — a file descriptor, a socket, a directory handle — and its only use reads `.getLines` through it and drops it, so this expression both creates the value and is the last place that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it: `Too many open files` under load, and on Windows a file that cannot be replaced or deleted while it is held. Open it with `scala.util.Using.resource(scala.io.Source.fromFile(…)) { r => … }`, which releases it on every path including a throw, or hold it and call `.close()` in a `finally`.
Disposable created and abandoned in the function that made it botmaker/src/scala/com/twitter/botmaker/util/ThriftUtil.scala:98— `scala.io.Source.fromFile(…)` opens something that has to be given back — a file descriptor, a socket, a directory handle — and its only use reads `.getLines` through it and drops it, so this expression both creates the value and is the last place that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it: `Too many open files` under load, and on Windows a file that cannot be replaced or deleted while it is held. Open it with `scala.util.Using.resource(scala.io.Source.fromFile(…)) { r => … }`, which releases it on every path including a throw, or hold it and call `.close()` in a `finally`.
Disposable created and abandoned in the function that made it botmaker/src/scala/com/twitter/botmaker/util/ThriftUtil.scala:106— `scala.io.Source.fromFile(…)` opens something that has to be given back — a file descriptor, a socket, a directory handle — and its only use reads `.getLines` through it and drops it, so this expression both creates the value and is the last place that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it: `Too many open files` under load, and on Windows a file that cannot be replaced or deleted while it is held. Open it with `scala.util.Using.resource(scala.io.Source.fromFile(…)) { r => … }`, which releases it on every path including a throw, or hold it and call `.close()` in a `finally`.
AnnotationValue::read_from_in_protocol (cyclomatic 100) thunder/schema/user.rs:4926— AnnotationValue::read_from_in_protocol has cyclomatic complexity 100 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AnnotationValue::write_to_out_protocol (cyclomatic 62) thunder/schema/user.rs:5387— AnnotationValue::write_to_out_protocol has cyclomatic complexity 62 (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: Account::read_from_in_protocol (cyclomatic 71) 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.
RetrievalInputBuffer::compute_from_columnar_bytes (cyclomatic 23) phoenix/crates/serving/xai-recsys-engine/src/util.rs:239— RetrievalInputBuffer::compute_from_columnar_bytes 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.
RetrievalInputBuffer::compute_for_item (cyclomatic 20) phoenix/crates/serving/xai-recsys-engine/src/util.rs:42— RetrievalInputBuffer::compute_for_item 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.
FullTweet::read_from_in_protocol (cyclomatic 22) thunder/schema/events.rs:1544— FullTweet::read_from_in_protocol 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. This is NOT this file's highest cyclomatic complexity: Event::write_to_out_protocol (cyclomatic 41) 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.
FullTweet::write_to_out_protocol (cyclomatic 20) thunder/schema/events.rs:1678— FullTweet::write_to_out_protocol has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: Event::write_to_out_protocol (cyclomatic 41) 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.
abuse_v3_features::extract_batch (cyclomatic 22) bdsm/rust/abuse-v3-features/src/lib.rs:328— abuse_v3_features::extract_batch 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.
abuse_v3_features::derived::compute_derived (cyclomatic 20) bdsm/rust/abuse-v3-features/src/derived.rs:4— abuse_v3_features::derived::compute_derived 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.
BaseSnapshotStore::start (cyclomatic 19) phoenix-rankall/src/store/base.rs:464— BaseSnapshotStore::start 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.
BaseSnapshotStore::load_existing_data (cyclomatic 17) phoenix-rankall/src/store/base.rs:130— BaseSnapshotStore::load_existing_data 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.
Place::read_from_in_protocol (cyclomatic 18) thunder/schema/tweet.rs:1419— Place::read_from_in_protocol has cyclomatic complexity 18 (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.
Place::write_to_out_protocol (cyclomatic 16) thunder/schema/tweet.rs:1530— Place::write_to_out_protocol 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.
AnnotationValue::read_from_in_protocol (cognitive 197) thunder/schema/user.rs:4926— AnnotationValue::read_from_in_protocol has cognitive complexity 197 (threshold 15). Drivers by points: if/else 37 (104 pts), loops 30 (91 pts), match/switch 1 (2 pts) (nesting depth added 129). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotationValue::write_to_out_protocol (cognitive 62) thunder/schema/user.rs:5387— AnnotationValue::write_to_out_protocol has cognitive complexity 62 (threshold 15). Drivers by points: loops 29 (61 pts), match/switch 1 (nesting depth added 32). 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.
RetrievalInputBuffer::compute_from_columnar_bytes (cognitive 46) phoenix/crates/serving/xai-recsys-engine/src/util.rs:239— RetrievalInputBuffer::compute_from_columnar_bytes has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 6 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RetrievalInputBuffer::compute_for_item (cognitive 41) phoenix/crates/serving/xai-recsys-engine/src/util.rs:42— RetrievalInputBuffer::compute_for_item has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 6 (13 pts), match/switch 4 (7 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TweetTypeMetricsHydrator::create_tweet_type_bitset (cognitive 34) home-mixer/candidate_hydrators/tweet_type_metrics_hydrator.rs:24— TweetTypeMetricsHydrator::create_tweet_type_bitset has cognitive complexity 34 (threshold 15). Drivers by points: if/else 29 (32 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
TweetTypeMetricsHydrator::slate_position_bits (cognitive 16) home-mixer/candidate_hydrators/tweet_type_metrics_hydrator.rs:163— TweetTypeMetricsHydrator::slate_position_bits has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RetrieveRequestBatch::build_eligible_mask_into_shards (cognitive 25) phoenix/crates/serving/xai-recsys-engine/src/python.rs:688— RetrieveRequestBatch::build_eligible_mask_into_shards has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (8 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RetrieveRequestBatch::reply (cognitive 19) phoenix/crates/serving/xai-recsys-engine/src/python.rs:782— RetrieveRequestBatch::reply has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Place::write_to_out_protocol (cognitive 19) thunder/schema/tweet.rs:1530— Place::write_to_out_protocol has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, loops 4 (8 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Place::read_from_in_protocol (cognitive 17) thunder/schema/tweet.rs:1419— Place::read_from_in_protocol has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×2
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×2
D4 · Code Duplication· Near-duplicate member family (4 members, 29 shared lines) · ×2
Near-duplicate member family (4 members, 29 shared lines) home-mixer/server.rs:371— home-mixer/server.rs:371-422 | home-mixer/server.rs:467-522 | home-mixer/server.rs:533-585 | home-mixer/server.rs:636-688 — These 4 members are variants of one another: a block of 29 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Near-duplicate member family (4 members, 29 shared lines) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:233— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:233-335 | thunder/schema/media_common.rs:385-446 | thunder/schema/tweet.rs:2674-2736 | thunder/schema/user.rs:10784-10827 — These 4 members are variants of one another: a block of 29 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Near-duplicate member pair (54 shared lines) phoenix/xrex/pallas/ranker_attention_v2.py:905— phoenix/xrex/pallas/ranker_attention_v2.py:905-1091 | phoenix/xrex/pallas/ranker_attention_varlen.py:1054-1328 — These two members are variants of one another: 54 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (54 shared lines) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala:49— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala:49-116 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala:50-136 — These two members are variants of one another: 54 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (35 shared lines) phoenix/xrex/models/recsys_feature_prep.py:758— phoenix/xrex/models/recsys_feature_prep.py:758-834 | phoenix/xrex/models/recsys_model.py:1620-1724 — These two members are variants of one another: 35 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 (35 shared lines) phoenix/xrex/pallas/ranker_attention_varlen.py:218— phoenix/xrex/pallas/ranker_attention_varlen.py:218-355 | phoenix/xrex/pallas/ranker_attention_varlen.py:721-861 — These two members are variants of one another: 35 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (30 shared lines) phoenix/xrex/pallas/ranker_attention_v2.py:660— phoenix/xrex/pallas/ranker_attention_v2.py:660-757 | phoenix/xrex/pallas/ranker_attention_v2.py:785-880 — These two members are variants of one another: 30 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (30 shared lines) phoenix/xrex/pallas/ranker_attention_v2.py:85— phoenix/xrex/pallas/ranker_attention_v2.py:85-190 | phoenix/xrex/pallas/ranker_attention_varlen.py:218-355 — These two members are variants of one another: 30 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (8 members, 50+ identical tokens) botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:272— botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:272-319 | botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:329-375 | botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:386-473 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:132-309 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:323-456 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:142-277 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:290-374 | botmaker/src/scala/com/twitter/botmaker/runtime/LogWriter.scala:127-171 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:49— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:49-174 | simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:51-195 | simclusters/simclusters_v2/summingbird/storm/PersistentTweetJobRunner.scala:54-210 | simclusters/simclusters_v2/summingbird/storm/TweetJobRunner.scala:59-256 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJobRunner.scala:55-206 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala:51-195 | simclusters/simclusters_v2/summingbird/storm/TwhinTweetJobRunner.scala:54-233 | simclusters/simclusters_v2/summingbird/storm/TwhinUserJobRunner.scala:51-180 — 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.
Duplicated block (46 lines × 2) thunder/schema/user.rs:10084— thunder/schema/user.rs:10084-10129 | thunder/schema/user.rs:10491-10536 — both copies are in the same file, so extract the block into 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) phoenix/xrex/models/recsys_gen_recs_model.py:191— phoenix/xrex/models/recsys_gen_recs_model.py:191-236 | phoenix/xrex/models/recsys_gen_recs_model.py:401-446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (45 lines × 2) home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:769— home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:769-813 | home-mixer/candidate_pipeline/phoenix_scores_pipeline.rs:257-301 — before extracting anything, compare `home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/phoenix_scores_pipeline.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (45 lines × 2) phoenix/xrex/cutedsl/ranker_attention_fa4.py:138— phoenix/xrex/cutedsl/ranker_attention_fa4.py:138-182 | phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:407-451 — before extracting anything, compare `phoenix/xrex/cutedsl/ranker_attention_fa4.py` and `phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 258 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/cutedsl/ranker_attention_fa4.py:138` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (39 lines × 2) home-mixer/ads/multi_risk_blender.rs:215— home-mixer/ads/multi_risk_blender.rs:215-253 | home-mixer/ads/partition_organic_blender.rs:150-188 — before extracting anything, compare `home-mixer/ads/multi_risk_blender.rs` and `home-mixer/ads/partition_organic_blender.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (39 lines × 2) home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:821— home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:821-859 | home-mixer/candidate_pipeline/phoenix_scores_pipeline.rs:300-338 — before extracting anything, compare `home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/phoenix_scores_pipeline.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (24 lines × 3) home-mixer/ads/multi_risk_blender.rs:339— home-mixer/ads/multi_risk_blender.rs:339-362 | home-mixer/ads/partition_organic_blender.rs:269-292 | home-mixer/ads/time_gap_blender.rs:248-271 — before extracting anything, compare `home-mixer/ads/multi_risk_blender.rs` and `home-mixer/ads/partition_organic_blender.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (24 lines × 3) phoenix/xrex/inference/gen_recs_runner.py:316— phoenix/xrex/inference/gen_recs_runner.py:316-339 | phoenix/xrex/inference/model_runner.py:5359-5382 | phoenix/xrex/inference/sid_retrieval_runner.py:382-405 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/inference/gen_recs_runner.py:316` it does not close everything it opens, so those 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 (19–21 lines × 2) home-mixer/ads/partition_organic_blender.rs:135— home-mixer/ads/partition_organic_blender.rs:135-155 | home-mixer/ads/time_gap_blender.rs:144-162 — before extracting anything, compare `home-mixer/ads/partition_organic_blender.rs` and `home-mixer/ads/time_gap_blender.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19–21 lines × 2) phoenix/xrex/cutedsl/ranker_attention_fa4.py:585— phoenix/xrex/cutedsl/ranker_attention_fa4.py:585-605 | phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:728-746 — before extracting anything, compare `phoenix/xrex/cutedsl/ranker_attention_fa4.py` and `phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 258 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/cutedsl/ranker_attention_fa4.py:585` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 11) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:248— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:248-260 | thunder/schema/events.rs:2618-2630 | thunder/schema/tweet.rs:698-710 | thunder/schema/tweet.rs:992-1004 | thunder/schema/tweet.rs:2382-2394 | thunder/schema/tweet.rs:2685-2697 | thunder/schema/tweet.rs:3733-3745 | thunder/schema/user.rs:3278-3290 | thunder/schema/user.rs:5861-5873 | thunder/schema/user.rs:10792-10804 | thunder/schema/user.rs:12231-12243 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 214 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 11) thunder/schema/tweet.rs:848— thunder/schema/tweet.rs:848-860 | thunder/schema/tweet.rs:1158-1170 | thunder/schema/tweet_media.rs:412-424 | thunder/schema/tweet_media.rs:489-501 | thunder/schema/user.rs:3355-3367 | thunder/schema/user.rs:3880-3892 | thunder/schema/user.rs:4033-4045 | thunder/schema/user.rs:4401-4413 | thunder/schema/user.rs:4621-4633 | thunder/schema/user.rs:4844-4856 | thunder/schema/user.rs:14123-14135 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_media.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 9) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:482— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:482-494 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:765-777 | thunder/schema/media_entity.rs:199-211 | thunder/schema/tweet.rs:1661-1673 | thunder/schema/tweet.rs:2705-2717 | thunder/schema/tweet.rs:3741-3753 | thunder/schema/user.rs:10800-10812 | thunder/schema/user.rs:12995-13007 | thunder/schema/user.rs:13035-13047 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/media_entity.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 9) thunder/schema/tweet.rs:2180— thunder/schema/tweet.rs:2180-2192 | thunder/schema/tweet.rs:3541-3553 | thunder/schema/tweet_media.rs:264-276 | thunder/schema/tweet_media.rs:423-435 | thunder/schema/user.rs:3891-3903 | thunder/schema/user.rs:4632-4644 | thunder/schema/user.rs:7019-7031 | thunder/schema/user.rs:12586-12598 | thunder/schema/user.rs:13920-13932 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_media.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 5) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:486— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:486-498 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:769-781 | thunder/schema/user.rs:12239-12251 | thunder/schema/user.rs:12999-13011 | thunder/schema/user.rs:13039-13051 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 5) phoenix/xrex/data/grpc_recsys.py:78— phoenix/xrex/data/grpc_recsys.py:78-90 | phoenix/xrex/inference/gen_recs_runner.py:331-343 | phoenix/xrex/inference/model_runner.py:4252-4264 | phoenix/xrex/inference/model_runner.py:5374-5386 | phoenix/xrex/inference/sid_retrieval_runner.py:397-409 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (12 lines × 9) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:746— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:746-757 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:778-789 | thunder/schema/tweet.rs:2267-2278 | thunder/schema/tweet.rs:2387-2398 | thunder/schema/tweet.rs:2690-2701 | thunder/schema/tweet.rs:3738-3749 | thunder/schema/user.rs:10797-10808 | thunder/schema/user.rs:13048-13059 | thunder/schema/user.rs:13650-13661 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 293 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 9) thunder/schema/events.rs:316— thunder/schema/events.rs:316-327 | thunder/schema/events.rs:4056-4067 | thunder/schema/tweet.rs:1878-1889 | thunder/schema/tweet.rs:1942-1953 | thunder/schema/tweet.rs:2808-2819 | thunder/schema/tweet.rs:5187-5198 | thunder/schema/tweet_events.rs:695-706 | thunder/schema/tweet_events.rs:1244-1255 | thunder/schema/user.rs:3792-3803 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 6) thunder/schema/media_common.rs:521— thunder/schema/media_common.rs:521-532 | thunder/schema/user.rs:5803-5814 | thunder/schema/user.rs:7127-7138 | thunder/schema/user.rs:10965-10976 | thunder/schema/user.rs:13074-13085 | thunder/schema/user.rs:13374-13385 — before extracting anything, compare `thunder/schema/media_common.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 6) thunder/schema/tweet_media.rs:624— thunder/schema/tweet_media.rs:624-635 | thunder/schema/tweet_media.rs:708-719 | thunder/schema/tweet_media.rs:791-802 | thunder/schema/user.rs:8099-8110 | thunder/schema/user.rs:9923-9934 | thunder/schema/user.rs:12271-12282 — before extracting anything, compare `thunder/schema/tweet_media.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 172 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 11) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:485— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:485-495 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:768-778 | thunder/schema/events.rs:2625-2635 | thunder/schema/media_common.rs:411-421 | thunder/schema/media_entity.rs:202-212 | thunder/schema/tweet.rs:1775-1785 | thunder/schema/tweet.rs:3744-3754 | thunder/schema/user.rs:11247-11257 | thunder/schema/user.rs:12238-12248 | thunder/schema/user.rs:12998-13008 | thunder/schema/user.rs:13038-13048 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 214 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 × 11) thunder/schema/events.rs:687— thunder/schema/events.rs:687-697 | thunder/schema/events.rs:884-894 | thunder/schema/events.rs:1043-1053 | thunder/schema/events.rs:1611-1621 | thunder/schema/media_entity.rs:228-238 | thunder/schema/tweet.rs:3023-3033 | thunder/schema/tweet_events.rs:309-319 | thunder/schema/user.rs:9142-9152 | thunder/schema/user.rs:9186-9196 | thunder/schema/user.rs:9202-9212 | thunder/schema/user.rs:9250-9260 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/media_entity.rs` as WHOLE FILES: this scan already matched 6 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 (10 lines × 14) phoenix-rankall/src/processor/gen/hydra.rs:206— phoenix-rankall/src/processor/gen/hydra.rs:206-215 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:99-108 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:608-617 | thunder/schema/events.rs:1024-1033 | thunder/schema/events.rs:3031-3040 | thunder/schema/events.rs:3108-3117 | thunder/schema/events.rs:3185-3194 | thunder/schema/events.rs:3262-3271 | thunder/schema/events.rs:3567-3576 | thunder/schema/events.rs:3738-3747 | thunder/schema/tweet.rs:2579-2588 | thunder/schema/tweet.rs:2876-2885 | thunder/schema/user.rs:5715-5724 | thunder/schema/user.rs:9689-9698 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 14) thunder/schema/user.rs:3631— thunder/schema/user.rs:3631-3640 | thunder/schema/user.rs:4775-4784 | thunder/schema/user.rs:6135-6144 | thunder/schema/user.rs:6223-6232 | thunder/schema/user.rs:6279-6288 | thunder/schema/user.rs:6303-6312 | thunder/schema/user.rs:6335-6344 | thunder/schema/user.rs:6363-6372 | thunder/schema/user.rs:7345-7354 | thunder/schema/user.rs:7596-7605 | thunder/schema/user.rs:7632-7641 | thunder/schema/user.rs:8614-8623 | thunder/schema/user.rs:9110-9119 | thunder/schema/user.rs:9270-9279 — all 14 copies are in the same file, so extract the block into one function there and call 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 × 8) thunder/schema/events.rs:260— thunder/schema/events.rs:260-269 | thunder/schema/events.rs:427-436 | thunder/schema/events.rs:507-516 | thunder/schema/events.rs:587-596 | thunder/schema/events.rs:2231-2240 | thunder/schema/events.rs:2510-2519 | thunder/schema/events.rs:2577-2586 | thunder/schema/events.rs:2750-2759 — 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 (10 lines × 8) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:132— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:132-141 | simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:147-156 | simclusters/simclusters_v2/summingbird/storm/PersistentTweetJobRunner.scala:174-183 | simclusters/simclusters_v2/summingbird/storm/TweetJobRunner.scala:199-208 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJobRunner.scala:163-172 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala:147-156 | simclusters/simclusters_v2/summingbird/storm/TwhinTweetJobRunner.scala:180-189 | simclusters/simclusters_v2/summingbird/storm/TwhinUserJobRunner.scala:137-146 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala` and `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:132` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 10) thunder/schema/events.rs:2073— thunder/schema/events.rs:2073-2081 | thunder/schema/events.rs:2269-2277 | thunder/schema/events.rs:2362-2370 | thunder/schema/tweet.rs:1155-1163 | thunder/schema/tweet.rs:1293-1301 | thunder/schema/tweet.rs:3255-3263 | thunder/schema/tweet.rs:4095-4103 | thunder/schema/tweet_events.rs:1026-1034 | thunder/schema/user.rs:4695-4703 | thunder/schema/user.rs:10152-10160 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 10) thunder/schema/events.rs:4044— thunder/schema/events.rs:4044-4052 | thunder/schema/tweet.rs:2454-2462 | thunder/schema/tweet.rs:2796-2804 | thunder/schema/user.rs:10874-10882 | thunder/schema/user.rs:11138-11146 | thunder/schema/user.rs:11328-11336 | thunder/schema/user.rs:11472-11480 | thunder/schema/user.rs:11616-11624 | thunder/schema/user.rs:11786-11794 | thunder/schema/user.rs:13256-13264 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 6) thunder/schema/events.rs:1604— thunder/schema/events.rs:1604-1612 | thunder/schema/tweet.rs:1495-1503 | thunder/schema/user.rs:9899-9907 | thunder/schema/user.rs:9909-9917 | thunder/schema/user.rs:9919-9927 | thunder/schema/user.rs:10705-10713 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 6) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:81— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:81-89 | simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:98-106 | simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:140-148 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala:80-88 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala:97-105 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala:138-146 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 8) thunder/schema/tweet.rs:1826— thunder/schema/tweet.rs:1826-1832 | thunder/schema/tweet.rs:2300-2306 | thunder/schema/tweet_events.rs:720-726 | thunder/schema/tweet_events.rs:974-980 | thunder/schema/tweet_events.rs:1071-1077 | thunder/schema/user.rs:11293-11299 | thunder/schema/user.rs:12814-12820 | thunder/schema/user.rs:13118-13124 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 8) thunder/schema/events.rs:734— thunder/schema/events.rs:734-740 | thunder/schema/events.rs:931-937 | thunder/schema/events.rs:1684-1690 | thunder/schema/events.rs:2745-2751 | thunder/schema/events.rs:2817-2823 | thunder/schema/events.rs:3643-3649 | thunder/schema/events.rs:3814-3820 | thunder/schema/media_common.rs:453-459 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/media_common.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) phoenix-rankall/src/processor/gen/hydra.rs:134— phoenix-rankall/src/processor/gen/hydra.rs:134-140 | thunder/schema/events.rs:1761-1767 | thunder/schema/events.rs:4078-4084 | thunder/schema/tweet.rs:1900-1906 | thunder/schema/tweet.rs:1964-1970 | thunder/schema/user.rs:3833-3839 | thunder/schema/user.rs:3842-3848 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 95 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 (7 lines × 7) thunder/schema/events.rs:754— thunder/schema/events.rs:754-760 | thunder/schema/events.rs:951-957 | thunder/schema/events.rs:3663-3669 | thunder/schema/events.rs:3834-3840 | thunder/schema/tweet_events.rs:214-220 | thunder/schema/tweet_events.rs:345-351 | thunder/schema/tweet_events.rs:475-481 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20–21 lines × 2) simclusters/simclusters_v2/common/clustering/LouvainClusteringMethod.scala:66— simclusters/simclusters_v2/common/clustering/LouvainClusteringMethod.scala:66-86 | simclusters/simclusters_v2/common/clustering/LouvainClusteringMethod.scala:143-162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/common/clustering/LouvainClusteringMethod.scala:143` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20–21 lines × 2) phoenix/xrex/pallas/ranker_attention_v2.py:1019— phoenix/xrex/pallas/ranker_attention_v2.py:1019-1038 | phoenix/xrex/pallas/ranker_attention_varlen.py:1215-1235 — before extracting anything, compare `phoenix/xrex/pallas/ranker_attention_v2.py` and `phoenix/xrex/pallas/ranker_attention_varlen.py` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 287 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_v2.py:1019` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–12 lines × 2) simclusters/simclusters_v2/scalding/KnownForSources.scala:196— simclusters/simclusters_v2/scalding/KnownForSources.scala:196-207 | simclusters/simclusters_v2/scalding/UserUserFavGraph.scala:274-282 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/scalding/UserUserFavGraph.scala:274` it does not close everything it opens, so those 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–12 lines × 2) grox/flows/upa/classifier_banger_initial_screen_gemma.py:72— grox/flows/upa/classifier_banger_initial_screen_gemma.py:72-83 | grox/flows/upa/classifier_post_safety_screen_deluxe.py:35-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `grox/flows/upa/classifier_banger_initial_screen_gemma.py:72` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 4) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala:60— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala:60-70 | simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:53-63 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala:53-62 | simclusters/simclusters_v2/summingbird/storm/TwhinUserJob.scala:44-53 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJob.scala:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 4) botmaker/src/java/com/twitter/botmaker/compiler/Parser.java:38— botmaker/src/java/com/twitter/botmaker/compiler/Parser.java:38-48 | botmaker/src/java/com/twitter/botmaker/compiler/Parser.java:86-96 | botmaker/src/java/com/twitter/botmaker/compiler/Parser.java:145-154 | botmaker/src/java/com/twitter/botmaker/compiler/Parser.java:209-218 — 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 `botmaker/src/java/com/twitter/botmaker/compiler/Parser.java:38` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) simclusters/simclusters_v2/scalding/embedding/SimilarUsersBySimClustersEmbedding.scala:163— simclusters/simclusters_v2/scalding/embedding/SimilarUsersBySimClustersEmbedding.scala:163-172 | simclusters/simclusters_v2/scalding/embedding/SimilarUsersBySimClustersEmbedding.scala:179-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/scalding/embedding/SimilarUsersBySimClustersEmbedding.scala:163` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) phoenix/xrex/pallas/ranker_attention_v2.py:744— phoenix/xrex/pallas/ranker_attention_v2.py:744-754 | phoenix/xrex/pallas/ranker_attention_varlen.py:842-851 — before extracting anything, compare `phoenix/xrex/pallas/ranker_attention_v2.py` and `phoenix/xrex/pallas/ranker_attention_varlen.py` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 287 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_v2.py:744` it begins part-way through the construct above it, so those 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, `phoenix/xrex/pallas/ranker_attention_varlen.py:841` calls `minimum`, `fori_loop` and `phoenix/xrex/pallas/ranker_attention_v2.py:744` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 2) simclusters/simclusters_v2/scalding/embedding/tfg/InferredLanguageTfgBasedTopicEmbeddingsBaseApp.scala:62— simclusters/simclusters_v2/scalding/embedding/tfg/InferredLanguageTfgBasedTopicEmbeddingsBaseApp.scala:62-70 | simclusters/simclusters_v2/scalding/topic_recommendations/TopicsForProducersUtils.scala:66-75 — 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 `simclusters/simclusters_v2/scalding/embedding/tfg/InferredLanguageTfgBasedTopicEmbeddingsBaseApp.scala:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `simclusters/simclusters_v2/scalding/topic_recommendations/TopicsForProducersUtils.scala:65` calls `withDescription` and `simclusters/simclusters_v2/scalding/embedding/tfg/InferredLanguageTfgBasedTopicEmbeddingsBaseApp.scala:61` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 2) REDACTED:937— REDACTED:937-946 | REDACTED:963-971 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:963` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–7 lines × 14) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9284— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9284-9289 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9291-9297 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9300-9306 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9310-9316 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9321-9327 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9333-9339 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9346-9352 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9526-9531 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9533-9539 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9542-9548 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9552-9558 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9563-9569 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9575-9581 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9588-9594 — all 14 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9284` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 14) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12315— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12315-12320 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12322-12328 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12331-12337 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12341-12347 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12352-12358 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12364-12370 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12377-12383 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12546-12551 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12553-12559 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12562-12568 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12572-12578 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12583-12589 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12595-12601 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12608-12614 — all 14 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12315` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3565— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3565-3570 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3572-3578 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3581-3587 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3591-3597 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3709-3714 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3716-3722 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3725-3731 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3735-3741 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3565` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 8) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10288— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10288-10293 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10295-10301 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10304-10310 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10314-10320 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10443-10448 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10450-10456 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10459-10465 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10469-10475 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10288` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2480— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2480-2485 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2487-2493 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2496-2502 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2610-2615 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2617-2623 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2626-2632 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2480` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3339— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3339-3344 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3346-3352 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3355-3361 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3458-3463 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3465-3471 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3474-3480 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3339` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 5) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3629— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3629-3633 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3636-3640 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3645-3649 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3655-3659 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3666-3670 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3629` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 5) phoenix/xrex/models/recsys_model.py:1540— phoenix/xrex/models/recsys_model.py:1540-1544 | phoenix/xrex/models/recsys_model.py:1951-1957 | phoenix/xrex/models/recsys_model.py:1966-1971 | phoenix/xrex/models/recsys_model.py:3067-3071 | phoenix/xrex/models/recsys_model.py:3099-3103 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/models/recsys_model.py:1540` it begins part-way through the construct above it, so those 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 (48 lines × 2) botmaker/src/java/com/twitter/botmaker/compiler/Mock.java:24— botmaker/src/java/com/twitter/botmaker/compiler/Mock.java:24-71 | botmaker/src/java/com/twitter/botmaker/compiler/Mock.java:97-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/java/com/twitter/botmaker/compiler/Mock.java:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (48 lines × 2) grox/flows/mm_emb/renderer_v82.py:192— grox/flows/mm_emb/renderer_v82.py:192-239 | grox/flows/mm_emb/renderer_v8_search.py:232-279 — before extracting anything, compare `grox/flows/mm_emb/renderer_v82.py` and `grox/flows/mm_emb/renderer_v8_search.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 176 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (53 lines × 2) grox/flows/reply_spam/task_filter.py:105— grox/flows/reply_spam/task_filter.py:105-157 | grox/flows/reply_spam/task_multi_step_reply_spam.py:38-90 — before extracting anything, compare `grox/flows/reply_spam/task_filter.py` and `grox/flows/reply_spam/task_multi_step_reply_spam.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (53 lines × 2) phoenix/xrex/cutedsl/ranker_attention_fa4.py:477— phoenix/xrex/cutedsl/ranker_attention_fa4.py:477-529 | phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:634-686 — before extracting anything, compare `phoenix/xrex/cutedsl/ranker_attention_fa4.py` and `phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 258 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/cutedsl/ranker_attention_fa4.py:477` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–20 lines × 2) grox/flows/mm_emb/renderer.py:133— grox/flows/mm_emb/renderer.py:133-152 | phoenix/reference/mm_encoder.py:195-212 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–20 lines × 2) grox/flows/upa/task_filter.py:17— grox/flows/upa/task_filter.py:17-34 | grox/flows/upa/task_filter.py:55-74 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `grox/flows/upa/task_filter.py:17` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 before the matched lines, `grox/flows/upa/task_filter.py:16` calls `counter`, `add` and `grox/flows/upa/task_filter.py:54` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–9 lines × 2) phoenix/xrex/models/recsys_attention.py:21— phoenix/xrex/models/recsys_attention.py:21-27 | phoenix/xrex/models/recsys_attention.py:92-100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–9 lines × 2) phoenix/xrex/pallas/attention.py:64— phoenix/xrex/pallas/attention.py:64-72 | phoenix/xrex/pallas/attention.py:401-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6–7 lines × 2) grox/flows/ptos/classifier.py:286— grox/flows/ptos/classifier.py:286-291 | grox/flows/ptos/classifier.py:341-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. Read the line range as the matched WINDOW rather than a finished unit: at `grox/flows/ptos/classifier.py:341` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 2) grox/libs/kafka_cli/multi_region_consumer.py:76— grox/libs/kafka_cli/multi_region_consumer.py:76-82 | grox/libs/kafka_cli/multi_region_producer.py:73-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. Read the line range as the matched WINDOW rather than a finished unit: at `grox/libs/kafka_cli/multi_region_consumer.py:76` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Low cohesion: ActionControl (LCOM4 4) abuse-enforcement-service/service-lib/src/action_control.rs:712— ActionControl'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: RecsysPredictorServer (LCOM4 4) phoenix/crates/serving/xai-recsys-engine/src/python.rs:3712— RecsysPredictorServer'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.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×2
Recursive walk over a caller-supplied document has no depth cap phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py:168— `from_dict` is public and takes `value: Any` from its caller, and it calls itself at line 168 (`from_dict`) with a piece of `value` (and at line 175, line 213, line 224, line 250) — and nowhere in `from_dict` 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 `from_dict` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py:266— `to_dict` is public and takes `obj: Any` from its caller, and it calls itself at line 266 (`to_dict`) with a piece of `obj` (and at line 268, line 270, line 288) — and nowhere in `to_dict` 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 `to_dict` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
batch_prefetcher.prefetcher_loop (cyclomatic 110) REDACTED:133— batch_prefetcher.prefetcher_loop has cyclomatic complexity 110 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RankingBatchPrep::compute_batch_inputs_rust_quick (cyclomatic 103) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1587— RankingBatchPrep::compute_batch_inputs_rust_quick 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.
recsys_batch.from_record_batch (cyclomatic 103) phoenix/xrex/data/recsys/recsys_batch.py:710— recsys_batch.from_record_batch 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.
row_embedding_restore._prepare (cyclomatic 94) phoenix/xrex/train/row_embedding_restore.py:66— row_embedding_restore._prepare has cyclomatic complexity 94 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Event::read_from_in_protocol (cyclomatic 87) thunder/schema/events.rs:4137— Event::read_from_in_protocol has cyclomatic complexity 87 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Account::write_to_out_protocol (cyclomatic 69) thunder/schema/user.rs:6480— Account::write_to_out_protocol has cyclomatic complexity 69 (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: Account::read_from_in_protocol (cyclomatic 71) 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.
score_results_sink_focal._decide_hard_enforcement (cyclomatic 65) REDACTED:821— score_results_sink_focal._decide_hard_enforcement has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FlashAttentionForwardSm100.correction_loop (cyclomatic 63) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:2240— FlashAttentionForwardSm100.correction_loop has cyclomatic complexity 63 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
recsys_bundle_export.build_bundle (cyclomatic 62) phoenix/xrex/train/recsys_bundle_export.py:1074— recsys_bundle_export.build_bundle has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RecsysAggregatedModel.build_inputs (cyclomatic 59) phoenix/xrex/models/recsys_model.py:3512— RecsysAggregatedModel.build_inputs 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.
FlashAttentionForwardSm100.__call__ (cyclomatic 56) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:437— FlashAttentionForwardSm100.__call__ has cyclomatic complexity 56 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
Safety::write_to_out_protocol (cyclomatic 55) thunder/schema/user.rs:9353— Safety::write_to_out_protocol has cyclomatic complexity 55 (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: Account::read_from_in_protocol (cyclomatic 71) 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.
Compiler.createASTNodeTree (cyclomatic 54) botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:138— Compiler.createASTNodeTree 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.
Trainer.maybe_load_checkpoint (cyclomatic 54) phoenix/xrex/train/trainer.py:1163— Trainer.maybe_load_checkpoint has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RecsysTwoTowerEval.run (cyclomatic 53) phoenix/xrex/eval/recsys_eval.py:150— RecsysTwoTowerEval.run has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InterleavingRecordBatchProvider.__init__ (cyclomatic 52) phoenix/xrex/data/parquet_recsys.py:736— InterleavingRecordBatchProvider.__init__ has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RustKafkaDataset._async_kafka_consumer_arrow (cyclomatic 51) phoenix/xrex/data/rust_kafka_recsys.py:109— RustKafkaDataset._async_kafka_consumer_arrow has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FeaturesOfAuthCompletion.putLoginToMap (cyclomatic 49) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:133— FeaturesOfAuthCompletion.putLoginToMap has cyclomatic complexity 49 (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.
RecsysTrainer.create_executable (cyclomatic 49) phoenix/xrex/train/trainer_recsys.py:2497— RecsysTrainer.create_executable 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.
FlashAttentionForwardSm100.softmax_loop (cyclomatic 47) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:1788— FlashAttentionForwardSm100.softmax_loop has cyclomatic complexity 47 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
BaseModelRunner.run (cyclomatic 46) phoenix/xrex/inference/model_runner.py:3585— BaseModelRunner.run 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.
RecsysAggregatedModel.loss_inputs_and_normalizers (cyclomatic 45) phoenix/xrex/models/recsys_model.py:4164— RecsysAggregatedModel.loss_inputs_and_normalizers 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.
abuse_score_accumulator::main (cyclomatic 44) bdsm/rust/accumulator/src/main.rs:314— abuse_score_accumulator::main 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.
FlashAttentionForwardSm100.kernel (cyclomatic 44) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:850— FlashAttentionForwardSm100.kernel has cyclomatic complexity 44 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
BaseModelRunner.handle_requests (cyclomatic 43) phoenix/xrex/inference/model_runner.py:3235— BaseModelRunner.handle_requests has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RecsysAggregatedModel.loss (cyclomatic 43) phoenix/xrex/models/recsys_model.py:4416— RecsysAggregatedModel.loss has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
User::write_to_out_protocol (cyclomatic 42) thunder/schema/user.rs:14538— User::write_to_out_protocol 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. This is NOT this file's highest cyclomatic complexity: Account::read_from_in_protocol (cyclomatic 71) 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.
RetrievalBatchPrep::compute_batch_inputs_rust_quick (cyclomatic 42) phoenix/crates/serving/xai-recsys-engine/src/python.rs:2406— RetrievalBatchPrep::compute_batch_inputs_rust_quick 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.
RecsysTrainer._save_checkpoint_current_params (cyclomatic 41) phoenix/xrex/train/trainer_recsys.py:3406— RecsysTrainer._save_checkpoint_current_params has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PostRenderer.render (cyclomatic 41) grox/core/lm/post.py:36— PostRenderer.render has cyclomatic complexity 41 (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.
MediaLoader.hydrate_media (cyclomatic 40) grox/core/data_loaders/media_loader.py:226— MediaLoader.hydrate_media 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.
FlashAttentionForwardSm100.__init__ (cyclomatic 39) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:204— FlashAttentionForwardSm100.__init__ has cyclomatic complexity 39 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
TaskPublishUnifiedPostAnnotationsManhattan._exec (cyclomatic 39) grox/flows/upa/task_write.py:33— TaskPublishUnifiedPostAnnotationsManhattan._exec 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.
Compiler.botmakerFunctionToASTNode (cyclomatic 37) botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:475— Compiler.botmakerFunctionToASTNode has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
recsys_batch.apply_negative_sampling (cyclomatic 37) phoenix/xrex/data/recsys/recsys_batch.py:1623— recsys_batch.apply_negative_sampling has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FunctionUnit2O11.createASTNode (cyclomatic 36) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11271— FunctionUnit2O11.createASTNode has cyclomatic complexity 36 (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.
RecsysTrainer._finalize_checkpoint_load (cyclomatic 36) phoenix/xrex/train/trainer_recsys.py:2985— RecsysTrainer._finalize_checkpoint_load 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.
HoldGateConfig::from_config (cyclomatic 35) abuse-enforcement-service/service-lib/src/overturn_hold.rs:244— HoldGateConfig::from_config has cyclomatic complexity 35 (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.
Sender::handle_send (cyclomatic 35) phoenix/crates/serving/xai-recsys-engine/src/copy.rs:423— Sender::handle_send has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
history_id_lists._fill_rows (cyclomatic 35) phoenix/xrex/data/recsys/history_id_lists.py:460— history_id_lists._fill_rows has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PhoenixKafkaDataset.make (cyclomatic 34) phoenix/xrex/data/streaming/kafkaloader.py:1344— PhoenixKafkaDataset.make 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.
KeyOrigin::spec (cyclomatic 33) visibility-filtering/hydration/store/key_origin.rs:74— KeyOrigin::spec 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.
FlashAttentionForwardSm100.load (cyclomatic 33) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:1325— FlashAttentionForwardSm100.load has cyclomatic complexity 33 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
BaseModelRunner._load_via_copy_port (cyclomatic 33) phoenix/xrex/inference/model_runner.py:2256— BaseModelRunner._load_via_copy_port 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.
TweetTypeMetricsHydrator::create_tweet_type_bitset (cyclomatic 32) home-mixer/candidate_hydrators/tweet_type_metrics_hydrator.rs:24— TweetTypeMetricsHydrator::create_tweet_type_bitset has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
kafkaconsumer._consumer_poll_loop (cyclomatic 32) phoenix/xrex/data/streaming/kafkaconsumer.py:1306— kafkaconsumer._consumer_poll_loop 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.
BaseModelRunner._finalize_hot_swap (cyclomatic 32) phoenix/xrex/inference/model_runner.py:1904— BaseModelRunner._finalize_hot_swap 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.
FeaturesOfRtpCaseUpdateEvent.apply (cyclomatic 31) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfRtpCaseUpdateEvent.java:47— FeaturesOfRtpCaseUpdateEvent.apply 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.
xai_configlib.cast_type (cyclomatic 31) phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py:403— xai_configlib.cast_type 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.
FunctionUnit2O9.createASTNode (cyclomatic 30) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9263— FunctionUnit2O9.createASTNode has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FeaturesOfAuthCompletion.putPasswordResetToMap (cyclomatic 30) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:300— FeaturesOfAuthCompletion.putPasswordResetToMap has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FeaturesOfEventBusFanoutEvent.apply (cyclomatic 30) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfEventBusFanoutEvent.java:44— FeaturesOfEventBusFanoutEvent.apply 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.
score_results_sink_focal.main (cyclomatic 30) REDACTED:1459— score_results_sink_focal.main 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.
rust_parquet_recsys._block_shuffle_record_batches (cyclomatic 30) phoenix/xrex/data/rust_parquet_recsys.py:46— rust_parquet_recsys._block_shuffle_record_batches 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.
recsys_bundle_export._retrieval_export (cyclomatic 30) phoenix/xrex/train/recsys_bundle_export.py:937— recsys_bundle_export._retrieval_export has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TaskWriteSafetyPostAnnotationsResultSink._apply_labels_for_annotation (cyclomatic 30) grox/flows/ptos/task_write_safety_post_annotations_result_sink.py:162— TaskWriteSafetyPostAnnotationsResultSink._apply_labels_for_annotation 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.
PhoenixDataset.compute_max_steps (cyclomatic 29) phoenix/xrex/data/parquet_recsys.py:1860— PhoenixDataset.compute_max_steps 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.
checkpoint_storage.load_checkpoint_from_storage (cyclomatic 29) phoenix/xrex/inference/checkpoint_storage.py:82— checkpoint_storage.load_checkpoint_from_storage 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.
launch_inference.run (cyclomatic 29) phoenix/xrex/inference/launch_inference.py:274— launch_inference.run 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.
BaseModelRunner._init_hotswap_buffers (cyclomatic 29) phoenix/xrex/inference/model_runner.py:922— BaseModelRunner._init_hotswap_buffers 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.
V82EmbedPostRenderer._author_block (cyclomatic 29) grox/flows/mm_emb/renderer_v82.py:187— V82EmbedPostRenderer._author_block 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.
V8SearchEmbedPostRenderer._author_block (cyclomatic 29) grox/flows/mm_emb/renderer_v8_search.py:227— V8SearchEmbedPostRenderer._author_block 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.
Store::land (cyclomatic 28) visibility-filtering/hydration/store.rs:518— Store::land 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.
ranker_attention_varlen_fa4._build_packed_block_sparse (cyclomatic 28) phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:30— ranker_attention_varlen_fa4._build_packed_block_sparse 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.
PhoenixKafkaDataset._iterate_training_batches (cyclomatic 28) phoenix/xrex/data/streaming/kafkaloader.py:1516— PhoenixKafkaDataset._iterate_training_batches 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.
kafkaloader._unify_record_batch_schemas (cyclomatic 28) phoenix/xrex/data/streaming/kafkaloader.py:763— kafkaloader._unify_record_batch_schemas 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.
image.build_motion_reveal_images (cyclomatic 28) grox/libs/video_tools/image.py:412— image.build_motion_reveal_images 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.
TweetEventData::read_from_in_protocol (cyclomatic 27) thunder/schema/tweet_events.rs:1319— TweetEventData::read_from_in_protocol has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FunctionUnit2O8.createASTNode (cyclomatic 27) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10883— FunctionUnit2O8.createASTNode has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (FunctionUnit3O8.createASTNode) 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.
FunctionUnit3O8.createASTNode (cyclomatic 27) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12299— FunctionUnit3O8.createASTNode has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (FunctionUnit2O8.createASTNode) 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.
dump_gen._check_with_pyarrow (cyclomatic 27) phoenix/reference/dump_gen.py:448— dump_gen._check_with_pyarrow has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PhoenixKafkaDataset.kafka_to_training_batch (cyclomatic 27) phoenix/xrex/data/streaming/kafkaloader.py:1172— PhoenixKafkaDataset.kafka_to_training_batch has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RetrievalModelRunner.gather_embeddings_and_forward (cyclomatic 27) phoenix/xrex/inference/model_runner.py:5100— RetrievalModelRunner.gather_embeddings_and_forward has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RecsysTwoTowerModel.forward (cyclomatic 27) phoenix/xrex/models/recsys_two_tower_model.py:2225— RecsysTwoTowerModel.forward has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
xai_configlib.from_dict (cyclomatic 27) phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py:158— xai_configlib.from_dict has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HoldGate::evaluate (cyclomatic 26) abuse-enforcement-service/service-lib/src/overturn_hold.rs:1595— HoldGate::evaluate 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.
Perspective::write_to_out_protocol (cyclomatic 26) thunder/schema/user.rs:10489— Perspective::write_to_out_protocol has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: Account::read_from_in_protocol (cyclomatic 71) 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.
FlashAttentionForwardSm100.mma (cyclomatic 26) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:1553— FlashAttentionForwardSm100.mma has cyclomatic complexity 26 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
sequence_packing.pack_batch (cyclomatic 26) phoenix/xrex/data/recsys/sequence_packing.py:315— sequence_packing.pack_batch 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.
model_runner._loader_subprocess_main (cyclomatic 26) phoenix/xrex/inference/model_runner.py:320— model_runner._loader_subprocess_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.
RecsysTrainer._write_shmem_checkpoint (cyclomatic 26) phoenix/xrex/train/trainer_recsys.py:3270— RecsysTrainer._write_shmem_checkpoint 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.
checksum.compare_checksum_dicts (cyclomatic 26) phoenix/python/training/xai-checkpointing/xai_checkpointing/checksum.py:361— checksum.compare_checksum_dicts 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.
MediaLoader.hydrate_video (cyclomatic 26) grox/core/data_loaders/media_loader.py:385— MediaLoader.hydrate_video 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.
UthReferenceMonthMhPublisherApp.buildReference (cyclomatic 25) under-the-hood/scalding/UthReferenceMonthMhPublisherJob.scala:229— UthReferenceMonthMhPublisherApp.buildReference 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.
Type.of (cyclomatic 25) botmaker/src/java/com/twitter/botmaker/compiler/types/Type.java:319— Type.of 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.
RecsysAggregatedModel.metrics (cyclomatic 25) phoenix/xrex/models/recsys_model.py:5027— RecsysAggregatedModel.metrics 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.
Transformer.__call__ (cyclomatic 25) phoenix/xrex/models/transformer.py:686— Transformer.__call__ 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.
V8SearchEmbedPostRenderer.render_for_embedding (cyclomatic 25) grox/flows/mm_emb/renderer_v8_search.py:157— V8SearchEmbedPostRenderer.render_for_embedding 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.
AppPushDevice::write_to_out_protocol (cyclomatic 24) thunder/schema/user.rs:13112— AppPushDevice::write_to_out_protocol has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: Account::read_from_in_protocol (cyclomatic 71) 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.
FunctionUnit4O7.createASTNode (cyclomatic 24) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9687— FunctionUnit4O7.createASTNode has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (FunctionUnit2O7.createASTNode) 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.
FunctionUnit2O7.createASTNode (cyclomatic 24) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10550— FunctionUnit2O7.createASTNode has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (FunctionUnit4O7.createASTNode) 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.
score_results_sink_focal._publish_score_result (cyclomatic 24) REDACTED:1224— score_results_sink_focal._publish_score_result 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.
RetrievalDataset.load_datasets (cyclomatic 24) phoenix/xrex/data/retrieval_dataset.py:396— RetrievalDataset.load_datasets 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.
kafkaconsumer.consume_messages (cyclomatic 24) phoenix/xrex/data/streaming/kafkaconsumer.py:1745— kafkaconsumer.consume_messages 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.
recsys_feature_prep._add_context_features (cyclomatic 24) phoenix/xrex/models/recsys_feature_prep.py:596— recsys_feature_prep._add_context_features 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.
TaskSafetyPtosAdultContentLeadingFramesFilter._eligible_with_post (cyclomatic 24) grox/flows/ptos/task_safety_ptos_adult_content_leading_frames_filter.py:29— TaskSafetyPtosAdultContentLeadingFramesFilter._eligible_with_post has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
HistoryUrlEmbeddingLookup._lookup (cyclomatic 23) phoenix/xrex/data/streaming/history_url_embedding.py:173— HistoryUrlEmbeddingLookup._lookup 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.
kafkaconsumer._consume_multi_consumer (cyclomatic 23) phoenix/xrex/data/streaming/kafkaconsumer.py:1512— kafkaconsumer._consume_multi_consumer 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.
NotificationExtension1::write_to_out_protocol (cyclomatic 22) thunder/schema/user.rs:7387— NotificationExtension1::write_to_out_protocol 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. This is NOT this file's highest cyclomatic complexity: Account::read_from_in_protocol (cyclomatic 71) 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.
mm_encoder._render_single_post (cyclomatic 22) phoenix/reference/mm_encoder.py:127— mm_encoder._render_single_post 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.
ranker_attention_varlen_fa4.varlen_kernels (cyclomatic 22) phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:326— ranker_attention_varlen_fa4.varlen_kernels 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.
InterleavingRecordBatchProvider._get_ready_batches_from_index (cyclomatic 22) phoenix/xrex/data/parquet_recsys.py:1036— InterleavingRecordBatchProvider._get_ready_batches_from_index 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.
recsys_batch.apply_global_negative_sampling (cyclomatic 22) phoenix/xrex/data/recsys/recsys_batch.py:1974— recsys_batch.apply_global_negative_sampling 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.
BaseModelRunner._coordinator_loop (cyclomatic 22) phoenix/xrex/inference/model_runner.py:1658— BaseModelRunner._coordinator_loop 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.
recsys_feature_prep._add_history_features (cyclomatic 22) phoenix/xrex/models/recsys_feature_prep.py:895— recsys_feature_prep._add_history_features 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.
RecsysAggregatedModel.embed_categorical_context_features (cyclomatic 22) phoenix/xrex/models/recsys_model.py:2937— RecsysAggregatedModel.embed_categorical_context_features 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.
Conversation.to_openai_messages (cyclomatic 22) grox/core/lm/convo.py:390— Conversation.to_openai_messages 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.
V5EmbedPostRenderer._render_single_post (cyclomatic 22) grox/flows/mm_emb/renderer.py:49— V5EmbedPostRenderer._render_single_post 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.
Notification::write_to_out_protocol (cyclomatic 21) thunder/schema/user.rs:7693— Notification::write_to_out_protocol 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. This is NOT this file's highest cyclomatic complexity: Account::read_from_in_protocol (cyclomatic 71) 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.
FunctionUnit2O6.createASTNode (cyclomatic 21) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10267— FunctionUnit2O6.createASTNode 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.
FeaturesOfMediaUpdate.putTags (cyclomatic 21) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfMediaUpdate.java:47— FeaturesOfMediaUpdate.putTags 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.
BaseModelRunner._load_via_nfs (cyclomatic 21) phoenix/xrex/inference/model_runner.py:2438— BaseModelRunner._load_via_nfs 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.
checkpointing.save_checkpoint (cyclomatic 21) phoenix/xrex/utils/checkpointing.py:222— checkpointing.save_checkpoint 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.
TaskWriteSafetyPostAnnotationsResultSink._exec (cyclomatic 21) grox/flows/ptos/task_write_safety_post_annotations_result_sink.py:317— TaskWriteSafetyPostAnnotationsResultSink._exec 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.
AdsBrandSafetyVfHydrator::hydrate (cyclomatic 20) home-mixer/candidate_hydrators/ads_brand_safety_vf_hydrator.rs:81— AdsBrandSafetyVfHydrator::hydrate 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.
AnalysisProcessor::process_batch (cyclomatic 20) phoenix-rankall/src/processor/analysis_processor.rs:35— AnalysisProcessor::process_batch 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.
ThriftStructType.getFieldValueMetadata (cyclomatic 20) botmaker/src/java/com/twitter/botmaker/compiler/types/ThriftStructType.java:285— ThriftStructType.getFieldValueMetadata 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.
10.serialize (cyclomatic 20) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:554— 10.serialize 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.
manhattan_arrow_adapter.arrow_bytes_to_batch (cyclomatic 20) bdsm/runtime/manhattan_arrow_adapter.py:74— manhattan_arrow_adapter.arrow_bytes_to_batch 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.
ranker_attention_fa4.ranker_attention_fa4 (cyclomatic 20) phoenix/xrex/cutedsl/ranker_attention_fa4.py:254— ranker_attention_fa4.ranker_attention_fa4 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.
hooks._checkpoint_cleaner (cyclomatic 20) phoenix/xrex/driver/hooks.py:641— hooks._checkpoint_cleaner 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.
BaseModelRunner._maybe_init_live_dense_swap (cyclomatic 20) phoenix/xrex/inference/model_runner.py:1140— BaseModelRunner._maybe_init_live_dense_swap 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.
RecsysAggregatedModelConfig.validate_purchase_value (cyclomatic 20) phoenix/xrex/models/recsys_model.py:1076— RecsysAggregatedModelConfig.validate_purchase_value 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.
RecsysTrainer.maybe_build_retrieval_post_embeddings (cyclomatic 20) phoenix/xrex/train/trainer_recsys.py:3927— RecsysTrainer.maybe_build_retrieval_post_embeddings 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.
Post.from_post_metadata (cyclomatic 20) grox/core/data_loaders/data_types.py:768— Post.from_post_metadata 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.
ConversationControl::read_from_in_protocol (cyclomatic 19) thunder/schema/tweet.rs:4735— ConversationControl::read_from_in_protocol 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.
ScarecrowOutputCollector.addOutputFeature (cyclomatic 19) scarecrow/ScarecrowBotMaker.scala:185— ScarecrowOutputCollector.addOutputFeature 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.
10.computeFingerprint (cyclomatic 19) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:490— 10.computeFingerprint has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 2 other methods here (10.toScript, 10.toStratoJson) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file's highest cyclomatic complexity: 10.deserialize (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
10.toScript (cyclomatic 19) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:740— 10.toScript has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 2 other methods here (10.computeFingerprint, 10.toStratoJson) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file's highest cyclomatic complexity: 10.deserialize (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
10.toStratoJson (cyclomatic 19) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:804— 10.toStratoJson has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: 2 other methods here (10.computeFingerprint, 10.toScript) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file's highest cyclomatic complexity: 10.deserialize (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
score_results_sink_focal._cusp_lane (cyclomatic 19) REDACTED:981— score_results_sink_focal._cusp_lane 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.
score_results_sink_focal._build_bq_row (cyclomatic 19) REDACTED:1162— score_results_sink_focal._build_bq_row 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.
parquet_recsys._block_resume_window (cyclomatic 19) phoenix/xrex/data/parquet_recsys.py:583— parquet_recsys._block_resume_window 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.
id_list_features.parse_id_lists (cyclomatic 19) phoenix/xrex/data/recsys/id_list_features.py:350— id_list_features.parse_id_lists has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
kafkaconsumer.handle_topic_offset (cyclomatic 19) phoenix/xrex/data/streaming/kafkaconsumer.py:1034— kafkaconsumer.handle_topic_offset has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BaseModelRunner.prepare_and_compute (cyclomatic 19) phoenix/xrex/inference/model_runner.py:3019— BaseModelRunner.prepare_and_compute has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
recsys_feature_prep._build_user_features_token (cyclomatic 19) phoenix/xrex/models/recsys_feature_prep.py:504— recsys_feature_prep._build_user_features_token has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
id_list_fill_stats.main (cyclomatic 19) phoenix/xrex/tools/id_list_fill_stats.py:109— id_list_fill_stats.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.
log_util.configure_logging (cyclomatic 19) phoenix/xrex/utils/log_util.py:103— log_util.configure_logging 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.
xai_configlib.replace_recursive (cyclomatic 19) phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py:342— xai_configlib.replace_recursive 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.
load.load_checkpoint_streamed (cyclomatic 19) phoenix/python/training/xai-checkpointing/xai_checkpointing/load.py:468— load.load_checkpoint_streamed has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PostStore::insert_posts_internal (cyclomatic 18) thunder/posts/post_store.rs:156— PostStore::insert_posts_internal 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.
MediaEntity::write_to_out_protocol (cyclomatic 18) thunder/schema/media_entity.rs:277— MediaEntity::write_to_out_protocol 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. This is NOT this file's highest cyclomatic complexity: MediaEntity::read_from_in_protocol (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
Profile::write_to_out_protocol (cyclomatic 18) thunder/schema/user.rs:4502— Profile::write_to_out_protocol 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. This is NOT this file's highest cyclomatic complexity: Account::read_from_in_protocol (cyclomatic 71) 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.
TraceEmitter::new_active (cyclomatic 18) bdsm/rust/accumulator/src/trace.rs:109— TraceEmitter::new_active 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.
TweetEmbedding::write_to_out_protocol (cyclomatic 18) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:821— TweetEmbedding::write_to_out_protocol 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. This is NOT this file's highest cyclomatic complexity: TweetEmbedding::read_from_in_protocol (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
FunctionUnit0O5.createASTNode (cyclomatic 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:632— FunctionUnit0O5.createASTNode 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. This shape REPEATS in the file: 7 other methods here (FunctionUnit1O5.createASTNode, FunctionUnit2O5.createASTNode, FunctionUnit3O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit1O5.createASTNode (cyclomatic 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1478— FunctionUnit1O5.createASTNode 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. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O5.createASTNode, FunctionUnit2O5.createASTNode, FunctionUnit3O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit2O5.createASTNode (cyclomatic 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2459— FunctionUnit2O5.createASTNode 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. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O5.createASTNode, FunctionUnit1O5.createASTNode, FunctionUnit3O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit3O5.createASTNode (cyclomatic 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3549— FunctionUnit3O5.createASTNode 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. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O5.createASTNode, FunctionUnit1O5.createASTNode, FunctionUnit2O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit4O5.createASTNode (cyclomatic 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4748— FunctionUnit4O5.createASTNode 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. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O5.createASTNode, FunctionUnit1O5.createASTNode, FunctionUnit2O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit5O5.createASTNode (cyclomatic 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6043— FunctionUnit5O5.createASTNode 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. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O5.createASTNode, FunctionUnit1O5.createASTNode, FunctionUnit2O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit6O5.createASTNode (cyclomatic 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7424— FunctionUnit6O5.createASTNode 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. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O5.createASTNode, FunctionUnit1O5.createASTNode, FunctionUnit2O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit7O5.createASTNode (cyclomatic 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8907— FunctionUnit7O5.createASTNode 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. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O5.createASTNode, FunctionUnit1O5.createASTNode, FunctionUnit2O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
ScalaType.asJava (cyclomatic 18) botmaker/src/scala/com/twitter/botmaker/compiler/types/ScalaType.scala:65— ScalaType.asJava 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.
Cast.mkCast (cyclomatic 18) botmaker/src/java/com/twitter/botmaker/function/conversion/Cast.java:42— Cast.mkCast 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.
InterleavingRecordBatchProvider._get_record_batches_block_shuffle (cyclomatic 18) phoenix/xrex/data/parquet_recsys.py:1354— InterleavingRecordBatchProvider._get_record_batches_block_shuffle 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.
kafkaconsumer.validate_offset_map (cyclomatic 18) phoenix/xrex/data/streaming/kafkaconsumer.py:884— kafkaconsumer.validate_offset_map 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.
RecsysAggregatedModel.__call__ (cyclomatic 18) phoenix/xrex/models/recsys_model.py:4012— RecsysAggregatedModel.__call__ 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.
RecsysTrainer.async_emb_step (cyclomatic 18) phoenix/xrex/train/trainer_recsys.py:1862— RecsysTrainer.async_emb_step 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.
RecsysTrainer._create_async_emb_executables (cyclomatic 18) phoenix/xrex/train/trainer_recsys.py:2342— RecsysTrainer._create_async_emb_executables 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.
LitePostRenderer.render (cyclomatic 18) grox/core/lm/post.py:143— LitePostRenderer.render 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.
UserRenderer.render (cyclomatic 18) grox/core/lm/user.py:8— UserRenderer.render has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ScoreResultProcessor::process (cyclomatic 17) abuse-enforcement-service/service-lib/src/lib.rs:1583— ScoreResultProcessor::process has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MessagingDevice::write_to_out_protocol (cyclomatic 17) thunder/schema/user.rs:12808— MessagingDevice::write_to_out_protocol has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: Account::read_from_in_protocol (cyclomatic 71) 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.
ScalaType.asScala (cyclomatic 17) botmaker/src/scala/com/twitter/botmaker/compiler/types/ScalaType.scala:178— ScalaType.asScala has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ExperimentalApproximateCosineSimilarity.apply (cyclomatic 17) simclusters/simclustersann/candidate_source/ExperimentalApproximateCosineSimilarity.scala:56— ExperimentalApproximateCosineSimilarity.apply 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.
sequence_cache.merge_realtime_into_sequence (cyclomatic 17) bdsm/runtime/sequence_cache.py:198— sequence_cache.merge_realtime_into_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.
recsys_model.build_metric_masks (cyclomatic 17) phoenix/xrex/models/recsys_model.py:2156— recsys_model.build_metric_masks has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GenRecsTrainer.eval_gen_recs (cyclomatic 17) phoenix/xrex/train/trainer_gen_recs.py:408— GenRecsTrainer.eval_gen_recs 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.
RecsysTrainer.init (cyclomatic 17) phoenix/xrex/train/trainer_recsys.py:702— RecsysTrainer.init has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
trainer_recsys._chunked_row_forward_on_device (cyclomatic 17) phoenix/xrex/train/trainer_recsys.py:237— trainer_recsys._chunked_row_forward_on_device 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.
TaskSafetyPtosKeyFramesFilter._eligible_with_post (cyclomatic 17) grox/flows/ptos/task_safety_ptos_key_frames_filter.py:36— TaskSafetyPtosKeyFramesFilter._eligible_with_post has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TaskSafetyPtosSafemodelSexNudity._run (cyclomatic 17) grox/flows/ptos/task_safety_ptos_safemodel_sex_nudity.py:75— TaskSafetyPtosSafemodelSexNudity._run has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
XaiEmbeddingClientHttp._send_encode_request (cyclomatic 17) grox/libs/embed/embed_http.py:207— XaiEmbeddingClientHttp._send_encode_request 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.
Pipeline::run_loop (cyclomatic 16) phoenix-rankall/src/pipeline/mod.rs:78— Pipeline::run_loop 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.
Counts::write_to_out_protocol (cyclomatic 16) thunder/schema/user.rs:9784— Counts::write_to_out_protocol 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: Account::read_from_in_protocol (cyclomatic 71) 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.
TrendFlattened::read_from_in_protocol (cyclomatic 16) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:233— TrendFlattened::read_from_in_protocol 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. This is NOT this file's highest cyclomatic complexity: TweetEmbedding::read_from_in_protocol (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
FunctionUnit.codeGen (cyclomatic 16) botmaker/src/scala/com/twitter/botmaker/FunctionUnit.scala:140— FunctionUnit.codeGen 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.
ScalaType.ofType (cyclomatic 16) botmaker/src/scala/com/twitter/botmaker/compiler/types/ScalaType.scala:11— ScalaType.ofType 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.
CompiledEvaluator.run (cyclomatic 16) botmaker/src/scala/com/twitter/botmaker/rule/RuleEvaluator.scala:120— CompiledEvaluator.run 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.
FeaturesOfRtpCaseUpdateEvent.processEvidenceFields (cyclomatic 16) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfRtpCaseUpdateEvent.java:301— FeaturesOfRtpCaseUpdateEvent.processEvidenceFields 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.
2.split (cyclomatic 16) botmaker/src/java/com/twitter/botmaker/compiler/RegexCache.java:95— 2.split 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.
ThriftOperator.isDivergentTo (cyclomatic 16) botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java:93— ThriftOperator.isDivergentTo 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.
ThriftStructOperator.isDivergentTo (cyclomatic 16) botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftStructOperator.java:92— ThriftStructOperator.isDivergentTo 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.
login_starter_pack_counter.get_login_pack_age_minutes (cyclomatic 16) bdsm/runtime/login_starter_pack_counter.py:60— login_starter_pack_counter.get_login_pack_age_minutes 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.
score_results_sink_focal._build_policy_config (cyclomatic 16) REDACTED:650— score_results_sink_focal._build_policy_config 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.
score_results_sink_focal._spam_bounce_lane (cyclomatic 16) REDACTED:1100— score_results_sink_focal._spam_bounce_lane 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.
score_results_sink_focal._apply_scoring_cooldowns (cyclomatic 16) REDACTED:1314— score_results_sink_focal._apply_scoring_cooldowns 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.
mm_encoder._process_cardv2 (cyclomatic 16) phoenix/reference/mm_encoder.py:215— mm_encoder._process_cardv2 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.
BaseModelRunner._follower_coordinator_loop (cyclomatic 16) phoenix/xrex/inference/model_runner.py:1809— BaseModelRunner._follower_coordinator_loop 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.
BaseModelRunner.maybe_load_checkpoint (cyclomatic 16) phoenix/xrex/inference/model_runner.py:2571— BaseModelRunner.maybe_load_checkpoint 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.
RecsysAggregatedModelConfig.make (cyclomatic 16) phoenix/xrex/models/recsys_model.py:1266— RecsysAggregatedModelConfig.make 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.
RecsysAggregatedModel._compute_metrics_after_masks (cyclomatic 16) phoenix/xrex/models/recsys_model.py:2338— RecsysAggregatedModel._compute_metrics_after_masks 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.
RecsysAggregatedModel.decode_continuous (cyclomatic 16) phoenix/xrex/models/recsys_model.py:3297— RecsysAggregatedModel.decode_continuous 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.
jax_extensions._find_no_barrier_inputs (cyclomatic 16) phoenix/xrex/utils/jax_extensions.py:201— jax_extensions._find_no_barrier_inputs 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.
MediaLoader.construct_convo_video (cyclomatic 16) grox/core/data_loaders/media_loader.py:616— MediaLoader.construct_convo_video 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.
PostMapper.from_post_metadata_strato (cyclomatic 16) grox/core/data_loaders/post_mapper.py:86— PostMapper.from_post_metadata_strato 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.
TaskASRTranscription._exec_with_post (cyclomatic 16) grox/core/tasks/task_asr.py:38— TaskASRTranscription._exec_with_post 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.
V5EmbedPostRenderer._process_cardv2 (cyclomatic 16) grox/flows/mm_emb/renderer.py:155— V5EmbedPostRenderer._process_cardv2 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.
batch_prefetcher.prefetcher_loop (cognitive 305) REDACTED:133— batch_prefetcher.prefetcher_loop has cognitive complexity 305 (threshold 15). Drivers by points: if/else 68 (175 pts), error handling 19 (52 pts), loops 18 (47 pts), ternaries 6 (21 pts), boolean chains 10 (nesting depth added 184). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlashAttentionForwardSm100.correction_loop (cognitive 227) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:2240— FlashAttentionForwardSm100.correction_loop has cognitive complexity 227 (threshold 15). Drivers by points: if/else 43 (124 pts), ternaries 15 (62 pts), loops 9 (34 pts), boolean chains 7 (nesting depth added 153). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
recsys_batch.from_record_batch (cognitive 184) phoenix/xrex/data/recsys/recsys_batch.py:710— recsys_batch.from_record_batch has cognitive complexity 184 (threshold 15). Drivers by points: if/else 64 (112 pts), loops 14 (31 pts), ternaries 14 (22 pts), boolean chains 16, error handling 1 (3 pts) (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
row_embedding_restore._prepare (cognitive 163) phoenix/xrex/train/row_embedding_restore.py:66— row_embedding_restore._prepare has cognitive complexity 163 (threshold 15). Drivers by points: if/else 38 (82 pts), ternaries 16 (35 pts), boolean chains 34, loops 5 (12 pts) (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RankingBatchPrep::compute_batch_inputs_rust_quick (cognitive 146) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1587— RankingBatchPrep::compute_batch_inputs_rust_quick has cognitive complexity 146 (threshold 15). Drivers by points: if/else 84 (127 pts), boolean chains 15, loops 3 (4 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Trainer.maybe_load_checkpoint (cognitive 133) phoenix/xrex/train/trainer.py:1163— Trainer.maybe_load_checkpoint has cognitive complexity 133 (threshold 15). Drivers by points: if/else 34 (74 pts), loops 11 (35 pts), ternaries 4 (12 pts), boolean chains 9, error handling 1 (3 pts) (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.
Event::read_from_in_protocol (cognitive 131) thunder/schema/events.rs:4137— Event::read_from_in_protocol has cognitive complexity 131 (threshold 15). Drivers by points: if/else 45 (128 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 84). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
abuse_score_accumulator::main (cognitive 119) bdsm/rust/accumulator/src/main.rs:314— abuse_score_accumulator::main has cognitive complexity 119 (threshold 15). Drivers by points: if/else 31 (83 pts), loops 10 (20 pts), match/switch 6 (14 pts), boolean chains 2 (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecsysAggregatedModel.build_inputs (cognitive 108) phoenix/xrex/models/recsys_model.py:3512— RecsysAggregatedModel.build_inputs has cognitive complexity 108 (threshold 15). Drivers by points: if/else 36 (63 pts), ternaries 15 (32 pts), boolean chains 8, loops 2 (5 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
recsys_bundle_export.build_bundle (cognitive 108) phoenix/xrex/train/recsys_bundle_export.py:1074— recsys_bundle_export.build_bundle has cognitive complexity 108 (threshold 15). Drivers by points: if/else 32 (55 pts), ternaries 17 (32 pts), boolean chains 12, loops 4 (9 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.
FeaturesOfRtpCaseUpdateEvent.apply (cognitive 105) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfRtpCaseUpdateEvent.java:47— FeaturesOfRtpCaseUpdateEvent.apply has cognitive complexity 105 (threshold 15). Drivers by points: if/else 24 (92 pts), loops 4 (11 pts), boolean chains 2 (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecsysAggregatedModel.loss_inputs_and_normalizers (cognitive 102) phoenix/xrex/models/recsys_model.py:4164— RecsysAggregatedModel.loss_inputs_and_normalizers has cognitive complexity 102 (threshold 15). Drivers by points: if/else 25 (61 pts), ternaries 10 (25 pts), boolean chains 9, loops 4 (7 pts) (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlashAttentionForwardSm100.softmax_loop (cognitive 99) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:1788— FlashAttentionForwardSm100.softmax_loop has cognitive complexity 99 (threshold 15). Drivers by points: if/else 20 (43 pts), ternaries 14 (32 pts), boolean chains 12, loops 4 (12 pts) (nesting depth added 49). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
BaseModelRunner.run (cognitive 98) phoenix/xrex/inference/model_runner.py:3585— BaseModelRunner.run has cognitive complexity 98 (threshold 15). Drivers by points: if/else 32 (64 pts), error handling 6 (20 pts), loops 4 (9 pts), boolean chains 4, ternaries 1 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
history_id_lists._fill_rows (cognitive 96) phoenix/xrex/data/recsys/history_id_lists.py:460— history_id_lists._fill_rows has cognitive complexity 96 (threshold 15). Drivers by points: if/else 17 (62 pts), loops 7 (17 pts), boolean chains 9, ternaries 2 (8 pts) (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlashAttentionForwardSm100.load (cognitive 89) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:1325— FlashAttentionForwardSm100.load has cognitive complexity 89 (threshold 15). Drivers by points: if/else 21 (55 pts), ternaries 6 (21 pts), boolean chains 8, loops 2 (5 pts) (nesting depth added 52). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
BaseModelRunner.handle_requests (cognitive 88) phoenix/xrex/inference/model_runner.py:3235— BaseModelRunner.handle_requests has cognitive complexity 88 (threshold 15). Drivers by points: if/else 28 (72 pts), boolean chains 15, loops 1 (nesting depth added 44). 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.
score_results_sink_focal._decide_hard_enforcement (cognitive 87) REDACTED:821— score_results_sink_focal._decide_hard_enforcement has cognitive complexity 87 (threshold 15). Drivers by points: if/else 30 (55 pts), boolean chains 25, loops 2 (4 pts), ternaries 1 (3 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.
RustKafkaDataset._async_kafka_consumer_arrow (cognitive 87) phoenix/xrex/data/rust_kafka_recsys.py:109— RustKafkaDataset._async_kafka_consumer_arrow has cognitive complexity 87 (threshold 15). Drivers by points: if/else 30 (55 pts), ternaries 9 (13 pts), boolean chains 10, error handling 2 (5 pts), loops 2 (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.
RecsysTwoTowerEval.run (cognitive 80) phoenix/xrex/eval/recsys_eval.py:150— RecsysTwoTowerEval.run has cognitive complexity 80 (threshold 15). Drivers by points: if/else 28 (58 pts), error handling 3 (6 pts), ternaries 3 (6 pts), boolean chains 5, loops 3 (5 pts) (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.
MediaLoader.hydrate_media (cognitive 80) grox/core/data_loaders/media_loader.py:226— MediaLoader.hydrate_media has cognitive complexity 80 (threshold 15). Drivers by points: if/else 21 (53 pts), loops 6 (19 pts), boolean chains 8 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FlashAttentionForwardSm100.mma (cognitive 79) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:1553— FlashAttentionForwardSm100.mma has cognitive complexity 79 (threshold 15). Drivers by points: if/else 15 (44 pts), loops 6 (17 pts), ternaries 6 (17 pts), boolean chains 1 (nesting depth added 51). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
RecsysTrainer._finalize_checkpoint_load (cognitive 78) phoenix/xrex/train/trainer_recsys.py:2985— RecsysTrainer._finalize_checkpoint_load has cognitive complexity 78 (threshold 15). Drivers by points: if/else 17 (34 pts), loops 8 (22 pts), ternaries 4 (12 pts), boolean chains 10 (nesting depth added 39). 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.
FlashAttentionForwardSm100.__call__ (cognitive 74) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:437— FlashAttentionForwardSm100.__call__ has cognitive complexity 74 (threshold 15). Drivers by points: if/else 24 (32 pts), ternaries 23 (30 pts), boolean chains 11, loops 1 (nesting depth added 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
RecsysTrainer.create_executable (cognitive 74) phoenix/xrex/train/trainer_recsys.py:2497— RecsysTrainer.create_executable has cognitive complexity 74 (threshold 15). Drivers by points: if/else 40 (63 pts), boolean chains 6, ternaries 3 (5 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.
FlashAttentionForwardSm100.kernel (cognitive 71) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:850— FlashAttentionForwardSm100.kernel has cognitive complexity 71 (threshold 15). Drivers by points: if/else 31 (46 pts), boolean chains 10, ternaries 7 (9 pts), loops 3 (6 pts) (nesting depth added 20). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
xai_configlib.from_dict (cognitive 70) phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py:158— xai_configlib.from_dict has cognitive complexity 70 (threshold 15). Drivers by points: if/else 22 (56 pts), loops 3 (11 pts), boolean chains 3 (nesting depth added 42). 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.
Account::write_to_out_protocol (cognitive 68) thunder/schema/user.rs:6480— Account::write_to_out_protocol has cognitive complexity 68 (threshold 15). Drivers by points: if/else 68. 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.
RecsysAggregatedModel.loss (cognitive 68) phoenix/xrex/models/recsys_model.py:4416— RecsysAggregatedModel.loss has cognitive complexity 68 (threshold 15). Drivers by points: if/else 30 (41 pts), ternaries 7 (18 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
score_results_sink_focal.main (cognitive 66) REDACTED:1459— score_results_sink_focal.main has cognitive complexity 66 (threshold 15). Drivers by points: if/else 12 (34 pts), ternaries 4 (12 pts), loops 4 (11 pts), boolean chains 7, error handling 2 (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.
kafkaloader._unify_record_batch_schemas (cognitive 66) phoenix/xrex/data/streaming/kafkaloader.py:763— kafkaloader._unify_record_batch_schemas has cognitive complexity 66 (threshold 15). Drivers by points: if/else 17 (42 pts), loops 9 (15 pts), error handling 1 (5 pts), ternaries 1 (4 pts) (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.
Conversation.to_openai_messages (cognitive 66) grox/core/lm/convo.py:390— Conversation.to_openai_messages has cognitive complexity 66 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 5 (17 pts), ternaries 3 (17 pts), boolean chains 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InterleavingRecordBatchProvider.__init__ (cognitive 65) phoenix/xrex/data/parquet_recsys.py:736— InterleavingRecordBatchProvider.__init__ has cognitive complexity 65 (threshold 15). Drivers by points: if/else 27 (41 pts), boolean chains 19, ternaries 4, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Sender::handle_send (cognitive 63) phoenix/crates/serving/xai-recsys-engine/src/copy.rs:423— Sender::handle_send has cognitive complexity 63 (threshold 15). Drivers by points: if/else 26 (44 pts), loops 6 (11 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecsysTrainer._save_checkpoint_current_params (cognitive 61) phoenix/xrex/train/trainer_recsys.py:3406— RecsysTrainer._save_checkpoint_current_params has cognitive complexity 61 (threshold 15). Drivers by points: if/else 22 (37 pts), boolean chains 15, loops 2 (5 pts), ternaries 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.
PhoenixKafkaDataset._iterate_training_batches (cognitive 58) phoenix/xrex/data/streaming/kafkaloader.py:1516— PhoenixKafkaDataset._iterate_training_batches has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (45 pts), boolean chains 7, loops 2 (4 pts), error handling 1 (2 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.
model_runner._loader_subprocess_main (cognitive 58) phoenix/xrex/inference/model_runner.py:320— model_runner._loader_subprocess_main has cognitive complexity 58 (threshold 15). Drivers by points: if/else 12 (34 pts), error handling 6 (12 pts), loops 3 (8 pts), boolean chains 3, ternaries 1 (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.
recsys_batch.apply_negative_sampling (cognitive 57) phoenix/xrex/data/recsys/recsys_batch.py:1623— recsys_batch.apply_negative_sampling has cognitive complexity 57 (threshold 15). Drivers by points: if/else 31 (39 pts), ternaries 6 (9 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 13). 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.
rust_parquet_recsys._block_shuffle_record_batches (cognitive 57) phoenix/xrex/data/rust_parquet_recsys.py:46— rust_parquet_recsys._block_shuffle_record_batches has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (39 pts), ternaries 4 (9 pts), boolean chains 5, loops 2 (4 pts) (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.
kafkaconsumer._consumer_poll_loop (cognitive 57) phoenix/xrex/data/streaming/kafkaconsumer.py:1306— kafkaconsumer._consumer_poll_loop has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (36 pts), loops 6 (13 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaskWriteSafetyPostAnnotationsResultSink._apply_labels_for_annotation (cognitive 57) grox/flows/ptos/task_write_safety_post_annotations_result_sink.py:162— TaskWriteSafetyPostAnnotationsResultSink._apply_labels_for_annotation has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (49 pts), boolean chains 7, loops 1 (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.
FeaturesOfEventBusFanoutEvent.apply (cognitive 56) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfEventBusFanoutEvent.java:44— FeaturesOfEventBusFanoutEvent.apply has cognitive complexity 56 (threshold 15). Drivers by points: if/else 26 (49 pts), loops 1 (5 pts), boolean chains 2 (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.
FeaturesOfMediaUpdate.putTags (cognitive 56) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfMediaUpdate.java:47— FeaturesOfMediaUpdate.putTags has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (43 pts), loops 2 (5 pts), boolean chains 4, ternaries 1 (4 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.
TaskPublishUnifiedPostAnnotationsManhattan._exec (cognitive 55) grox/flows/upa/task_write.py:33— TaskPublishUnifiedPostAnnotationsManhattan._exec has cognitive complexity 55 (threshold 15). Drivers by points: if/else 21 (33 pts), loops 4 (8 pts), boolean chains 7, ternaries 6 (7 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.
Safety::write_to_out_protocol (cognitive 54) thunder/schema/user.rs:9353— Safety::write_to_out_protocol has cognitive complexity 54 (threshold 15). Drivers by points: if/else 54. 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.
RetrievalBatchPrep::compute_batch_inputs_rust_quick (cognitive 53) phoenix/crates/serving/xai-recsys-engine/src/python.rs:2406— RetrievalBatchPrep::compute_batch_inputs_rust_quick has cognitive complexity 53 (threshold 15). Drivers by points: if/else 31 (43 pts), boolean chains 10 (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.
BaseModelRunner._load_via_copy_port (cognitive 52) phoenix/xrex/inference/model_runner.py:2256— BaseModelRunner._load_via_copy_port has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (32 pts), loops 4 (7 pts), ternaries 4 (7 pts), boolean chains 6 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecsysTrainer._write_shmem_checkpoint (cognitive 52) phoenix/xrex/train/trainer_recsys.py:3270— RecsysTrainer._write_shmem_checkpoint has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 4 (7 pts), boolean chains 6, error handling 1 (4 pts), ternaries 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HoldGateConfig::from_config (cognitive 51) abuse-enforcement-service/service-lib/src/overturn_hold.rs:244— HoldGateConfig::from_config has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 13 (18 pts), loops 3 (6 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.
BaseModelRunner._coordinator_loop (cognitive 51) phoenix/xrex/inference/model_runner.py:1658— BaseModelRunner._coordinator_loop has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (43 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (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.
RetrievalModelRunner.gather_embeddings_and_forward (cognitive 51) phoenix/xrex/inference/model_runner.py:5100— RetrievalModelRunner.gather_embeddings_and_forward has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (29 pts), loops 3 (13 pts), boolean chains 4, ternaries 3, error handling 1 (2 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.
checksum.compare_checksum_dicts (cognitive 51) phoenix/python/training/xai-checkpointing/xai_checkpointing/checksum.py:361— checksum.compare_checksum_dicts has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 7 (13 pts), error handling 2 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PhoenixDataset.compute_max_steps (cognitive 50) phoenix/xrex/data/parquet_recsys.py:1860— PhoenixDataset.compute_max_steps has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (26 pts), ternaries 5 (13 pts), boolean chains 9, loops 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RetrievalDataset.load_datasets (cognitive 50) phoenix/xrex/data/retrieval_dataset.py:396— RetrievalDataset.load_datasets has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (27 pts), ternaries 6 (18 pts), boolean chains 4, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UthReferenceMonthMhPublisherApp.buildReference (cognitive 49) under-the-hood/scalding/UthReferenceMonthMhPublisherJob.scala:229— UthReferenceMonthMhPublisherApp.buildReference has cognitive complexity 49 (threshold 15). Drivers by points: if/else 26, loops 10 (22 pts), boolean chains 1 (nesting depth added 12). 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.
BaseModelRunner._init_hotswap_buffers (cognitive 49) phoenix/xrex/inference/model_runner.py:922— BaseModelRunner._init_hotswap_buffers has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 6 (15 pts), boolean chains 6, ternaries 3 (5 pts), error handling 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.
PostRenderer.render (cognitive 49) grox/core/lm/post.py:36— PostRenderer.render has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (26 pts), loops 5 (10 pts), boolean chains 9, ternaries 3 (4 pts) (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
FeaturesOfAuthCompletion.putLoginToMap (cognitive 48) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:133— FeaturesOfAuthCompletion.putLoginToMap has cognitive complexity 48 (threshold 15). Drivers by points: if/else 48. 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.
AnalysisProcessor::process_batch (cognitive 47) phoenix-rankall/src/processor/analysis_processor.rs:35— AnalysisProcessor::process_batch has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (26 pts), match/switch 6 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ranker_attention_varlen_fa4._build_packed_block_sparse (cognitive 47) phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:30— ranker_attention_varlen_fa4._build_packed_block_sparse has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (25 pts), loops 10 (16 pts), boolean chains 4, ternaries 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecsysAggregatedModel.metrics (cognitive 47) phoenix/xrex/models/recsys_model.py:5027— RecsysAggregatedModel.metrics has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (27 pts), ternaries 5 (11 pts), loops 5 (7 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.
jax_extensions._find_no_barrier_inputs (cognitive 46) phoenix/xrex/utils/jax_extensions.py:201— jax_extensions._find_no_barrier_inputs has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (30 pts), loops 4 (13 pts), boolean chains 3 (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.
checkpoint_storage.load_checkpoint_from_storage (cognitive 44) phoenix/xrex/inference/checkpoint_storage.py:82— checkpoint_storage.load_checkpoint_from_storage has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (28 pts), loops 7 (10 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseModelRunner._finalize_hot_swap (cognitive 44) phoenix/xrex/inference/model_runner.py:1904— BaseModelRunner._finalize_hot_swap has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 7, loops 4 (6 pts), error handling 2 (3 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.
V8SearchEmbedPostRenderer.render_for_embedding (cognitive 44) grox/flows/mm_emb/renderer_v8_search.py:157— V8SearchEmbedPostRenderer.render_for_embedding has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 5 (12 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PhoenixKafkaDataset.make (cognitive 43) phoenix/xrex/data/streaming/kafkaloader.py:1344— PhoenixKafkaDataset.make has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 12, error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FunctionUnit2O11.createASTNode (cognitive 42) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11271— FunctionUnit2O11.createASTNode has cognitive complexity 42 (threshold 15). Drivers by points: if/else 39 (42 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HistoryUrlEmbeddingLookup._lookup (cognitive 42) phoenix/xrex/data/streaming/history_url_embedding.py:173— HistoryUrlEmbeddingLookup._lookup has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 5 (10 pts), boolean chains 3, ternaries 1 (2 pts), error handling 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.
image.build_motion_reveal_images (cognitive 42) grox/libs/video_tools/image.py:412— image.build_motion_reveal_images has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (29 pts), loops 7 (10 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TweetEventData::read_from_in_protocol (cognitive 41) thunder/schema/tweet_events.rs:1319— TweetEventData::read_from_in_protocol has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (38 pts), match/switch 1 (2 pts), loops 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.
User::write_to_out_protocol (cognitive 41) thunder/schema/user.rs:14538— User::write_to_out_protocol has cognitive complexity 41 (threshold 15). Drivers by points: if/else 41. 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.
FlashAttentionForwardSm100.__init__ (cognitive 41) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:204— FlashAttentionForwardSm100.__init__ has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 16, if/else 13 (15 pts), ternaries 8 (10 pts) (nesting depth added 4). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
InterleavingRecordBatchProvider._get_ready_batches_from_index (cognitive 41) phoenix/xrex/data/parquet_recsys.py:1036— InterleavingRecordBatchProvider._get_ready_batches_from_index has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 5, loops 3 (5 pts), error handling 1 (4 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.
sequence_packing.pack_batch (cognitive 39) phoenix/xrex/data/recsys/sequence_packing.py:315— sequence_packing.pack_batch has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (24 pts), ternaries 3 (7 pts), boolean chains 6, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai_configlib.replace_recursive (cognitive 39) phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py:342— xai_configlib.replace_recursive has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 3 (7 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.
MediaLoader.hydrate_video (cognitive 38) grox/core/data_loaders/media_loader.py:385— MediaLoader.hydrate_video has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 7, ternaries 2 (5 pts), error handling 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.
ThriftUtil.removeSetField (cognitive 37) botmaker/src/scala/com/twitter/botmaker/util/ThriftUtil.scala:233— ThriftUtil.removeSetField has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (30 pts), match/switch 3 (7 pts) (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.
mm_encoder._process_cardv2 (cognitive 37) phoenix/reference/mm_encoder.py:215— mm_encoder._process_cardv2 has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 2 (5 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
hooks._checkpoint_cleaner (cognitive 37) phoenix/xrex/driver/hooks.py:641— hooks._checkpoint_cleaner has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 5 (8 pts), error handling 2 (6 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
recsys_bundle_export._retrieval_export (cognitive 37) phoenix/xrex/train/recsys_bundle_export.py:937— recsys_bundle_export._retrieval_export has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 6, ternaries 3, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
xai_configlib.cast_type (cognitive 37) phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py:403— xai_configlib.cast_type has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (21 pts), error handling 3 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
V5EmbedPostRenderer._process_cardv2 (cognitive 37) grox/flows/mm_emb/renderer.py:155— V5EmbedPostRenderer._process_cardv2 has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 2 (5 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FunctionUnit2O9.createASTNode (cognitive 36) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9263— FunctionUnit2O9.createASTNode has cognitive complexity 36 (threshold 15). Drivers by points: if/else 33 (36 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
manhattan_arrow_adapter.arrow_bytes_to_batch (cognitive 36) bdsm/runtime/manhattan_arrow_adapter.py:74— manhattan_arrow_adapter.arrow_bytes_to_batch has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 5 (8 pts), ternaries 2 (4 pts), boolean chains 2, error handling 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.
PhoenixKafkaDataset.kafka_to_training_batch (cognitive 36) phoenix/xrex/data/streaming/kafkaloader.py:1172— PhoenixKafkaDataset.kafka_to_training_batch has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 5, ternaries 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.
RecsysSIDRetrievalEval._accumulate_beam (cognitive 36) phoenix/xrex/eval/recsys_eval.py:859— RecsysSIDRetrievalEval._accumulate_beam has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 3 (6 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.
RecsysAggregatedModel.embed_categorical_context_features (cognitive 36) phoenix/xrex/models/recsys_model.py:2937— RecsysAggregatedModel.embed_categorical_context_features has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 5, 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.
RecsysTwoTowerModel.forward (cognitive 36) phoenix/xrex/models/recsys_two_tower_model.py:2225— RecsysTwoTowerModel.forward has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 10 (14 pts), if/else 9 (10 pts), boolean chains 7, loops 3 (5 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Transformer.__call__ (cognitive 36) phoenix/xrex/models/transformer.py:686— Transformer.__call__ has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 7, ternaries 4, 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.
TraceEmitter::new_active (cognitive 35) bdsm/rust/accumulator/src/trace.rs:109— TraceEmitter::new_active has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 6 (13 pts), if/else 5 (12 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.
mm_encoder._render_single_post (cognitive 35) phoenix/reference/mm_encoder.py:127— mm_encoder._render_single_post has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 3 (6 pts), boolean chains 4 (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.
InterleavingRecordBatchProvider._get_record_batches_synced (cognitive 35) phoenix/xrex/data/parquet_recsys.py:1509— InterleavingRecordBatchProvider._get_record_batches_synced has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (21 pts), ternaries 2 (8 pts), loops 2 (4 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.
recsys_feature_prep._add_context_features (cognitive 35) phoenix/xrex/models/recsys_feature_prep.py:596— recsys_feature_prep._add_context_features has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
V5EmbedPostRenderer._render_single_post (cognitive 35) grox/flows/mm_emb/renderer.py:49— V5EmbedPostRenderer._render_single_post has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 3 (6 pts), boolean chains 4 (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.
FeaturesOfExploreClientEvent.apply (cognitive 34) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfExploreClientEvent.java:27— FeaturesOfExploreClientEvent.apply has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (32 pts), 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.
FunctionUnit.codeGen (cognitive 33) botmaker/src/scala/com/twitter/botmaker/FunctionUnit.scala:140— FunctionUnit.codeGen has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23 (30 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FunctionUnit2O8.createASTNode (cognitive 33) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10883— FunctionUnit2O8.createASTNode has cognitive complexity 33 (threshold 15). Drivers by points: if/else 30 (33 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (FunctionUnit3O8.createASTNode) 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.
FunctionUnit3O8.createASTNode (cognitive 33) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12299— FunctionUnit3O8.createASTNode has cognitive complexity 33 (threshold 15). Drivers by points: if/else 30 (33 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (FunctionUnit2O8.createASTNode) 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.
FlashAttentionForwardSm100.epilogue_s2g (cognitive 33) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:2741— FlashAttentionForwardSm100.epilogue_s2g has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (13 pts), ternaries 1 (5 pts), boolean chains 2 (nesting depth added 20). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
BaseModelRunner._load_via_nfs (cognitive 33) phoenix/xrex/inference/model_runner.py:2438— BaseModelRunner._load_via_nfs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 3, error handling 2, loops 1 (2 pts), ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdsBrandSafetyVfHydrator::hydrate (cognitive 32) home-mixer/candidate_hydrators/ads_brand_safety_vf_hydrator.rs:81— AdsBrandSafetyVfHydrator::hydrate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (25 pts), loops 3 (4 pts), match/switch 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.
AsyncRateLimiter.apply (cognitive 32) botmaker/src/scala/com/twitter/botmaker/common/AsyncRateLimiter.scala:44— AsyncRateLimiter.apply has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 2 (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.
parquet_recsys._block_resume_window (cognitive 32) phoenix/xrex/data/parquet_recsys.py:583— parquet_recsys._block_resume_window has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 7, loops 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.
recsys_batch.apply_global_negative_sampling (cognitive 32) phoenix/xrex/data/recsys/recsys_batch.py:1974— recsys_batch.apply_global_negative_sampling has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27 (30 pts), boolean chains 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
kafkaconsumer.consume_messages (cognitive 32) phoenix/xrex/data/streaming/kafkaconsumer.py:1745— kafkaconsumer.consume_messages has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 10, 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.
launch_inference.run (cognitive 32) phoenix/xrex/inference/launch_inference.py:274— launch_inference.run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 6, loops 4 (5 pts), ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
RecsysAggregatedModel.decode_continuous (cognitive 32) phoenix/xrex/models/recsys_model.py:3297— RecsysAggregatedModel.decode_continuous has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (5 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.
checkpointing.save_checkpoint (cognitive 32) phoenix/xrex/utils/checkpointing.py:222— checkpointing.save_checkpoint has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (26 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
score_results_sink_focal._publish_score_result (cognitive 31) REDACTED:1224— score_results_sink_focal._publish_score_result has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3 (6 pts), boolean chains 5, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
score_results_sink_focal._apply_scoring_cooldowns (cognitive 31) REDACTED:1314— score_results_sink_focal._apply_scoring_cooldowns has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (6 pts), error handling 2 (4 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InterleavingRecordBatchProvider._get_record_batches_block_shuffle (cognitive 31) phoenix/xrex/data/parquet_recsys.py:1354— InterleavingRecordBatchProvider._get_record_batches_block_shuffle has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 3 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kafkaconsumer._consume_multi_consumer (cognitive 31) phoenix/xrex/data/streaming/kafkaconsumer.py:1512— kafkaconsumer._consume_multi_consumer has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 5 (6 pts), boolean chains 3, ternaries 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.
recsys_feature_prep._add_history_features (cognitive 31) phoenix/xrex/models/recsys_feature_prep.py:895— recsys_feature_prep._add_history_features has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecsysTrainer.dataset_with_prepare (cognitive 31) phoenix/xrex/train/trainer_recsys.py:1058— RecsysTrainer.dataset_with_prepare has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecsysTrainer.maybe_build_retrieval_post_embeddings (cognitive 31) phoenix/xrex/train/trainer_recsys.py:3927— RecsysTrainer.maybe_build_retrieval_post_embeddings has cognitive complexity 31 (threshold 15). Drivers by points: if/else 19 (23 pts), loops 2 (4 pts), ternaries 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TaskASRTranscription._exec_with_post (cognitive 31) grox/core/tasks/task_asr.py:38— TaskASRTranscription._exec_with_post has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (28 pts), ternaries 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.
PredictRequestBatch::reply (cognitive 30) phoenix/crates/serving/xai-recsys-engine/src/python.rs:390— PredictRequestBatch::reply has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FunctionUnit4O7.createASTNode (cognitive 30) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9687— FunctionUnit4O7.createASTNode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27 (30 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (FunctionUnit2O7.createASTNode) 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.
FunctionUnit2O7.createASTNode (cognitive 30) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10550— FunctionUnit2O7.createASTNode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27 (30 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (FunctionUnit4O7.createASTNode) 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.
UthUserMonthMhPublisherApp.assembleUserMonths (cognitive 30) under-the-hood/scalding/UthUserMonthMhPublisherJob.scala:210— UthUserMonthMhPublisherApp.assembleUserMonths has cognitive complexity 30 (threshold 15). Drivers by points: loops 11 (27 pts), if/else 2, boolean chains 1 (nesting depth added 16). 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.
BaseModelRunner._follower_coordinator_loop (cognitive 30) phoenix/xrex/inference/model_runner.py:1809— BaseModelRunner._follower_coordinator_loop has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 3 (6 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pipeline::run_loop (cognitive 29) phoenix-rankall/src/pipeline/mod.rs:78— Pipeline::run_loop has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConversationControl::read_from_in_protocol (cognitive 29) thunder/schema/tweet.rs:4735— ConversationControl::read_from_in_protocol has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (26 pts), 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.
FeaturesOfAuthCompletion.putPasswordResetToMap (cognitive 29) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfAuthCompletion.java:300— FeaturesOfAuthCompletion.putPasswordResetToMap has cognitive complexity 29 (threshold 15). Drivers by points: if/else 29. 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.
Compiler.createASTNodeTree (cognitive 29) botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:138— Compiler.createASTNodeTree has cognitive complexity 29 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 5 (7 pts), ternaries 2 (7 pts), match/switch 2 (3 pts), boolean chains 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.
score_results_sink_focal._cusp_lane (cognitive 29) REDACTED:981— score_results_sink_focal._cusp_lane has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 7, 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.
ranker_attention_varlen_fa4.varlen_kernels (cognitive 29) phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:326— ranker_attention_varlen_fa4.varlen_kernels has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 5 (9 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.
InterleavingRecordBatchProvider._drain_files (cognitive 29) phoenix/xrex/data/parquet_recsys.py:1123— InterleavingRecordBatchProvider._drain_files has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 4 (9 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.
reply_features.place_focal_post (cognitive 29) phoenix/xrex/data/recsys/reply_features.py:143— reply_features.place_focal_post has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 4 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sequence_packing.fit_sample_budget (cognitive 29) phoenix/xrex/data/recsys/sequence_packing.py:96— sequence_packing.fit_sample_budget has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (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.
TaskWriteSafetyPostAnnotationsResultSink._exec (cognitive 29) grox/flows/ptos/task_write_safety_post_annotations_result_sink.py:317— TaskWriteSafetyPostAnnotationsResultSink._exec has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 5, loops 2 (5 pts), 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, 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.
ExperimentalApproximateCosineSimilarity.apply (cognitive 28) simclusters/simclustersann/candidate_source/ExperimentalApproximateCosineSimilarity.scala:56— ExperimentalApproximateCosineSimilarity.apply has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 1 (3 pts), boolean chains 2, 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.
18.toScript (cognitive 28) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1471— 18.toScript has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kafkaconsumer.validate_offset_map (cognitive 28) phoenix/xrex/data/streaming/kafkaconsumer.py:884— kafkaconsumer.validate_offset_map has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 5, 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.
launch_multi_inference.build_worker_cmd (cognitive 28) REDACTED:411— launch_multi_inference.build_worker_cmd has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 2, 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.
id_list_fill_stats.main (cognitive 28) phoenix/xrex/tools/id_list_fill_stats.py:109— id_list_fill_stats.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 4 (8 pts), ternaries 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.
log_util.configure_logging (cognitive 28) phoenix/xrex/utils/log_util.py:103— log_util.configure_logging has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
training.train (cognitive 28) clip/training.py:122— training.train has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (4 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PriorityTaskGenerator._poll (cognitive 28) grox/core/generators/task_generator.py:100— PriorityTaskGenerator._poll has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), error handling 2 (6 pts), loops 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.
TopicIdsFilter::filter (cognitive 27) home-mixer/filters/topic_ids_filter.rs:19— TopicIdsFilter::filter has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 3 (8 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FunctionUnit2O6.createASTNode (cognitive 27) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10267— FunctionUnit2O6.createASTNode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24 (27 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
login_starter_pack_counter.get_login_pack_age_minutes (cognitive 27) bdsm/runtime/login_starter_pack_counter.py:60— login_starter_pack_counter.get_login_pack_age_minutes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (23 pts), error handling 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.
dump_gen._check_with_pyarrow (cognitive 27) phoenix/reference/dump_gen.py:448— dump_gen._check_with_pyarrow has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, loops 9 (10 pts), if/else 3, ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Post.from_post_metadata (cognitive 27) grox/core/data_loaders/data_types.py:768— Post.from_post_metadata has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16, ternaries 11. 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.
XaiEmbeddingClientHttp._send_encode_request (cognitive 27) grox/libs/embed/embed_http.py:207— XaiEmbeddingClientHttp._send_encode_request has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 3 (7 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
xai_recsys_mm_server::snapshot::fetch_recent_embeddings_from_o2 (cognitive 26) phoenix/crates/serving/xai-recsys-mm-server/src/snapshot.rs:408— xai_recsys_mm_server::snapshot::fetch_recent_embeddings_from_o2 has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 4 (13 pts), if/else 3 (7 pts), loops 4 (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.
FeaturesOfPeriscopePublishBroadcastEvent.apply (cognitive 26) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfPeriscopePublishBroadcastEvent.java:23— FeaturesOfPeriscopePublishBroadcastEvent.apply has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (26 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ThriftOperator.isDivergentTo (cognitive 26) botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java:93— ThriftOperator.isDivergentTo has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (6 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.
ThriftStructOperator.isDivergentTo (cognitive 26) botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftStructOperator.java:92— ThriftStructOperator.isDivergentTo has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (6 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.
sid_codebook.train_rqvae (cognitive 26) phoenix/reference/sid_codebook.py:388— sid_codebook.train_rqvae has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (4 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.
ranker_attention_fa4.ranker_attention_fa4 (cognitive 26) phoenix/xrex/cutedsl/ranker_attention_fa4.py:254— ranker_attention_fa4.ranker_attention_fa4 has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 5 (9 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecsysTrainer.async_emb_step (cognitive 26) phoenix/xrex/train/trainer_recsys.py:1862— RecsysTrainer.async_emb_step has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Video.interleave_storyboard (cognitive 26) grox/core/lm/convo.py:167— Video.interleave_storyboard has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (10 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.
V82EmbedPostRenderer._author_block (cognitive 26) grox/flows/mm_emb/renderer_v82.py:187— V82EmbedPostRenderer._author_block has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15, boolean chains 9, 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.
V82EmbedPostRenderer._collect_post_media (cognitive 26) grox/flows/mm_emb/renderer_v82.py:286— V82EmbedPostRenderer._collect_post_media has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (6 pts), boolean chains 4, 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.
V8SearchEmbedPostRenderer._author_block (cognitive 26) grox/flows/mm_emb/renderer_v8_search.py:227— V8SearchEmbedPostRenderer._author_block has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15, boolean chains 8, ternaries 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.
TaskSafetyPtosSafemodelSexNudity._collect_payloads (cognitive 26) grox/flows/ptos/task_safety_ptos_safemodel_sex_nudity.py:156— TaskSafetyPtosSafemodelSexNudity._collect_payloads has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (10 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplyScorer._parse (cognitive 26) grox/flows/reply_spam/classifier_reply_ranking.py:109— ReplyScorer._parse has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 3 (7 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimpleReplyScorer._parse (cognitive 26) grox/flows/reply_spam/classifier_simple_reply_scorer.py:87— SimpleReplyScorer._parse has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 3 (7 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Perspective::write_to_out_protocol (cognitive 25) thunder/schema/user.rs:10489— Perspective::write_to_out_protocol has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25. 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.
FeaturesOfTweetSafetyLabelEvent.apply (cognitive 25) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfTweetSafetyLabelEvent.java:30— FeaturesOfTweetSafetyLabelEvent.apply has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 4 (11 pts), boolean chains 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.
Type.of (cognitive 25) botmaker/src/java/com/twitter/botmaker/compiler/types/Type.java:319— Type.of has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, boolean chains 12. 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.
score_results_sink_focal._build_policy_config (cognitive 25) REDACTED:650— score_results_sink_focal._build_policy_config has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14, ternaries 4 (8 pts), boolean chains 3 (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.
score_results_sink_focal._paused_head_lane (cognitive 25) REDACTED:1038— score_results_sink_focal._paused_head_lane has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
score_results_sink_focal._build_bq_row (cognitive 25) REDACTED:1162— score_results_sink_focal._build_bq_row has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 10, 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.
mma_sm100_desc.make_smem_desc_base (cognitive 25) phoenix/xrex/cutedsl/ranker_fa4/mma_sm100_desc.py:229— mma_sm100_desc.make_smem_desc_base has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 10). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
BaseModelRunner._maybe_init_live_dense_swap (cognitive 25) phoenix/xrex/inference/model_runner.py:1140— BaseModelRunner._maybe_init_live_dense_swap has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, loops 2, error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenRecsTrainer.eval_gen_recs (cognitive 25) phoenix/xrex/train/trainer_gen_recs.py:408— GenRecsTrainer.eval_gen_recs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 6 (10 pts), error handling 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
trainer_recsys._chunked_row_forward_on_device (cognitive 25) phoenix/xrex/train/trainer_recsys.py:237— trainer_recsys._chunked_row_forward_on_device has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3 (5 pts), boolean chains 3, error handling 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.
dek.publish_tree_dek (cognitive 25) phoenix/python/training/xai-checkpointing/xai_checkpointing/dek.py:58— dek.publish_tree_dek has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), error handling 2 (5 pts), boolean chains 2, 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.
load.load_checkpoint_streamed (cognitive 25) phoenix/python/training/xai-checkpointing/xai_checkpointing/load.py:468— load.load_checkpoint_streamed has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 4 (8 pts), ternaries 4 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
V8SearchEmbedPostRenderer._collect_media_records (cognitive 25) grox/flows/mm_emb/renderer_v8_search.py:331— V8SearchEmbedPostRenderer._collect_media_records has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (6 pts), boolean chains 5, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppPushDevice::write_to_out_protocol (cognitive 24) thunder/schema/user.rs:13112— AppPushDevice::write_to_out_protocol has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FunctionUnit0O5.createASTNode (cognitive 24) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:632— FunctionUnit0O5.createASTNode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21 (24 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit1O5.createASTNode, FunctionUnit2O5.createASTNode, FunctionUnit3O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit1O5.createASTNode (cognitive 24) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1478— FunctionUnit1O5.createASTNode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21 (24 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O5.createASTNode, FunctionUnit2O5.createASTNode, FunctionUnit3O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit2O5.createASTNode (cognitive 24) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2459— FunctionUnit2O5.createASTNode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21 (24 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O5.createASTNode, FunctionUnit1O5.createASTNode, FunctionUnit3O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit3O5.createASTNode (cognitive 24) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3549— FunctionUnit3O5.createASTNode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21 (24 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O5.createASTNode, FunctionUnit1O5.createASTNode, FunctionUnit2O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit4O5.createASTNode (cognitive 24) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4748— FunctionUnit4O5.createASTNode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21 (24 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O5.createASTNode, FunctionUnit1O5.createASTNode, FunctionUnit2O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit5O5.createASTNode (cognitive 24) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6043— FunctionUnit5O5.createASTNode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21 (24 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O5.createASTNode, FunctionUnit1O5.createASTNode, FunctionUnit2O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit6O5.createASTNode (cognitive 24) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7424— FunctionUnit6O5.createASTNode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21 (24 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O5.createASTNode, FunctionUnit1O5.createASTNode, FunctionUnit2O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit7O5.createASTNode (cognitive 24) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8907— FunctionUnit7O5.createASTNode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21 (24 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O5.createASTNode, FunctionUnit1O5.createASTNode, FunctionUnit2O5.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
GizmoduckSafetyFlags.flagDiffsPipe (cognitive 24) under-the-hood/scalding/GizmoduckSafetyFlags.scala:33— GizmoduckSafetyFlags.flagDiffsPipe has cognitive complexity 24 (threshold 15). Drivers by points: loops 4 (18 pts), if/else 3, match/switch 1 (2 pts), boolean chains 1 (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.
FeaturesOfUserModification.apply (cognitive 24) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfUserModification.java:29— FeaturesOfUserModification.apply has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 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.
2.split (cognitive 24) botmaker/src/java/com/twitter/botmaker/compiler/RegexCache.java:95— 2.split has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 8, loops 2 (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.
ranker_attention_varlen_fa4.build_block_sparse_layout (cognitive 24) phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:214— ranker_attention_varlen_fa4.build_block_sparse_layout has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4 (8 pts), ternaries 2 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LazyRecordBatchIterator.seek (cognitive 24) phoenix/xrex/data/parquet_recsys.py:204— LazyRecordBatchIterator.seek has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 2 (3 pts), ternaries 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.
TaskWriteSafetyPostAnnotationsResultSink._compute_bool_metadata_from_violations (cognitive 24) grox/flows/ptos/task_write_safety_post_annotations_result_sink.py:78— TaskWriteSafetyPostAnnotationsResultSink._compute_bool_metadata_from_violations has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdAdjacentServedFilter::filter (cognitive 23) home-mixer/filters/ad_adjacent_served_filter.rs:48— AdAdjacentServedFilter::filter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (7 pts), match/switch 2 (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.
sid_io.load_codebook (cognitive 23) phoenix/reference/sid_io.py:24— sid_io.load_codebook has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 2, 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.
RecsysTwoTowerEval._create_retrieval_metrics (cognitive 23) phoenix/xrex/eval/recsys_eval.py:589— RecsysTwoTowerEval._create_retrieval_metrics has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 4 (9 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.
BaseModelRunner.maybe_load_checkpoint (cognitive 23) phoenix/xrex/inference/model_runner.py:2571— BaseModelRunner.maybe_load_checkpoint has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, error handling 2 (3 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
recsys_model.build_metric_masks (cognitive 23) phoenix/xrex/models/recsys_model.py:2156— recsys_model.build_metric_masks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 5, loops 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
LitePostRenderer.render (cognitive 23) grox/core/lm/post.py:143— LitePostRenderer.render has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 3 (6 pts), boolean chains 1, ternaries 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.
UserRenderer.render (cognitive 23) grox/core/lm/user.py:8— UserRenderer.render has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, ternaries 3 (6 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaskSafetyPtosAdultContentLeadingFramesFilter._eligible_with_post (cognitive 23) grox/flows/ptos/task_safety_ptos_adult_content_leading_frames_filter.py:29— TaskSafetyPtosAdultContentLeadingFramesFilter._eligible_with_post has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 7, ternaries 3, loops 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
HeadGuard::spawn_refresh_with (cognitive 22) abuse-enforcement-service/service-lib/src/head_guard.rs:595— HeadGuard::spawn_refresh_with has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, 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.
ScoreResultProcessor::process (cognitive 22) abuse-enforcement-service/service-lib/src/lib.rs:1583— ScoreResultProcessor::process has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 4 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
OffSwitch::spawn_refresh_with (cognitive 22) abuse-enforcement-service/service-lib/src/off_switch.rs:629— OffSwitch::spawn_refresh_with has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, 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.
FullTweet::write_to_out_protocol (cognitive 22) thunder/schema/events.rs:1678— FullTweet::write_to_out_protocol has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, loops 3 (6 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BatchDispatcher.flush (cognitive 22) botmaker/src/scala/com/twitter/botmaker/common/BatchDispatcher.scala:47— BatchDispatcher.flush has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, loops 2 (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.
TweetJob.generate (cognitive 22) simclusters/simclusters_v2/summingbird/storm/TweetJob.scala:37— TweetJob.generate has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 11 (14 pts), if/else 5, loops 1 (2 pts), boolean chains 1 (nesting depth added 4). 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.
Compiler.botmakerFunctionToASTNode (cognitive 22) botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:475— Compiler.botmakerFunctionToASTNode has cognitive complexity 22 (threshold 15). Drivers by points: error handling 4 (10 pts), if/else 4 (5 pts), match/switch 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.
score_results_sink_focal._spam_bounce_lane (cognitive 22) REDACTED:1100— score_results_sink_focal._spam_bounce_lane has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, 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.
kafkaconsumer._deserialize_messages (cognitive 22) phoenix/xrex/data/streaming/kafkaconsumer.py:539— kafkaconsumer._deserialize_messages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 5 (8 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.
eval_utils.report_forward_eval_results (cognitive 22) phoenix/xrex/eval/eval_utils.py:128— eval_utils.report_forward_eval_results has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (8 pts), ternaries 1 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
launch_multi_inference.wait_for_workers (cognitive 22) REDACTED:210— launch_multi_inference.wait_for_workers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecsysAggregatedModelConfig.validate_purchase_value (cognitive 22) phoenix/xrex/models/recsys_model.py:1076— RecsysAggregatedModelConfig.validate_purchase_value has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
RecsysAggregatedModel._compute_metrics_after_masks (cognitive 22) phoenix/xrex/models/recsys_model.py:2338— RecsysAggregatedModel._compute_metrics_after_masks has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 7, boolean chains 3 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
transformer.layer_stack_block (cognitive 22) phoenix/xrex/models/transformer.py:614— transformer.layer_stack_block has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 1 (4 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.
RecsysTrainer._create_async_emb_executables (cognitive 22) phoenix/xrex/train/trainer_recsys.py:2342— RecsysTrainer._create_async_emb_executables has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 3 (5 pts), error handling 1 (2 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.
layer_stack.stack_params (cognitive 22) phoenix/xrex/utils/layer_stack.py:145— layer_stack.stack_params has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (6 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.
ocdbt._load_node (cognitive 22) phoenix/xrex/utils/ocdbt.py:75— ocdbt._load_node has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (4 pts), ternaries 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.
Post._collect_urls (cognitive 22) grox/core/data_loaders/data_types.py:739— Post._collect_urls has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (6 pts), boolean chains 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotificationExtension1::write_to_out_protocol (cognitive 21) thunder/schema/user.rs:7387— NotificationExtension1::write_to_out_protocol has cognitive complexity 21 (threshold 15). Drivers by points: if/else 21. 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.
LmdbEmbeddingCache::insert_many (cognitive 21) phoenix/crates/serving/xai-recsys-mm-server/src/embedding_cache.rs:312— LmdbEmbeddingCache::insert_many has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 2 (3 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.
UserAgent.evaluate (cognitive 21) botmaker/botmaker_common/src/main/scala/com/twitter/botmaker/common/UserAgent.scala:24— UserAgent.evaluate 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.
FunctionUnit0O4.createASTNode (cognitive 21) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:478— FunctionUnit0O4.createASTNode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18 (21 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit1O4.createASTNode, FunctionUnit2O4.createASTNode, FunctionUnit3O4.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit1O4.createASTNode (cognitive 21) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1301— FunctionUnit1O4.createASTNode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18 (21 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O4.createASTNode, FunctionUnit2O4.createASTNode, FunctionUnit3O4.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit2O4.createASTNode (cognitive 21) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2254— FunctionUnit2O4.createASTNode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18 (21 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O4.createASTNode, FunctionUnit1O4.createASTNode, FunctionUnit3O4.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit3O4.createASTNode (cognitive 21) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3323— FunctionUnit3O4.createASTNode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18 (21 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O4.createASTNode, FunctionUnit1O4.createASTNode, FunctionUnit2O4.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit4O4.createASTNode (cognitive 21) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4501— FunctionUnit4O4.createASTNode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18 (21 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O4.createASTNode, FunctionUnit1O4.createASTNode, FunctionUnit2O4.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit5O4.createASTNode (cognitive 21) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5778— FunctionUnit5O4.createASTNode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18 (21 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O4.createASTNode, FunctionUnit1O4.createASTNode, FunctionUnit2O4.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit6O4.createASTNode (cognitive 21) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7141— FunctionUnit6O4.createASTNode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18 (21 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O4.createASTNode, FunctionUnit1O4.createASTNode, FunctionUnit2O4.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit7O4.createASTNode (cognitive 21) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8605— FunctionUnit7O4.createASTNode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18 (21 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O4.createASTNode, FunctionUnit1O4.createASTNode, FunctionUnit2O4.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
UthDailyPostsBackfillApp.countLabelsPerAsOfDay (cognitive 21) under-the-hood/scalding/UthDailyPostsBackfillJob.scala:236— UthDailyPostsBackfillApp.countLabelsPerAsOfDay has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 2, 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.
FeaturesOfUnifiedPostAnnotationsEvent.apply (cognitive 21) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfUnifiedPostAnnotationsEvent.java:19— FeaturesOfUnifiedPostAnnotationsEvent.apply has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (21 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.
CompilerUnitBuilder.build (cognitive 21) botmaker/src/java/com/twitter/botmaker/compiler/CompilerBuilder.java:50— CompilerUnitBuilder.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 4 (10 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.
10.serialize (cognitive 21) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:554— 10.serialize has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
sequence_cache.merge_realtime_into_sequence (cognitive 21) bdsm/runtime/sequence_cache.py:198— sequence_cache.merge_realtime_into_sequence has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 3 (4 pts), ternaries 2 (4 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starter_pack_follows.get_followed_pack_count (cognitive 21) bdsm/runtime/starter_pack_follows.py:59— starter_pack_follows.get_followed_pack_count has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), error handling 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.
train_head.main (cognitive 21) bdsm/training/train_head.py:121— train_head.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (4 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.
_OrderedBatchBuilder.close (cognitive 21) phoenix/xrex/data/streaming/kafkaconsumer.py:672— _OrderedBatchBuilder.close has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (5 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseModelRunner.prepare_and_compute (cognitive 21) phoenix/xrex/inference/model_runner.py:3019— BaseModelRunner.prepare_and_compute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 5 (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.
gpu._gpu_index_to_local_numa_node (cognitive 21) phoenix/xrex/utils/gpu.py:199— gpu._gpu_index_to_local_numa_node has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 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.
MediaLoader.construct_convo_video (cognitive 21) grox/core/data_loaders/media_loader.py:616— MediaLoader.construct_convo_video has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
UserRecentPostsLoader.load (cognitive 21) grox/core/data_loaders/strato_loader.py:93— UserRecentPostsLoader.load has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (5 pts), error handling 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.
BroadcastLivenessHydrator::hydrate (cognitive 20) home-mixer/candidate_hydrators/broadcast_liveness_hydrator.rs:85— BroadcastLivenessHydrator::hydrate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (6 pts), match/switch 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.
SidTailProcessor::process_batch (cognitive 20) phoenix-rankall/src/processor/sid_tail_processor.rs:42— SidTailProcessor::process_batch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 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.
MediaInfo::read_from_in_protocol (cognitive 20) thunder/schema/tweet_media.rs:841— MediaInfo::read_from_in_protocol has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 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.
Notification::write_to_out_protocol (cognitive 20) thunder/schema/user.rs:7693— Notification::write_to_out_protocol has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. 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.
ThriftStructType.getFieldValueMetadata (cognitive 20) botmaker/src/java/com/twitter/botmaker/compiler/types/ThriftStructType.java:285— ThriftStructType.getFieldValueMetadata has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. 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.
Cast.mkCast (cognitive 20) botmaker/src/java/com/twitter/botmaker/function/conversion/Cast.java:42— Cast.mkCast has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, 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.
score_results_sink_focal._flush_bq (cognitive 20) REDACTED:1375— score_results_sink_focal._flush_bq has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (9 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
id_list_features.parse_id_lists (cognitive 20) phoenix/xrex/data/recsys/id_list_features.py:350— id_list_features.parse_id_lists has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 3, 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.
core.init_run_dir (cognitive 20) phoenix/xrex/driver/core.py:256— core.init_run_dir has cognitive complexity 20 (threshold 15). Drivers by points: error handling 6 (12 pts), if/else 6 (8 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.
load._drain_read_futures (cognitive 20) phoenix/python/training/xai-checkpointing/xai_checkpointing/load.py:287— load._drain_read_futures has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 3 (6 pts), boolean chains 2, error handling 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.
V82EmbedPostRenderer._quoted_block (cognitive 20) grox/flows/mm_emb/renderer_v82.py:341— V82EmbedPostRenderer._quoted_block has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 5 (7 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
V8SearchEmbedPostRenderer._quoted_block (cognitive 20) grox/flows/mm_emb/renderer_v8_search.py:430— V8SearchEmbedPostRenderer._quoted_block has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 5 (7 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AuthorServedMetricsSideEffect::side_effect (cognitive 19) home-mixer/side_effects/author_served_metrics_side_effect.rs:96— AuthorServedMetricsSideEffect::side_effect has cognitive complexity 19 (threshold 15). Drivers by points: loops 8 (14 pts), if/else 4, boolean chains 1 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PhoenixRequestCacheSideEffect::side_effect (cognitive 19) home-mixer/side_effects/phoenix_request_cache_side_effect.rs:58— PhoenixRequestCacheSideEffect::side_effect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 4 (5 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.
ScoredStatsSideEffect::side_effect (cognitive 19) home-mixer/side_effects/scored_stats_side_effect.rs:42— ScoredStatsSideEffect::side_effect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnalysisDumpStore::dump_records (cognitive 19) phoenix-rankall/src/store/analysis.rs:67— AnalysisDumpStore::dump_records has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Action::from_thrift (cognitive 19) visibility-filtering-client/models.rs:202— Action::from_thrift has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CheckpointProxy::download_checkpoint (cognitive 19) phoenix/crates/serving/xai-recsys-engine/src/checkpoint_proxy.rs:324— CheckpointProxy::download_checkpoint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (5 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.
ScalaType.asScala (cognitive 19) botmaker/src/scala/com/twitter/botmaker/compiler/types/ScalaType.scala:178— ScalaType.asScala has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18 (19 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.
SimClustersANNCandidateSource.get (cognitive 19) simclusters/simclusters_v2/candidate_source/SimClustersANNCandidateSource.scala:48— SimClustersANNCandidateSource.get has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (14 pts), match/switch 2 (4 pts), if/else 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.
UthDailyPostsApp.countLabelsAsOf (cognitive 19) under-the-hood/scalding/UthDailyPostsJob.scala:337— UthDailyPostsApp.countLabelsAsOf has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 2, 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.
10.computeFingerprint (cognitive 19) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:490— 10.computeFingerprint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. 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. This shape REPEATS in the file: 2 other methods here (10.toScript, 10.toStratoJson) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
10.toScript (cognitive 19) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:740— 10.toScript has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. 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. This shape REPEATS in the file: 2 other methods here (10.computeFingerprint, 10.toStratoJson) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
10.toStratoJson (cognitive 19) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:804— 10.toStratoJson has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. 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. This shape REPEATS in the file: 2 other methods here (10.computeFingerprint, 10.toScript) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
InterleavingRecordBatchProvider._get_record_batches_shuffled (cognitive 19) phoenix/xrex/data/parquet_recsys.py:1285— InterleavingRecordBatchProvider._get_record_batches_shuffled has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 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.
kafkaconsumer._decode_training_message (cognitive 19) phoenix/xrex/data/streaming/kafkaconsumer.py:494— kafkaconsumer._decode_training_message has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kafkaloader._cast_column (cognitive 19) phoenix/xrex/data/streaming/kafkaloader.py:724— kafkaloader._cast_column has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4 (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.
ReadinessSupervisor.run (cognitive 19) REDACTED:47— ReadinessSupervisor.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 1 (2 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.
MultiHeadAttention.__call__ (cognitive 19) phoenix/xrex/models/layers.py:136— MultiHeadAttention.__call__ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
recsys_model.block_history_reduce (cognitive 19) phoenix/xrex/models/recsys_model.py:1794— recsys_model.block_history_reduce has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecsysTrainer.init (cognitive 19) phoenix/xrex/train/trainer_recsys.py:702— RecsysTrainer.init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 2, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
aot.RetryFileLock (cognitive 19) REDACTED:461— aot.RetryFileLock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 4 (7 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.
AiTrendFeedbackContextHydrator::hydrate (cognitive 18) home-mixer/candidate_hydrators/ai_trend_feedback_context_hydrator.rs:65— AiTrendFeedbackContextHydrator::hydrate has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 4 (5 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.
MediaEntity::write_to_out_protocol (cognitive 18) thunder/schema/media_entity.rs:277— MediaEntity::write_to_out_protocol has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HydrationPlan::fmt (cognitive 18) visibility-filtering/hydration/plan.rs:238— HydrationPlan::fmt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (6 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.
TweetEmbedding::write_to_out_protocol (cognitive 18) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:821— TweetEmbedding::write_to_out_protocol has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FunctionUnit0O3.createASTNode (cognitive 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:352— FunctionUnit0O3.createASTNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (18 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit1O3.createASTNode, FunctionUnit2O3.createASTNode, FunctionUnit3O3.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit1O3.createASTNode (cognitive 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1155— FunctionUnit1O3.createASTNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (18 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O3.createASTNode, FunctionUnit2O3.createASTNode, FunctionUnit3O3.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit2O3.createASTNode (cognitive 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2083— FunctionUnit2O3.createASTNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (18 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O3.createASTNode, FunctionUnit1O3.createASTNode, FunctionUnit3O3.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit3O3.createASTNode (cognitive 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3134— FunctionUnit3O3.createASTNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (18 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O3.createASTNode, FunctionUnit1O3.createASTNode, FunctionUnit2O3.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit4O3.createASTNode (cognitive 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4294— FunctionUnit4O3.createASTNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (18 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O3.createASTNode, FunctionUnit1O3.createASTNode, FunctionUnit2O3.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit5O3.createASTNode (cognitive 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5556— FunctionUnit5O3.createASTNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (18 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O3.createASTNode, FunctionUnit1O3.createASTNode, FunctionUnit2O3.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit6O3.createASTNode (cognitive 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6904— FunctionUnit6O3.createASTNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (18 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O3.createASTNode, FunctionUnit1O3.createASTNode, FunctionUnit2O3.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
FunctionUnit7O3.createASTNode (cognitive 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8352— FunctionUnit7O3.createASTNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (18 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 7 other methods here (FunctionUnit0O3.createASTNode, FunctionUnit1O3.createASTNode, FunctionUnit2O3.createASTNode, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
ScalaType.asJava (cognitive 18) botmaker/src/scala/com/twitter/botmaker/compiler/types/ScalaType.scala:65— ScalaType.asJava has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, match/switch 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TweetPairLabelCollectionUtil.getScoredCoengagedTweetPairs (cognitive 18) simclusters/simclusters_v2/scalding/tweet_similarity/TweetPairLabelCollectionUtil.scala:252— TweetPairLabelCollectionUtil.getScoredCoengagedTweetPairs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 3 (4 pts) (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.
UthDailyPostsApp.countTweetFlagsOnBatchDay (cognitive 18) under-the-hood/scalding/UthDailyPostsJob.scala:188— UthDailyPostsApp.countTweetFlagsOnBatchDay has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gizmoduck_age.get_user_age_hours (cognitive 18) bdsm/runtime/gizmoduck_age.py:51— gizmoduck_age.get_user_age_hours has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 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.
mm_encoder._parse_encode_response (cognitive 18) phoenix/reference/mm_encoder.py:354— mm_encoder._parse_encode_response has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, ternaries 1 (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.
kafkaloader.auto_detect_auth (cognitive 18) phoenix/xrex/data/streaming/kafkaloader.py:942— kafkaloader.auto_detect_auth has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SidBeamResolver.resolve_to_indices (cognitive 18) phoenix/xrex/inference/sid_post_index.py:196— SidBeamResolver.resolve_to_indices 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.
recsys_feature_prep._build_user_features_token (cognitive 18) phoenix/xrex/models/recsys_feature_prep.py:504— recsys_feature_prep._build_user_features_token has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 8. 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.
recsys_model.pad_to_next_128_multiple (cognitive 18) phoenix/xrex/models/recsys_model.py:1999— recsys_model.pad_to_next_128_multiple has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. 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.
RecsysTrainer.create_dataset (cognitive 18) phoenix/xrex/train/trainer_recsys.py:1272— RecsysTrainer.create_dataset has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecsysTrainer._segment_sum (cognitive 18) phoenix/xrex/train/trainer_recsys.py:1492— RecsysTrainer._segment_sum has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (18 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.
RecsysTrainer._retrieval_checkpoint_datasets (cognitive 18) phoenix/xrex/train/trainer_recsys.py:3732— RecsysTrainer._retrieval_checkpoint_datasets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
orbax_encrypted.get_encrypted_checkpointer (cognitive 18) phoenix/python/training/xai-checkpointing/xai_checkpointing/orbax_encrypted.py:276— orbax_encrypted.get_encrypted_checkpointer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TwitterCLIP.__init__ (cognitive 18) clip/model.py:58— TwitterCLIP.__init__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 4 (5 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TaskSafetyPtosKeyFramesFilter._eligible_with_post (cognitive 18) grox/flows/ptos/task_safety_ptos_key_frames_filter.py:36— TaskSafetyPtosKeyFramesFilter._eligible_with_post has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
TaskSafetyPtosSafemodelSexNudity._run (cognitive 18) grox/flows/ptos/task_safety_ptos_safemodel_sex_nudity.py:75— TaskSafetyPtosSafemodelSexNudity._run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 4, boolean chains 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
FrameSampler._frames_at (cognitive 18) grox/libs/video_tools/frame_sampler.py:88— FrameSampler._frames_at has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilteredTopicsHydrator::hydrate (cognitive 17) home-mixer/candidate_hydrators/filtered_topics_hydrator.rs:59— FilteredTopicsHydrator::hydrate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 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.
Profile::write_to_out_protocol (cognitive 17) thunder/schema/user.rs:4502— Profile::write_to_out_protocol has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. 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.
SimClustersANNCandidateSource.fetchCandidates (cognitive 17) simclusters/simclusters_v2/candidate_source/SimClustersANNCandidateSource.scala:89— SimClustersANNCandidateSource.fetchCandidates has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntityEmbeddingUtil.getEntityUserMatrix (cognitive 17) simclusters/simclusters_v2/scalding/embedding/common/EntityEmbeddingUtil.scala:16— EntityEmbeddingUtil.getEntityUserMatrix has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (14 pts), boolean chains 1, if/else 1, 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.
AccountLabelEvents.deltaEventsPipe (cognitive 17) under-the-hood/scalding/AccountLabelEvents.scala:21— AccountLabelEvents.deltaEventsPipe has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (14 pts), if/else 2, boolean chains 1 (nesting depth added 10). 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.
UthGizmoduckSafetyFlagDailyBackfillApp.labelDiffsPipe (cognitive 17) under-the-hood/scalding/legacy_experimental_adhoc/UthGizmoduckSafetyFlagDailyBackfillJob.scala:189— UthGizmoduckSafetyFlagDailyBackfillApp.labelDiffsPipe has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (14 pts), if/else 2, boolean chains 1 (nesting depth added 10). 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.
load_backbone.load_params (cognitive 17) bdsm/runtime/load_backbone.py:9— load_backbone.load_params has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parquet_recsys.load_global_ids_from_parquet_file (cognitive 17) phoenix/xrex/data/parquet_recsys.py:87— parquet_recsys.load_global_ids_from_parquet_file has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 2 (5 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.
BatchManifest.batch_timestamps (cognitive 17) phoenix/xrex/data/parquet_recsys_metadata.py:139— BatchManifest.batch_timestamps has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rust_parquet_recsys._block_shuffle_window (cognitive 17) phoenix/xrex/data/rust_parquet_recsys.py:261— rust_parquet_recsys._block_shuffle_window has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (4 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.
RecsysSIDRetrievalEval.run (cognitive 17) phoenix/xrex/eval/recsys_eval.py:726— RecsysSIDRetrievalEval.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 2 (4 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.
RecsysAggregatedModel.__call__ (cognitive 17) phoenix/xrex/models/recsys_model.py:4012— RecsysAggregatedModel.__call__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, 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.
RecsysTwoTowerModel.build_user_inputs (cognitive 17) phoenix/xrex/models/recsys_two_tower_model.py:1567— RecsysTwoTowerModel.build_user_inputs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 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.
ThrottledD2HArrayHandler.serialize (cognitive 17) phoenix/xrex/utils/checkpointing.py:141— ThrottledD2HArrayHandler.serialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (4 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.
checksum.get_checksum_dict (cognitive 17) phoenix/python/training/xai-checkpointing/xai_checkpointing/checksum.py:90— checksum.get_checksum_dict 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.
load.load_checkpoint (cognitive 17) phoenix/python/training/xai-checkpointing/xai_checkpointing/load.py:324— load.load_checkpoint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 3 (6 pts), ternaries 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.
Dispatcher._result_loop (cognitive 17) grox/core/dispatcher.py:127— Dispatcher._result_loop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ThreadRenderer._render_signals (cognitive 17) grox/core/lm/thread.py:36— ThreadRenderer._render_signals has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (17 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.
CoordinatedSpamScorer._parse (cognitive 17) grox/flows/reply_spam/classifier_coordinated_spam.py:173— CoordinatedSpamScorer._parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiStepReplySpamScorer._parse (cognitive 17) grox/flows/reply_spam/classifier_multi_step_reply_spam.py:177— MultiStepReplySpamScorer._parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiRegionKafkaConsumer.poll (cognitive 17) grox/libs/kafka_cli/multi_region_consumer.py:142— MultiRegionKafkaConsumer.poll has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (6 pts), ternaries 2 (6 pts), if/else 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.
QuoteHydrator::hydrate (cognitive 16) home-mixer/candidate_hydrators/quote_hydrator.rs:193— QuoteHydrator::hydrate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (3 pts), 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.
TopicFeedbackContextHydrator::hydrate (cognitive 16) home-mixer/candidate_hydrators/topic_feedback_context_hydrator.rs:123— TopicFeedbackContextHydrator::hydrate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (4 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.
MessagingDevice::write_to_out_protocol (cognitive 16) thunder/schema/user.rs:12808— MessagingDevice::write_to_out_protocol has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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.
ThunderServiceImpl::get_in_network_posts (cognitive 16) thunder/thunder_service.rs:152— ThunderServiceImpl::get_in_network_posts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, match/switch 1 (2 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.
PacedBody::poll_frame (cognitive 16) phoenix/crates/serving/xai-recsys-engine/src/copy_manifest.rs:479— PacedBody::poll_frame has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 2 (4 pts), loops 1 (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.
RequestQueue::with_batch_wait (cognitive 16) phoenix/crates/serving/xai-recsys-engine/src/request_queue.rs:46— RequestQueue::with_batch_wait has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (6 pts), loops 3 (5 pts), match/switch 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.
ScalaType.ofType (cognitive 16) botmaker/src/scala/com/twitter/botmaker/compiler/types/ScalaType.scala:11— ScalaType.ofType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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.
CompiledEvaluator.run (cognitive 16) botmaker/src/scala/com/twitter/botmaker/rule/RuleEvaluator.scala:120— CompiledEvaluator.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), match/switch 5 (7 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimClustersEmbedding.sum (cognitive 16) simclusters/simclusters_v2/common/SimClustersEmbedding.scala:88— SimClustersEmbedding.sum 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.
ClusterEvaluation.summarizePerClusterResults (cognitive 16) simclusters/simclusters_v2/scalding/ClusterEvaluation.scala:217— ClusterEvaluation.summarizePerClusterResults has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TopUsersSimilarityGraph.convertIterableToGraph (cognitive 16) simclusters/simclusters_v2/scalding/TopUsersSimilarityGraph.scala:400— TopUsersSimilarityGraph.convertIterableToGraph has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (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.
LocaleEntitySimClustersEmbeddingV2Job.prepareNounToUserMatrix (cognitive 16) simclusters/simclusters_v2/scalding/embedding/LocaleEntitySimClustersEmbeddingV2Job.scala:193— LocaleEntitySimClustersEmbeddingV2Job.prepareNounToUserMatrix has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (14 pts), if/else 1, 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.
FeaturesOfRtpCaseUpdateEvent.processEvidenceFields (cognitive 16) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfRtpCaseUpdateEvent.java:301— FeaturesOfRtpCaseUpdateEvent.processEvidenceFields has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FeaturesOfXchatMessageEvent.apply (cognitive 16) botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfXchatMessageEvent.java:25— FeaturesOfXchatMessageEvent.apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (16 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Parser.parseParams (cognitive 16) botmaker/src/java/com/twitter/botmaker/compiler/Parser.java:121— Parser.parseParams has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, error handling 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.
FlashAttentionForwardSm100.load_KV (cognitive 16) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:2898— FlashAttentionForwardSm100.load_KV has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 4 (5 pts), boolean chains 2 (nesting depth added 4). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
PhoenixDataset.example_data_shape (cognitive 16) phoenix/xrex/data/parquet_recsys.py:2354— PhoenixDataset.example_data_shape has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 3, ternaries 3, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
sequence_packing._drop_candidates_over_budget (cognitive 16) phoenix/xrex/data/recsys/sequence_packing.py:665— sequence_packing._drop_candidates_over_budget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (6 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.
kafkaconsumer.deserialize_messages (cognitive 16) phoenix/xrex/data/streaming/kafkaconsumer.py:729— kafkaconsumer.deserialize_messages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, error handling 2 (3 pts), loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kafkaconsumer.handle_topic_offset (cognitive 16) phoenix/xrex/data/streaming/kafkaconsumer.py:1034— kafkaconsumer.handle_topic_offset has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 4, loops 2 (3 pts), 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.
RetrievalModelRunner._build_eligible_mask (cognitive 16) phoenix/xrex/inference/model_runner.py:5027— RetrievalModelRunner._build_eligible_mask has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 3, ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecsysAggregatedModelConfig.make (cognitive 16) phoenix/xrex/models/recsys_model.py:1266— RecsysAggregatedModelConfig.make has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6, loops 1 (2 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.
RecsysAggregatedModel.compute_engagement_count_metrics (cognitive 16) phoenix/xrex/models/recsys_model.py:2661— RecsysAggregatedModel.compute_engagement_count_metrics has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (6 pts), loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
aot.cutlass_module_device_digest (cognitive 16) REDACTED:321— aot.cutlass_module_device_digest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MediaProcessor._result_loop (cognitive 16) grox/core/data_loaders/media_processor.py:162— MediaProcessor._result_loop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 2 (4 pts), ternaries 1 (3 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.
PostMapper.from_post_metadata_strato (cognitive 16) grox/core/data_loaders/post_mapper.py:86— PostMapper.from_post_metadata_strato has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, ternaries 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
V82EmbedPostRenderer._card_block (cognitive 16) grox/flows/mm_emb/renderer_v82.py:323— V82EmbedPostRenderer._card_block has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
V8SearchEmbedPostRenderer._card_block (cognitive 16) grox/flows/mm_emb/renderer_v8_search.py:412— V8SearchEmbedPostRenderer._card_block has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaskSafetyPtosPolicyDetection._exec_with_post (cognitive 16) grox/flows/ptos/task_safety_ptos_policy.py:68— TaskSafetyPtosPolicyDetection._exec_with_post has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 2, error handling 1 (2 pts), loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EapiSampler._extract_details (cognitive 16) grox/libs/grok_sampler/eapi_sampler.py:182— EapiSampler._extract_details has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 4, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrameSampler._sample (cognitive 16) grox/libs/video_tools/frame_sampler.py:30— FrameSampler._sample has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, 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.
TooManyFunctions: crate::home-mixer::util::urt::prompt_marshaller home-mixer/util/urt/prompt_marshaller.rs:62— TooManyFunctions — 31 free functions. The bar is 30 free functions; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Near-duplicate member family (24 members, 22 shared lines) · ×1
Near-duplicate member family (24 members, 22 shared lines) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:97— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:97-130 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:606-639 | thunder/schema/events.rs:211-248 | thunder/schema/events.rs:378-415 | thunder/schema/events.rs:458-495 | thunder/schema/events.rs:538-575 | thunder/schema/events.rs:1304-1341 | thunder/schema/events.rs:1382-1413 | thunder/schema/events.rs:1449-1480 | thunder/schema/events.rs:2171-2214 | thunder/schema/events.rs:2539-2570 | thunder/schema/events.rs:2701-2738 | thunder/schema/events.rs:2779-2810 | thunder/schema/events.rs:3028-3068 | thunder/schema/events.rs:3105-3145 | thunder/schema/events.rs:3182-3222 | thunder/schema/events.rs:3259-3299 | thunder/schema/tweet.rs:625-656 | thunder/schema/tweet.rs:761-798 | thunder/schema/tweet.rs:919-950 | thunder/schema/tweet.rs:2869-2930 | thunder/schema/tweet_events.rs:534-565 | thunder/schema/tweet_events.rs:601-632 | thunder/schema/tweet_events.rs:1114-1157 — These 24 members are variants of one another: a block of 22 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 24 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 24 times.
D4 · Code Duplication· Near-duplicate member family (13 members, 23 shared lines) · ×1
Near-duplicate member family (13 members, 23 shared lines) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:97— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:97-130 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:606-639 | thunder/schema/events.rs:1018-1076 | thunder/schema/events.rs:3028-3068 | thunder/schema/events.rs:3105-3145 | thunder/schema/events.rs:3182-3222 | thunder/schema/events.rs:3259-3299 | thunder/schema/events.rs:3557-3636 | thunder/schema/events.rs:3728-3807 | thunder/schema/tweet.rs:2575-2618 | thunder/schema/tweet.rs:2869-2930 | thunder/schema/user.rs:5712-5750 | thunder/schema/user.rs:9674-9783 — These 13 members are variants of one another: a block of 23 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 13 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 13 times.
D4 · Code Duplication· Near-duplicate member family (10 members, 21 shared lines) · ×1
Near-duplicate member family (10 members, 21 shared lines) thunder/schema/events.rs:4041— thunder/schema/events.rs:4041-4072 | thunder/schema/tweet.rs:2451-2482 | thunder/schema/tweet.rs:2793-2824 | thunder/schema/user.rs:10871-10902 | thunder/schema/user.rs:11134-11177 | thunder/schema/user.rs:11325-11356 | thunder/schema/user.rs:11469-11500 | thunder/schema/user.rs:11613-11644 | thunder/schema/user.rs:11783-11814 | thunder/schema/user.rs:13252-13295 — These 10 members are variants of one another: a block of 21 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication· Near-duplicate member family (8 members, 22 shared lines) · ×1
Near-duplicate member family (8 members, 22 shared lines) thunder/schema/tweet.rs:692— thunder/schema/tweet.rs:692-723 | thunder/schema/tweet.rs:841-878 | thunder/schema/tweet.rs:1995-2032 | thunder/schema/tweet.rs:2075-2112 | thunder/schema/tweet_media.rs:483-514 | thunder/schema/user.rs:3349-3380 | thunder/schema/user.rs:11393-11430 | thunder/schema/user.rs:11537-11574 — These 8 members are variants of one another: a block of 22 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Near-duplicate member family (8 members, 12 shared lines) · ×1
Near-duplicate member family (8 members, 12 shared lines) thunder/schema/events.rs:1018— thunder/schema/events.rs:1018-1076 | thunder/schema/events.rs:2067-2116 | thunder/schema/events.rs:2264-2307 | thunder/schema/events.rs:2357-2400 | thunder/schema/events.rs:2450-2493 | thunder/schema/events.rs:2931-2985 | thunder/schema/tweet.rs:4092-4124 | thunder/schema/tweet_events.rs:1021-1064 — These 8 members are variants of one another: a block of 12 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Near-duplicate member family (7 members, 34 shared lines) · ×1
Near-duplicate member family (7 members, 34 shared lines) thunder/schema/events.rs:1018— thunder/schema/events.rs:1018-1076 | thunder/schema/events.rs:2931-2985 | thunder/schema/events.rs:3557-3636 | thunder/schema/events.rs:3728-3807 | thunder/schema/media_common.rs:385-446 | thunder/schema/tweet.rs:2869-2930 | thunder/schema/user.rs:9674-9783 — These 7 members are variants of one another: a block of 34 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Near-duplicate member family (7 members, 23 shared lines) · ×1
Near-duplicate member family (7 members, 23 shared lines) thunder/schema/tweet.rs:4160— thunder/schema/tweet.rs:4160-4205 | thunder/schema/tweet.rs:4248-4293 | thunder/schema/tweet.rs:4336-4381 | thunder/schema/tweet.rs:4424-4469 | thunder/schema/tweet.rs:4512-4557 | thunder/schema/tweet.rs:4600-4645 | thunder/schema/tweet_events.rs:289-338 — These 7 members are variants of one another: a block of 23 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Near-duplicate member family (7 members, 22 shared lines) · ×1
Near-duplicate member family (7 members, 22 shared lines) thunder/schema/events.rs:2067— thunder/schema/events.rs:2067-2116 | thunder/schema/events.rs:2264-2307 | thunder/schema/events.rs:2357-2400 | thunder/schema/tweet.rs:1150-1193 | thunder/schema/tweet.rs:4092-4124 | thunder/schema/tweet_events.rs:1021-1064 | thunder/schema/user.rs:4692-4723 — These 7 members are variants of one another: a block of 22 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Near-duplicate member family (6 members, 14 shared lines) · ×1
Near-duplicate member family (6 members, 14 shared lines) thunder/schema/user.rs:7241— thunder/schema/user.rs:7241-7386 | thunder/schema/user.rs:7553-7692 | thunder/schema/user.rs:8326-8411 | thunder/schema/user.rs:10008-10081 | thunder/schema/user.rs:10319-10488 | thunder/schema/user.rs:12368-12417 — These 6 members are variants of one another: a block of 14 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Near-duplicate member family (6 members, 12 shared lines) · ×1
Near-duplicate member family (6 members, 12 shared lines) thunder/schema/media_common.rs:571— thunder/schema/media_common.rs:571-596 | thunder/schema/tweet.rs:841-878 | thunder/schema/tweet.rs:1237-1262 | thunder/schema/tweet.rs:3341-3366 | thunder/schema/tweet_media.rs:483-514 | thunder/schema/user.rs:3349-3380 — These 6 members are variants of one another: a block of 12 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 27 shared lines) · ×1
Near-duplicate member family (5 members, 27 shared lines) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:233— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:233-335 | thunder/schema/media_common.rs:385-446 | thunder/schema/tweet.rs:1635-1690 | thunder/schema/user.rs:7887-7924 | thunder/schema/user.rs:10784-10827 — These 5 members are variants of one another: a block of 27 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 44 shared lines) · ×1
Near-duplicate member family (4 members, 44 shared lines) thunder/schema/events.rs:636— thunder/schema/events.rs:636-727 | thunder/schema/events.rs:833-924 | thunder/schema/events.rs:3557-3636 | thunder/schema/events.rs:3728-3807 — These 4 members are variants of one another: a block of 44 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 37 shared lines) · ×1
Near-duplicate member family (4 members, 37 shared lines) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:434— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:434-530 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:699-820 | thunder/schema/user.rs:12692-12807 | thunder/schema/user.rs:12953-13111 — These 4 members are variants of one another: a block of 37 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 28 shared lines) · ×1
Near-duplicate member family (4 members, 28 shared lines) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:233— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:233-335 | thunder/schema/tweet.rs:2674-2736 | thunder/schema/tweet.rs:3722-3783 | thunder/schema/user.rs:10784-10827 — These 4 members are variants of one another: a block of 28 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 27 shared lines) · ×1
Near-duplicate member family (4 members, 27 shared lines) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:699— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:699-820 | thunder/schema/tweet.rs:2375-2412 | thunder/schema/user.rs:11685-11734 | thunder/schema/user.rs:13627-13682 — These 4 members are variants of one another: a block of 27 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 25 shared lines) · ×1
Near-duplicate member family (4 members, 25 shared lines) thunder/schema/tweet_media.rs:405— thunder/schema/tweet_media.rs:405-442 | thunder/schema/user.rs:3873-3910 | thunder/schema/user.rs:4614-4651 | thunder/schema/user.rs:13887-13945 — These 4 members are variants of one another: a block of 25 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 11 shared lines) · ×1
Near-duplicate member family (4 members, 11 shared lines) thunder/schema/tweet.rs:2033— thunder/schema/tweet.rs:2033-2053 | thunder/schema/tweet.rs:2113-2133 | thunder/schema/user.rs:11431-11451 | thunder/schema/user.rs:11575-11595 — These 4 members are variants of one another: a block of 11 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 43 shared lines) · ×1
Near-duplicate member family (3 members, 43 shared lines) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:45— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:45-154 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala:45-152 | simclusters/simclusters_v2/summingbird/storm/TwhinUserJob.scala:39-120 — These 3 members are variants of one another: a block of 43 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 30 shared lines) · ×1
Near-duplicate member family (3 members, 30 shared lines) home-mixer/clients/prompts_client.rs:35— home-mixer/clients/prompts_client.rs:35-85 | home-mixer/clients/simclusters_ann_client.rs:38-88 | home-mixer/clients/who_to_follow_client.rs:37-89 — These 3 members are variants of one another: a block of 30 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 25 shared lines) · ×1
Near-duplicate member family (3 members, 25 shared lines) phoenix-rankall/src/processor/main_processor.rs:28— phoenix-rankall/src/processor/main_processor.rs:28-66 | phoenix-rankall/src/processor/sid_processor.rs:38-100 | phoenix-rankall/src/processor/topic_processor.rs:27-79 — These 3 members are variants of one another: a block of 25 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 22 shared lines) · ×1
Near-duplicate member family (3 members, 22 shared lines) thunder/schema/user.rs:8771— thunder/schema/user.rs:8771-8802 | thunder/schema/user.rs:8838-8869 | thunder/schema/user.rs:10206-10237 — These 3 members are variants of one another: a block of 22 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 18 shared lines) · ×1
Near-duplicate member family (3 members, 18 shared lines) botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:269— botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:269-458 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:30-157 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:31-259 — These 3 members are variants of one another: a block of 18 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (161 shared lines) phoenix/xrex/pallas/ranker_attention_fa3.py:89— phoenix/xrex/pallas/ranker_attention_fa3.py:89-403 | phoenix/xrex/pallas/ranker_attention_fa3.py:1252-1553 — These two members are variants of one another: 161 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 (158 shared lines) phoenix/xrex/cutedsl/ranker_attention_fa4.py:265— phoenix/xrex/cutedsl/ranker_attention_fa4.py:265-689 | phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:337-775 — These two members are variants of one another: 158 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 (88 shared lines) home-mixer/ads/partition_organic_blender.rs:25— home-mixer/ads/partition_organic_blender.rs:25-199 | home-mixer/ads/time_gap_blender.rs:53-177 — These two members are variants of one another: 88 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 (86 shared lines) phoenix/xrex/data/recsys/recsys_batch.py:1639— phoenix/xrex/data/recsys/recsys_batch.py:1639-1971 | phoenix/xrex/data/recsys/recsys_batch.py:1987-2231 — These two members are variants of one another: 86 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 (74 shared lines) phoenix/xrex/pallas/ranker_attention_varlen.py:721— phoenix/xrex/pallas/ranker_attention_varlen.py:721-861 | phoenix/xrex/pallas/ranker_attention_varlen.py:891-1034 — These two members are variants of one another: 74 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 (67 shared lines) phoenix/xrex/pallas/ranker_attention_v2.py:85— phoenix/xrex/pallas/ranker_attention_v2.py:85-190 | phoenix/xrex/pallas/ranker_attention_v2.py:210-324 — These two members are variants of one another: 67 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 (64 shared lines) phoenix/xrex/data/streaming/kafkaconsumer.py:1328— phoenix/xrex/data/streaming/kafkaconsumer.py:1328-1471 | phoenix/xrex/data/streaming/kafkaconsumer.py:1776-2048 — These two members are variants of one another: 64 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (58 shared lines) simclusters/simclusters_v2/common/clustering/LouvainClusteringMethod.scala:23— simclusters/simclusters_v2/common/clustering/LouvainClusteringMethod.scala:23-87 | simclusters/simclusters_v2/common/clustering/LouvainClusteringMethod.scala:94-199 — These two members are variants of one another: 58 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (48 shared lines) phoenix/xrex/pallas/ranker_attention_v2.py:660— phoenix/xrex/pallas/ranker_attention_v2.py:660-757 | phoenix/xrex/pallas/ranker_attention_varlen.py:721-861 — These two members are variants of one another: 48 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (45 shared lines) phoenix/reference/sid_codebook.py:233— phoenix/reference/sid_codebook.py:233-286 | phoenix/reference/sid_codebook.py:603-674 — These two members are variants of one another: 45 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (40 shared lines) phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:355— phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:355-452 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:491-554 — These two members are variants of one another: 40 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (38 shared lines) phoenix/xrex/pallas/ranker_attention_v2.py:785— phoenix/xrex/pallas/ranker_attention_v2.py:785-880 | phoenix/xrex/pallas/ranker_attention_varlen.py:891-1034 — These two members are variants of one another: 38 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (27 shared lines) abuse-enforcement-service/service-lib/src/action_control.rs:1159— abuse-enforcement-service/service-lib/src/action_control.rs:1159-1227 | abuse-enforcement-service/service-lib/src/head_guard.rs:465-529 — These two members are variants of one another: 27 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (26 shared lines) grox/flows/ptos/classifier.py:251— grox/flows/ptos/classifier.py:251-292 | grox/flows/ptos/classifier.py:297-352 — These two members are variants of one another: 26 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 (65 corresponding lines) · ×1
Edited copy of a member (65 corresponding lines) thunder/schema/events.rs:728— thunder/schema/events.rs:728-793 | thunder/schema/events.rs:925-990 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (49 corresponding lines) · ×1
Edited copy of a member (49 corresponding lines) grox/flows/mm_emb/renderer_v82.py:188— grox/flows/mm_emb/renderer_v82.py:188-243 | grox/flows/mm_emb/renderer_v8_search.py:228-288 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) phoenix/xrex/pallas/ranker_attention_utils.py:28— phoenix/xrex/pallas/ranker_attention_utils.py:28-56 | phoenix/xrex/pallas/ranker_attention_utils.py:71-99 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×1
Edited copy of a member (38 corresponding lines) thunder/schema/tweet_events.rs:670— thunder/schema/tweet_events.rs:670-713 | thunder/schema/tweet_events.rs:1209-1264 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) grox/flows/reply_spam/task_multi_step_reply_spam.py:156— grox/flows/reply_spam/task_multi_step_reply_spam.py:156-185 | grox/flows/reply_spam/task_write.py:163-192 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×1
Edited copy of a member (18 corresponding lines) thunder/schema/tweet.rs:2294— thunder/schema/tweet.rs:2294-2319 | thunder/schema/tweet.rs:2413-2433 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) thunder/schema/user.rs:4838— thunder/schema/user.rs:4838-4870 | thunder/schema/user.rs:14116-14153 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) grox/flows/upa/task_filter.py:16— grox/flows/upa/task_filter.py:16-40 | grox/flows/upa/task_filter.py:55-79 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (67 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (67 members, 50+ identical tokens) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:35— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:35-80 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:102-143 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:167-222 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:248-319 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:352-442 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:478-593 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:632-775 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:801-852 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:876-920 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:946-1009 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1037-1119 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1155-1262 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1301-1436 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1478-1644 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1672-1726 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1752-1803 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1831-1907 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1943-2044 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2083-2212 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2254-2414 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2459-2653 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2683-2743 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2771-2825 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2855-2940 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2979-3092 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3134-3278 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3323-3501 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3549-3764 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3796-3859 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3889-3949 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3988-4082 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4124-4249 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4294-4453 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4501-4697 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4748-4984 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5026-5092 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5124-5187 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5229-5329 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5374-5508 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5556-5727 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5778-5989 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6043-6297 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6342-6411 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6445-6511 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6556-6662 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6710-6853 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6904-7087 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7141-7367 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7424-7696 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7745-7817 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7863-7932 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7981-8093 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8145-8297 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8352-8547 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8605-8846 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8907-9197 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9263-9623 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9687-10012 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10083-10219 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10267-10498 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10550-10821 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10883-11197 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11271-11732 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11791-11909 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11976-12106 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12162-12234 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12299-12643 — These 67 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 67 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 67 times.
D4 · Code Duplication· Members sharing a duplicated core (26 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (26 members, 50+ identical tokens) phoenix-rankall/src/processor/gen/hydra.rs:181— phoenix-rankall/src/processor/gen/hydra.rs:181-193 | phoenix-rankall/src/processor/gen/hydra.rs:457-469 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:676-695 | thunder/schema/events.rs:617-632 | thunder/schema/events.rs:814-829 | thunder/schema/events.rs:1521-1540 | thunder/schema/events.rs:3540-3553 | thunder/schema/events.rs:3711-3724 | thunder/schema/media_entity.rs:132-151 | thunder/schema/tweet.rs:1401-1415 | thunder/schema/tweet_events.rs:111-123 | thunder/schema/tweet_events.rs:386-397 | thunder/schema/user.rs:3414-3426 | thunder/schema/user.rs:3573-3586 | thunder/schema/user.rs:4356-4376 | thunder/schema/user.rs:5977-6048 | thunder/schema/user.rs:7213-7237 | thunder/schema/user.rs:7526-7549 | thunder/schema/user.rs:8308-8322 | thunder/schema/user.rs:8948-9005 | thunder/schema/user.rs:9652-9670 | thunder/schema/user.rs:9992-10004 | thunder/schema/user.rs:10287-10315 | thunder/schema/user.rs:12669-12688 | thunder/schema/user.rs:12924-12949 | thunder/schema/user.rs:14224-14268 — These 26 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 26 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 26 times.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) phoenix-rankall/src/processor/gen/hydra.rs:114— phoenix-rankall/src/processor/gen/hydra.rs:114-143 | thunder/schema/events.rs:1678-1775 | thunder/schema/events.rs:4073-4087 | thunder/schema/tweet.rs:1895-1909 | thunder/schema/tweet.rs:1959-1973 | thunder/schema/user.rs:3813-3851 | thunder/schema/user.rs:5387-5690 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Duplicated block (54–55 lines × 2) phoenix/crates/common/xai-recsys/src/util.rs:939— phoenix/crates/common/xai-recsys/src/util.rs:939-993 | phoenix/crates/serving/xai-recsys-engine/src/util.rs:85-138 — before extracting anything, compare `phoenix/crates/common/xai-recsys/src/util.rs` and `phoenix/crates/serving/xai-recsys-engine/src/util.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 139 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 (35 lines × 4) thunder/schema/events.rs:736— thunder/schema/events.rs:736-770 | thunder/schema/events.rs:933-967 | thunder/schema/events.rs:3645-3679 | thunder/schema/events.rs:3816-3850 — 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 (35 lines × 2) home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:590— home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs:590-624 | home-mixer/candidate_pipeline/phoenix_scores_pipeline.rs:199-233 — before extracting anything, compare `home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/phoenix_scores_pipeline.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (30–34 lines × 2) thunder/schema/media_entity.rs:54— thunder/schema/media_entity.rs:54-83 | thunder/schema/user.rs:3186-3219 — before extracting anything, compare `thunder/schema/media_entity.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 231 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (28 lines × 4) thunder/schema/tweet.rs:1996— thunder/schema/tweet.rs:1996-2023 | thunder/schema/tweet.rs:2076-2103 | thunder/schema/user.rs:11394-11421 | thunder/schema/user.rs:11538-11565 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (25–27 lines × 2) phoenix/crates/common/xai-recsys/src/util.rs:1426— phoenix/crates/common/xai-recsys/src/util.rs:1426-1452 | phoenix/crates/serving/xai-recsys-engine/src/util.rs:338-362 — before extracting anything, compare `phoenix/crates/common/xai-recsys/src/util.rs` and `phoenix/crates/serving/xai-recsys-engine/src/util.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 139 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–26 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/python.rs:972— phoenix/crates/serving/xai-recsys-engine/src/python.rs:972-997 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:2804-2828 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 3) phoenix-rankall/src/processor/main_processor.rs:31— phoenix-rankall/src/processor/main_processor.rs:31-55 | phoenix-rankall/src/processor/sid_processor.rs:42-66 | phoenix-rankall/src/processor/topic_processor.rs:30-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (23–25 lines × 2) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1233— phoenix/crates/serving/xai-recsys-engine/src/python.rs:1233-1257 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:1289-1311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 4) thunder/schema/events.rs:667— thunder/schema/events.rs:667-689 | thunder/schema/events.rs:864-886 | thunder/schema/events.rs:3586-3608 | thunder/schema/events.rs:3757-3779 — 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–22 lines × 4) phoenix-rankall/src/store/base.rs:1090— phoenix-rankall/src/store/base.rs:1090-1103 | phoenix-rankall/src/store/base.rs:1111-1119 | phoenix-rankall/src/store/base.rs:1127-1145 | phoenix-rankall/src/store/base.rs:1154-1175 — 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–22 lines × 4) thunder/schema/events.rs:1818— thunder/schema/events.rs:1818-1830 | thunder/schema/events.rs:1988-2000 | thunder/schema/tweet.rs:3019-3040 | thunder/schema/tweet_events.rs:1037-1049 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–21 lines × 3) phoenix/crates/serving/xai-recsys-engine/src/checkpoint_store.rs:335— phoenix/crates/serving/xai-recsys-engine/src/checkpoint_store.rs:335-355 | phoenix/crates/serving/xai-recsys-engine/src/checkpoint_store.rs:451-454 | phoenix/crates/serving/xai-recsys-engine/src/storage_util.rs:69-88 — 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 (20 lines × 6) thunder/schema/media_entity.rs:173— thunder/schema/media_entity.rs:173-192 | thunder/schema/tweet.rs:1643-1662 | thunder/schema/tweet.rs:1762-1781 | thunder/schema/tweet.rs:2163-2182 | thunder/schema/user.rs:11041-11060 | thunder/schema/user.rs:11234-11253 — before extracting anything, compare `thunder/schema/media_entity.rs` and `thunder/schema/tweet.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 (19–20 lines × 3) phoenix/crates/common/xai-recsys/src/util.rs:1150— phoenix/crates/common/xai-recsys/src/util.rs:1150-1168 | phoenix/crates/common/xai-recsys/src/util.rs:1316-1335 | phoenix/crates/common/xai-recsys/src/util.rs:1611-1629 — 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 (18 lines × 11) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:163— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:163-180 | thunder/schema/events.rs:1195-1212 | thunder/schema/events.rs:1249-1266 | thunder/schema/events.rs:3990-4007 | thunder/schema/tweet.rs:2518-2535 | thunder/schema/tweet.rs:4039-4056 | thunder/schema/tweet.rs:4687-4704 | thunder/schema/tweet.rs:4888-4905 | thunder/schema/tweet.rs:4941-4958 | thunder/schema/tweet.rs:4994-5011 | thunder/schema/user.rs:10640-10657 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 214 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 (18 lines × 5) thunder/schema/media_common.rs:574— thunder/schema/media_common.rs:574-591 | thunder/schema/tweet.rs:1240-1257 | thunder/schema/tweet.rs:3203-3220 | thunder/schema/tweet.rs:3344-3361 | thunder/schema/tweet_media.rs:551-568 — before extracting anything, compare `thunder/schema/media_common.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 235 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 4) home-mixer/server.rs:397— home-mixer/server.rs:397-414 | home-mixer/server.rs:497-514 | home-mixer/server.rs:560-577 | home-mixer/server.rs:663-680 — 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 (18 lines × 3) home-mixer/candidate_pipeline/following_candidate_pipeline.rs:77— home-mixer/candidate_pipeline/following_candidate_pipeline.rs:77-94 | home-mixer/candidate_pipeline/for_you_candidate_pipeline.rs:82-99 | home-mixer/candidate_pipeline/ranked_following_candidate_pipeline.rs:53-70 — before extracting anything, compare `home-mixer/candidate_pipeline/following_candidate_pipeline.rs` and `home-mixer/candidate_pipeline/for_you_candidate_pipeline.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–18 lines × 2) phoenix-rankall/src/store/base.rs:727— phoenix-rankall/src/store/base.rs:727-739 | phoenix-rankall/src/store/base.rs:781-798 — both copies are in the same file, so extract the block into 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 × 6) thunder/schema/tweet.rs:4210— thunder/schema/tweet.rs:4210-4226 | thunder/schema/tweet.rs:4298-4314 | thunder/schema/tweet.rs:4386-4402 | thunder/schema/tweet.rs:4474-4490 | thunder/schema/tweet.rs:4562-4578 | thunder/schema/tweet.rs:4650-4666 — 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 (14–17 lines × 2) home-mixer/candidate_hydrators/blocked_by_hydrator.rs:31— home-mixer/candidate_hydrators/blocked_by_hydrator.rs:31-44 | home-mixer/candidate_hydrators/following_blocked_by_hydrator.rs:28-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 11) thunder/schema/media_entity.rs:173— thunder/schema/media_entity.rs:173-187 | thunder/schema/tweet.rs:1643-1657 | thunder/schema/tweet.rs:1762-1776 | thunder/schema/tweet.rs:2000-2014 | thunder/schema/tweet.rs:2080-2094 | thunder/schema/tweet.rs:2163-2177 | thunder/schema/tweet_media.rs:340-354 | thunder/schema/user.rs:11041-11055 | thunder/schema/user.rs:11234-11248 | thunder/schema/user.rs:11398-11412 | thunder/schema/user.rs:11542-11556 — before extracting anything, compare `thunder/schema/media_entity.rs` and `thunder/schema/tweet.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–15 lines × 4) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1777— phoenix/crates/serving/xai-recsys-engine/src/python.rs:1777-1791 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:1807-1820 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:1848-1861 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:1889-1902 — 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 (4–15 lines × 4) thunder/schema/events.rs:644— thunder/schema/events.rs:644-658 | thunder/schema/events.rs:841-855 | thunder/schema/events.rs:3562-3565 | thunder/schema/events.rs:3733-3736 — 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–14 lines × 18) thunder/schema/tweet.rs:3032— thunder/schema/tweet.rs:3032-3044 | thunder/schema/user.rs:6136-6148 | thunder/schema/user.rs:6184-6196 | thunder/schema/user.rs:6204-6216 | thunder/schema/user.rs:6304-6316 | thunder/schema/user.rs:6336-6348 | thunder/schema/user.rs:6364-6376 | thunder/schema/user.rs:7105-7118 | thunder/schema/user.rs:7271-7284 | thunder/schema/user.rs:7597-7609 | thunder/schema/user.rs:7633-7645 | thunder/schema/user.rs:8346-8359 | thunder/schema/user.rs:9072-9085 | thunder/schema/user.rs:9111-9123 | thunder/schema/user.rs:10026-10039 | thunder/schema/user.rs:10353-10366 | thunder/schema/user.rs:12382-12395 | thunder/schema/user.rs:12568-12581 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 50) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:103— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:103-115 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:450-462 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:612-624 | thunder/schema/events.rs:218-230 | thunder/schema/events.rs:298-310 | thunder/schema/events.rs:385-397 | thunder/schema/events.rs:465-477 | thunder/schema/events.rs:545-557 | thunder/schema/events.rs:652-664 | thunder/schema/events.rs:849-861 | thunder/schema/events.rs:1028-1040 | thunder/schema/events.rs:1311-1323 | thunder/schema/events.rs:1388-1400 | thunder/schema/events.rs:1455-1467 | thunder/schema/events.rs:1564-1576 | thunder/schema/events.rs:2076-2088 | thunder/schema/events.rs:2179-2191 | thunder/schema/events.rs:2272-2284 | thunder/schema/events.rs:2365-2377 | thunder/schema/events.rs:2458-2470 | thunder/schema/events.rs:2545-2557 | thunder/schema/events.rs:2708-2720 | thunder/schema/events.rs:2785-2797 | thunder/schema/events.rs:2855-2867 | thunder/schema/events.rs:2940-2952 | thunder/schema/events.rs:3035-3047 | thunder/schema/events.rs:3112-3124 | thunder/schema/events.rs:3189-3201 | thunder/schema/events.rs:3266-3278 | thunder/schema/events.rs:3455-3467 | thunder/schema/events.rs:3571-3583 | thunder/schema/events.rs:3742-3754 | thunder/schema/media_common.rs:396-408 | thunder/schema/tweet.rs:631-643 | thunder/schema/tweet.rs:768-780 | thunder/schema/tweet.rs:925-937 | thunder/schema/tweet.rs:2880-2892 | thunder/schema/tweet.rs:3611-3623 | thunder/schema/tweet_events.rs:540-552 | thunder/schema/tweet_events.rs:607-619 | thunder/schema/tweet_events.rs:677-689 | thunder/schema/tweet_events.rs:926-938 | thunder/schema/tweet_events.rs:1029-1041 | thunder/schema/tweet_events.rs:1122-1134 | thunder/schema/tweet_events.rs:1218-1230 | thunder/schema/user.rs:9693-9705 | thunder/schema/user.rs:12712-12724 | thunder/schema/user.rs:12979-12991 | thunder/schema/user.rs:13637-13649 | thunder/schema/user.rs:14317-14329 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 214 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 48) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:110— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:110-122 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:303-315 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:619-631 | thunder/schema/events.rs:229-241 | thunder/schema/events.rs:396-408 | thunder/schema/events.rs:476-488 | thunder/schema/events.rs:556-568 | thunder/schema/events.rs:1051-1063 | thunder/schema/events.rs:1322-1334 | thunder/schema/events.rs:1395-1407 | thunder/schema/events.rs:1462-1474 | thunder/schema/events.rs:1914-1926 | thunder/schema/events.rs:2194-2206 | thunder/schema/events.rs:2473-2485 | thunder/schema/events.rs:2552-2564 | thunder/schema/events.rs:2719-2731 | thunder/schema/events.rs:2792-2804 | thunder/schema/events.rs:2959-2971 | thunder/schema/events.rs:3046-3058 | thunder/schema/events.rs:3123-3135 | thunder/schema/events.rs:3200-3212 | thunder/schema/events.rs:3277-3289 | thunder/schema/events.rs:3610-3622 | thunder/schema/events.rs:3781-3793 | thunder/schema/media_common.rs:254-266 | thunder/schema/media_common.rs:423-435 | thunder/schema/tweet.rs:638-650 | thunder/schema/tweet.rs:779-791 | thunder/schema/tweet.rs:932-944 | thunder/schema/tweet.rs:1668-1680 | thunder/schema/tweet.rs:2598-2610 | thunder/schema/tweet.rs:2712-2724 | thunder/schema/tweet.rs:2907-2919 | thunder/schema/tweet.rs:3634-3646 | thunder/schema/tweet.rs:3760-3772 | thunder/schema/tweet_events.rs:444-456 | thunder/schema/tweet_events.rs:547-559 | thunder/schema/tweet_events.rs:614-626 | thunder/schema/tweet_events.rs:771-783 | thunder/schema/tweet_events.rs:851-863 | thunder/schema/tweet_events.rs:947-959 | thunder/schema/tweet_events.rs:1137-1149 | thunder/schema/user.rs:3964-3976 | thunder/schema/user.rs:5730-5742 | thunder/schema/user.rs:6395-6407 | thunder/schema/user.rs:7905-7917 | thunder/schema/user.rs:9752-9764 | thunder/schema/user.rs:10807-10819 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 214 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 29) thunder/schema/events.rs:1995— thunder/schema/events.rs:1995-2007 | thunder/schema/events.rs:2095-2107 | thunder/schema/events.rs:2287-2299 | thunder/schema/events.rs:2380-2392 | thunder/schema/tweet.rs:1080-1092 | thunder/schema/tweet.rs:1173-1185 | thunder/schema/tweet.rs:1787-1799 | thunder/schema/tweet.rs:3039-3051 | thunder/schema/tweet.rs:4105-4117 | thunder/schema/tweet.rs:4184-4196 | thunder/schema/tweet.rs:4272-4284 | thunder/schema/tweet.rs:4360-4372 | thunder/schema/tweet.rs:4448-4460 | thunder/schema/tweet.rs:4536-4548 | thunder/schema/tweet.rs:4624-4636 | thunder/schema/tweet_events.rs:182-194 | thunder/schema/tweet_events.rs:317-329 | thunder/schema/tweet_events.rs:1044-1056 | thunder/schema/user.rs:4705-4717 | thunder/schema/user.rs:4779-4791 | thunder/schema/user.rs:7349-7361 | thunder/schema/user.rs:8384-8396 | thunder/schema/user.rs:8618-8630 | thunder/schema/user.rs:8784-8796 | thunder/schema/user.rs:8851-8863 | thunder/schema/user.rs:10056-10068 | thunder/schema/user.rs:10219-10231 | thunder/schema/user.rs:10447-10459 | thunder/schema/user.rs:12396-12408 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 24) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:788— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:788-800 | thunder/schema/events.rs:2866-2878 | thunder/schema/tweet.rs:705-717 | thunder/schema/tweet.rs:859-871 | thunder/schema/tweet.rs:999-1011 | thunder/schema/tweet.rs:2013-2025 | thunder/schema/tweet.rs:2093-2105 | thunder/schema/tweet.rs:2273-2285 | thunder/schema/tweet.rs:2393-2405 | thunder/schema/tweet.rs:3863-3875 | thunder/schema/tweet_media.rs:496-508 | thunder/schema/user.rs:3362-3374 | thunder/schema/user.rs:4851-4863 | thunder/schema/user.rs:5868-5880 | thunder/schema/user.rs:11062-11074 | thunder/schema/user.rs:11255-11267 | thunder/schema/user.rs:11411-11423 | thunder/schema/user.rs:11555-11567 | thunder/schema/user.rs:11713-11725 | thunder/schema/user.rs:11936-11948 | thunder/schema/user.rs:12016-12028 | thunder/schema/user.rs:13660-13672 | thunder/schema/user.rs:14036-14048 | thunder/schema/user.rs:14134-14146 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 214 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 13) thunder/schema/user.rs:4698— thunder/schema/user.rs:4698-4710 | thunder/schema/user.rs:7004-7016 | thunder/schema/user.rs:7100-7112 | thunder/schema/user.rs:7266-7278 | thunder/schema/user.rs:8341-8353 | thunder/schema/user.rs:8777-8789 | thunder/schema/user.rs:8844-8856 | thunder/schema/user.rs:9067-9079 | thunder/schema/user.rs:10021-10033 | thunder/schema/user.rs:10212-10224 | thunder/schema/user.rs:10348-10360 | thunder/schema/user.rs:12377-12389 | thunder/schema/user.rs:12563-12575 — 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 (13 lines × 12) phoenix-rankall/src/processor/gen/scored_candidate.rs:316— phoenix-rankall/src/processor/gen/scored_candidate.rs:316-328 | thunder/schema/events.rs:4044-4056 | thunder/schema/tweet.rs:1866-1878 | thunder/schema/tweet.rs:1930-1942 | thunder/schema/tweet.rs:3848-3860 | thunder/schema/tweet.rs:4165-4177 | thunder/schema/tweet.rs:4253-4265 | thunder/schema/tweet.rs:4341-4353 | thunder/schema/tweet.rs:4429-4441 | thunder/schema/tweet.rs:4517-4529 | thunder/schema/tweet.rs:4605-4617 | thunder/schema/tweet.rs:5175-5187 — before extracting anything, compare `phoenix-rankall/src/processor/gen/scored_candidate.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 68) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:101— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:101-112 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:246-257 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:448-459 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:610-621 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:717-728 | thunder/schema/events.rs:216-227 | thunder/schema/events.rs:296-307 | thunder/schema/events.rs:383-394 | thunder/schema/events.rs:463-474 | thunder/schema/events.rs:543-554 | thunder/schema/events.rs:650-661 | thunder/schema/events.rs:847-858 | thunder/schema/events.rs:1026-1037 | thunder/schema/events.rs:1309-1320 | thunder/schema/events.rs:1386-1397 | thunder/schema/events.rs:1453-1464 | thunder/schema/events.rs:1562-1573 | thunder/schema/events.rs:2074-2085 | thunder/schema/events.rs:2177-2188 | thunder/schema/events.rs:2270-2281 | thunder/schema/events.rs:2363-2374 | thunder/schema/events.rs:2456-2467 | thunder/schema/events.rs:2543-2554 | thunder/schema/events.rs:2616-2627 | thunder/schema/events.rs:2706-2717 | thunder/schema/events.rs:2783-2794 | thunder/schema/events.rs:2853-2864 | thunder/schema/events.rs:2938-2949 | thunder/schema/events.rs:3033-3044 | thunder/schema/events.rs:3110-3121 | thunder/schema/events.rs:3187-3198 | thunder/schema/events.rs:3264-3275 | thunder/schema/events.rs:3453-3464 | thunder/schema/events.rs:3569-3580 | thunder/schema/events.rs:3740-3751 | thunder/schema/media_common.rs:394-405 | thunder/schema/tweet.rs:629-640 | thunder/schema/tweet.rs:696-707 | thunder/schema/tweet.rs:766-777 | thunder/schema/tweet.rs:923-934 | thunder/schema/tweet.rs:990-1001 | thunder/schema/tweet.rs:2380-2391 | thunder/schema/tweet.rs:2683-2694 | thunder/schema/tweet.rs:2878-2889 | thunder/schema/tweet.rs:3010-3021 | thunder/schema/tweet.rs:3609-3620 | thunder/schema/tweet.rs:3731-3742 | thunder/schema/tweet.rs:4096-4107 | thunder/schema/tweet.rs:5050-5061 | thunder/schema/tweet.rs:5386-5397 | thunder/schema/tweet_events.rs:538-549 | thunder/schema/tweet_events.rs:605-616 | thunder/schema/tweet_events.rs:675-686 | thunder/schema/tweet_events.rs:924-935 | thunder/schema/tweet_events.rs:1027-1038 | thunder/schema/tweet_events.rs:1120-1131 | thunder/schema/tweet_events.rs:1216-1227 | thunder/schema/user.rs:3276-3287 | thunder/schema/user.rs:5859-5870 | thunder/schema/user.rs:7822-7833 | thunder/schema/user.rs:9691-9702 | thunder/schema/user.rs:10790-10801 | thunder/schema/user.rs:11692-11703 | thunder/schema/user.rs:12229-12240 | thunder/schema/user.rs:12710-12721 | thunder/schema/user.rs:12977-12988 | thunder/schema/user.rs:13635-13646 | thunder/schema/user.rs:14315-14326 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 214 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 32) thunder/schema/events.rs:223— thunder/schema/events.rs:223-234 | thunder/schema/events.rs:390-401 | thunder/schema/events.rs:470-481 | thunder/schema/events.rs:550-561 | thunder/schema/events.rs:657-668 | thunder/schema/events.rs:854-865 | thunder/schema/events.rs:1033-1044 | thunder/schema/events.rs:1316-1327 | thunder/schema/events.rs:1569-1580 | thunder/schema/events.rs:2081-2092 | thunder/schema/events.rs:2184-2195 | thunder/schema/events.rs:2277-2288 | thunder/schema/events.rs:2370-2381 | thunder/schema/events.rs:2713-2724 | thunder/schema/events.rs:2945-2956 | thunder/schema/events.rs:3040-3051 | thunder/schema/events.rs:3117-3128 | thunder/schema/events.rs:3194-3205 | thunder/schema/events.rs:3271-3282 | thunder/schema/events.rs:3460-3471 | thunder/schema/events.rs:3576-3587 | thunder/schema/events.rs:3747-3758 | thunder/schema/media_common.rs:401-412 | thunder/schema/tweet.rs:773-784 | thunder/schema/tweet.rs:2885-2896 | thunder/schema/tweet_events.rs:1127-1138 | thunder/schema/tweet_events.rs:1223-1234 | thunder/schema/user.rs:8516-8527 | thunder/schema/user.rs:9698-9709 | thunder/schema/user.rs:12244-12255 | thunder/schema/user.rs:13642-13653 | thunder/schema/user.rs:14322-14333 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/media_common.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 22) thunder/schema/media_common.rs:312— thunder/schema/media_common.rs:312-323 | thunder/schema/tweet.rs:846-857 | thunder/schema/tweet.rs:1156-1167 | thunder/schema/tweet.rs:1432-1443 | thunder/schema/tweet.rs:3130-3141 | thunder/schema/tweet_media.rs:410-421 | thunder/schema/tweet_media.rs:487-498 | thunder/schema/tweet_media.rs:775-786 | thunder/schema/user.rs:3353-3364 | thunder/schema/user.rs:3878-3889 | thunder/schema/user.rs:4031-4042 | thunder/schema/user.rs:4288-4299 | thunder/schema/user.rs:4399-4410 | thunder/schema/user.rs:4619-4630 | thunder/schema/user.rs:4842-4853 | thunder/schema/user.rs:6122-6133 | thunder/schema/user.rs:11853-11864 | thunder/schema/user.rs:11923-11934 | thunder/schema/user.rs:12003-12014 | thunder/schema/user.rs:13349-13360 | thunder/schema/user.rs:13895-13906 | thunder/schema/user.rs:14121-14132 — before extracting anything, compare `thunder/schema/media_common.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 235 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 18) thunder/schema/user.rs:3955— thunder/schema/user.rs:3955-3966 | thunder/schema/user.rs:4134-4145 | thunder/schema/user.rs:4696-4707 | thunder/schema/user.rs:6909-6920 | thunder/schema/user.rs:7002-7013 | thunder/schema/user.rs:7098-7109 | thunder/schema/user.rs:7264-7275 | thunder/schema/user.rs:7892-7903 | thunder/schema/user.rs:7975-7986 | thunder/schema/user.rs:8339-8350 | thunder/schema/user.rs:8775-8786 | thunder/schema/user.rs:8842-8853 | thunder/schema/user.rs:9065-9076 | thunder/schema/user.rs:10019-10030 | thunder/schema/user.rs:10210-10221 | thunder/schema/user.rs:10346-10357 | thunder/schema/user.rs:12375-12386 | thunder/schema/user.rs:12561-12572 — all 18 copies are in the same file, so extract the block into one function there and call 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 × 17) thunder/schema/events.rs:4056— thunder/schema/events.rs:4056-4067 | thunder/schema/tweet.rs:1878-1889 | thunder/schema/tweet.rs:1942-1953 | thunder/schema/tweet.rs:2466-2477 | thunder/schema/tweet.rs:2808-2819 | thunder/schema/tweet_events.rs:695-706 | thunder/schema/tweet_events.rs:1244-1255 | thunder/schema/user.rs:3792-3803 | thunder/schema/user.rs:10719-10730 | thunder/schema/user.rs:10886-10897 | thunder/schema/user.rs:11160-11171 | thunder/schema/user.rs:11340-11351 | thunder/schema/user.rs:11484-11495 | thunder/schema/user.rs:11628-11639 | thunder/schema/user.rs:11798-11809 | thunder/schema/user.rs:13278-13289 | thunder/schema/user.rs:13764-13775 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 14) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:471— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:471-482 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:750-761 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:782-793 | thunder/schema/media_entity.rs:188-199 | thunder/schema/tweet.rs:853-864 | thunder/schema/tweet.rs:1658-1669 | thunder/schema/tweet.rs:2694-2705 | thunder/schema/user.rs:4038-4049 | thunder/schema/user.rs:4422-4433 | thunder/schema/user.rs:11056-11067 | thunder/schema/user.rs:12741-12752 | thunder/schema/user.rs:13052-13063 | thunder/schema/user.rs:13654-13665 | thunder/schema/user.rs:14128-14139 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/media_entity.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 12) thunder/schema/tweet.rs:2466— thunder/schema/tweet.rs:2466-2477 | thunder/schema/tweet.rs:3444-3455 | thunder/schema/tweet.rs:5124-5135 | thunder/schema/user.rs:10719-10730 | thunder/schema/user.rs:10886-10897 | thunder/schema/user.rs:11160-11171 | thunder/schema/user.rs:11340-11351 | thunder/schema/user.rs:11484-11495 | thunder/schema/user.rs:11628-11639 | thunder/schema/user.rs:11798-11809 | thunder/schema/user.rs:13278-13289 | thunder/schema/user.rs:13764-13775 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 8) thunder/schema/events.rs:1037— thunder/schema/events.rs:1037-1048 | thunder/schema/events.rs:2089-2100 | thunder/schema/events.rs:2281-2292 | thunder/schema/events.rs:2374-2385 | thunder/schema/events.rs:2463-2474 | thunder/schema/events.rs:2949-2960 | thunder/schema/tweet_events.rs:1034-1045 | thunder/schema/user.rs:12729-12740 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 7) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:455— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:455-466 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:774-785 | thunder/schema/events.rs:2860-2871 | thunder/schema/media_common.rs:405-416 | thunder/schema/user.rs:8082-8093 | thunder/schema/user.rs:13044-13055 | thunder/schema/user.rs:13646-13657 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 214 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 × 79) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:101— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:101-111 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:163-173 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:246-256 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:448-458 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:610-620 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:717-727 | thunder/schema/events.rs:216-226 | thunder/schema/events.rs:296-306 | thunder/schema/events.rs:383-393 | thunder/schema/events.rs:463-473 | thunder/schema/events.rs:543-553 | thunder/schema/events.rs:650-660 | thunder/schema/events.rs:847-857 | thunder/schema/events.rs:1026-1036 | thunder/schema/events.rs:1195-1205 | thunder/schema/events.rs:1249-1259 | thunder/schema/events.rs:1309-1319 | thunder/schema/events.rs:1386-1396 | thunder/schema/events.rs:1453-1463 | thunder/schema/events.rs:1562-1572 | thunder/schema/events.rs:2074-2084 | thunder/schema/events.rs:2177-2187 | thunder/schema/events.rs:2270-2280 | thunder/schema/events.rs:2363-2373 | thunder/schema/events.rs:2456-2466 | thunder/schema/events.rs:2543-2553 | thunder/schema/events.rs:2616-2626 | thunder/schema/events.rs:2706-2716 | thunder/schema/events.rs:2783-2793 | thunder/schema/events.rs:2853-2863 | thunder/schema/events.rs:2938-2948 | thunder/schema/events.rs:3033-3043 | thunder/schema/events.rs:3110-3120 | thunder/schema/events.rs:3187-3197 | thunder/schema/events.rs:3264-3274 | thunder/schema/events.rs:3453-3463 | thunder/schema/events.rs:3569-3579 | thunder/schema/events.rs:3740-3750 | thunder/schema/events.rs:3990-4000 | thunder/schema/media_common.rs:394-404 | thunder/schema/tweet.rs:629-639 | thunder/schema/tweet.rs:696-706 | thunder/schema/tweet.rs:766-776 | thunder/schema/tweet.rs:923-933 | thunder/schema/tweet.rs:990-1000 | thunder/schema/tweet.rs:2380-2390 | thunder/schema/tweet.rs:2518-2528 | thunder/schema/tweet.rs:2683-2693 | thunder/schema/tweet.rs:2878-2888 | thunder/schema/tweet.rs:3010-3020 | thunder/schema/tweet.rs:3609-3619 | thunder/schema/tweet.rs:3731-3741 | thunder/schema/tweet.rs:4039-4049 | thunder/schema/tweet.rs:4096-4106 | thunder/schema/tweet.rs:4687-4697 | thunder/schema/tweet.rs:4888-4898 | thunder/schema/tweet.rs:4941-4951 | thunder/schema/tweet.rs:4994-5004 | thunder/schema/tweet.rs:5050-5060 | thunder/schema/tweet.rs:5386-5396 | thunder/schema/tweet_events.rs:538-548 | thunder/schema/tweet_events.rs:605-615 | thunder/schema/tweet_events.rs:675-685 | thunder/schema/tweet_events.rs:924-934 | thunder/schema/tweet_events.rs:1027-1037 | thunder/schema/tweet_events.rs:1120-1130 | thunder/schema/tweet_events.rs:1216-1226 | thunder/schema/user.rs:3276-3286 | thunder/schema/user.rs:5859-5869 | thunder/schema/user.rs:7822-7832 | thunder/schema/user.rs:9691-9701 | thunder/schema/user.rs:10640-10650 | thunder/schema/user.rs:10790-10800 | thunder/schema/user.rs:11692-11702 | thunder/schema/user.rs:12229-12239 | thunder/schema/user.rs:12710-12720 | thunder/schema/user.rs:12977-12987 | thunder/schema/user.rs:13635-13645 | thunder/schema/user.rs:14315-14325 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 214 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 54) phoenix-rankall/src/processor/gen/hydra.rs:70— phoenix-rankall/src/processor/gen/hydra.rs:70-80 | phoenix-rankall/src/processor/gen/hydra.rs:208-218 | phoenix-rankall/src/processor/gen/hydra.rs:486-496 | phoenix-rankall/src/processor/gen/scored_candidate.rs:87-97 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:101-110 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:163-172 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:246-255 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:448-457 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:610-619 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:717-726 | thunder/schema/events.rs:296-305 | thunder/schema/events.rs:650-659 | thunder/schema/events.rs:847-856 | thunder/schema/events.rs:1026-1035 | thunder/schema/events.rs:1309-1318 | thunder/schema/events.rs:1453-1462 | thunder/schema/events.rs:1562-1571 | thunder/schema/events.rs:2616-2625 | thunder/schema/events.rs:2853-2862 | thunder/schema/events.rs:2938-2947 | thunder/schema/events.rs:3033-3042 | thunder/schema/events.rs:3110-3119 | thunder/schema/events.rs:3187-3196 | thunder/schema/events.rs:3264-3273 | thunder/schema/events.rs:3453-3462 | thunder/schema/events.rs:3569-3578 | thunder/schema/events.rs:3740-3749 | thunder/schema/media_common.rs:394-403 | thunder/schema/tweet.rs:990-999 | thunder/schema/tweet.rs:2380-2389 | thunder/schema/tweet.rs:2683-2692 | thunder/schema/tweet.rs:2878-2887 | thunder/schema/tweet.rs:3010-3019 | thunder/schema/tweet.rs:3609-3618 | thunder/schema/tweet.rs:3731-3740 | thunder/schema/tweet.rs:4039-4048 | thunder/schema/tweet.rs:4687-4696 | thunder/schema/tweet.rs:4888-4897 | thunder/schema/tweet.rs:4941-4950 | thunder/schema/tweet.rs:4994-5003 | thunder/schema/tweet.rs:5050-5059 | thunder/schema/tweet.rs:5386-5395 | thunder/schema/tweet_events.rs:924-933 | thunder/schema/user.rs:3276-3285 | thunder/schema/user.rs:5859-5868 | thunder/schema/user.rs:7822-7831 | thunder/schema/user.rs:9691-9700 | thunder/schema/user.rs:10790-10799 | thunder/schema/user.rs:11692-11701 | thunder/schema/user.rs:12229-12238 | thunder/schema/user.rs:12710-12719 | thunder/schema/user.rs:12977-12986 | thunder/schema/user.rs:13635-13644 | thunder/schema/user.rs:14315-14324 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix-rankall/src/processor/gen/scored_candidate.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 32) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:489— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:489-499 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:772-782 | thunder/schema/events.rs:659-669 | thunder/schema/events.rs:691-701 | thunder/schema/events.rs:856-866 | thunder/schema/events.rs:888-898 | thunder/schema/events.rs:1035-1045 | thunder/schema/events.rs:1571-1581 | thunder/schema/events.rs:1615-1625 | thunder/schema/events.rs:2083-2093 | thunder/schema/events.rs:2186-2196 | thunder/schema/events.rs:2279-2289 | thunder/schema/events.rs:2372-2382 | thunder/schema/events.rs:2947-2957 | thunder/schema/events.rs:3462-3472 | thunder/schema/events.rs:3578-3588 | thunder/schema/events.rs:3749-3759 | thunder/schema/media_common.rs:403-413 | thunder/schema/media_entity.rs:232-242 | thunder/schema/tweet.rs:2887-2897 | thunder/schema/tweet_events.rs:1129-1139 | thunder/schema/tweet_events.rs:1225-1235 | thunder/schema/user.rs:8080-8090 | thunder/schema/user.rs:8514-8524 | thunder/schema/user.rs:9146-9156 | thunder/schema/user.rs:9700-9710 | thunder/schema/user.rs:12242-12252 | thunder/schema/user.rs:12727-12737 | thunder/schema/user.rs:13002-13012 | thunder/schema/user.rs:13042-13052 | thunder/schema/user.rs:13644-13654 | thunder/schema/user.rs:14324-14334 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 214 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 × 27) thunder/schema/media_common.rs:312— thunder/schema/media_common.rs:312-322 | thunder/schema/media_common.rs:574-584 | thunder/schema/tweet.rs:846-856 | thunder/schema/tweet.rs:1156-1166 | thunder/schema/tweet.rs:1240-1250 | thunder/schema/tweet.rs:1432-1442 | thunder/schema/tweet.rs:3130-3140 | thunder/schema/tweet.rs:3203-3213 | thunder/schema/tweet.rs:3344-3354 | thunder/schema/tweet_media.rs:410-420 | thunder/schema/tweet_media.rs:487-497 | thunder/schema/tweet_media.rs:551-561 | thunder/schema/tweet_media.rs:775-785 | thunder/schema/user.rs:3353-3363 | thunder/schema/user.rs:3878-3888 | thunder/schema/user.rs:4031-4041 | thunder/schema/user.rs:4288-4298 | thunder/schema/user.rs:4399-4409 | thunder/schema/user.rs:4619-4629 | thunder/schema/user.rs:4842-4852 | thunder/schema/user.rs:6122-6132 | thunder/schema/user.rs:11853-11863 | thunder/schema/user.rs:11923-11933 | thunder/schema/user.rs:12003-12013 | thunder/schema/user.rs:13349-13359 | thunder/schema/user.rs:13895-13905 | thunder/schema/user.rs:14121-14131 — before extracting anything, compare `thunder/schema/media_common.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 235 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 25) thunder/schema/events.rs:1821— thunder/schema/events.rs:1821-1831 | thunder/schema/tweet.rs:3019-3029 | thunder/schema/tweet.rs:3031-3041 | thunder/schema/user.rs:3631-3641 | thunder/schema/user.rs:6135-6145 | thunder/schema/user.rs:6183-6193 | thunder/schema/user.rs:6203-6213 | thunder/schema/user.rs:6223-6233 | thunder/schema/user.rs:6279-6289 | thunder/schema/user.rs:6303-6313 | thunder/schema/user.rs:6335-6345 | thunder/schema/user.rs:6363-6373 | thunder/schema/user.rs:7107-7117 | thunder/schema/user.rs:7273-7283 | thunder/schema/user.rs:7596-7606 | thunder/schema/user.rs:7632-7642 | thunder/schema/user.rs:8348-8358 | thunder/schema/user.rs:9074-9084 | thunder/schema/user.rs:9110-9120 | thunder/schema/user.rs:9182-9192 | thunder/schema/user.rs:9270-9280 | thunder/schema/user.rs:10028-10038 | thunder/schema/user.rs:10355-10365 | thunder/schema/user.rs:12384-12394 | thunder/schema/user.rs:12570-12580 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 21) thunder/schema/tweet.rs:1294— thunder/schema/tweet.rs:1294-1304 | thunder/schema/tweet.rs:3256-3266 | thunder/schema/user.rs:3955-3965 | thunder/schema/user.rs:4134-4144 | thunder/schema/user.rs:4696-4706 | thunder/schema/user.rs:6909-6919 | thunder/schema/user.rs:7002-7012 | thunder/schema/user.rs:7098-7108 | thunder/schema/user.rs:7264-7274 | thunder/schema/user.rs:7892-7902 | thunder/schema/user.rs:7975-7985 | thunder/schema/user.rs:8339-8349 | thunder/schema/user.rs:8775-8785 | thunder/schema/user.rs:8842-8852 | thunder/schema/user.rs:9065-9075 | thunder/schema/user.rs:10019-10029 | thunder/schema/user.rs:10153-10163 | thunder/schema/user.rs:10210-10220 | thunder/schema/user.rs:10346-10356 | thunder/schema/user.rs:12375-12385 | thunder/schema/user.rs:12561-12571 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 19) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:469— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:469-479 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:748-758 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:780-790 | thunder/schema/media_entity.rs:186-196 | thunder/schema/tweet.rs:1445-1455 | thunder/schema/tweet.rs:1474-1484 | thunder/schema/tweet.rs:1656-1666 | thunder/schema/tweet.rs:2692-2702 | thunder/schema/tweet.rs:3740-3750 | thunder/schema/user.rs:4040-4050 | thunder/schema/user.rs:4420-4430 | thunder/schema/user.rs:6239-6249 | thunder/schema/user.rs:10799-10809 | thunder/schema/user.rs:11054-11064 | thunder/schema/user.rs:12739-12749 | thunder/schema/user.rs:12994-13004 | thunder/schema/user.rs:13034-13044 | thunder/schema/user.rs:13050-13060 | thunder/schema/user.rs:13652-13662 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/media_entity.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 18) phoenix-rankall/src/processor/gen/scored_candidate.rs:227— phoenix-rankall/src/processor/gen/scored_candidate.rs:227-237 | thunder/schema/media_common.rs:312-321 | thunder/schema/tweet.rs:1432-1441 | thunder/schema/tweet.rs:3203-3212 | thunder/schema/tweet_media.rs:410-419 | thunder/schema/tweet_media.rs:551-560 | thunder/schema/user.rs:4031-4040 | thunder/schema/user.rs:4288-4297 | thunder/schema/user.rs:4399-4408 | thunder/schema/user.rs:4619-4628 | thunder/schema/user.rs:4842-4851 | thunder/schema/user.rs:6122-6131 | thunder/schema/user.rs:11853-11862 | thunder/schema/user.rs:11923-11932 | thunder/schema/user.rs:12003-12012 | thunder/schema/user.rs:13349-13358 | thunder/schema/user.rs:13895-13904 | thunder/schema/user.rs:14121-14130 — before extracting anything, compare `phoenix-rankall/src/processor/gen/scored_candidate.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 13) thunder/schema/events.rs:1039— thunder/schema/events.rs:1039-1049 | thunder/schema/events.rs:1817-1827 | thunder/schema/events.rs:1987-1997 | thunder/schema/events.rs:2465-2475 | thunder/schema/events.rs:2951-2961 | thunder/schema/media_entity.rs:206-216 | thunder/schema/tweet.rs:3027-3037 | thunder/schema/tweet_events.rs:1036-1046 | thunder/schema/user.rs:9138-9148 | thunder/schema/user.rs:9198-9208 | thunder/schema/user.rs:9234-9244 | thunder/schema/user.rs:9246-9256 | thunder/schema/user.rs:12731-12741 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/media_entity.rs` as WHOLE FILES: this scan already matched 6 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 × 10) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:457— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:457-467 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:744-754 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:776-786 | thunder/schema/media_common.rs:407-417 | thunder/schema/tweet.rs:1779-1789 | thunder/schema/tweet.rs:2265-2275 | thunder/schema/user.rs:7984-7994 | thunder/schema/user.rs:8084-8094 | thunder/schema/user.rs:13046-13056 | thunder/schema/user.rs:13648-13658 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/media_common.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 139 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 × 9) thunder/schema/media_entity.rs:279— thunder/schema/media_entity.rs:279-289 | thunder/schema/tweet.rs:1693-1703 | thunder/schema/tweet.rs:1812-1822 | thunder/schema/tweet.rs:2035-2045 | thunder/schema/tweet.rs:2115-2125 | thunder/schema/tweet.rs:2203-2213 | thunder/schema/user.rs:11279-11289 | thunder/schema/user.rs:11433-11443 | thunder/schema/user.rs:11577-11587 — before extracting anything, compare `thunder/schema/media_entity.rs` and `thunder/schema/tweet.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–11 lines × 3) phoenix/crates/serving/xai-recsys-engine/src/python.rs:1689— phoenix/crates/serving/xai-recsys-engine/src/python.rs:1689-1698 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:1753-1763 | phoenix/crates/serving/xai-recsys-engine/src/python.rs:2477-2486 — 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 × 11) thunder/schema/events.rs:1976— thunder/schema/events.rs:1976-1985 | thunder/schema/tweet.rs:3008-3017 | thunder/schema/user.rs:4764-4773 | thunder/schema/user.rs:7262-7271 | thunder/schema/user.rs:8337-8346 | thunder/schema/user.rs:8603-8612 | thunder/schema/user.rs:8773-8782 | thunder/schema/user.rs:8840-8849 | thunder/schema/user.rs:10017-10026 | thunder/schema/user.rs:10344-10353 | thunder/schema/user.rs:12373-12382 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 10) thunder/schema/tweet.rs:2488— thunder/schema/tweet.rs:2488-2497 | thunder/schema/user.rs:10751-10760 | thunder/schema/user.rs:10908-10917 | thunder/schema/user.rs:11192-11201 | thunder/schema/user.rs:11362-11371 | thunder/schema/user.rs:11506-11515 | thunder/schema/user.rs:11650-11659 | thunder/schema/user.rs:11820-11829 | thunder/schema/user.rs:13310-13319 | thunder/schema/user.rs:13796-13805 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 9) phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:715— phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:715-724 | thunder/schema/tweet.rs:2254-2263 | thunder/schema/tweet.rs:2378-2387 | thunder/schema/user.rs:4840-4849 | thunder/schema/user.rs:11039-11048 | thunder/schema/user.rs:11690-11699 | thunder/schema/user.rs:13633-13642 | thunder/schema/user.rs:14009-14018 | thunder/schema/user.rs:14119-14128 — before extracting anything, compare `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 293 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 (9 lines × 26) phoenix-rankall/src/processor/gen/hydra.rs:185— phoenix-rankall/src/processor/gen/hydra.rs:185-193 | phoenix-rankall/src/processor/gen/hydra.rs:461-469 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:687-695 | thunder/schema/events.rs:624-632 | thunder/schema/events.rs:821-829 | thunder/schema/events.rs:1532-1540 | thunder/schema/events.rs:3545-3553 | thunder/schema/events.rs:3716-3724 | thunder/schema/media_entity.rs:143-151 | thunder/schema/tweet.rs:1407-1415 | thunder/schema/tweet_events.rs:115-123 | thunder/schema/tweet_events.rs:389-397 | thunder/schema/user.rs:3418-3426 | thunder/schema/user.rs:3578-3586 | thunder/schema/user.rs:4368-4376 | thunder/schema/user.rs:6040-6048 | thunder/schema/user.rs:7229-7237 | thunder/schema/user.rs:7541-7549 | thunder/schema/user.rs:8314-8322 | thunder/schema/user.rs:8997-9005 | thunder/schema/user.rs:9662-9670 | thunder/schema/user.rs:9996-10004 | thunder/schema/user.rs:10307-10315 | thunder/schema/user.rs:12680-12688 | thunder/schema/user.rs:12941-12949 | thunder/schema/user.rs:14260-14268 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 20) phoenix-rankall/src/processor/gen/hydra.rs:207— phoenix-rankall/src/processor/gen/hydra.rs:207-215 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:100-108 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:245-253 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:609-617 | thunder/schema/events.rs:1025-1033 | thunder/schema/events.rs:2937-2945 | thunder/schema/events.rs:3032-3040 | thunder/schema/events.rs:3109-3117 | thunder/schema/events.rs:3186-3194 | thunder/schema/events.rs:3263-3271 | thunder/schema/events.rs:3568-3576 | thunder/schema/events.rs:3739-3747 | thunder/schema/media_common.rs:393-401 | thunder/schema/tweet.rs:1642-1650 | thunder/schema/tweet.rs:2877-2885 | thunder/schema/tweet.rs:3730-3738 | thunder/schema/user.rs:6121-6129 | thunder/schema/user.rs:7891-7899 | thunder/schema/user.rs:9690-9698 | thunder/schema/user.rs:10789-10797 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 17) phoenix-rankall/src/processor/gen/hydra.rs:354— phoenix-rankall/src/processor/gen/hydra.rs:354-362 | phoenix-rankall/src/processor/gen/scored_candidate.rs:316-324 | thunder/schema/tweet.rs:1866-1874 | thunder/schema/tweet.rs:1930-1938 | thunder/schema/tweet.rs:3432-3440 | thunder/schema/tweet.rs:3848-3856 | thunder/schema/tweet.rs:4165-4173 | thunder/schema/tweet.rs:4253-4261 | thunder/schema/tweet.rs:4341-4349 | thunder/schema/tweet.rs:4429-4437 | thunder/schema/tweet.rs:4517-4525 | thunder/schema/tweet.rs:4605-4613 | thunder/schema/tweet.rs:5112-5120 | thunder/schema/tweet.rs:5175-5183 | thunder/schema/tweet_events.rs:1583-1591 | thunder/schema/user.rs:12472-12480 | thunder/schema/user.rs:13742-13750 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix-rankall/src/processor/gen/scored_candidate.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 15) thunder/schema/tweet.rs:1761— thunder/schema/tweet.rs:1761-1769 | thunder/schema/tweet.rs:3009-3017 | thunder/schema/tweet.rs:4164-4172 | thunder/schema/tweet.rs:4252-4260 | thunder/schema/tweet.rs:4340-4348 | thunder/schema/tweet.rs:4428-4436 | thunder/schema/tweet.rs:4516-4524 | thunder/schema/tweet.rs:4604-4612 | thunder/schema/user.rs:7263-7271 | thunder/schema/user.rs:8338-8346 | thunder/schema/user.rs:8774-8782 | thunder/schema/user.rs:8841-8849 | thunder/schema/user.rs:10018-10026 | thunder/schema/user.rs:10345-10353 | thunder/schema/user.rs:12374-12382 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 13) phoenix-rankall/src/processor/gen/hydra.rs:485— phoenix-rankall/src/processor/gen/hydra.rs:485-493 | phoenix-rankall/src/processor/gen/scored_candidate.rs:315-323 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:716-724 | thunder/schema/events.rs:2852-2860 | thunder/schema/tweet.rs:2379-2387 | thunder/schema/tweet.rs:3847-3855 | thunder/schema/user.rs:4841-4849 | thunder/schema/user.rs:5858-5866 | thunder/schema/user.rs:11040-11048 | thunder/schema/user.rs:11233-11241 | thunder/schema/user.rs:11691-11699 | thunder/schema/user.rs:13634-13642 | thunder/schema/user.rs:14120-14128 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix-rankall/src/processor/gen/scored_candidate.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 11) thunder/schema/media_common.rs:573— thunder/schema/media_common.rs:573-581 | thunder/schema/tweet.rs:695-703 | thunder/schema/tweet.rs:845-853 | thunder/schema/tweet.rs:1239-1247 | thunder/schema/tweet.rs:1999-2007 | thunder/schema/tweet.rs:2079-2087 | thunder/schema/tweet.rs:3343-3351 | thunder/schema/tweet_media.rs:486-494 | thunder/schema/user.rs:3352-3360 | thunder/schema/user.rs:11397-11405 | thunder/schema/user.rs:11541-11549 — before extracting anything, compare `thunder/schema/media_common.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 235 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–9 lines × 5) phoenix-rankall/src/processor/gen/hydra.rs:361— phoenix-rankall/src/processor/gen/hydra.rs:361-369 | phoenix-rankall/src/processor/gen/hydra.rs:372-380 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:271-278 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:728-735 | thunder/schema/user.rs:5070-5077 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7–8 lines × 18) phoenix-rankall/src/processor/gen/hydra.rs:91— phoenix-rankall/src/processor/gen/hydra.rs:91-98 | phoenix-rankall/src/processor/gen/scored_candidate.rs:325-332 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:263-269 | thunder/schema/events.rs:313-319 | thunder/schema/events.rs:1639-1645 | thunder/schema/events.rs:4053-4059 | thunder/schema/tweet.rs:1875-1881 | thunder/schema/tweet.rs:1939-1945 | thunder/schema/tweet.rs:3857-3863 | thunder/schema/tweet.rs:4174-4180 | thunder/schema/tweet.rs:4262-4268 | thunder/schema/tweet.rs:4350-4356 | thunder/schema/tweet.rs:4438-4444 | thunder/schema/tweet.rs:4526-4532 | thunder/schema/tweet.rs:4614-4620 | thunder/schema/tweet.rs:5184-5190 | thunder/schema/user.rs:3779-3785 | thunder/schema/user.rs:3789-3795 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix-rankall/src/processor/gen/scored_candidate.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 14) thunder/schema/events.rs:259— thunder/schema/events.rs:259-266 | thunder/schema/events.rs:426-433 | thunder/schema/events.rs:506-513 | thunder/schema/events.rs:586-593 | thunder/schema/events.rs:743-750 | thunder/schema/events.rs:940-947 | thunder/schema/events.rs:2132-2139 | thunder/schema/events.rs:2230-2237 | thunder/schema/events.rs:2318-2325 | thunder/schema/events.rs:2411-2418 | thunder/schema/events.rs:2576-2583 | thunder/schema/events.rs:2749-2756 | thunder/schema/events.rs:3652-3659 | thunder/schema/events.rs:3823-3830 — all 14 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 6) thunder/schema/events.rs:254— thunder/schema/events.rs:254-261 | thunder/schema/events.rs:421-428 | thunder/schema/events.rs:501-508 | thunder/schema/events.rs:581-588 | thunder/schema/events.rs:2122-2129 | thunder/schema/events.rs:2220-2227 — 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–8 lines × 4) phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:163— phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:163-165 | phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:179-186 | phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:192-199 | phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:201-208 — 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 (3–8 lines × 5) phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:240— phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:240-242 | phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:256-263 | phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:269-276 | phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:278-281 | phoenix/crates/serving/xai-recsys-engine/src/emb_table.rs:283-285 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 20) phoenix-rankall/src/processor/gen/hydra.rs:90— phoenix-rankall/src/processor/gen/hydra.rs:90-96 | phoenix-rankall/src/processor/gen/scored_candidate.rs:324-330 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:262-268 | thunder/schema/events.rs:312-318 | thunder/schema/events.rs:1638-1644 | thunder/schema/events.rs:4052-4058 | thunder/schema/tweet.rs:1874-1880 | thunder/schema/tweet.rs:1938-1944 | thunder/schema/tweet.rs:3856-3862 | thunder/schema/tweet.rs:4173-4179 | thunder/schema/tweet.rs:4261-4267 | thunder/schema/tweet.rs:4349-4355 | thunder/schema/tweet.rs:4437-4443 | thunder/schema/tweet.rs:4525-4531 | thunder/schema/tweet.rs:4613-4619 | thunder/schema/tweet.rs:5183-5189 | thunder/schema/user.rs:3778-3784 | thunder/schema/user.rs:3788-3794 | thunder/schema/user.rs:5058-5064 | thunder/schema/user.rs:5309-5315 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix-rankall/src/processor/gen/scored_candidate.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 16) thunder/schema/tweet.rs:1584— thunder/schema/tweet.rs:1584-1590 | thunder/schema/tweet.rs:2488-2494 | thunder/schema/tweet.rs:5450-5456 | thunder/schema/user.rs:10751-10757 | thunder/schema/user.rs:10908-10914 | thunder/schema/user.rs:11183-11189 | thunder/schema/user.rs:11192-11198 | thunder/schema/user.rs:11362-11368 | thunder/schema/user.rs:11506-11512 | thunder/schema/user.rs:11650-11656 | thunder/schema/user.rs:11820-11826 | thunder/schema/user.rs:12511-12517 | thunder/schema/user.rs:13301-13307 | thunder/schema/user.rs:13310-13316 | thunder/schema/user.rs:13787-13793 | thunder/schema/user.rs:13796-13802 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 111 separate duplicated blocks between them, totalling at least 1166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 10) thunder/schema/events.rs:744— thunder/schema/events.rs:744-750 | thunder/schema/events.rs:941-947 | thunder/schema/events.rs:1857-1863 | thunder/schema/events.rs:2022-2028 | thunder/schema/events.rs:2133-2139 | thunder/schema/events.rs:2319-2325 | thunder/schema/events.rs:2412-2418 | thunder/schema/events.rs:2665-2671 | thunder/schema/events.rs:3653-3659 | thunder/schema/events.rs:3824-3830 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6–7 lines × 5) thunder/schema/media_common.rs:543— thunder/schema/media_common.rs:543-549 | thunder/schema/tweet.rs:1555-1561 | thunder/schema/user.rs:5563-5568 | thunder/schema/user.rs:13222-13228 | thunder/schema/user.rs:13414-13420 — before extracting anything, compare `thunder/schema/media_common.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 235 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–7 lines × 5) phoenix/crates/common/xai-recsys/src/util.rs:541— phoenix/crates/common/xai-recsys/src/util.rs:541-547 | phoenix/crates/common/xai-recsys/src/util.rs:926-929 | phoenix/crates/common/xai-recsys/src/util.rs:1265-1268 | phoenix/crates/serving/xai-recsys-engine/src/util.rs:63-68 | phoenix/crates/serving/xai-recsys-engine/src/util.rs:271-276 — before extracting anything, compare `phoenix/crates/common/xai-recsys/src/util.rs` and `phoenix/crates/serving/xai-recsys-engine/src/util.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 139 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 20) thunder/schema/events.rs:251— thunder/schema/events.rs:251-256 | thunder/schema/events.rs:418-423 | thunder/schema/events.rs:498-503 | thunder/schema/events.rs:578-583 | thunder/schema/events.rs:730-735 | thunder/schema/events.rs:927-932 | thunder/schema/events.rs:1680-1685 | thunder/schema/events.rs:2573-2578 | thunder/schema/events.rs:2656-2661 | thunder/schema/events.rs:2741-2746 | thunder/schema/events.rs:3639-3644 | thunder/schema/events.rs:3810-3815 | thunder/schema/media_common.rs:449-454 | thunder/schema/tweet.rs:726-731 | thunder/schema/tweet.rs:1020-1025 | thunder/schema/tweet.rs:2415-2420 | thunder/schema/tweet.rs:3065-3070 | thunder/schema/tweet.rs:3659-3664 | thunder/schema/tweet.rs:3786-3791 | thunder/schema/tweet_events.rs:635-640 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/media_common.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–6 lines × 8) phoenix-rankall/src/processor/gen/hydra.rs:134— phoenix-rankall/src/processor/gen/hydra.rs:134-139 | thunder/schema/events.rs:1761-1766 | thunder/schema/events.rs:4078-4083 | thunder/schema/tweet.rs:1900-1905 | thunder/schema/tweet.rs:1964-1969 | thunder/schema/user.rs:3833-3838 | thunder/schema/user.rs:3842-3847 | thunder/schema/user.rs:5477-5481 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `thunder/schema/events.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5–6 lines × 7) thunder/schema/events.rs:1722— thunder/schema/events.rs:1722-1727 | thunder/schema/tweet.rs:1593-1598 | thunder/schema/user.rs:5450-5454 | thunder/schema/user.rs:9947-9952 | thunder/schema/user.rs:9956-9961 | thunder/schema/user.rs:9965-9970 | thunder/schema/user.rs:10742-10747 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet.rs` as WHOLE FILES: this scan already matched 51 separate duplicated blocks between them, totalling at least 532 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–6 lines × 5) thunder/schema/tweet.rs:2830— thunder/schema/tweet.rs:2830-2835 | thunder/schema/tweet_events.rs:729-734 | thunder/schema/tweet_events.rs:1290-1295 | thunder/schema/tweet_events.rs:1632-1637 | thunder/schema/user.rs:5504-5508 — before extracting anything, compare `thunder/schema/tweet.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–6 lines × 4) phoenix-rankall/src/processor/gen/hydra.rs:401— phoenix-rankall/src/processor/gen/hydra.rs:401-406 | phoenix-rankall/src/processor/gen/hydra.rs:410-415 | phoenix/crates/serving/xai-recsys-mm-server/src/events.rs:831-836 | thunder/schema/user.rs:5486-5490 — before extracting anything, compare `phoenix-rankall/src/processor/gen/hydra.rs` and `phoenix/crates/serving/xai-recsys-mm-server/src/events.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5–6 lines × 3) thunder/schema/events.rs:1708— thunder/schema/events.rs:1708-1713 | thunder/schema/tweet_events.rs:983-988 | thunder/schema/user.rs:5441-5445 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/tweet_events.rs` as WHOLE FILES: this scan already matched 31 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 7) thunder/schema/events.rs:339— thunder/schema/events.rs:339-343 | thunder/schema/events.rs:3070-3074 | thunder/schema/events.rs:3147-3151 | thunder/schema/events.rs:3224-3228 | thunder/schema/events.rs:3301-3305 | thunder/schema/events.rs:3502-3506 | thunder/schema/user.rs:5890-5894 — before extracting anything, compare `thunder/schema/events.rs` and `thunder/schema/user.rs` as WHOLE FILES: this scan already matched 49 separate duplicated blocks between them, totalling at least 510 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (51 lines × 2) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:68— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:68-118 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala:67-117 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:68` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 (35–36 lines × 2) botmaker/src/scala/com/twitter/botmaker/rule/BotMaker.scala:735— botmaker/src/scala/com/twitter/botmaker/rule/BotMaker.scala:735-769 | scarecrow/ScarecrowBotMaker.scala:712-747 — 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 `botmaker/src/scala/com/twitter/botmaker/rule/BotMaker.scala:735` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (33 lines × 2) botmaker/src/scala/com/twitter/botmaker/rule/BotMaker.scala:704— botmaker/src/scala/com/twitter/botmaker/rule/BotMaker.scala:704-736 | scarecrow/ScarecrowBotMaker.scala:649-681 — 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 `botmaker/src/scala/com/twitter/botmaker/rule/BotMaker.scala:704` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31–32 lines × 2) agatha/hub/pmi/PMI.scala:163— agatha/hub/pmi/PMI.scala:163-194 | agatha/hub/pmi/PMI.scala:213-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `agatha/hub/pmi/PMI.scala:213` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 6) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:112— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:112-137 | simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:127-152 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJobRunner.scala:143-168 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala:127-152 | simclusters/simclusters_v2/summingbird/storm/TwhinTweetJobRunner.scala:160-185 | simclusters/simclusters_v2/summingbird/storm/TwhinUserJobRunner.scala:117-142 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala` and `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:112` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–26 lines × 2) simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJobRunner.scala:105— simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJobRunner.scala:105-130 | simclusters/simclusters_v2/summingbird/storm/TwhinTweetJobRunner.scala:112-134 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJobRunner.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinTweetJobRunner.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJobRunner.scala:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 2) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2093— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2093-2117 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2179-2203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2093` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 3) botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:344— botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:344-366 | botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:401-423 | botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:442-464 — 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 `botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:344` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17 lines × 4) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:154— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:154-170 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala:154-170 | simclusters/simclusters_v2/summingbird/storm/TwhinTweetJobRunner.scala:187-203 | simclusters/simclusters_v2/summingbird/storm/TwhinUserJobRunner.scala:144-160 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:154` it begins part-way through the construct above it, so those exact lines 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 × 3) botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:341— botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:341-357 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:107-123 | botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:212-228 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/botmaker_manhattan/src/main/scala/com/twitter/botmaker/runtime/ManhattanClient.scala:341` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `ManhattanClientConfig` in one and `MemCachedClientConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedClient.scala:106` calls `of` and `botmaker/botmaker_memcached/src/main/scala/com/twitter/botmaker/runtime/MemCachedCounter.scala:211` 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 (16–17 lines × 2) simclusters/simclusters_v2/scalding/topic_recommendations/ProducersForTopicsFromTopicFollowGraph.scala:34— simclusters/simclusters_v2/scalding/topic_recommendations/ProducersForTopicsFromTopicFollowGraph.scala:34-49 | simclusters/simclusters_v2/scalding/topic_recommendations/ProducersForTopicsFromTopicFollowGraph.scala:71-87 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/scalding/topic_recommendations/ProducersForTopicsFromTopicFollowGraph.scala:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `simclusters/simclusters_v2/scalding/topic_recommendations/ProducersForTopicsFromTopicFollowGraph.scala:33` calls `args` and `simclusters/simclusters_v2/scalding/topic_recommendations/ProducersForTopicsFromTopicFollowGraph.scala:70` 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 (16 lines × 7) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:132— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:132-147 | simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:147-162 | simclusters/simclusters_v2/summingbird/storm/TweetJobRunner.scala:199-214 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJobRunner.scala:163-178 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala:147-162 | simclusters/simclusters_v2/summingbird/storm/TwhinTweetJobRunner.scala:180-195 | simclusters/simclusters_v2/summingbird/storm/TwhinUserJobRunner.scala:137-152 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala` and `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:132` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `simclusters/simclusters_v2/summingbird/storm/TweetJobRunner.scala:218` calls `set`, `FlatMapParallelism` and `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:166` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 6) simclusters/simclusters_v2/scalding/mbcg/TweetEmbeddingGenerationJob.scala:313— simclusters/simclusters_v2/scalding/mbcg/TweetEmbeddingGenerationJob.scala:313-328 | simclusters/simclusters_v2/scalding/mbcg/TweetEmbeddingGenerationJob.scala:336-351 | simclusters/simclusters_v2/scalding/mbcg/TweetEmbeddingGenerationJob.scala:359-374 | simclusters/simclusters_v2/scalding/mbcg/UserEmbeddingGenerationJob.scala:200-215 | simclusters/simclusters_v2/scalding/mbcg/UserEmbeddingGenerationJob.scala:223-238 | simclusters/simclusters_v2/scalding/mbcg/UserEmbeddingGenerationJob.scala:246-261 — before extracting anything, compare `simclusters/simclusters_v2/scalding/mbcg/TweetEmbeddingGenerationJob.scala` and `simclusters/simclusters_v2/scalding/mbcg/UserEmbeddingGenerationJob.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala:53— simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala:53-68 | simclusters/simclusters_v2/summingbird/storm/TwhinTweetJobRunner.scala:56-71 | simclusters/simclusters_v2/summingbird/storm/TwhinUserJobRunner.scala:53-68 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinTweetJobRunner.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–14 lines × 3) simclusters/simclusters_v2/summingbird/storm/TweetJob.scala:60— simclusters/simclusters_v2/summingbird/storm/TweetJob.scala:60-69 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala:61-74 | simclusters/simclusters_v2/summingbird/storm/TwhinTweetJob.scala:52-65 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJob.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinTweetJob.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/TweetJob.scala:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 67) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:62— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:62-73 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:126-137 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:201-212 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:293-304 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:410-421 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:553-564 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:726-737 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:832-843 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:902-914 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:985-996 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1089-1100 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1224-1235 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1389-1400 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1587-1598 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1705-1716 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1783-1794 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1879-1890 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2008-2019 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2167-2178 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2359-2370 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2587-2598 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2720-2731 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2804-2815 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2909-2920 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3052-3063 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3228-3239 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3440-3451 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3691-3702 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3835-3846 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3926-3937 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4048-4059 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4205-4216 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4398-4409 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4630-4641 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4904-4915 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5067-5078 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5163-5174 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5293-5304 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5461-5472 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5668-5679 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5917-5928 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6211-6222 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6385-6396 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6486-6497 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6624-6635 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6803-6814 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7024-7035 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7290-7301 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7604-7615 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7790-7801 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7906-7917 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8053-8064 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8244-8255 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8480-8491 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8764-8775 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9099-9110 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9503-9514 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9903-9914 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10171-10182 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10420-10431 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10730-10741 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11092-11103 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11579-11590 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11867-11878 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12060-12071 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12207-12218 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12528-12539 — all 67 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:62` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1703` calls `toScala2`, `get` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:830` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 4) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:59— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala:59-71 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala:59-71 | simclusters/simclusters_v2/summingbird/storm/TwhinTweetJobRunner.scala:62-74 | simclusters/simclusters_v2/summingbird/storm/TwhinUserJobRunner.scala:59-71 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJobRunner.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJobRunner.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 3) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:111— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:111-122 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala:110-120 | simclusters/simclusters_v2/summingbird/storm/TwhinUserJob.scala:81-91 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildUserJob.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildUserJob.scala:111` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–12 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:364— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:364-375 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:404-407 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:424-435 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:364` it begins part-way through the construct above it, so those exact lines 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 × 17) botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:286— botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:286-296 | botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:343-353 | botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:400-410 | botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:441-451 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:148-158 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:195-205 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:238-248 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:280-290 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:337-347 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:382-392 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala:423-433 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:157-167 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:200-210 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:248-258 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:303-313 | botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala:343-353 | botmaker/src/scala/com/twitter/botmaker/runtime/LogWriter.scala:138-148 — before extracting anything, compare `botmaker/src/scala/com/twitter/botmaker/runtime/LocalCounter.scala` and `botmaker/src/scala/com/twitter/botmaker/runtime/LocalStore.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/runtime/BatchQueue.scala:286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `BatchQueueConfig` in one and `LocalCounterConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8–10 lines × 3) simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:62— simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:62-71 | simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJobRunner.scala:68-77 | simclusters/simclusters_v2/summingbird/storm/TwhinTweetJobRunner.scala:67-74 — before extracting anything, compare `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala` and `simclusters/simclusters_v2/summingbird/storm/TwhinRebuildTweetJobRunner.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/summingbird/storm/AdsTwhinRebuildTweetJobRunner.scala:62` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–10 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7490— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7490-7499 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7597-7599 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7672-7681 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7490` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7490` calls `Option`, `toScala8`, `get` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7597` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–10 lines × 7) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8758— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8758-8760 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8978-8987 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8992-8994 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9076-9078 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9092-9094 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9172-9181 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9186-9188 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8978` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8978` calls `Option`, `toScala9`, `get` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8758` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (4–10 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10104— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10104-10113 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10148-10151 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10194-10203 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10104` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10104` calls `toScala9`, `get` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10148` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–10 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8994— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8994-8998 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9094-9096 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9188-9192 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11396-11405 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11556-11558 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11706-11715 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8994` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–10 lines × 6) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11809— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11809-11818 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11847-11850 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11887-11896 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12178-12182 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12202-12205 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12225-12229 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11809` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11809` calls `toScala6`, `get` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11847` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–10 lines × 12) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10101— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10101-10103 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10116-10118 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10146-10148 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10162-10164 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10191-10193 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10206-10208 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11996-12005 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12008-12010 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12037-12039 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12052-12054 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12082-12091 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12094-12096 — all 12 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11996` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11995` calls `toScala7`, `get`, `toScala8` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10101` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 134) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:37— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:37-44 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:51-58 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:104-111 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:117-124 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:169-176 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:186-193 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:250-257 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:272-279 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:354-361 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:382-389 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:480-487 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:516-523 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:634-641 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:679-686 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:803-810 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:819-826 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:878-886 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:892-900 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:948-955 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:968-975 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1039-1046 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1065-1072 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1157-1164 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1191-1198 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1303-1310 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1346-1353 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1480-1487 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1533-1540 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1674-1681 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1691-1698 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1754-1761 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1770-1777 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1833-1840 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1857-1864 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1945-1952 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1977-1984 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2085-2092 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2126-2133 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2256-2263 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2307-2314 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2461-2468 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2523-2530 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2685-2692 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2704-2711 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2773-2780 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2790-2797 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2857-2864 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2884-2891 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:2981-2988 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3017-3024 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3136-3143 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3182-3189 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3325-3332 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3382-3389 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3551-3558 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3620-3627 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3798-3805 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3818-3825 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3891-3898 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3910-3917 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3990-3997 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4020-4027 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4126-4133 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4166-4173 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4296-4303 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4347-4354 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4503-4510 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4566-4573 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4750-4757 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:4826-4833 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5028-5035 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5049-5056 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5126-5133 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5146-5153 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5231-5238 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5263-5270 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5376-5383 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5419-5426 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5558-5565 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5613-5620 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5780-5787 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5848-5855 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6045-6052 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6127-6134 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6344-6351 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6366-6373 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6447-6454 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6468-6475 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6558-6565 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6592-6599 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6712-6719 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6758-6765 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6906-6913 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6965-6972 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7143-7150 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7216-7223 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7426-7433 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7514-7521 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7747-7754 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7770-7777 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7865-7872 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7887-7894 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:7983-7990 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8019-8026 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8147-8154 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8196-8203 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8354-8361 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8417-8424 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8607-8614 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8685-8692 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:8909-8916 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9003-9010 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9265-9272 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9381-9388 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9689-9696 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9794-9801 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10085-10092 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10129-10136 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10269-10276 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10343-10350 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10552-10559 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10639-10646 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10885-10892 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10986-10993 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11273-11280 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11422-11429 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11793-11800 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11831-11838 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11978-11985 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12020-12027 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12164-12171 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12187-12194 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12301-12308 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12412-12419 — all 134 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:957` calls `evaluate`, `toScala1`, `get` and `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:1842` 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 × 7) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12427— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12427-12433 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12435-12442 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12445-12452 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12456-12463 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12468-12475 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12481-12488 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12495-12502 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:12427` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 4) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3635— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3635-3641 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3643-3650 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3653-3660 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3664-3671 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3635` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 3) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3397— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3397-3403 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3405-3412 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3415-3422 — 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:3397` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 18) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11292— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11292-11297 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11299-11305 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11308-11314 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11318-11324 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11329-11335 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11341-11347 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11354-11360 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11368-11374 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11383-11389 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11602-11607 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11609-11615 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11618-11624 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11628-11634 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11639-11645 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11651-11657 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11664-11670 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11678-11684 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11693-11699 — all 18 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11292` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 12) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10904— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10904-10909 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10911-10917 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10920-10926 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10930-10936 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10941-10947 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10953-10959 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11115-11120 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11122-11128 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11131-11137 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11141-11147 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11152-11158 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11164-11170 — all 12 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10904` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 10) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10571— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10571-10576 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10578-10584 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10587-10593 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10597-10603 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10608-10614 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10753-10758 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10760-10766 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10769-10775 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10779-10785 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10790-10796 — all 10 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10571` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 12) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9704— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9704-9709 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9713-9718 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9723-9728 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9734-9739 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9746-9751 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9759-9764 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9922-9927 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9931-9936 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9941-9946 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9952-9957 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9964-9969 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9977-9982 — all 12 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9704` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–6 lines × 5) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5159— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5159-5162 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5433-5438 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5627-5632 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5862-5867 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:6141-6146 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:5159` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 30) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11293— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11293-11297 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11301-11305 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11310-11314 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11320-11324 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11331-11335 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11343-11347 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11356-11360 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11370-11374 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11385-11389 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11401-11405 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11445-11449 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11454-11458 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11464-11468 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11475-11479 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11487-11491 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11500-11504 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11514-11518 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11529-11533 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11545-11549 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11562-11566 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11603-11607 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11611-11615 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11620-11624 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11630-11634 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11641-11645 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11653-11657 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11666-11670 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11680-11684 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11695-11699 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11711-11715 — all 30 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11293` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 21) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10905— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10905-10909 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10913-10917 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10922-10926 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10932-10936 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10943-10947 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10955-10959 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10968-10972 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11009-11013 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11018-11022 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11028-11032 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11039-11043 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11051-11055 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11064-11068 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11078-11082 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11116-11120 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11124-11128 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11133-11137 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11143-11147 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11154-11158 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11166-11170 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11179-11183 — all 21 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10905` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 20) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11286— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11286-11290 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11292-11296 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11299-11304 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11308-11313 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11318-11323 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11329-11334 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11341-11346 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11354-11359 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11368-11373 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11383-11388 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11596-11600 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11602-11606 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11609-11614 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11618-11623 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11628-11633 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11639-11644 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11651-11656 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11664-11669 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11678-11683 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11693-11698 — all 20 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11286` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 16) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9278— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9278-9282 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9284-9288 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9291-9296 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9300-9305 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9310-9315 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9321-9326 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9333-9338 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9346-9351 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9520-9524 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9526-9530 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9533-9538 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9542-9547 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9552-9557 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9563-9568 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9575-9580 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9588-9593 — all 16 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:9278` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 14) botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10898— botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10898-10902 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10904-10908 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10911-10916 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10920-10925 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10930-10935 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10941-10946 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10953-10958 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11109-11113 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11115-11119 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11122-11127 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11131-11136 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11141-11146 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11152-11157 | botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:11164-11169 — all 14 copies are in the same file, so extract the block into one function there and call 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 `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala:10898` it begins part-way through the construct above it, so those exact lines 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 × 5) simclusters/simclusters_v2/scalding/embedding/producer/AggregatableFavBasedProducerEmbeddings.scala:146— simclusters/simclusters_v2/scalding/embedding/producer/AggregatableFavBasedProducerEmbeddings.scala:146-162 | simclusters/simclusters_v2/scalding/embedding/producer/AggregatableFavBasedProducerEmbeddings.scala:203-219 | simclusters/simclusters_v2/scalding/embedding/producer/AggregatableFollowBasedProducerEmbeddings.scala:99-115 | simclusters/simclusters_v2/scalding/embedding/producer/AggregatableLogFavBasedProducerEmbeddings.scala:214-230 | simclusters/simclusters_v2/scalding/embedding/producer/AggregatableLogFavBasedProducerEmbeddings.scala:272-288 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `simclusters/simclusters_v2/scalding/embedding/producer/AggregatableFavBasedProducerEmbeddings.scala: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 (37 lines × 2) botmaker/src/java/com/twitter/botmaker/compiler/CompilerUnit.java:122— botmaker/src/java/com/twitter/botmaker/compiler/CompilerUnit.java:122-158 | botmaker/src/java/com/twitter/botmaker/compiler/CompilerUnit.java:178-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. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/java/com/twitter/botmaker/compiler/CompilerUnit.java:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (33–34 lines × 3) botmaker/src/java/com/twitter/botmaker/compiler/CompilerUnit.java:126— botmaker/src/java/com/twitter/botmaker/compiler/CompilerUnit.java:126-158 | botmaker/src/java/com/twitter/botmaker/compiler/CompilerUnit.java:181-214 | botmaker/src/java/com/twitter/botmaker/compiler/CompilerUnit.java:237-269 — 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 `botmaker/src/java/com/twitter/botmaker/compiler/CompilerUnit.java:126` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 (34 lines × 2) botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java:96— botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java:96-129 | botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftStructOperator.java:95-128 — before extracting anything, compare `botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java` and `botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftStructOperator.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (21–23 lines × 2) botmaker/src/java/com/twitter/botmaker/function/DerivedFeatureCall.java:97— botmaker/src/java/com/twitter/botmaker/function/DerivedFeatureCall.java:97-119 | botmaker/src/java/com/twitter/botmaker/function/With.java:66-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `botmaker/src/java/com/twitter/botmaker/function/DerivedFeatureCall.java:121` calls `getName`, `isLogged`, `isEmpty` and `botmaker/src/java/com/twitter/botmaker/function/With.java:88` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14–19 lines × 2) botmaker/src/java/com/twitter/botmaker/function/collection/IndexAccessor.java:88— botmaker/src/java/com/twitter/botmaker/function/collection/IndexAccessor.java:88-101 | botmaker/src/java/com/twitter/botmaker/function/collection/IndexAccessor.java:140-158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/java/com/twitter/botmaker/function/collection/IndexAccessor.java:88` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14–15 lines × 3) botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:836— botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:836-850 | botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:861-875 | botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:886-899 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13–14 lines × 3) botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:887— botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:887-899 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:967-980 | botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java:1048-1061 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `Collection` in one and `List` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9–10 lines × 3) botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:919— botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:919-927 | botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:955-964 | botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:1004-1013 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:917` calls `getReturnType` and `botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java:953` 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 (59 lines × 2) botmaker/src/java/com/twitter/botmaker/function/feature/OutputFeature.java:1— botmaker/src/java/com/twitter/botmaker/function/feature/OutputFeature.java:1-60 | botmaker/src/java/com/twitter/botmaker/function/misc/DebugOutput.java:1-59 — before extracting anything, compare `botmaker/src/java/com/twitter/botmaker/function/feature/OutputFeature.java` and `botmaker/src/java/com/twitter/botmaker/function/misc/DebugOutput.java` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `botmaker/src/java/com/twitter/botmaker/function/feature/OutputFeature.java:1` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (63 lines × 2) grox/flows/reply_spam/classifier_reply_ranking.py:110— grox/flows/reply_spam/classifier_reply_ranking.py:110-172 | grox/flows/reply_spam/classifier_simple_reply_scorer.py:88-150 — 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 `grox/flows/reply_spam/classifier_reply_ranking.py:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (57 lines × 2) phoenix/xrex/cutedsl/ranker_attention_fa4.py:378— phoenix/xrex/cutedsl/ranker_attention_fa4.py:378-434 | phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py:532-588 — before extracting anything, compare `phoenix/xrex/cutedsl/ranker_attention_fa4.py` and `phoenix/xrex/cutedsl/ranker_attention_varlen_fa4.py` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 258 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/cutedsl/ranker_attention_fa4.py:378` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (44–47 lines × 2) REDACTED:326— REDACTED:326-372 | REDACTED:597-640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:374` calls `min` and `REDACTED:641` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17–42 lines × 2) phoenix/xrex/pallas/ranker_attention_v2.py:577— phoenix/xrex/pallas/ranker_attention_v2.py:577-618 | phoenix/xrex/pallas/ranker_attention_varlen.py:588-604 — before extracting anything, compare `phoenix/xrex/pallas/ranker_attention_v2.py` and `phoenix/xrex/pallas/ranker_attention_varlen.py` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 287 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_v2.py:577` it does not close everything it opens, so those 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 (37–40 lines × 2) grox/flows/mm_emb/embedder_v82.py:73— grox/flows/mm_emb/embedder_v82.py:73-109 | grox/flows/mm_emb/embedder_v8_search.py:65-104 — before extracting anything, compare `grox/flows/mm_emb/embedder_v82.py` and `grox/flows/mm_emb/embedder_v8_search.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `grox/flows/mm_emb/embedder_v82.py:73` it begins part-way through the construct above it, so those 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 (35–37 lines × 2) phoenix/xrex/data/streaming/kafkaconsumer.py:1426— phoenix/xrex/data/streaming/kafkaconsumer.py:1426-1460 | phoenix/xrex/data/streaming/kafkaconsumer.py:1970-2006 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `phoenix/xrex/data/streaming/kafkaconsumer.py:1969` calls `info` and `phoenix/xrex/data/streaming/kafkaconsumer.py:1425` 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–37 lines × 2) phoenix/xrex/pallas/ranker_attention_v2.py:585— phoenix/xrex/pallas/ranker_attention_v2.py:585-621 | phoenix/xrex/pallas/ranker_attention_varlen.py:635-654 — before extracting anything, compare `phoenix/xrex/pallas/ranker_attention_v2.py` and `phoenix/xrex/pallas/ranker_attention_varlen.py` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 287 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_v2.py:585` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `phoenix/xrex/pallas/ranker_attention_v2.py:622` calls `swapaxes` and `phoenix/xrex/pallas/ranker_attention_varlen.py:654` 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 (36 lines × 2) phoenix/xrex/pallas/ranker_attention_v2.py:148— phoenix/xrex/pallas/ranker_attention_v2.py:148-183 | phoenix/xrex/pallas/ranker_attention_v2.py:287-322 — both copies are in the same file, so extract the 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 (29–30 lines × 2) phoenix/xrex/models/recsys_model.py:4565— phoenix/xrex/models/recsys_model.py:4565-4594 | phoenix/xrex/models/recsys_model.py:5314-5342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/models/recsys_model.py:4565` it begins part-way through the construct above it, so those exact lines 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–26 lines × 2) phoenix/xrex/pallas/ranker_attention_v2.py:1073— phoenix/xrex/pallas/ranker_attention_v2.py:1073-1087 | phoenix/xrex/pallas/ranker_attention_varlen.py:1288-1313 — before extracting anything, compare `phoenix/xrex/pallas/ranker_attention_v2.py` and `phoenix/xrex/pallas/ranker_attention_varlen.py` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 287 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_v2.py:1073` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–25 lines × 2) phoenix/xrex/pallas/ranker_attention_fa3.py:684— phoenix/xrex/pallas/ranker_attention_fa3.py:684-693 | phoenix/xrex/pallas/ranker_attention_fa3.py:915-939 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_fa3.py:684` it does not close everything it opens, so those 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–24 lines × 2) phoenix/xrex/models/recsys_model.py:1534— phoenix/xrex/models/recsys_model.py:1534-1557 | phoenix/xrex/models/recsys_model.py:3061-3082 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–24 lines × 2) phoenix/xrex/pallas/attention.py:198— phoenix/xrex/pallas/attention.py:198-206 | phoenix/xrex/pallas/ranker_attention_v2.py:503-526 — before extracting anything, compare `phoenix/xrex/pallas/attention.py` and `phoenix/xrex/pallas/ranker_attention_v2.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/attention.py:198` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 3) grox/flows/ptos/task_filter.py:57— grox/flows/ptos/task_filter.py:57-75 | grox/flows/reply_spam/task_filter.py:162-180 | grox/flows/reply_spam/task_multi_step_reply_spam.py:104-122 — before extracting anything, compare `grox/flows/reply_spam/task_filter.py` and `grox/flows/reply_spam/task_multi_step_reply_spam.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `grox/flows/ptos/task_filter.py:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16–19 lines × 2) phoenix/xrex/models/recsys_gen_recs_model.py:280— phoenix/xrex/models/recsys_gen_recs_model.py:280-298 | phoenix/xrex/models/recsys_sid_retrieval_model.py:310-325 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–19 lines × 2) phoenix/xrex/pallas/ranker_attention_v2.py:942— phoenix/xrex/pallas/ranker_attention_v2.py:942-960 | phoenix/xrex/pallas/ranker_attention_varlen.py:1111-1128 — before extracting anything, compare `phoenix/xrex/pallas/ranker_attention_v2.py` and `phoenix/xrex/pallas/ranker_attention_varlen.py` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 287 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/pallas/ranker_attention_v2.py:942` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–18 lines × 2) phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:1695— phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:1695-1712 | phoenix/xrex/cutedsl/ranker_fa4/flash_fwd_sm100.py:1740-1755 — both copies are in the same file, so extract the block into 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–17 lines × 2) phoenix/xrex/pallas/ranker_attention_varlen.py:234— phoenix/xrex/pallas/ranker_attention_varlen.py:234-250 | phoenix/xrex/pallas/ranker_attention_varlen.py:258-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 `phoenix/xrex/pallas/ranker_attention_varlen.py:234` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–16 lines × 3) phoenix/xrex/configs/xrecsys.py:169— phoenix/xrex/configs/xrecsys.py:169-184 | phoenix/xrex/configs/xrecsys_gen_recs.py:56-68 | phoenix/xrex/configs/xrecsys_two_tower.py:184-199 — before extracting anything, compare `phoenix/xrex/configs/xrecsys.py` and `phoenix/xrex/configs/xrecsys_two_tower.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `phoenix/xrex/configs/xrecsys_two_tower.py:183` calls `get` and `phoenix/xrex/configs/xrecsys.py:168` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–15 lines × 2) phoenix/xrex/inference/model_runner.py:4155— phoenix/xrex/inference/model_runner.py:4155-4169 | phoenix/xrex/inference/model_runner.py:5124-5136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/inference/model_runner.py:4155` it begins part-way through the construct above it, so those exact lines 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–14 lines × 3) phoenix/xrex/eval/metrics_recsys.py:135— phoenix/xrex/eval/metrics_recsys.py:135-138 | phoenix/xrex/eval/metrics_recsys.py:297-310 | phoenix/xrex/eval/metrics_recsys.py:391-404 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–14 lines × 2) phoenix/xrex/models/recsys_model.py:1946— phoenix/xrex/models/recsys_model.py:1946-1959 | phoenix/xrex/models/recsys_model.py:1962-1973 — both copies are in the same file, so extract the block into 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–14 lines × 2) phoenix/xrex/pallas/ranker_attention_v2.py:718— phoenix/xrex/pallas/ranker_attention_v2.py:718-731 | phoenix/xrex/pallas/ranker_attention_v2.py:850-860 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `phoenix/xrex/pallas/ranker_attention_v2.py:849` calls `load`, `ds` and `phoenix/xrex/pallas/ranker_attention_v2.py:717` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 3) bdsm/runtime/gizmoduck_age.py:77— bdsm/runtime/gizmoduck_age.py:77-88 | bdsm/runtime/login_starter_pack_counter.py:90-102 | bdsm/runtime/starter_pack_follows.py:85-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8–12 lines × 2) phoenix/xrex/models/recsys_model.py:2038— phoenix/xrex/models/recsys_model.py:2038-2045 | phoenix/xrex/models/recsys_model.py:2061-2072 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `phoenix/xrex/models/recsys_model.py:2073` calls `zeros` and `phoenix/xrex/models/recsys_model.py:2046` 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–12 lines × 2) phoenix/xrex/pallas/ranker_attention_varlen.py:815— phoenix/xrex/pallas/ranker_attention_varlen.py:815-826 | phoenix/xrex/pallas/ranker_attention_varlen.py:992-1001 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `phoenix/xrex/pallas/ranker_attention_varlen.py:991` calls `load`, `ds` and `phoenix/xrex/pallas/ranker_attention_varlen.py:814` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–11 lines × 4) phoenix/xrex/pallas/ranker_attention_varlen.py:738— phoenix/xrex/pallas/ranker_attention_varlen.py:738-743 | phoenix/xrex/pallas/ranker_attention_varlen.py:746-751 | phoenix/xrex/pallas/ranker_attention_varlen.py:916-926 | phoenix/xrex/pallas/ranker_attention_varlen.py:954-959 — 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 `phoenix/xrex/pallas/ranker_attention_varlen.py:916` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `phoenix/xrex/pallas/ranker_attention_varlen.py:744` calls `load`, `ds` and `phoenix/xrex/pallas/ranker_attention_varlen.py:915` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–10 lines × 2) phoenix/reference/sid_codebook.py:810— phoenix/reference/sid_codebook.py:810-815 | phoenix/reference/sid_codebook.py:816-825 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–10 lines × 2) phoenix/xrex/train/trainer_recsys.py:1620— phoenix/xrex/train/trainer_recsys.py:1620-1629 | phoenix/xrex/train/trainer_recsys.py:2046-2053 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `phoenix/xrex/train/trainer_recsys.py:1620` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `phoenix/xrex/train/trainer_recsys.py:1631` calls `prod` and `phoenix/xrex/train/trainer_recsys.py:2055` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 3) phoenix/xrex/models/recsys_model.py:1950— phoenix/xrex/models/recsys_model.py:1950-1958 | phoenix/xrex/models/recsys_model.py:1965-1972 | phoenix/xrex/models/recsys_model.py:3098-3105 — 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 `phoenix/xrex/models/recsys_model.py:1950` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–8 lines × 3) phoenix/xrex/pallas/attention.py:65— phoenix/xrex/pallas/attention.py:65-72 | phoenix/xrex/pallas/attention.py:402-407 | phoenix/xrex/pallas/attention.py:495-500 — 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–8 lines × 2) phoenix/xrex/inference/checkpoint_storage.py:54— phoenix/xrex/inference/checkpoint_storage.py:54-59 | phoenix/xrex/inference/model_runner.py:2542-2549 — 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 `phoenix/xrex/inference/model_runner.py:2542` it begins part-way through the construct above it, so those exact lines 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) phoenix/reference/sid_assign.py:25— phoenix/reference/sid_assign.py:25-31 | phoenix/reference/sid_codebook.py:585-588 | phoenix/reference/sid_codebook.py:620-623 | phoenix/reference/sid_io.py:196-202 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Sync-over-async blocking botmaker/src/scala/com/twitter/botmaker/loader/Scheduler.scala:39— `start` is async and calls Await.result — a blocking call inside async code stalls the execution-context thread, and every future or fiber scheduled on it for as long as it runs.
R10 · Code Duplication· Duplicated block with local edits (10 matched lines × 2 locations) · ×1
Duplicated block with local edits (10 matched lines × 2 locations) under-the-hood/jetfuel/routes/index.tsx:67— under-the-hood/jetfuel/routes/index.tsx:67 · under-the-hood/jetfuel/routes/report.tsx:185 — the two spans are one implementation copied and then locally edited — 102 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 (9 lines × 2 locations) under-the-hood/jetfuel/routes/_lib/report.ts:38— under-the-hood/jetfuel/routes/_lib/report.ts:38 · under-the-hood/jetfuel/routes/_lib/report.ts:50 — 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.
Interpolated log message defeats structured logging REDACTED:595— `info` at line 595 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 REDACTED:620— `info` at line 620 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 REDACTED:627— `info` at line 627 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 REDACTED:629— `info` at line 629 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 REDACTED:663— `error` at line 663 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging REDACTED:696— `info` at line 696 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 phoenix/xrex/utils/gpu.py:101— `info` at line 101 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 phoenix/xrex/utils/gpu.py:103— `error` 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging phoenix/xrex/utils/gpu.py:166— `error` at line 166 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging phoenix/xrex/utils/gpu.py:211— `warning` at line 211 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 phoenix/xrex/utils/gpu.py:298— `warning` at line 298 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 phoenix/xrex/utils/gpu.py:303— `warning` at line 303 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 phoenix/xrex/utils/gpu.py:306— `info` at line 306 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 phoenix/xrex/utils/gpu.py:308— `warning` at line 308 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 phoenix/xrex/utils/jax_extensions.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 phoenix/xrex/utils/jax_extensions.py:76— `info` at line 76 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 phoenix/xrex/utils/jax_extensions.py:80— `info` at line 80 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 phoenix/xrex/utils/jax_extensions.py:83— `info` at line 83 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 phoenix/xrex/utils/jax_extensions.py:84— `info` at line 84 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 phoenix/xrex/utils/jax_extensions.py:102— `info` at line 102 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 phoenix/xrex/utils/log_timer.py:75— `info` at line 75 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 phoenix/xrex/utils/metadata.py:96— `error` 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging phoenix/xrex/utils/metadata.py:106— `error` at line 106 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.error("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.error("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging phoenix/xrex/utils/metadata.py:499— `info` at line 499 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 phoenix/xrex/utils/metadata.py:508— `info` at line 508 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.
Duplicated predicate botmaker/src/java/com/twitter/botmaker/function/collection/Contains.java:51— `!Object.class.equals(typeBase) && !String.class.equals(typeBase) && !Collection.class.isAssignableFrom(typeBase) && !Map.class.isAssignableF…` appears character-identically in 2 files — botmaker/src/java/com/twitter/botmaker/function/collection/Contains.java, botmaker/src/java/com/twitter/botmaker/function/collection/Count.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 botmaker/src/java/com/twitter/botmaker/function/logic/Conjunction.java:131— `!context.isDebugging() && extractor instanceof Extractor.Functor` appears character-identically in 2 files — botmaker/src/java/com/twitter/botmaker/function/logic/Conjunction.java, botmaker/src/java/com/twitter/botmaker/function/logic/Disjunction.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 botmaker/src/java/com/twitter/botmaker/function/logic/Equals.java:39— `Type.doubleLike(numA) || Type.doubleLike(numB)` appears character-identically in 2 files — botmaker/src/java/com/twitter/botmaker/function/logic/Equals.java, botmaker/src/java/com/twitter/botmaker/function/logic/NotEquals.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 botmaker/src/java/com/twitter/botmaker/function/logic/GreaterThan.java:48— `Type.longLike(argA) && Type.longLike(argB)` appears character-identically in 4 files — botmaker/src/java/com/twitter/botmaker/function/logic/GreaterThan.java, botmaker/src/java/com/twitter/botmaker/function/logic/GreaterThanOrEquals.java, botmaker/src/java/com/twitter/botmaker/function/logic/LessThan.java, botmaker/src/java/com/twitter/botmaker/function/logic/LessThanOrEquals.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 botmaker/src/java/com/twitter/botmaker/function/logic/Equals.java:36— `a instanceof Number && b instanceof Number` appears character-identically in 2 files — botmaker/src/java/com/twitter/botmaker/function/logic/Equals.java, botmaker/src/java/com/twitter/botmaker/function/logic/NotEquals.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 botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java:106— `fieldType.typeBase == List.class && node instanceof ListOperator` appears character-identically in 2 files — botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java, botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftStructOperator.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 botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java:116— `fieldType.typeBase == Map.class && node instanceof MapOperator` appears character-identically in 2 files — botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java, botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftStructOperator.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 botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java:96— `fieldType.typeBase == Set.class && node instanceof SetOperator` appears character-identically in 2 files — botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftOperator.java, botmaker/src/java/com/twitter/botmaker/function/thrift/ThriftStructOperator.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 botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfNsfwFlag.java:28— `inAppReport.isSetEntityReportDetails() && inAppReport.getEntityReportDetails().getMomentReportDetails() != null` appears character-identically in 2 files — botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfNsfwFlag.java, botmaker/scarecrow_features/src/main/java/com/twitter/scarecrow/features/FeaturesOfTweetReport.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 phoenix/reference/dump_gen.py:607— `(cwd / "xrex" / "__init__.py").exists() and str(cwd) not in sys.path` appears character-identically in 2 files — phoenix/reference/dump_gen.py, phoenix/reference/gen_recs_artifacts_gen.py. 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 phoenix/xrex/pallas/ranker_attention_fa3.py:67— `any(block_is_set) and not all(block_is_set)` appears character-identically in 2 files — phoenix/xrex/pallas/ranker_attention_fa3.py, phoenix/xrex/pallas/ranker_attention_varlen.py. 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 grox/core/data_loaders/asr_processor.py:379— `cls._result_task and not cls._result_task.done()` appears character-identically in 2 files — grox/core/data_loaders/asr_processor.py, grox/core/data_loaders/media_processor.py. 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 grox/flows/mm_emb/renderer_v82.py:261— `core_user.get("isBlueVerified") or safety.get("isBlueVerified")` appears character-identically in 2 files — grox/flows/mm_emb/renderer_v82.py, grox/flows/mm_emb/renderer_v8_search.py. 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 grox/core/generators/registry.py:18— `existing is not None and existing is not cls` appears character-identically in 2 files — grox/core/generators/registry.py, phoenix/python/common/xai-configlib/src/xai_configlib/__init__.py. 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 grox/libs/video_tools/frame_sampler.py:52— `frame.pts is None or frame.time_base is None` appears character-identically in 2 files — grox/libs/video_tools/frame_sampler.py, grox/libs/video_tools/key_frames.py. 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 phoenix/xrex/cuda/async_emb/async_emb.py:194— `grads.shape == (ctx.tokens_per_rank, ctx.emb_width) and grads.dtype == jnp.bfloat16` appears character-identically in 2 files — phoenix/xrex/cuda/async_emb/async_emb.py, phoenix/xrex/cuda/row_emb/row_emb.py. 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 phoenix/xrex/models/recsys_model.py:1327— `isinstance(attn_config, RecsysAttentionConfig) and attn_config.num_user_prefix_tokens == self.num_user_prefix_tokens` appears character-identically in 2 files — phoenix/xrex/models/recsys_model.py, phoenix/xrex/models/recsys_two_tower_model.py. 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 grox/core/registry.py:13— `isinstance(cls, type) and issubclass(cls, GrpcServicer)` appears character-identically in 2 files — grox/core/registry.py, grox/core/services/registry.py. 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 grox/core/plans/registry.py:7— `isinstance(cls, type) and issubclass(cls, Plan)` appears character-identically in 2 files — grox/core/plans/registry.py, grox/core/registry.py. 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 grox/core/generators/registry.py:8— `isinstance(cls, type) and issubclass(cls, TaskGenerator)` appears character-identically in 2 files — grox/core/generators/registry.py, grox/core/registry.py. 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 grox/libs/embed/embed_http.py:246— `isinstance(first, dict) and "embedding" in first` appears character-identically in 2 files — grox/libs/embed/embed_http.py, phoenix/reference/mm_encoder.py. 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 grox/flows/mm_emb/embedder_v82.py:51— `isinstance(m, Video) and m.convo_video and m.convo_video.asr_transcript` appears character-identically in 2 files — grox/flows/mm_emb/embedder_v82.py, grox/flows/mm_emb/task_multimodal_post_embedding.py. 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 grox/flows/mm_emb/renderer_v82.py:293— `isinstance(medium, Image) and medium.convo_image and medium.convo_image.content` appears character-identically in 2 files — grox/flows/mm_emb/renderer_v82.py, grox/flows/mm_emb/renderer_v8_search.py. 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 grox/flows/mm_emb/renderer_v82.py:299— `isinstance(medium, Video) and medium.convo_video and medium.convo_video.frames` appears character-identically in 2 files — grox/flows/mm_emb/renderer_v82.py, grox/flows/mm_emb/renderer_v8_search.py. 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 grox/flows/reply_spam/classifier_reply_ranking.py:128— `isinstance(repaired, dict) and "score" in repaired` appears character-identically in 2 files — grox/flows/reply_spam/classifier_reply_ranking.py, grox/flows/reply_spam/classifier_simple_reply_scorer.py. 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.
Hand-rolled JSON/XML parsing via regex phoenix/xrex/models/fp8.py:35— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex grox/flows/reply_spam/classifier_coordinated_spam.py:217— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex grox/flows/reply_spam/classifier_multi_step_reply_spam.py:221— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex grox/flows/reply_spam/classifier_reply_ranking.py:137— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex grox/flows/reply_spam/classifier_reply_ranking.py:152— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex grox/flows/reply_spam/classifier_simple_reply_scorer.py:115— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex grox/flows/reply_spam/classifier_simple_reply_scorer.py:130— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
Silent fallback default on Err abuse-enforcement-service/service-lib/src/overturn_hold.rs:898— `endpoint` turns every `Err` into `"url=<bad URL>".to_owned()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err home-mixer/candidate_hydrators/quote_hydrator.rs:58— `get_quoted_video_durations` turns every `Err` into `HashMap::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err phoenix-rankall/src/hydrate/fav_counts.rs:51— `fetch_chunk` turns every `Err` into `HashMap::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err home-mixer/clients/ad_index_client.rs:30— `app_env` turns every `Err` into `"prod".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err phoenix-rankall/src/hydrate/strato.rs:47— `json_i64` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err phoenix/crates/common/xai-recsys/src/util.rs:387— `parse_ipv4_to_u32` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err phoenix/crates/serving/xai-recsys-sid-retrieval/src/http_api.rs:56— `sid_source_name` turns every `Err` into `"SEED_SID_SOURCE_UNSPECIFIED".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on parse failure phoenix/xrex/cutedsl/ranker_fa4/fa_logging.py:49— `_parse_log_level` returns `0` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure REDACTED:22— `_read_version_file` returns `0` when `(FileNotFoundError, ValueError, OSError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure phoenix/xrex/inference/model_runner.py:163— `_read_version_file` returns `0` when `(FileNotFoundError, ValueError, OSError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure grox/flows/mm_emb/renderer_v82.py:104— `_format_join_date` returns `''` when `(OverflowError, OSError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure grox/flows/mm_emb/renderer_v8_search.py:119— `_format_join_date` returns `''` when `(OverflowError, OSError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch bdsm/runtime/sequence_cache.py:145— `_arrow_member_to_rows` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch phoenix/xrex/data/recsys/history_id_lists.py:387— `_local_device_count` swallows every exception into `return 1` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch phoenix/xrex/utils/launch_env.py:41— `read_experiment_git_commit_hash` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
README/code drift README.md:315— README.md links to `visibility-filtering/rules/registry.rs`, but `visibility-filtering/rules/registry.rs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
No SAST — No static application security testing detected. For this repository's stack, add cargo-audit / cargo-deny (or clippy) (or `semgrep --config=auto`, which runs on any language) — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
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 phoenix/xrex/data/streaming/kafkaconsumer.py:2007— `debug` at line 2007 is called with an argument built by `sorted(dropped_by_partition.keys())` (line 2009), whose cost grows with the collection it walks. Python 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 `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
X5 · Nullable reference types· Scala's null is not held to the type system everywhere · ×1
Scala's null is not held to the type system everywhere — No build over this repository's 547 Scala product file(s) passes `-Yexplicit-nulls`, enables WartRemover's `Null` wart or runs Scalafix's `DisableSyntax.noNulls`, so every reference type admits null and nothing reports a `null` written into the code or returned from a Java API — the first one to reach a method call is a `NullPointerException`. `Option` by convention is a habit no tool here holds the code to.
Outdated: arc-swap — `arc-swap` is locked at 1.9.2 but 1.9.3 is the current stable release on crates.io, and it already satisfies the `"1.7"` requirement declared in phoenix/crates/serving/xai-recsys-sid-retrieval/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p arc-swap` and commit the updated REDACTED.
Outdated: async-trait — `async-trait` is locked at 0.1.91 but 0.1.92 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in phoenix/crates/serving/xai-recsys-engine/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p async-trait` and commit the updated REDACTED.
Outdated: clap — `clap` is locked at 4.6.6 but 4.6.7 is the current stable release on crates.io, and it already satisfies the `"4"` requirement declared in bdsm/rust/accumulator/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
Outdated: crc32fast — `crc32fast` is locked at 1.5.0 but 1.5.3 is the current stable release on crates.io, and it already satisfies the `"1.4"` requirement declared in phoenix/crates/common/xai-recsys/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crc32fast` and commit the updated REDACTED.
Outdated: fastrace — `fastrace` is locked at 0.7.18 but 0.7.19 is the current stable release on crates.io, and it already satisfies the `"0.7"` requirement declared in phoenix/crates/serving/xai-recsys-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p fastrace` and commit the updated REDACTED.
Outdated: futures — `futures` is locked at 0.3.33 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in phoenix/crates/serving/xai-recsys-engine/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures` and commit the updated REDACTED.
Outdated: google-cloud-auth — `google-cloud-auth` is locked at 1.15.0 but 1.18.0 is the current stable release on crates.io, and it already satisfies the `"1.7"` requirement declared in phoenix/crates/serving/xai-recsys-engine/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p google-cloud-auth` and commit the updated REDACTED.
Outdated: google-cloud-storage — `google-cloud-storage` is locked at 1.17.0 but 1.21.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in phoenix/crates/serving/xai-recsys-engine/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p google-cloud-storage` and commit the updated REDACTED.
Outdated: http — `http` is locked at 1.4.2 but 1.5.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in phoenix/crates/serving/xai-recsys-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p http` and commit the updated REDACTED.
Outdated: http-body-util — `http-body-util` is locked at 0.1.4 but 0.1.5 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in phoenix/crates/serving/xai-recsys-engine/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p http-body-util` and commit the updated REDACTED.
Outdated: lazy_static — `lazy_static` is locked at 1.5.0 but 1.5.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in phoenix/crates/common/xai-recsys/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p lazy_static` 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"` requirement declared in phoenix/crates/serving/xai-recsys-engine/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
Outdated: log — `log` is locked at 0.4.33 but 0.4.34 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in phoenix/crates/common/xai-recsys/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p log` 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.8"` requirement declared in phoenix/crates/serving/xai-recsys-engine/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p memmap2` and commit the updated REDACTED.
Outdated: rustls — `rustls` is locked at 0.23.42 but 0.23.46 is the current stable release on crates.io, and it already satisfies the `"0.23"` requirement declared in phoenix/crates/serving/xai-recsys-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustls` and commit the updated REDACTED.
Outdated: serde_json — `serde_json` is locked at 1.0.151 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in bdsm/rust/accumulator/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
Outdated: tokio — `tokio` is locked at 1.53.1 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in bdsm/rust/accumulator/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
Outdated: tokio-rustls — `tokio-rustls` is locked at 0.26.4 but 0.26.6 is the current stable release on crates.io, and it already satisfies the `"0.26"` requirement declared in phoenix/crates/serving/xai-recsys-server/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio-rustls` and commit the updated REDACTED.
Outdated: tokio-util — `tokio-util` is locked at 0.7.19 but 0.7.20 is the current stable release on crates.io, and it already satisfies the `"0.7"` requirement declared in phoenix/crates/serving/xai-recsys-engine/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio-util` 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 10 file(s) — `botmaker/src/scala/com/twitter/botmaker/FunctionUnitGen.scala`, `grox/core/lm/convo.py`, `grox/core/processors.py`, `grox/core/registry.py`, `grox/core/schedules/context.py`, … (+5 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
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 01a17604-ae02-76e6-b506-ed2aac55fc0e · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 9 · Warnings: 2567 · Recommendations: 95 · Info: 19 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 26-10-2026 @ 02:23 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.