Public report of juspay/hyperswitch, published 25 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 25 October 2026, 23:18 UTC · Survey ID cd_db0a001aef74498ca263d52458199bd3
juspay/hyperswitch
Measured 25 October 2026, 23:14 UTC, at code version 4e6a36b
First survey, so nothing to compare with yet
CAI scoreAt risk
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A very large codebase: 954,023 lines of product code in 41 projects, tests not counted · Estimated rebuild effort: about 6.9 person-years · Weakest lens: Accessibility, 22
Findings by how serious they are
2042 critical5776 serious1980 minor
12 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
25 October 2026, 23:14 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.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. 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 ▸
92of 92 dimensions measured by tools.
9685of 9798 findings point to an exact file and line, so you can open each one in the code. The other 113 concern the repository as a whole, such as missing documentation.
92dimensions across 9 lenses, read from 954,023 lines of product code in 41 projects.
juspay/hyperswitch is rated At risk because critical security findings are open, most of them in its code. Its score is held back in part because it has controls that only work with a mouse. It scores 41 out of 100, which the At risk rating leaves unchanged.
Accessibility, at 22, is the weakest lens and counts most in the score. The best first steps are labelling the form fields and buttons and making the controls keyboard-usable, each worth about 6 points. Raising Accessibility to 70 would lift the score to about 56.
1,631 weaknesses in the code could be used by an attacker. 156 pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with, and ninety-four passwords or keys in the code and 24 in the code's history are open to anyone who can read the repository. Fixing the weaknesses the scanner points to, pinning each tool to an exact version and replacing each exposed password or key would close these risks. Updating the vulnerable packages would fix the 16 packages with a known security hole, and the 60 unsafe settings in infrastructure or container files need changing to safe values. The 27 pieces of business logic tied to the database or web code need separating from the database and web code.
The product code is 954,023 lines, about €1,000,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Accessibility rose from 22 to 70, the lowest score rated Strong, the score would rise from 41 to about 56.
Code composition: what the lines of code are
Product code 94%Tests 6%
Rebuild cost: about €1,000,000 · Estimate
Cost to rebuild
€330,000 to €1,700,000, for 5,528 to 17,537 hours of work, about 6.9 person-years for 4 to 13 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 41. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Very large: 954,023 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
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Raises the score by about 6 points · Medium effort · Forms & labels
2
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €1,000,000 to build again, about 6.9 person-years of work. Its weakest lens is Accessibility, at 22 (Critical). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label. 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 6.9 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 3% to 6% on every change. The history of the code shows how much it changes: about 218,777 lines over the last 90 days, which is about 887,262 lines a year. At that pace, the extra work comes to an estimated 59.4 to 356.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.
1713 modules, with 16223 dependencies between them. 5 loops run through 639 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1673 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.
common_utils.types uses common_enums.enums, so a change to common_enums.enums can break common_utils.types, while a change to common_utils.types can't break common_enums.enums.
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.
3→39 common_utils.types uses api_models.paymentspart of a loop✕
Connections
1 pair of types, where a type in common_utils.types uses a type in api_models.payments.
common_utils.types uses api_models.payments, so a change to api_models.payments can break common_utils.types, while a change to common_utils.types can't break api_models.payments.
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.
3→40 common_utils.types uses api_models.adminpart of a loop✕
Connections
1 pair of types, where a type in common_utils.types uses a type in api_models.admin.
common_utils.types uses api_models.admin, so a change to api_models.admin can break common_utils.types, while a change to common_utils.types can't break api_models.admin.
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.
4→35 hyperswitch_interfaces.api.authentication uses hyperswitch_interfaces.apipart of a loop✕
Connections
5 pairs of types, where a type in hyperswitch_interfaces.api.authentication uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.authentication uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.authentication, while a change to hyperswitch_interfaces.api.authentication can't break hyperswitch_interfaces.api.
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.
5→35 hyperswitch_interfaces.api.disputes uses hyperswitch_interfaces.apipart of a loop✕
Connections
6 pairs of types, where a type in hyperswitch_interfaces.api.disputes uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.disputes uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.disputes, while a change to hyperswitch_interfaces.api.disputes can't break hyperswitch_interfaces.api.
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.
6→35 hyperswitch_interfaces.api.files uses hyperswitch_interfaces.apipart of a loop✕
Connections
3 pairs of types, where a type in hyperswitch_interfaces.api.files uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.files uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.files, while a change to hyperswitch_interfaces.api.files can't break hyperswitch_interfaces.api.
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.
7→35 hyperswitch_interfaces.api.fraud_check uses hyperswitch_interfaces.apipart of a loop✕
Connections
7 pairs of types, where a type in hyperswitch_interfaces.api.fraud_check uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.fraud_check uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.fraud_check, while a change to hyperswitch_interfaces.api.fraud_check can't break hyperswitch_interfaces.api.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
8→32 hyperswitch_interfaces.api.fraud_check_v2 uses hyperswitch_interfaces.connector_integration_v2part of a loop✕
Connections
6 pairs of types, where a type in hyperswitch_interfaces.api.fraud_check_v2 uses a type in hyperswitch_interfaces.connector_integration_v2.
hyperswitch_interfaces.api.fraud_check_v2 uses hyperswitch_interfaces.connector_integration_v2, so a change to hyperswitch_interfaces.connector_integration_v2 can break hyperswitch_interfaces.api.fraud_check_v2, while a change to hyperswitch_interfaces.api.fraud_check_v2 can't break hyperswitch_interfaces.connector_integration_v2.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
8→35 hyperswitch_interfaces.api.fraud_check_v2 uses hyperswitch_interfaces.apipart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_interfaces.api.fraud_check_v2 uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.fraud_check_v2 uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.fraud_check_v2, while a change to hyperswitch_interfaces.api.fraud_check_v2 can't break hyperswitch_interfaces.api.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
9→35 hyperswitch_interfaces.api.merchant_connector_webhook_management uses hyperswitch_interfaces.apipart of a loop✕
Connections
3 pairs of types, where a type in hyperswitch_interfaces.api.merchant_connector_webhook_management uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.merchant_connector_webhook_management uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.merchant_connector_webhook_management, while a change to hyperswitch_interfaces.api.merchant_connector_webhook_management can't break hyperswitch_interfaces.api.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10→35 hyperswitch_interfaces.api.payouts uses hyperswitch_interfaces.apipart of a loop✕
Connections
9 pairs of types, where a type in hyperswitch_interfaces.api.payouts uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.payouts uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.payouts, while a change to hyperswitch_interfaces.api.payouts can't break hyperswitch_interfaces.api.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10→37 hyperswitch_interfaces.api.payouts uses hyperswitch_connectors.connectors.adyen.transformerspart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_interfaces.api.payouts uses a type in hyperswitch_connectors.connectors.adyen.transformers.
hyperswitch_interfaces.api.payouts uses hyperswitch_connectors.connectors.adyen.transformers, so a change to hyperswitch_connectors.connectors.adyen.transformers can break hyperswitch_interfaces.api.payouts, while a change to hyperswitch_interfaces.api.payouts can't break hyperswitch_connectors.connectors.adyen.transformers.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
11→32 hyperswitch_interfaces.api.payouts_v2 uses hyperswitch_interfaces.connector_integration_v2part of a loop✕
Connections
8 pairs of types, where a type in hyperswitch_interfaces.api.payouts_v2 uses a type in hyperswitch_interfaces.connector_integration_v2.
hyperswitch_interfaces.api.payouts_v2 uses hyperswitch_interfaces.connector_integration_v2, so a change to hyperswitch_interfaces.connector_integration_v2 can break hyperswitch_interfaces.api.payouts_v2, while a change to hyperswitch_interfaces.api.payouts_v2 can't break hyperswitch_interfaces.connector_integration_v2.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
11→35 hyperswitch_interfaces.api.payouts_v2 uses hyperswitch_interfaces.apipart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_interfaces.api.payouts_v2 uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.payouts_v2 uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.payouts_v2, while a change to hyperswitch_interfaces.api.payouts_v2 can't break hyperswitch_interfaces.api.
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.
12→35 hyperswitch_interfaces.api.refunds uses hyperswitch_interfaces.apipart of a loop✕
Connections
4 pairs of types, where a type in hyperswitch_interfaces.api.refunds uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.refunds uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.refunds, while a change to hyperswitch_interfaces.api.refunds can't break hyperswitch_interfaces.api.
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→32 hyperswitch_interfaces.api.refunds_v2 uses hyperswitch_interfaces.connector_integration_v2part of a loop✕
Connections
3 pairs of types, where a type in hyperswitch_interfaces.api.refunds_v2 uses a type in hyperswitch_interfaces.connector_integration_v2.
hyperswitch_interfaces.api.refunds_v2 uses hyperswitch_interfaces.connector_integration_v2, so a change to hyperswitch_interfaces.connector_integration_v2 can break hyperswitch_interfaces.api.refunds_v2, while a change to hyperswitch_interfaces.api.refunds_v2 can't break hyperswitch_interfaces.connector_integration_v2.
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→35 hyperswitch_interfaces.api.refunds_v2 uses hyperswitch_interfaces.apipart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_interfaces.api.refunds_v2 uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.refunds_v2 uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.refunds_v2, while a change to hyperswitch_interfaces.api.refunds_v2 can't break hyperswitch_interfaces.api.
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.
14→35 hyperswitch_interfaces.api.revenue_recovery uses hyperswitch_interfaces.apipart of a loop✕
Connections
5 pairs of types, where a type in hyperswitch_interfaces.api.revenue_recovery uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.revenue_recovery uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.revenue_recovery, while a change to hyperswitch_interfaces.api.revenue_recovery can't break hyperswitch_interfaces.api.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
15→35 hyperswitch_interfaces.api.vault uses hyperswitch_interfaces.apipart of a loop✕
Connections
5 pairs of types, where a type in hyperswitch_interfaces.api.vault uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.vault uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.vault, while a change to hyperswitch_interfaces.api.vault can't break hyperswitch_interfaces.api.
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.
16→32 hyperswitch_interfaces.api.vault_v2 uses hyperswitch_interfaces.connector_integration_v2part of a loop✕
Connections
4 pairs of types, where a type in hyperswitch_interfaces.api.vault_v2 uses a type in hyperswitch_interfaces.connector_integration_v2.
hyperswitch_interfaces.api.vault_v2 uses hyperswitch_interfaces.connector_integration_v2, so a change to hyperswitch_interfaces.connector_integration_v2 can break hyperswitch_interfaces.api.vault_v2, while a change to hyperswitch_interfaces.api.vault_v2 can't break hyperswitch_interfaces.connector_integration_v2.
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.
16→35 hyperswitch_interfaces.api.vault_v2 uses hyperswitch_interfaces.apipart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_interfaces.api.vault_v2 uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.vault_v2 uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.vault_v2, while a change to hyperswitch_interfaces.api.vault_v2 can't break hyperswitch_interfaces.api.
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.
diesel_models.dispute uses common_utils.id_type.profile, so a change to common_utils.id_type.profile can break diesel_models.dispute, while a change to diesel_models.dispute can't break common_utils.id_type.profile.
Position
Below the diagonal: diesel_models.dispute uses a module listed above it, which is the healthy direction.
diesel_models.dispute uses common_utils.types, so a change to common_utils.types can break diesel_models.dispute, while a change to diesel_models.dispute can't break common_utils.types.
Position
Below the diagonal: diesel_models.dispute uses a module listed above it, which is the healthy direction.
17→38 diesel_models.dispute uses common_enums.enumspart of a loop✕
Connections
8 pairs of types, where a type in diesel_models.dispute uses a type in common_enums.enums.
diesel_models.dispute uses common_enums.enums, so a change to common_enums.enums can break diesel_models.dispute, while a change to diesel_models.dispute can't break common_enums.enums.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→40 diesel_models.dispute uses api_models.adminpart of a loop✕
Connections
2 pairs of types, where a type in diesel_models.dispute uses a type in api_models.admin.
diesel_models.dispute uses api_models.admin, so a change to api_models.admin can break diesel_models.dispute, while a change to diesel_models.dispute can't break api_models.admin.
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.
diesel_models.payouts uses common_utils.id_type.profile, so a change to common_utils.id_type.profile can break diesel_models.payouts, while a change to diesel_models.payouts can't break common_utils.id_type.profile.
Position
Below the diagonal: diesel_models.payouts uses a module listed above it, which is the healthy direction.
diesel_models.payouts uses common_utils.types, so a change to common_utils.types can break diesel_models.payouts, while a change to diesel_models.payouts can't break common_utils.types.
Position
Below the diagonal: diesel_models.payouts uses a module listed above it, which is the healthy direction.
18→38 diesel_models.payouts uses common_enums.enumspart of a loop✕
Connections
14 pairs of types, where a type in diesel_models.payouts uses a type in common_enums.enums.
diesel_models.payouts uses common_enums.enums, so a change to common_enums.enums can break diesel_models.payouts, while a change to diesel_models.payouts can't break common_enums.enums.
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.
18→40 diesel_models.payouts uses api_models.adminpart of a loop✕
Connections
3 pairs of types, where a type in diesel_models.payouts uses a type in api_models.admin.
diesel_models.payouts uses api_models.admin, so a change to api_models.admin can break diesel_models.payouts, while a change to diesel_models.payouts can't break api_models.admin.
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.
diesel_models.refund uses common_utils.id_type.profile, so a change to common_utils.id_type.profile can break diesel_models.refund, while a change to diesel_models.refund can't break common_utils.id_type.profile.
Position
Below the diagonal: diesel_models.refund uses a module listed above it, which is the healthy direction.
diesel_models.refund uses common_utils.types, so a change to common_utils.types can break diesel_models.refund, while a change to diesel_models.refund can't break common_utils.types.
Position
Below the diagonal: diesel_models.refund uses a module listed above it, which is the healthy direction.
19→38 diesel_models.refund uses common_enums.enumspart of a loop✕
Connections
3 pairs of types, where a type in diesel_models.refund uses a type in common_enums.enums.
diesel_models.refund uses common_enums.enums, so a change to common_enums.enums can break diesel_models.refund, while a change to diesel_models.refund can't break common_enums.enums.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→40 diesel_models.refund uses api_models.adminpart of a loop✕
Connections
4 pairs of types, where a type in diesel_models.refund uses a type in api_models.admin.
diesel_models.refund uses api_models.admin, so a change to api_models.admin can break diesel_models.refund, while a change to diesel_models.refund can't break api_models.admin.
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.
hyperswitch_connectors.connectors.authipay.transformers uses common_utils.types, so a change to common_utils.types can break hyperswitch_connectors.connectors.authipay.transformers, while a change to hyperswitch_connectors.connectors.authipay.transformers can't break common_utils.types.
Position
Below the diagonal: hyperswitch_connectors.connectors.authipay.transformers uses a module listed above it, which is the healthy direction.
20→25 hyperswitch_connectors.connectors.authipay.transformers uses hyperswitch_connectors.connectors.paypal.transformerspart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_connectors.connectors.authipay.transformers uses a type in hyperswitch_connectors.connectors.paypal.transformers.
hyperswitch_connectors.connectors.authipay.transformers uses hyperswitch_connectors.connectors.paypal.transformers, so a change to hyperswitch_connectors.connectors.paypal.transformers can break hyperswitch_connectors.connectors.authipay.transformers, while a change to hyperswitch_connectors.connectors.authipay.transformers can't break hyperswitch_connectors.connectors.paypal.transformers.
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.
20→38 hyperswitch_connectors.connectors.authipay.transformers uses common_enums.enumspart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_connectors.connectors.authipay.transformers uses a type in common_enums.enums.
hyperswitch_connectors.connectors.authipay.transformers uses common_enums.enums, so a change to common_enums.enums can break hyperswitch_connectors.connectors.authipay.transformers, while a change to hyperswitch_connectors.connectors.authipay.transformers can't break common_enums.enums.
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.
20→39 hyperswitch_connectors.connectors.authipay.transformers uses api_models.paymentspart of a loop✕
Connections
6 pairs of types, where a type in hyperswitch_connectors.connectors.authipay.transformers uses a type in api_models.payments.
hyperswitch_connectors.connectors.authipay.transformers uses api_models.payments, so a change to api_models.payments can break hyperswitch_connectors.connectors.authipay.transformers, while a change to hyperswitch_connectors.connectors.authipay.transformers can't break api_models.payments.
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.
20→40 hyperswitch_connectors.connectors.authipay.transformers uses api_models.adminpart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_connectors.connectors.authipay.transformers uses a type in api_models.admin.
hyperswitch_connectors.connectors.authipay.transformers uses api_models.admin, so a change to api_models.admin can break hyperswitch_connectors.connectors.authipay.transformers, while a change to hyperswitch_connectors.connectors.authipay.transformers can't break api_models.admin.
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.
hyperswitch_interfaces.api.files_v2 uses hyperswitch_interfaces.api.files, so a change to hyperswitch_interfaces.api.files can break hyperswitch_interfaces.api.files_v2, while a change to hyperswitch_interfaces.api.files_v2 can't break hyperswitch_interfaces.api.files.
Position
Below the diagonal: hyperswitch_interfaces.api.files_v2 uses a module listed above it, which is the healthy direction.
21→32 hyperswitch_interfaces.api.files_v2 uses hyperswitch_interfaces.connector_integration_v2part of a loop✕
Connections
2 pairs of types, where a type in hyperswitch_interfaces.api.files_v2 uses a type in hyperswitch_interfaces.connector_integration_v2.
hyperswitch_interfaces.api.files_v2 uses hyperswitch_interfaces.connector_integration_v2, so a change to hyperswitch_interfaces.connector_integration_v2 can break hyperswitch_interfaces.api.files_v2, while a change to hyperswitch_interfaces.api.files_v2 can't break hyperswitch_interfaces.connector_integration_v2.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
21→35 hyperswitch_interfaces.api.files_v2 uses hyperswitch_interfaces.apipart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_interfaces.api.files_v2 uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.files_v2 uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.files_v2, while a change to hyperswitch_interfaces.api.files_v2 can't break hyperswitch_interfaces.api.
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.
hyperswitch_interfaces.webhooks uses common_utils.types, so a change to common_utils.types can break hyperswitch_interfaces.webhooks, while a change to hyperswitch_interfaces.webhooks can't break common_utils.types.
Position
Below the diagonal: hyperswitch_interfaces.webhooks uses a module listed above it, which is the healthy direction.
22→35 hyperswitch_interfaces.webhooks uses hyperswitch_interfaces.apipart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_interfaces.webhooks uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.webhooks uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.webhooks, while a change to hyperswitch_interfaces.webhooks can't break hyperswitch_interfaces.api.
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.
22→38 hyperswitch_interfaces.webhooks uses common_enums.enumspart of a loop✕
Connections
6 pairs of types, where a type in hyperswitch_interfaces.webhooks uses a type in common_enums.enums.
hyperswitch_interfaces.webhooks uses common_enums.enums, so a change to common_enums.enums can break hyperswitch_interfaces.webhooks, while a change to hyperswitch_interfaces.webhooks can't break common_enums.enums.
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.
22→40 hyperswitch_interfaces.webhooks uses api_models.adminpart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_interfaces.webhooks uses a type in api_models.admin.
hyperswitch_interfaces.webhooks uses api_models.admin, so a change to api_models.admin can break hyperswitch_interfaces.webhooks, while a change to hyperswitch_interfaces.webhooks can't break api_models.admin.
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.
hyperswitch_domain_models.router_response_types uses common_utils.types, so a change to common_utils.types can break hyperswitch_domain_models.router_response_types, while a change to hyperswitch_domain_models.router_response_types can't break common_utils.types.
Position
Below the diagonal: hyperswitch_domain_models.router_response_types uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in hyperswitch_domain_models.router_response_types uses a type in hyperswitch_connectors.connectors.authipay.transformers.
hyperswitch_domain_models.router_response_types uses hyperswitch_connectors.connectors.authipay.transformers, so a change to hyperswitch_connectors.connectors.authipay.transformers can break hyperswitch_domain_models.router_response_types, while a change to hyperswitch_domain_models.router_response_types can't break hyperswitch_connectors.connectors.authipay.transformers.
Position
Below the diagonal: hyperswitch_domain_models.router_response_types uses a module listed above it, which is the healthy direction.
23→25 hyperswitch_domain_models.router_response_types uses hyperswitch_connectors.connectors.paypal.transformerspart of a loop✕
Connections
2 pairs of types, where a type in hyperswitch_domain_models.router_response_types uses a type in hyperswitch_connectors.connectors.paypal.transformers.
hyperswitch_domain_models.router_response_types uses hyperswitch_connectors.connectors.paypal.transformers, so a change to hyperswitch_connectors.connectors.paypal.transformers can break hyperswitch_domain_models.router_response_types, while a change to hyperswitch_domain_models.router_response_types can't break hyperswitch_connectors.connectors.paypal.transformers.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
23→38 hyperswitch_domain_models.router_response_types uses common_enums.enumspart of a loop✕
Connections
9 pairs of types, where a type in hyperswitch_domain_models.router_response_types uses a type in common_enums.enums.
hyperswitch_domain_models.router_response_types uses common_enums.enums, so a change to common_enums.enums can break hyperswitch_domain_models.router_response_types, while a change to hyperswitch_domain_models.router_response_types can't break common_enums.enums.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
23→39 hyperswitch_domain_models.router_response_types uses api_models.paymentspart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_domain_models.router_response_types uses a type in api_models.payments.
hyperswitch_domain_models.router_response_types uses api_models.payments, so a change to api_models.payments can break hyperswitch_domain_models.router_response_types, while a change to hyperswitch_domain_models.router_response_types can't break api_models.payments.
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.
hyperswitch_interfaces.api.payments uses hyperswitch_connectors.connectors.authipay.transformers, so a change to hyperswitch_connectors.connectors.authipay.transformers can break hyperswitch_interfaces.api.payments, while a change to hyperswitch_interfaces.api.payments can't break hyperswitch_connectors.connectors.authipay.transformers.
Position
Below the diagonal: hyperswitch_interfaces.api.payments uses a module listed above it, which is the healthy direction.
24→35 hyperswitch_interfaces.api.payments uses hyperswitch_interfaces.apipart of a loop✕
Connections
38 pairs of types, where a type in hyperswitch_interfaces.api.payments uses a type in hyperswitch_interfaces.api. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
hyperswitch_interfaces.api.payments uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.payments, while a change to hyperswitch_interfaces.api.payments can't break hyperswitch_interfaces.api.
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.
hyperswitch_connectors.connectors.paypal.transformers uses common_utils.id_type.profile, so a change to common_utils.id_type.profile can break hyperswitch_connectors.connectors.paypal.transformers, while a change to hyperswitch_connectors.connectors.paypal.transformers can't break common_utils.id_type.profile.
Position
Below the diagonal: hyperswitch_connectors.connectors.paypal.transformers uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.paypal.transformers uses common_utils.types, so a change to common_utils.types can break hyperswitch_connectors.connectors.paypal.transformers, while a change to hyperswitch_connectors.connectors.paypal.transformers can't break common_utils.types.
Position
Below the diagonal: hyperswitch_connectors.connectors.paypal.transformers uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.paypal.transformers uses hyperswitch_domain_models.router_response_types, so a change to hyperswitch_domain_models.router_response_types can break hyperswitch_connectors.connectors.paypal.transformers, while a change to hyperswitch_connectors.connectors.paypal.transformers can't break hyperswitch_domain_models.router_response_types.
Position
Below the diagonal: hyperswitch_connectors.connectors.paypal.transformers uses a module listed above it, which is the healthy direction.
25→38 hyperswitch_connectors.connectors.paypal.transformers uses common_enums.enumspart of a loop✕
Connections
14 pairs of types, where a type in hyperswitch_connectors.connectors.paypal.transformers uses a type in common_enums.enums.
hyperswitch_connectors.connectors.paypal.transformers uses common_enums.enums, so a change to common_enums.enums can break hyperswitch_connectors.connectors.paypal.transformers, while a change to hyperswitch_connectors.connectors.paypal.transformers can't break common_enums.enums.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
25→39 hyperswitch_connectors.connectors.paypal.transformers uses api_models.paymentspart of a loop✕
Connections
13 pairs of types, where a type in hyperswitch_connectors.connectors.paypal.transformers uses a type in api_models.payments.
hyperswitch_connectors.connectors.paypal.transformers uses api_models.payments, so a change to api_models.payments can break hyperswitch_connectors.connectors.paypal.transformers, while a change to hyperswitch_connectors.connectors.paypal.transformers can't break api_models.payments.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
25→40 hyperswitch_connectors.connectors.paypal.transformers uses api_models.adminpart of a loop✕
Connections
2 pairs of types, where a type in hyperswitch_connectors.connectors.paypal.transformers uses a type in api_models.admin.
hyperswitch_connectors.connectors.paypal.transformers uses api_models.admin, so a change to api_models.admin can break hyperswitch_connectors.connectors.paypal.transformers, while a change to hyperswitch_connectors.connectors.paypal.transformers can't break api_models.admin.
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.
hyperswitch_interfaces.api.payments_v2 uses hyperswitch_interfaces.api.payments, so a change to hyperswitch_interfaces.api.payments can break hyperswitch_interfaces.api.payments_v2, while a change to hyperswitch_interfaces.api.payments_v2 can't break hyperswitch_interfaces.api.payments.
Position
Below the diagonal: hyperswitch_interfaces.api.payments_v2 uses a module listed above it, which is the healthy direction.
26→32 hyperswitch_interfaces.api.payments_v2 uses hyperswitch_interfaces.connector_integration_v2part of a loop✕
Connections
35 pairs of types, where a type in hyperswitch_interfaces.api.payments_v2 uses a type in hyperswitch_interfaces.connector_integration_v2. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
hyperswitch_interfaces.api.payments_v2 uses hyperswitch_interfaces.connector_integration_v2, so a change to hyperswitch_interfaces.connector_integration_v2 can break hyperswitch_interfaces.api.payments_v2, while a change to hyperswitch_interfaces.api.payments_v2 can't break hyperswitch_interfaces.connector_integration_v2.
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.
26→35 hyperswitch_interfaces.api.payments_v2 uses hyperswitch_interfaces.apipart of a loop✕
Connections
3 pairs of types, where a type in hyperswitch_interfaces.api.payments_v2 uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.payments_v2 uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.payments_v2, while a change to hyperswitch_interfaces.api.payments_v2 can't break hyperswitch_interfaces.api.
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.
diesel_models.fraud_check uses hyperswitch_connectors.connectors.paypal.transformers, so a change to hyperswitch_connectors.connectors.paypal.transformers can break diesel_models.fraud_check, while a change to diesel_models.fraud_check can't break hyperswitch_connectors.connectors.paypal.transformers.
Position
Below the diagonal: diesel_models.fraud_check uses a module listed above it, which is the healthy direction.
27→38 diesel_models.fraud_check uses common_enums.enumspart of a loop✕
Connections
6 pairs of types, where a type in diesel_models.fraud_check uses a type in common_enums.enums.
diesel_models.fraud_check uses common_enums.enums, so a change to common_enums.enums can break diesel_models.fraud_check, while a change to diesel_models.fraud_check can't break common_enums.enums.
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.
27→40 diesel_models.fraud_check uses api_models.adminpart of a loop✕
Connections
2 pairs of types, where a type in diesel_models.fraud_check uses a type in api_models.admin.
diesel_models.fraud_check uses api_models.admin, so a change to api_models.admin can break diesel_models.fraud_check, while a change to diesel_models.fraud_check can't break api_models.admin.
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.
hyperswitch_connectors.connectors.nmi.transformers uses common_utils.types, so a change to common_utils.types can break hyperswitch_connectors.connectors.nmi.transformers, while a change to hyperswitch_connectors.connectors.nmi.transformers can't break common_utils.types.
Position
Below the diagonal: hyperswitch_connectors.connectors.nmi.transformers uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in hyperswitch_connectors.connectors.nmi.transformers uses a type in hyperswitch_connectors.connectors.paypal.transformers.
hyperswitch_connectors.connectors.nmi.transformers uses hyperswitch_connectors.connectors.paypal.transformers, so a change to hyperswitch_connectors.connectors.paypal.transformers can break hyperswitch_connectors.connectors.nmi.transformers, while a change to hyperswitch_connectors.connectors.nmi.transformers can't break hyperswitch_connectors.connectors.paypal.transformers.
Position
Below the diagonal: hyperswitch_connectors.connectors.nmi.transformers uses a module listed above it, which is the healthy direction.
28→38 hyperswitch_connectors.connectors.nmi.transformers uses common_enums.enumspart of a loop✕
Connections
13 pairs of types, where a type in hyperswitch_connectors.connectors.nmi.transformers uses a type in common_enums.enums.
hyperswitch_connectors.connectors.nmi.transformers uses common_enums.enums, so a change to common_enums.enums can break hyperswitch_connectors.connectors.nmi.transformers, while a change to hyperswitch_connectors.connectors.nmi.transformers can't break common_enums.enums.
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.
28→39 hyperswitch_connectors.connectors.nmi.transformers uses api_models.paymentspart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_connectors.connectors.nmi.transformers uses a type in api_models.payments.
hyperswitch_connectors.connectors.nmi.transformers uses api_models.payments, so a change to api_models.payments can break hyperswitch_connectors.connectors.nmi.transformers, while a change to hyperswitch_connectors.connectors.nmi.transformers can't break api_models.payments.
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.
28→40 hyperswitch_connectors.connectors.nmi.transformers uses api_models.adminpart of a loop✕
Connections
2 pairs of types, where a type in hyperswitch_connectors.connectors.nmi.transformers uses a type in api_models.admin.
hyperswitch_connectors.connectors.nmi.transformers uses api_models.admin, so a change to api_models.admin can break hyperswitch_connectors.connectors.nmi.transformers, while a change to hyperswitch_connectors.connectors.nmi.transformers can't break api_models.admin.
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.
hyperswitch_connectors.connectors.worldline.transformers uses common_utils.types, so a change to common_utils.types can break hyperswitch_connectors.connectors.worldline.transformers, while a change to hyperswitch_connectors.connectors.worldline.transformers can't break common_utils.types.
Position
Below the diagonal: hyperswitch_connectors.connectors.worldline.transformers uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in hyperswitch_connectors.connectors.worldline.transformers uses a type in hyperswitch_connectors.connectors.paypal.transformers.
hyperswitch_connectors.connectors.worldline.transformers uses hyperswitch_connectors.connectors.paypal.transformers, so a change to hyperswitch_connectors.connectors.paypal.transformers can break hyperswitch_connectors.connectors.worldline.transformers, while a change to hyperswitch_connectors.connectors.worldline.transformers can't break hyperswitch_connectors.connectors.paypal.transformers.
Position
Below the diagonal: hyperswitch_connectors.connectors.worldline.transformers uses a module listed above it, which is the healthy direction.
29→38 hyperswitch_connectors.connectors.worldline.transformers uses common_enums.enumspart of a loop✕
Connections
5 pairs of types, where a type in hyperswitch_connectors.connectors.worldline.transformers uses a type in common_enums.enums.
hyperswitch_connectors.connectors.worldline.transformers uses common_enums.enums, so a change to common_enums.enums can break hyperswitch_connectors.connectors.worldline.transformers, while a change to hyperswitch_connectors.connectors.worldline.transformers can't break common_enums.enums.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
29→39 hyperswitch_connectors.connectors.worldline.transformers uses api_models.paymentspart of a loop✕
Connections
3 pairs of types, where a type in hyperswitch_connectors.connectors.worldline.transformers uses a type in api_models.payments.
hyperswitch_connectors.connectors.worldline.transformers uses api_models.payments, so a change to api_models.payments can break hyperswitch_connectors.connectors.worldline.transformers, while a change to hyperswitch_connectors.connectors.worldline.transformers can't break api_models.payments.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
29→40 hyperswitch_connectors.connectors.worldline.transformers uses api_models.adminpart of a loop✕
Connections
2 pairs of types, where a type in hyperswitch_connectors.connectors.worldline.transformers uses a type in api_models.admin.
hyperswitch_connectors.connectors.worldline.transformers uses api_models.admin, so a change to api_models.admin can break hyperswitch_connectors.connectors.worldline.transformers, while a change to hyperswitch_connectors.connectors.worldline.transformers can't break api_models.admin.
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.
1 pair of types, where a type in hyperswitch_interfaces.events.connector_api_logs uses a type in hyperswitch_connectors.connectors.paypal.transformers.
hyperswitch_interfaces.events.connector_api_logs uses hyperswitch_connectors.connectors.paypal.transformers, so a change to hyperswitch_connectors.connectors.paypal.transformers can break hyperswitch_interfaces.events.connector_api_logs, while a change to hyperswitch_interfaces.events.connector_api_logs can't break hyperswitch_connectors.connectors.paypal.transformers.
Position
Below the diagonal: hyperswitch_interfaces.events.connector_api_logs uses a module listed above it, which is the healthy direction.
30→38 hyperswitch_interfaces.events.connector_api_logs uses common_enums.enumspart of a loop✕
Connections
3 pairs of types, where a type in hyperswitch_interfaces.events.connector_api_logs uses a type in common_enums.enums.
hyperswitch_interfaces.events.connector_api_logs uses common_enums.enums, so a change to common_enums.enums can break hyperswitch_interfaces.events.connector_api_logs, while a change to hyperswitch_interfaces.events.connector_api_logs can't break common_enums.enums.
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.
30→40 hyperswitch_interfaces.events.connector_api_logs uses api_models.adminpart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_interfaces.events.connector_api_logs uses a type in api_models.admin.
hyperswitch_interfaces.events.connector_api_logs uses api_models.admin, so a change to api_models.admin can break hyperswitch_interfaces.events.connector_api_logs, while a change to hyperswitch_interfaces.events.connector_api_logs can't break api_models.admin.
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.
router.routes.app uses common_utils.id_type.profile, so a change to common_utils.id_type.profile can break router.routes.app, while a change to router.routes.app can't break common_utils.id_type.profile.
Position
Below the diagonal: router.routes.app uses a module listed above it, which is the healthy direction.
router.routes.app uses hyperswitch_domain_models.connector_endpoints, so a change to hyperswitch_domain_models.connector_endpoints can break router.routes.app, while a change to router.routes.app can't break hyperswitch_domain_models.connector_endpoints.
Position
Below the diagonal: router.routes.app uses a module listed above it, which is the healthy direction.
router.routes.app uses hyperswitch_connectors.connectors.paypal.transformers, so a change to hyperswitch_connectors.connectors.paypal.transformers can break router.routes.app, while a change to router.routes.app can't break hyperswitch_connectors.connectors.paypal.transformers.
Position
Below the diagonal: router.routes.app uses a module listed above it, which is the healthy direction.
31→38 router.routes.app uses common_enums.enumspart of a loop✕
Connections
4 pairs of types, where a type in router.routes.app uses a type in common_enums.enums.
router.routes.app uses common_enums.enums, so a change to common_enums.enums can break router.routes.app, while a change to router.routes.app can't break common_enums.enums.
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.
hyperswitch_interfaces.connector_integration_v2 uses common_utils.types, so a change to common_utils.types can break hyperswitch_interfaces.connector_integration_v2, while a change to hyperswitch_interfaces.connector_integration_v2 can't break common_utils.types.
Position
Below the diagonal: hyperswitch_interfaces.connector_integration_v2 uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.connector_integration_v2 uses hyperswitch_interfaces.api.fraud_check_v2, so a change to hyperswitch_interfaces.api.fraud_check_v2 can break hyperswitch_interfaces.connector_integration_v2, while a change to hyperswitch_interfaces.connector_integration_v2 can't break hyperswitch_interfaces.api.fraud_check_v2.
Position
Below the diagonal: hyperswitch_interfaces.connector_integration_v2 uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.connector_integration_v2 uses hyperswitch_interfaces.api.payouts_v2, so a change to hyperswitch_interfaces.api.payouts_v2 can break hyperswitch_interfaces.connector_integration_v2, while a change to hyperswitch_interfaces.connector_integration_v2 can't break hyperswitch_interfaces.api.payouts_v2.
Position
Below the diagonal: hyperswitch_interfaces.connector_integration_v2 uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.connector_integration_v2 uses hyperswitch_interfaces.api.refunds_v2, so a change to hyperswitch_interfaces.api.refunds_v2 can break hyperswitch_interfaces.connector_integration_v2, while a change to hyperswitch_interfaces.connector_integration_v2 can't break hyperswitch_interfaces.api.refunds_v2.
Position
Below the diagonal: hyperswitch_interfaces.connector_integration_v2 uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.connector_integration_v2 uses hyperswitch_interfaces.api.vault_v2, so a change to hyperswitch_interfaces.api.vault_v2 can break hyperswitch_interfaces.connector_integration_v2, while a change to hyperswitch_interfaces.connector_integration_v2 can't break hyperswitch_interfaces.api.vault_v2.
Position
Below the diagonal: hyperswitch_interfaces.connector_integration_v2 uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.connector_integration_v2 uses hyperswitch_interfaces.api.files_v2, so a change to hyperswitch_interfaces.api.files_v2 can break hyperswitch_interfaces.connector_integration_v2, while a change to hyperswitch_interfaces.connector_integration_v2 can't break hyperswitch_interfaces.api.files_v2.
Position
Below the diagonal: hyperswitch_interfaces.connector_integration_v2 uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.connector_integration_v2 uses hyperswitch_interfaces.webhooks, so a change to hyperswitch_interfaces.webhooks can break hyperswitch_interfaces.connector_integration_v2, while a change to hyperswitch_interfaces.connector_integration_v2 can't break hyperswitch_interfaces.webhooks.
Position
Below the diagonal: hyperswitch_interfaces.connector_integration_v2 uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.connector_integration_v2 uses hyperswitch_interfaces.api.payments_v2, so a change to hyperswitch_interfaces.api.payments_v2 can break hyperswitch_interfaces.connector_integration_v2, while a change to hyperswitch_interfaces.connector_integration_v2 can't break hyperswitch_interfaces.api.payments_v2.
Position
Below the diagonal: hyperswitch_interfaces.connector_integration_v2 uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.connector_integration_v2 uses hyperswitch_connectors.connectors.nmi.transformers, so a change to hyperswitch_connectors.connectors.nmi.transformers can break hyperswitch_interfaces.connector_integration_v2, while a change to hyperswitch_interfaces.connector_integration_v2 can't break hyperswitch_connectors.connectors.nmi.transformers.
Position
Below the diagonal: hyperswitch_interfaces.connector_integration_v2 uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.connector_integration_v2 uses hyperswitch_interfaces.events.connector_api_logs, so a change to hyperswitch_interfaces.events.connector_api_logs can break hyperswitch_interfaces.connector_integration_v2, while a change to hyperswitch_interfaces.connector_integration_v2 can't break hyperswitch_interfaces.events.connector_api_logs.
Position
Below the diagonal: hyperswitch_interfaces.connector_integration_v2 uses a module listed above it, which is the healthy direction.
32→33 hyperswitch_interfaces.connector_integration_v2 uses hyperswitch_interfaces.api.disputes_v2part of a loop✕
Connections
1 pair of types, where a type in hyperswitch_interfaces.connector_integration_v2 uses a type in hyperswitch_interfaces.api.disputes_v2.
hyperswitch_interfaces.connector_integration_v2 uses hyperswitch_interfaces.api.disputes_v2, so a change to hyperswitch_interfaces.api.disputes_v2 can break hyperswitch_interfaces.connector_integration_v2, while a change to hyperswitch_interfaces.connector_integration_v2 can't break hyperswitch_interfaces.api.disputes_v2.
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.
32→35 hyperswitch_interfaces.connector_integration_v2 uses hyperswitch_interfaces.apipart of a loop✕
Connections
7 pairs of types, where a type in hyperswitch_interfaces.connector_integration_v2 uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.connector_integration_v2 uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.connector_integration_v2, while a change to hyperswitch_interfaces.connector_integration_v2 can't break hyperswitch_interfaces.api.
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.
hyperswitch_interfaces.api.disputes_v2 uses hyperswitch_interfaces.connector_integration_v2, so a change to hyperswitch_interfaces.connector_integration_v2 can break hyperswitch_interfaces.api.disputes_v2, while a change to hyperswitch_interfaces.api.disputes_v2 can't break hyperswitch_interfaces.connector_integration_v2.
Position
Below the diagonal: hyperswitch_interfaces.api.disputes_v2 uses a module listed above it, which is the healthy direction.
33→35 hyperswitch_interfaces.api.disputes_v2 uses hyperswitch_interfaces.apipart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_interfaces.api.disputes_v2 uses a type in hyperswitch_interfaces.api.
hyperswitch_interfaces.api.disputes_v2 uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_interfaces.api.disputes_v2, while a change to hyperswitch_interfaces.api.disputes_v2 can't break hyperswitch_interfaces.api.
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.
1 pair of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_domain_models.connector_endpoints.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_domain_models.connector_endpoints, so a change to hyperswitch_domain_models.connector_endpoints can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_domain_models.connector_endpoints.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.unified_authentication_service uses common_utils.types, so a change to common_utils.types can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break common_utils.types.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
5 pairs of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_interfaces.api.authentication.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.authentication, so a change to hyperswitch_interfaces.api.authentication can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.authentication.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.disputes, so a change to hyperswitch_interfaces.api.disputes can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.disputes.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.files, so a change to hyperswitch_interfaces.api.files can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.files.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
6 pairs of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_interfaces.api.fraud_check.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.fraud_check, so a change to hyperswitch_interfaces.api.fraud_check can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.fraud_check.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
7 pairs of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_interfaces.api.fraud_check_v2.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.fraud_check_v2, so a change to hyperswitch_interfaces.api.fraud_check_v2 can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.fraud_check_v2.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_interfaces.api.merchant_connector_webhook_management.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.merchant_connector_webhook_management, so a change to hyperswitch_interfaces.api.merchant_connector_webhook_management can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.merchant_connector_webhook_management.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.payouts, so a change to hyperswitch_interfaces.api.payouts can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.payouts.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
8 pairs of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_interfaces.api.payouts_v2.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.payouts_v2, so a change to hyperswitch_interfaces.api.payouts_v2 can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.payouts_v2.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.refunds, so a change to hyperswitch_interfaces.api.refunds can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.refunds.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
4 pairs of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_interfaces.api.refunds_v2.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.refunds_v2, so a change to hyperswitch_interfaces.api.refunds_v2 can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.refunds_v2.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
5 pairs of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_interfaces.api.revenue_recovery.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.revenue_recovery, so a change to hyperswitch_interfaces.api.revenue_recovery can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.revenue_recovery.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.vault, so a change to hyperswitch_interfaces.api.vault can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.vault.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.vault_v2, so a change to hyperswitch_interfaces.api.vault_v2 can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.vault_v2.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.unified_authentication_service uses diesel_models.dispute, so a change to diesel_models.dispute can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break diesel_models.dispute.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.unified_authentication_service uses diesel_models.payouts, so a change to diesel_models.payouts can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break diesel_models.payouts.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.unified_authentication_service uses diesel_models.refund, so a change to diesel_models.refund can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break diesel_models.refund.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_connectors.connectors.authipay.transformers.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_connectors.connectors.authipay.transformers, so a change to hyperswitch_connectors.connectors.authipay.transformers can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_connectors.connectors.authipay.transformers.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.files_v2, so a change to hyperswitch_interfaces.api.files_v2 can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.files_v2.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.webhooks, so a change to hyperswitch_interfaces.webhooks can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.webhooks.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
31 pairs of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_interfaces.api.payments. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.payments, so a change to hyperswitch_interfaces.api.payments can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.payments.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_connectors.connectors.paypal.transformers.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_connectors.connectors.paypal.transformers, so a change to hyperswitch_connectors.connectors.paypal.transformers can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_connectors.connectors.paypal.transformers.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_interfaces.api.payments_v2.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.payments_v2, so a change to hyperswitch_interfaces.api.payments_v2 can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.payments_v2.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.unified_authentication_service uses diesel_models.fraud_check, so a change to diesel_models.fraud_check can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break diesel_models.fraud_check.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_connectors.connectors.nmi.transformers.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_connectors.connectors.nmi.transformers, so a change to hyperswitch_connectors.connectors.nmi.transformers can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_connectors.connectors.nmi.transformers.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_connectors.connectors.worldline.transformers.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_connectors.connectors.worldline.transformers, so a change to hyperswitch_connectors.connectors.worldline.transformers can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_connectors.connectors.worldline.transformers.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_interfaces.events.connector_api_logs.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.events.connector_api_logs, so a change to hyperswitch_interfaces.events.connector_api_logs can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.events.connector_api_logs.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_interfaces.connector_integration_v2.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.connector_integration_v2, so a change to hyperswitch_interfaces.connector_integration_v2 can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.connector_integration_v2.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
6 pairs of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_interfaces.api.disputes_v2.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api.disputes_v2, so a change to hyperswitch_interfaces.api.disputes_v2 can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.disputes_v2.
Position
Below the diagonal: hyperswitch_connectors.connectors.unified_authentication_service uses a module listed above it, which is the healthy direction.
34→35 hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.apipart of a loop✕
Connections
20 pairs of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_interfaces.api.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_interfaces.api.
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.
34→36 hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_connectors.utilspart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_connectors.utils.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_connectors.utils, so a change to hyperswitch_connectors.utils can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_connectors.utils.
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.
34→37 hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_connectors.connectors.adyen.transformerspart of a loop✕
Connections
2 pairs of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in hyperswitch_connectors.connectors.adyen.transformers.
hyperswitch_connectors.connectors.unified_authentication_service uses hyperswitch_connectors.connectors.adyen.transformers, so a change to hyperswitch_connectors.connectors.adyen.transformers can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break hyperswitch_connectors.connectors.adyen.transformers.
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.
34→38 hyperswitch_connectors.connectors.unified_authentication_service uses common_enums.enumspart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_connectors.connectors.unified_authentication_service uses a type in common_enums.enums.
hyperswitch_connectors.connectors.unified_authentication_service uses common_enums.enums, so a change to common_enums.enums can break hyperswitch_connectors.connectors.unified_authentication_service, while a change to hyperswitch_connectors.connectors.unified_authentication_service can't break common_enums.enums.
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.
hyperswitch_interfaces.api uses hyperswitch_domain_models.connector_endpoints, so a change to hyperswitch_domain_models.connector_endpoints can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_domain_models.connector_endpoints.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses common_utils.types, so a change to common_utils.types can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break common_utils.types.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses hyperswitch_interfaces.api.authentication, so a change to hyperswitch_interfaces.api.authentication can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_interfaces.api.authentication.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses hyperswitch_interfaces.api.files, so a change to hyperswitch_interfaces.api.files can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_interfaces.api.files.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses hyperswitch_interfaces.api.merchant_connector_webhook_management, so a change to hyperswitch_interfaces.api.merchant_connector_webhook_management can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_interfaces.api.merchant_connector_webhook_management.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses hyperswitch_interfaces.api.revenue_recovery, so a change to hyperswitch_interfaces.api.revenue_recovery can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_interfaces.api.revenue_recovery.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses hyperswitch_interfaces.api.vault, so a change to hyperswitch_interfaces.api.vault can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_interfaces.api.vault.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses diesel_models.dispute, so a change to diesel_models.dispute can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break diesel_models.dispute.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses diesel_models.payouts, so a change to diesel_models.payouts can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break diesel_models.payouts.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses diesel_models.refund, so a change to diesel_models.refund can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break diesel_models.refund.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses hyperswitch_interfaces.webhooks, so a change to hyperswitch_interfaces.webhooks can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_interfaces.webhooks.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses hyperswitch_domain_models.router_response_types, so a change to hyperswitch_domain_models.router_response_types can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_domain_models.router_response_types.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses hyperswitch_interfaces.api.payments, so a change to hyperswitch_interfaces.api.payments can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_interfaces.api.payments.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses hyperswitch_connectors.connectors.paypal.transformers, so a change to hyperswitch_connectors.connectors.paypal.transformers can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_connectors.connectors.paypal.transformers.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses diesel_models.fraud_check, so a change to diesel_models.fraud_check can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break diesel_models.fraud_check.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses hyperswitch_connectors.connectors.nmi.transformers, so a change to hyperswitch_connectors.connectors.nmi.transformers can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_connectors.connectors.nmi.transformers.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses hyperswitch_connectors.connectors.worldline.transformers, so a change to hyperswitch_connectors.connectors.worldline.transformers can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_connectors.connectors.worldline.transformers.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses hyperswitch_interfaces.events.connector_api_logs, so a change to hyperswitch_interfaces.events.connector_api_logs can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_interfaces.events.connector_api_logs.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses hyperswitch_interfaces.connector_integration_v2, so a change to hyperswitch_interfaces.connector_integration_v2 can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_interfaces.connector_integration_v2.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
hyperswitch_interfaces.api uses hyperswitch_connectors.connectors.unified_authentication_service, so a change to hyperswitch_connectors.connectors.unified_authentication_service can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_connectors.connectors.unified_authentication_service.
Position
Below the diagonal: hyperswitch_interfaces.api uses a module listed above it, which is the healthy direction.
35→36 hyperswitch_interfaces.api uses hyperswitch_connectors.utilspart of a loop✕
Connections
2 pairs of types, where a type in hyperswitch_interfaces.api uses a type in hyperswitch_connectors.utils.
hyperswitch_interfaces.api uses hyperswitch_connectors.utils, so a change to hyperswitch_connectors.utils can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_connectors.utils.
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.
35→37 hyperswitch_interfaces.api uses hyperswitch_connectors.connectors.adyen.transformerspart of a loop✕
Connections
1 pair of types, where a type in hyperswitch_interfaces.api uses a type in hyperswitch_connectors.connectors.adyen.transformers.
hyperswitch_interfaces.api uses hyperswitch_connectors.connectors.adyen.transformers, so a change to hyperswitch_connectors.connectors.adyen.transformers can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break hyperswitch_connectors.connectors.adyen.transformers.
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.
35→38 hyperswitch_interfaces.api uses common_enums.enumspart of a loop✕
Connections
11 pairs of types, where a type in hyperswitch_interfaces.api uses a type in common_enums.enums.
hyperswitch_interfaces.api uses common_enums.enums, so a change to common_enums.enums can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break common_enums.enums.
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.
35→40 hyperswitch_interfaces.api uses api_models.adminpart of a loop✕
Connections
3 pairs of types, where a type in hyperswitch_interfaces.api uses a type in api_models.admin.
hyperswitch_interfaces.api uses api_models.admin, so a change to api_models.admin can break hyperswitch_interfaces.api, while a change to hyperswitch_interfaces.api can't break api_models.admin.
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.
hyperswitch_connectors.utils uses common_utils.types, so a change to common_utils.types can break hyperswitch_connectors.utils, while a change to hyperswitch_connectors.utils can't break common_utils.types.
Position
Below the diagonal: hyperswitch_connectors.utils uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.utils uses hyperswitch_connectors.connectors.paypal.transformers, so a change to hyperswitch_connectors.connectors.paypal.transformers can break hyperswitch_connectors.utils, while a change to hyperswitch_connectors.utils can't break hyperswitch_connectors.connectors.paypal.transformers.
Position
Below the diagonal: hyperswitch_connectors.utils uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.utils uses hyperswitch_connectors.connectors.nmi.transformers, so a change to hyperswitch_connectors.connectors.nmi.transformers can break hyperswitch_connectors.utils, while a change to hyperswitch_connectors.utils can't break hyperswitch_connectors.connectors.nmi.transformers.
Position
Below the diagonal: hyperswitch_connectors.utils uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.utils uses hyperswitch_interfaces.api, so a change to hyperswitch_interfaces.api can break hyperswitch_connectors.utils, while a change to hyperswitch_connectors.utils can't break hyperswitch_interfaces.api.
Position
Below the diagonal: hyperswitch_connectors.utils uses a module listed above it, which is the healthy direction.
36→38 hyperswitch_connectors.utils uses common_enums.enumspart of a loop✕
Connections
13 pairs of types, where a type in hyperswitch_connectors.utils uses a type in common_enums.enums.
hyperswitch_connectors.utils uses common_enums.enums, so a change to common_enums.enums can break hyperswitch_connectors.utils, while a change to hyperswitch_connectors.utils can't break common_enums.enums.
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.
36→39 hyperswitch_connectors.utils uses api_models.paymentspart of a loop✕
Connections
14 pairs of types, where a type in hyperswitch_connectors.utils uses a type in api_models.payments.
hyperswitch_connectors.utils uses api_models.payments, so a change to api_models.payments can break hyperswitch_connectors.utils, while a change to hyperswitch_connectors.utils can't break api_models.payments.
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.
hyperswitch_connectors.connectors.adyen.transformers uses common_utils.types, so a change to common_utils.types can break hyperswitch_connectors.connectors.adyen.transformers, while a change to hyperswitch_connectors.connectors.adyen.transformers can't break common_utils.types.
Position
Below the diagonal: hyperswitch_connectors.connectors.adyen.transformers uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.adyen.transformers uses hyperswitch_domain_models.router_response_types, so a change to hyperswitch_domain_models.router_response_types can break hyperswitch_connectors.connectors.adyen.transformers, while a change to hyperswitch_connectors.connectors.adyen.transformers can't break hyperswitch_domain_models.router_response_types.
Position
Below the diagonal: hyperswitch_connectors.connectors.adyen.transformers uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in hyperswitch_connectors.connectors.adyen.transformers uses a type in hyperswitch_connectors.connectors.paypal.transformers.
hyperswitch_connectors.connectors.adyen.transformers uses hyperswitch_connectors.connectors.paypal.transformers, so a change to hyperswitch_connectors.connectors.paypal.transformers can break hyperswitch_connectors.connectors.adyen.transformers, while a change to hyperswitch_connectors.connectors.adyen.transformers can't break hyperswitch_connectors.connectors.paypal.transformers.
Position
Below the diagonal: hyperswitch_connectors.connectors.adyen.transformers uses a module listed above it, which is the healthy direction.
hyperswitch_connectors.connectors.adyen.transformers uses hyperswitch_connectors.utils, so a change to hyperswitch_connectors.utils can break hyperswitch_connectors.connectors.adyen.transformers, while a change to hyperswitch_connectors.connectors.adyen.transformers can't break hyperswitch_connectors.utils.
Position
Below the diagonal: hyperswitch_connectors.connectors.adyen.transformers uses a module listed above it, which is the healthy direction.
37→38 hyperswitch_connectors.connectors.adyen.transformers uses common_enums.enumspart of a loop✕
Connections
38 pairs of types, where a type in hyperswitch_connectors.connectors.adyen.transformers uses a type in common_enums.enums. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
hyperswitch_connectors.connectors.adyen.transformers uses common_enums.enums, so a change to common_enums.enums can break hyperswitch_connectors.connectors.adyen.transformers, while a change to hyperswitch_connectors.connectors.adyen.transformers can't break common_enums.enums.
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.
37→39 hyperswitch_connectors.connectors.adyen.transformers uses api_models.paymentspart of a loop✕
Connections
28 pairs of types, where a type in hyperswitch_connectors.connectors.adyen.transformers uses a type in api_models.payments. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
hyperswitch_connectors.connectors.adyen.transformers uses api_models.payments, so a change to api_models.payments can break hyperswitch_connectors.connectors.adyen.transformers, while a change to hyperswitch_connectors.connectors.adyen.transformers can't break api_models.payments.
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.
37→40 hyperswitch_connectors.connectors.adyen.transformers uses api_models.adminpart of a loop✕
Connections
2 pairs of types, where a type in hyperswitch_connectors.connectors.adyen.transformers uses a type in api_models.admin.
hyperswitch_connectors.connectors.adyen.transformers uses api_models.admin, so a change to api_models.admin can break hyperswitch_connectors.connectors.adyen.transformers, while a change to hyperswitch_connectors.connectors.adyen.transformers can't break api_models.admin.
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.
common_enums.enums uses hyperswitch_connectors.connectors.authipay.transformers, so a change to hyperswitch_connectors.connectors.authipay.transformers can break common_enums.enums, while a change to common_enums.enums can't break hyperswitch_connectors.connectors.authipay.transformers.
Position
Below the diagonal: common_enums.enums uses a module listed above it, which is the healthy direction.
common_enums.enums uses hyperswitch_connectors.connectors.paypal.transformers, so a change to hyperswitch_connectors.connectors.paypal.transformers can break common_enums.enums, while a change to common_enums.enums can't break hyperswitch_connectors.connectors.paypal.transformers.
Position
Below the diagonal: common_enums.enums uses a module listed above it, which is the healthy direction.
common_enums.enums uses hyperswitch_connectors.connectors.nmi.transformers, so a change to hyperswitch_connectors.connectors.nmi.transformers can break common_enums.enums, while a change to common_enums.enums can't break hyperswitch_connectors.connectors.nmi.transformers.
Position
Below the diagonal: common_enums.enums uses a module listed above it, which is the healthy direction.
common_enums.enums uses router.routes.app, so a change to router.routes.app can break common_enums.enums, while a change to common_enums.enums can't break router.routes.app.
Position
Below the diagonal: common_enums.enums uses a module listed above it, which is the healthy direction.
common_enums.enums uses hyperswitch_connectors.connectors.adyen.transformers, so a change to hyperswitch_connectors.connectors.adyen.transformers can break common_enums.enums, while a change to common_enums.enums can't break hyperswitch_connectors.connectors.adyen.transformers.
Position
Below the diagonal: common_enums.enums uses a module listed above it, which is the healthy direction.
38→39 common_enums.enums uses api_models.paymentspart of a loop✕
Connections
1 pair of types, where a type in common_enums.enums uses a type in api_models.payments.
common_enums.enums uses api_models.payments, so a change to api_models.payments can break common_enums.enums, while a change to common_enums.enums can't break api_models.payments.
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.
38→40 common_enums.enums uses api_models.adminpart of a loop✕
Connections
1 pair of types, where a type in common_enums.enums uses a type in api_models.admin.
common_enums.enums uses api_models.admin, so a change to api_models.admin can break common_enums.enums, while a change to common_enums.enums can't break api_models.admin.
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.
api_models.payments uses common_utils.id_type.profile, so a change to common_utils.id_type.profile can break api_models.payments, while a change to api_models.payments can't break common_utils.id_type.profile.
Position
Below the diagonal: api_models.payments uses a module listed above it, which is the healthy direction.
87 pairs of types, where a type in api_models.payments uses a type in common_utils.types. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
api_models.payments uses common_utils.types, so a change to common_utils.types can break api_models.payments, while a change to api_models.payments can't break common_utils.types.
Position
Below the diagonal: api_models.payments uses a module listed above it, which is the healthy direction.
api_models.payments uses hyperswitch_connectors.connectors.paypal.transformers, so a change to hyperswitch_connectors.connectors.paypal.transformers can break api_models.payments, while a change to api_models.payments can't break hyperswitch_connectors.connectors.paypal.transformers.
Position
Below the diagonal: api_models.payments uses a module listed above it, which is the healthy direction.
api_models.payments uses diesel_models.fraud_check, so a change to diesel_models.fraud_check can break api_models.payments, while a change to api_models.payments can't break diesel_models.fraud_check.
Position
Below the diagonal: api_models.payments uses a module listed above it, which is the healthy direction.
api_models.payments uses hyperswitch_connectors.utils, so a change to hyperswitch_connectors.utils can break api_models.payments, while a change to api_models.payments can't break hyperswitch_connectors.utils.
Position
Below the diagonal: api_models.payments uses a module listed above it, which is the healthy direction.
293 pairs of types, where a type in api_models.payments uses a type in common_enums.enums. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
api_models.payments uses common_enums.enums, so a change to common_enums.enums can break api_models.payments, while a change to api_models.payments can't break common_enums.enums.
Position
Below the diagonal: api_models.payments uses a module listed above it, which is the healthy direction.
39→40 api_models.payments uses api_models.adminpart of a loop✕
Connections
31 pairs of types, where a type in api_models.payments uses a type in api_models.admin. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
api_models.payments uses api_models.admin, so a change to api_models.admin can break api_models.payments, while a change to api_models.payments can't break api_models.admin.
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.
api_models.admin uses common_utils.id_type.profile, so a change to common_utils.id_type.profile can break api_models.admin, while a change to api_models.admin can't break common_utils.id_type.profile.
Position
Below the diagonal: api_models.admin uses a module listed above it, which is the healthy direction.
api_models.admin uses common_utils.types, so a change to common_utils.types can break api_models.admin, while a change to api_models.admin can't break common_utils.types.
Position
Below the diagonal: api_models.admin uses a module listed above it, which is the healthy direction.
api_models.admin uses hyperswitch_connectors.connectors.authipay.transformers, so a change to hyperswitch_connectors.connectors.authipay.transformers can break api_models.admin, while a change to api_models.admin can't break hyperswitch_connectors.connectors.authipay.transformers.
Position
Below the diagonal: api_models.admin uses a module listed above it, which is the healthy direction.
api_models.admin uses hyperswitch_connectors.connectors.paypal.transformers, so a change to hyperswitch_connectors.connectors.paypal.transformers can break api_models.admin, while a change to api_models.admin can't break hyperswitch_connectors.connectors.paypal.transformers.
Position
Below the diagonal: api_models.admin uses a module listed above it, which is the healthy direction.
api_models.admin uses router.routes.app, so a change to router.routes.app can break api_models.admin, while a change to api_models.admin can't break router.routes.app.
Position
Below the diagonal: api_models.admin uses a module listed above it, which is the healthy direction.
29 pairs of types, where a type in api_models.admin uses a type in common_enums.enums. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
api_models.admin uses common_enums.enums, so a change to common_enums.enums can break api_models.admin, while a change to api_models.admin can't break common_enums.enums.
Position
Below the diagonal: api_models.admin uses a module listed above it, which is the healthy direction.
api_models.admin uses api_models.payments, so a change to api_models.payments can break api_models.admin, while a change to api_models.admin can't break api_models.payments.
Position
Below the diagonal: api_models.admin uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 49% · Weak · gated by R1 ·
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
1807
High / Critical
A03:2025 — Software Supply Chain Failures
127
High / Critical
A07:2025 — Authentication Failures
119
High / Critical
A02:2025 — Security Misconfiguration
102
High / Critical
Roadmap
First, ensure all form controls and buttons have proper programmatic labels and that custom interactive elements are fully keyboard-operable with correct semantics. Next, address visual and motion safety by maintaining visible focus styles, respecting reduced motion preferences, and improving color contrast ratios. Finally, enforce accessibility standards by integrating automated checks into your CI pipeline and correcting page structure issues such as missing landmarks, titles, and language attributes.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Enforce accessibility in the toolchain: add an accessibility check that can read your UI — no component framework was detected and your pages are rendered by server-side templates, which neither the JSX/Vue ESLint plugins nor the HTML-template linters can parse; run axe/pa11y over the rendered pages, or assert the accessibility invariants over that rendered HTML in the test suite you already have, then assert with cypress-axe in tests, then gate axe/pa11y/Lighthouse in CI.
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 — 2042
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 — 5776
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 — 1980
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 12
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. 92 of 92 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 92 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, 9685 of 9798 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: the JavaScript/TypeScript half could not be measured — the JavaScript/TypeScript suite(s) run through a browser-driven runner the coverage collector does not drive — cypress-tests/ (cypress), cypress-tests-v2/ (cypress) — a gap in the analyzer, not something this repository is missing. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo — a coverage step in CI (`grcov .`) shows coverage is measured in your own CI. Commit the lcov/Cobertura report it produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and the real number is read on the next scan.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 1,655 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 206 test source file(s) (.rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.rs, .js, .ts) and this repository declares a Cargo test suite (repository root, 321 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 package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
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.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
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. `crates/router/src/core/payments.rs`, `crates/router/src/core/payments/routing.rs` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D44 Platform End-of-Life — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a REDACTED) is simply not read here yet.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 18 — an image could not be pulled) — poststart-hook Error context canceled superposition-init Error context canceled migration_runner Error context canceled hyperswitch-server Error context canceled hyperswitch-web Error context canceled hyperswitch-control-center Error context canceled superposition Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: superposition Error context canceled redis-standalone Error context canceled migration_runner Error context canceled superposition-init Error Get "https://registry-1.docker.io/v2/": Forbidden hyperswitch-server Error context canceled hyperswitch-control-center Error context canceled hyperswitch-web Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped.
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 Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — 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 Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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.
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. 673 further occurrence(s) are not listed individually; the score already reflects all 713.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Rust 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.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
C3 Audit Trail: This control is scored from in-repo evidence only — a working control configured outside the repository leaves no signal a static scan can credit.
C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
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.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
129 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ConnectorSpecificConfig::foreign_try_from at 220. A further 191 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 BankNames::foreign_try_from at 685 — they are counted neither in the figure above nor in this dimension's score. 68 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: crates/router/src/core/unified_connector_service/transformers.rs (BankNames::foreign_try_from at 685), crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs (BankNames::foreign_try_from at 651), crates/common_enums/src/transformers.rs (Country::from_numeric at 250), crates/kgraph_utils/src/transformers.rs (kgraph_utils::transformers::get_dir_country_dir_value at 249), crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs (ZslResponseStatus::try_from at 193), and 63 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.
+ 55 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with ConnectorSpecificConfig::foreign_try_from (cyclomatic 220), PaymentMethodDataType::from (cyclomatic 135), router::core::unified_connector_service::build_unified_connector_service_payment_method (cyclomatic 104). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cyclomatic Complexity from 5.2 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 75 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 120 down to 120 or less in Cognitive Complexity — start with router::core::payments::tokenization::save_payment_method (cognitive 188), ConnectorApiIntegrationPayload::get_transformed_response_payload (cognitive 181), router::core::payment_methods::cards::build_merchant_enabled_pms_context (cognitive 172). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cognitive Complexity from 5.4 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.3 / 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 386 FileTooLong finding(s) in God Classes — start with REDACTED (77), utils.rs (11), REDACTED (6). — One of this dimension's main actionable groups (386 warning-level).
Resolve the 308 MethodTooLong finding(s) in God Classes — start with REDACTED (90), payment_attempt.rs (14), REDACTED (11). — One of this dimension's main actionable groups (308 warning-level).
Resolve the 284 FunctionTooLong finding(s) in God Classes — start with helpers.rs (23), REDACTED (23), utils.rs (23). — One of this dimension's main actionable groups (284 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
2985 duplicated block group(s) detected. A further 315 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 673 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 133 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with REDACTED (30), helpers.rs (7), REDACTED (6). — One of this dimension's main actionable groups (133 warning-level).
Resolve the 130 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with REDACTED (23), utils.rs (15), REDACTED (11). — One of this dimension's main actionable groups (130 warning-level).
Resolve the 127 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with REDACTED (32), REDACTED (6), REDACTED (5). — One of this dimension's main actionable groups (127 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling7.7 / 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.
41 production modules (Cargo), 0 dependency cycle(s), 4 unstable depended-on module(s). Read from the build's own module declarations; 9 module(s) off the main sequence, with abstractness counted on 37 of the 41 (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: card_metadata · ×7
Unstable project analytics
Unstable project hyperswitch_connectors
Unstable project payment_methods
Unstable project subscriptions
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 7 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 1 Unstable project analytics finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project hyperswitch_connectors finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — 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.
Low cohesion: Store (LCOM4 258) · ×98crates/drainer/src/services.rs:12
What to do
Resolve the 98 Low cohesion finding(s) in Cohesion (LCOM4) — start with REDACTED (2), payment_attempt.rs (2), services.rs. — One of this dimension's main actionable groups (98 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
Classify ADR enforcement: Hyperswitch RFC Process · ×2docs/rfcs/guidelines.md
What to do
Resolve the 2 Classify ADR enforcement finding(s) in Architectural Integrity — start with guidelines.md, 001-compile-time-perf.md. — One of this dimension's main actionable groups (2 recommendation-level).
Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d7_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution5.3 / 10Adequate✓ 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.
5175 test methods: 785 unit, 2735 integration, 0 BDD, 1655 e2e. The JavaScript/TypeScript suite contributes 1655 `it`/`test` case(s) across 154 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 3520 `#[test]` function(s) across 321 file(s) declaring at least one; its unit/integration split is Cargo's own — 187 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.
Inverted test pyramid
What to do
Resolve the 1 Inverted test pyramid finding(s) in Test Distribution. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d9_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Stronggated by 3 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
27 skipped (24 with a documented reason), 1602 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1655 tests (2 harness-style project(s) excluded from the assertion penalty). Measured on the JavaScript/TypeScript suite only — at least 206 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.
Resolve the 1602 No direct assertions finding(s) in Test Quality — start with 19-Wallet.cy.js (75), 25-ConnectorAgnosticNTID.cy.js (60), 0001-UCSComprehensiveTest.cy.js (57). — One of this dimension's main actionable groups (1602 recommendation-level).
Resolve the 3 Skipped test finding(s) in Test Quality — start with 00005-DynamicRouting.cy.js (2), 00003-OidcRouteMismatch.cy.js. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 Test project verifies nothing finding(s) in Test Quality — start with 0000-Coreflows.cy.js. — One of this dimension's main actionable groups (1 recommendation-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
74 outdated, 0 yanked direct Cargo dependencies. 171 of 173 direct crates were graded against crates.io (0 not published there, 2 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: actix-http · ×74
What to do
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 94 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (40), REDACTED (8), REDACTED (7). — One of this dimension's main actionable groups (94 issue-level).
Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 1067 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 17 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 package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: crates/router/src/core/unified_connector_service/transformers.rs (69×685=47265); crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs (22×651=14322); crates/common_enums/src/enums.rs (46×127=5842) Repeated repair below the complexity floor: crates/hyperswitch_connectors/src/connectors/zift/transformers.rs (5 of 8 changes were fixes); crates/router/src/types/storage/revenue_recovery_redis_operation.rs (4 of 7 changes were fixes); crates/router/src/core/payments/flows/setup_mandate_flow.rs (3 of 5 changes were fixes)
Resolve the 77 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (15), enums.rs (3), helpers.rs (3). — One of this dimension's main actionable groups (77 warning-level).
Resolve the 5 Repeated repair finding(s) in Churn × Complexity Hotspots — start with REDACTED (2), revenue_recovery_redis_operation.rs, setup_mandate_flow.rs. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.7 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
46 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/hyperswitch_connectors/src/connectors/santander/responses.rs. Counted over 1461 of the 1999 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×6
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
885 deducted task-comment markers across 954023 LoC (0.1/KLoC) → score 9.8. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
TodoComment repeated across 97 filescrates/hyperswitch_connectors/src/connectors/affirm.rs:188
TodoComment repeated across 20 filescrates/hyperswitch_connectors/src/connectors/barclaycard.rs:343
TodoComment repeated across 12 filescrates/hyperswitch_connectors/src/connectors/breadpay.rs:121
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 396 TodoComment finding(s) in Explicit Debt — start with REDACTED (78), types.rs (16), REDACTED (16). — One of this dimension's main actionable groups (396 warning-level).
Resolve the 14 FixmeComment finding(s) in Explicit Debt — start with payments2.rs (3), REDACTED (3), lib.rs (2). — One of this dimension's main actionable groups (14 warning-level).
Resolve the 1 TodoComment repeated across 97 files finding(s) in Explicit Debt — start with affirm.rs. — One of this dimension's main actionable groups (1 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
0 of 2 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question). How well each record argues its case is not measured.
10 of 41 build units (Cargo, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED 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.
24 finding(s): 0 critical, 24 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 19 REDACTED finding(s) in Secrets (history) — start with REDACTED (6), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (19 issue-level).
Resolve the 5 High secret finding(s) in Secrets (history) — start with REDACTED (3), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
1807 finding(s): 0 critical, 1801 high, 6 medium, 0 low. 156 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 11 file(s) — `connector-template/test.rs` (line 11, line 12, line 13, …), `crates/router/locales/he.yml`, `crates/router/locales/ja.yml`, `crates/router/locales/pl.yml`, `crates/router/locales/zh.yml`, … (+6 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 11 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 6 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1616 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (1616). — One of this dimension's main actionable groups (1616 issue-level).
Resolve the 15 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5), REDACTED (5), REDACTED (5). — One of this dimension's main actionable groups (15 issue-level).
No action in Static Analysis (SAST) — all 156 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (156 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 10 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (6), REDACTED (4). — One of this dimension's main actionable groups (10 issue-level).
Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 2 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 60 High IaC finding(s) in IaC & Container Security — start with REDACTED (17), REDACTED (14), REDACTED (12). — One of this dimension's main actionable groups (60 issue-level).
Resolve the 39 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (14), REDACTED (6), REDACTED (5). — One of this dimension's main actionable groups (39 warning-level).
Resolve the 3 Low IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
187 of 1461 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is crates/smithy/src/lib.rs. Counted over 1461 of the 1999 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 15 Orphaned knowledge finding(s) in Knowledge Freshness — start with REDACTED (2), lib.rs, archipel.rs. — One of this dimension's main actionable groups (15 issue-level).
Resolve the 172 Orphaned file finding(s) in Knowledge Freshness — start with REDACTED (7), core.rs (7), metrics.rs (7). — One of this dimension's main actionable groups (172 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 38 Change coupling finding(s) in Change Coupling — start with REDACTED (4), lib.rs (3), connector_mapping.rs (2). — One of this dimension's main actionable groups (38 warning-level).
Resolve the 20 Change-coupling hub finding(s) in Change Coupling — start with connector.rs (2), connector_auth.rs, default_implementations_v2.rs. — One of this dimension's main actionable groups (20 warning-level).
Resolve the 2 Change coupling clique finding(s) in Change Coupling — start with REDACTED, aci.rs. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 7 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
No dependency in any ecosystem this repository declares is published as malicious.
✓ On the Gold path — maintain.
Detailed fixes: d43_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC2 · Forms & labels1.0 / 10Critical✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label. — crates/router/src/core/payment_link/payment_link_initiate/payment_link.html:205
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Do you agree with this assessment?
AC3 · Page structure4.8 / 10Weak✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div>, so there is no content here to wrap — render the <main> from the component mounted into it. (×2) — crates/router/src/core/generic_link/expired_link/index.html:2, crates/router/src/core/generic_link/payment_method_collect/status/index.html:2
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×5) — crates/router/src/core/generic_link/payment_method_collect/initiate/index.html:2, crates/router/src/core/generic_link/payout_link/initiate/index.html:2, crates/router/src/core/generic_link/payout_link/status/index.html:2, …
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. (×2) — crates/router/src/core/payment_link/payment_link_initiate/payment_link.html:205, crates/router/src/core/payment_link/payment_link_initiate/payment_link.html:0
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
`#payment-details-shimmer` moves (`animation: shimmer 1.5s infinite linear`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — crates/router/src/core/payment_link/payment_link_initiate/payment_link.html:24
`.connector-table h3::before` moves (`transition: transform 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — cypress-tests/dashboard/styles-minimal.css:273
`.failed-tests h2::before` moves (`transition: transform 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — cypress-tests/dashboard/styles-minimal.css:376
`.loading` moves (`animation: spin 1s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — cypress-tests/dashboard/styles-minimal.css:537
`#submit-spinner` moves (`animation: loading 1s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — crates/router/src/core/payment_link/payment_link_initiate/payment_link.css:671
`#hyper-checkout-cart` moves (`animation: slide-from-right 0.3s linear`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — crates/router/src/core/payment_link/payment_link_initiate/payment_link.css:780
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no a11y linter (an accessibility check that can read your UI — no component framework was detected and your pages are rendered by server-side templates, which neither the JSX/Vue ESLint plugins nor the HTML-template linters can parse; run axe/pa11y over the rendered pages, or assert the accessibility invariants over that rendered HTML in the test suite you already have) and no axe/pa11y/Lighthouse in tests or CI. Start by running that check over your rendered pages in CI. What was searched, so you can tell an absence from a miss: the 8 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain: add an accessibility check that can read your UI — no component framework was detected and your pages are rendered by server-side templates, which neither the JSX/Vue ESLint plugins nor the HTML-template linters can parse; run axe/pa11y over the rendered pages, or assert the accessibility invariants over that rendered HTML in the test suite you already have, then assert with cypress-axe in tests, then gate axe/pa11y/Lighthouse in CI.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Do you agree with this assessment?
C1 · Data Protection8.5 / 10Strong✓ Tool-verified
Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.
Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.
What to do
Strengthen data-at-rest protection: vault your keys (AWS KMS / Secrets Manager, GCP KMS / REDACTED Manager, Azure Key Vault, HashiCorp Vault — not a key read from an environment variable beside the data) and encrypt the most sensitive columns (an AEAD over the field before Diesel/sqlx write it, SQLCipher, pgcrypto) — partial coverage still leaves gaps.
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Do you agree with this assessment?
C3 · Audit Trail7.5 / 10Strong✓ Tool-verified
Other · Security — Whether changes to sensitive data are recorded (who, what, when) for compliance + incident response.
An audit mechanism is present, but the trail is not yet complete — missing: a write-side hook every change flows through (a SeaORM ActiveModelBehavior hook or a database trigger recording each change, or an event-sourced store), per-entity coverage (an event-sourced aggregate, or a hook on each entity that needs a who-changed-what trail).
What to do
Back the audit convention with a structural mechanism: a SeaORM ActiveModelBehavior before_save/after_save hook or a database trigger writing each sensitive change to an audit-log table, with the acting user and time on every entry.
Do you agree with this assessment?
C4 · Data Retention6.5 / 10Adequate✓ Tool-verified
Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).
Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.
A retention mechanism is present, but the data-lifecycle is not yet complete — missing: a scheduled purge / cleanup job (a scheduled task that deletes rows past their retention — diesel::delete(….filter(created_at.lt(cutoff))), purge_expired… / delete_old…), a documented retention period / data-expiry.
What to do
Complete the data-lifecycle story: an expiry limit (a declared maximum age for the stored data — a retention-age setting, or a store-level TTL where your storage offers one), a scheduled purge/cleanup job that enforces it, and a documented retention period covering the personal data.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (diesel/sea-orm/sqlx) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
`ApiKey` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/api_keys.rs:11
`Authorization` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/authorization.rs:12
`BatchBlocklistJob` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/batch_blocklist_job.rs:13
`Blocklist` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/blocklist.rs:24
`BlocklistLookup` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/blocklist_lookup.rs:26
`Capture` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/capture.rs:12
`CardIssuer` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/card_issuer.rs:11
`CardInfo` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/cards_info.rs:17
`Config` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/configs.rs:17
`Dispute` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/dispute.rs:46
`DynamicRoutingStats` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/dynamic_routing_stats.rs:29
`FileMetadata` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/file.rs:28
`FraudCheck` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/fraud_check.rs:12
`PayoutLink` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/generic_link.rs:157
`LockerMockUp` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/locker_mock_up.rs:10
`Mandate` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/mandate.rs:13
`Organization` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/organization.rs:22
`ProcessTracker` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/process_tracker.rs:26
`Refund` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/refund.rs:28
`RevenueRecoveryRetryStats` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/revenue_recovery_retry_stats.rs:11
`Role` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/role.rs:10
`RoutingAlgorithm` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/routing_algorithm.rs:9
`UnifiedTranslations` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/unified_translations.rs:11
`Theme` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/user/theme.rs:15
`User` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/user.rs:15
`UserAuthenticationMethod` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/user_authentication_method.rs:10
`UserRole` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — crates/diesel_models/src/user_role.rs:13
What to do
Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).
Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
Maturity · Maturity — Whether the 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 22 of 43 project(s) that lack one — worth up to 1 pts.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
cypress-tests/README.md links to `cypress/e2e/PaymentUtils/Stripe.js`, but `cypress-tests/cypress/e2e/PaymentUtils/Stripe.js` 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. — cypress-tests/README.md:282
cypress-tests/README.md links to `cypress-tests/cypress/e2e/PayoutUtils/Adyen.js`, but `cypress-tests/cypress-tests/cypress/e2e/PayoutUtils/Adyen.js` 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. — cypress-tests/README.md:283
What to do
Reconcile the README with reality: cypress-tests/README.md links to `cypress/e2e/PaymentUtils/Stripe.js`, but `cypress-tests/cypress/e2e/PaymentUtils/Stripe.js` does not exist; cypress-tests/README.md links to `cypress-tests/cypress/e2e/PayoutUtils/Adyen.js`, but `cypress-tests/cypress-tests/cypress/e2e/PayoutUtils/Adyen.js` does not exist.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning6.0 / 10Adequate✓ Tool-verified
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language 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.
10937/11817 types (93%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
What to do
Keep implementation types off the public surface (Rust: `pub(crate)`, or keep the module private) so internals can change without breaking consumers.
Only 24/29 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/config_importer`, `crates/hsdev`, `crates/openapi`, `crates/test_utils`, `cypress-tests/mitm-proxy`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
What to do
Add an approval/environment gate (required reviewers / protection rules) before production promotion.
Do you agree with this assessment?
P5 · DR & Backup7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — crates/analytics/src/clickhouse.rs:68
`reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — crates/common_utils/src/keymanager.rs:64, crates/external_services/src/http_client/client.rs:88, crates/injector/src/injector.rs:184
`hyper_util::client::legacy::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — crates/external_services/src/grpc_client.rs:116, crates/external_services/src/grpc_client/deja_transport.rs:630
What to do
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.
Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from 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.
Do you agree with this assessment?
R1 · Type Safety0.0 / 10Critical✓ 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.
5 typed · 2305 plain JS — the untyped files are crates/router/src/core/generic_link/payment_method_collect/initiate/script.js, crates/router/src/core/generic_link/payment_method_collect/status/script.js, crates/router/src/core/generic_link/payout_link/initiate/script.js, crates/router/src/core/generic_link/payout_link/status/script.js, crates/router/src/core/payment_link/locale.js, REDACTED (+2299 more).
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
REDACTED:102 · REDACTED:15 — the two spans are one implementation copied and then locally edited — 1109 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. — REDACTED:102
crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:14 · crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js:33 — the two spans are one implementation copied and then locally edited — 432 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. — crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:14
crates/router/src/core/generic_link/payout_link/initiate/script.js:39 · REDACTED:611 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/router/src/core/generic_link/payout_link/initiate/script.js:39
postman/collection-dir/adyen_uk/event.prerequest.js:18 · postman/collection-dir/paypal/event.prerequest.js:13 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — postman/collection-dir/adyen_uk/event.prerequest.js:18
loadtest/k6/payment-confirm.js:10 · REDACTED:10 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — loadtest/k6/payment-confirm.js:10
crates/router/src/services/redirection/assets/redirect_error_logs_push.js:67 · crates/router/src/services/redirection/assets/redirect_error_logs_push.js:82 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — crates/router/src/services/redirection/assets/redirect_error_logs_push.js:67
crates/router/src/core/generic_link/payout_link/status/script.js:27 · REDACTED:547 · REDACTED:359 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — crates/router/src/core/generic_link/payout_link/status/script.js:27
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.
(anonymous) has cyclomatic complexity 61 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — cypress-tests/cypress/support/redirectionHandler.js:2394
(anonymous) has cyclomatic complexity 52 and cognitive complexity 141; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — cypress-tests/cypress/support/commands.js:3576
(anonymous) has cyclomatic complexity 52 and cognitive complexity 108; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — cypress-tests/cypress/support/commands.js:5733
(anonymous) has cyclomatic complexity 39 and cognitive complexity 88; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — cypress-tests/cypress/support/commands.js:5160
(anonymous) has cyclomatic complexity 35 and cognitive complexity 104; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — cypress-tests/cypress/support/commands.js:4513
determineAffirmStep has cyclomatic complexity 33 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — cypress-tests/cypress/support/redirectionHandler.js:963
bankRedirectRedirection has cyclomatic complexity 30 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — cypress-tests/cypress/support/redirectionHandler.js:1465
(anonymous) has cyclomatic complexity 26 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — cypress-tests/cypress/support/redirectionHandler.js:4988, cypress-tests/cypress/support/redirectionHandler.js:5344
(anonymous) has cyclomatic complexity 25 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — cypress-tests/cypress/support/commands.js:4010
validateConfigValue has cyclomatic complexity 25 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — cypress-tests/cypress/utils/featureFlags.js:32
renderStatusDetails has cyclomatic complexity 24 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:188
renderStatusDetails has cyclomatic complexity 23 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/router/src/core/generic_link/payout_link/status/script.js:48
bankRedirectRedirection has cyclomatic complexity 23 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — cypress-tests-v2/cypress/support/redirectionHandler.js:100
(anonymous) has cyclomatic complexity 22 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — cypress-tests/cypress/support/commands.js:6298
initializeEventListeners has cyclomatic complexity 22 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:326
(anonymous) has cyclomatic complexity 22 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — cypress-tests/cypress/support/commands.js:12354
(anonymous) has cyclomatic complexity 21 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — cypress-tests/cypress/support/commands.js:4788
initializeSDK has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:10
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files9.6 / 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.
REDACTED has 1118 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
cypress-tests/dashboard/dashboard.js has 873 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — cypress-tests/dashboard/dashboard.js:1
crates/router/src/core/payment_link/locale.js has 637 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/router/src/core/payment_link/locale.js:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
22 file(s) (~5256 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — cypress-tests-v2
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Imported but not declared in any reachable package.json — installs work only by hoisting accident. — cypress-tests-v2/cypress.config.js:2
Only test files import it (first: REDACTED:4) — move it to devDependencies. — cypress-tests/package.json:34
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves HTTP itself (`HttpServer::new(` (crates/router/src/lib.rs:431)), so its Rust source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Rust spelling appears in production source, not proven on every route. A Rocket 0.5 application is credited the headers Rocket's default `Shield` sends unless it attaches its own, and its cookie jar's SameSite=Strict default; a session middleware its default cookie flags.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. (×4) — crates/common_utils/src/crypto.rs:525, crates/hyperswitch_connectors/src/connectors/braintree.rs:1061, crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs:360, …
DES / 3DES / RC4 / RC2 / Blowfish is deprecated or broken. Use an AEAD — `aes_gcm::Aes256Gcm` or `chacha20poly1305::ChaCha20Poly1305` (RustCrypto), or ring's `aead::AES_256_GCM` — with a fresh nonce per message; it authenticates as it encrypts. — crates/common_utils/src/crypto.rs:657
Set: Content-Security-Policy, Strict-Transport-Security. Missing: X-Content-Type-Options, X-Frame-Options — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each.(−1.0 on this card.) The server: `HttpServer::new(` (crates/router/src/lib.rs:431).
What to do
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 4 sites, not one: `crates/common_utils/src/crypto.rs:525` (`md5::compute`), `crates/hyperswitch_connectors/src/connectors/braintree.rs:1061` (`Sha1::digest`), `crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs:360` (`MessageDigest::sha1`), `crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs:961` (`SHA1_FOR_LEGACY_USE_ONLY`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Replace DES/3DES/RC4/RC2/Blowfish with an AEAD (`aes_gcm::Aes256Gcm`, `ChaCha20Poly1305`, or ring's `aead::AES_256_GCM`).
Add X-Content-Type-Options, X-Frame-Options beside the headers the Rust server already sets.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
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.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. 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 question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 0/1 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`postLog` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — crates/router/src/services/redirection/assets/redirect_error_logs_push.js:49
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
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.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped3.5 / 10Weak✓ Tool-verified
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.
`arrowDownImage.innerHTML` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — REDACTED:973, REDACTED:1151
`arrowUpImage.innerHTML` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:1114
`translations.notAllowed` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js:18, crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js:20
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
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.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — 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.
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.
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 104 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/subscriptions/src/webhooks.rs:104
`error!` at line 178 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/subscriptions/src/workflows/invoice_sync.rs:178
`info!` at line 312 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/subscriptions/src/workflows/invoice_sync.rs:312
`info!` at line 328 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/subscriptions/src/workflows/invoice_sync.rs:328
`debug!` at line 100 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/storage_impl/src/redis/pub_sub.rs:100
`debug!` at line 103 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/storage_impl/src/redis/pub_sub.rs:103
`debug!` at line 125 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/storage_impl/src/redis/pub_sub.rs:125
`error!` at line 618 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/storage_impl/src/payouts/payout_attempt.rs:618
`info!` at line 18 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/smithy-generator/src/main.rs:18
`info!` at line 29 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/smithy-generator/src/main.rs:29
`info!` at line 31 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. (×2) — crates/smithy-generator/src/main.rs:31, crates/scheduler/src/utils.rs:31
`info!` at line 41 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/smithy-generator/src/main.rs:41
`info!` at line 46 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/smithy-generator/src/main.rs:46
`info!` at line 53 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/smithy-generator/src/main.rs:53
`debug!` at line 102 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/scheduler/src/consumer.rs:102
`info!` at line 106 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/scheduler/src/consumer.rs:106
`info!` at line 114 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/scheduler/src/consumer.rs:114
`info!` at line 194 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/scheduler/src/consumer.rs:194
`error!` at line 50 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/scheduler/src/producer.rs:50
`debug!` at line 77 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/scheduler/src/utils.rs:77
`debug!` at line 87 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/scheduler/src/utils.rs:87
`debug!` at line 135 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/scheduler/src/utils.rs:135
`info!` at line 326 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/scheduler/src/utils.rs:326
`error!` at line 949 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router_env/src/request_id.rs:949
`error!` at line 980 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router_env/src/request_id.rs:980
`warn!` at line 32 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router_env/src/logger/storage.rs:32
`error!` at line 126 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router/src/events.rs:126
`error!` at line 506 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router/src/lib.rs:506
`error!` at line 525 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router/src/lib.rs:525
`warn!` at line 222 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router/src/middleware.rs:222
`info!` at line 227 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router/src/middleware.rs:227
`info!` at line 234 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router/src/middleware.rs:234
`warn!` at line 240 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router/src/middleware.rs:240
`info!` at line 244 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router/src/middleware.rs:244
`error!` at line 682 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router/src/utils.rs:682
`error!` at line 108 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router/src/workflows/dispute_list.rs:108
`error!` at line 56 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router/src/workflows/invoice_sync.rs:56
`warn!` at line 282 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router/src/workflows/outgoing_webhook_retry.rs:282
`error!` at line 821 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/router/src/workflows/outgoing_webhook_retry.rs:821
Statically assessed 12 of 55 WCAG 2.2 Level A/AA success criteria (22%; ≈24% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 43 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 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.
P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
Not included — 43 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — no exported interface declares behaviour
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 18 — an image could not be pulled) — poststart-hook Error context canceled superposition-init Error context canceled migration_runner Error context canceled hyperswitch-server Error context canceled hyperswitch-web Error context canceled hyperswitch-control-center Error context canceled superposition Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: superposition Error context canceled redis-standalone Error context canceled migration_runner Error context canceled superposition-init Error Get "https://registry-1.docker.io/v2/": Forbidden hyperswitch-server Error context canceled hyperswitch-control-center Error context canceled hyperswitch-web Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency is measured on C# only; JavaScript, Python, Rust, TypeScript not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .py, .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 2 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
D8 Code Coverage — Coverage not measured — JavaScript/TypeScript suite
DM1 Aggregate boundaries — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
DM3 Integration-event coupling — no integration events detected — coupling check not applicable
DM7 Repository granularity — no repository abstraction detected (e.g. uses a document session)
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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
PF2 Allocation hygiene — Not applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
R4 Test Coverage — 2414 test file(s) reach none of 18 production file(s) via imports — exercised outside the JS import graph (integration/bundled), not import-reachable
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. Rust's compiler refuses the unsynchronised version: a collection shared between a callback's thread and the waiting body must be `Sync`, which a `Vec`, `VecDeque` or `HashMap` is only behind a `Mutex`/`RwLock`, so the race this check looks for cannot be written in safe Rust. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
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.
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
Domain fused to persistence infrastructure: ApiKey crates/diesel_models/src/api_keys.rs:11— `ApiKey` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: Authorization crates/diesel_models/src/authorization.rs:12— `Authorization` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: BatchBlocklistJob crates/diesel_models/src/batch_blocklist_job.rs:13— `BatchBlocklistJob` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: Blocklist crates/diesel_models/src/blocklist.rs:24— `Blocklist` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: BlocklistLookup crates/diesel_models/src/blocklist_lookup.rs:26— `BlocklistLookup` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: Capture crates/diesel_models/src/capture.rs:12— `Capture` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: CardIssuer crates/diesel_models/src/card_issuer.rs:11— `CardIssuer` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: CardInfo crates/diesel_models/src/cards_info.rs:17— `CardInfo` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: Config crates/diesel_models/src/configs.rs:17— `Config` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: Dispute crates/diesel_models/src/dispute.rs:46— `Dispute` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: DynamicRoutingStats crates/diesel_models/src/dynamic_routing_stats.rs:29— `DynamicRoutingStats` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: FileMetadata crates/diesel_models/src/file.rs:28— `FileMetadata` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: FraudCheck crates/diesel_models/src/fraud_check.rs:12— `FraudCheck` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: PayoutLink crates/diesel_models/src/generic_link.rs:157— `PayoutLink` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: LockerMockUp crates/diesel_models/src/locker_mock_up.rs:10— `LockerMockUp` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: Mandate crates/diesel_models/src/mandate.rs:13— `Mandate` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: Organization crates/diesel_models/src/organization.rs:22— `Organization` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: ProcessTracker crates/diesel_models/src/process_tracker.rs:26— `ProcessTracker` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: Refund crates/diesel_models/src/refund.rs:28— `Refund` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: RevenueRecoveryRetryStats crates/diesel_models/src/revenue_recovery_retry_stats.rs:11— `RevenueRecoveryRetryStats` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: Role crates/diesel_models/src/role.rs:10— `Role` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: RoutingAlgorithm crates/diesel_models/src/routing_algorithm.rs:9— `RoutingAlgorithm` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: UnifiedTranslations crates/diesel_models/src/unified_translations.rs:11— `UnifiedTranslations` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: Theme crates/diesel_models/src/user/theme.rs:15— `Theme` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Domain fused to persistence infrastructure: User crates/diesel_models/src/user.rs:15— `User` is a domain AGGREGATE fused to persistence ON ITS OWN DECLARATION (the diesel `#[derive(Queryable, Insertable, Identifiable)]` + `#[diesel(table_name)]` mapping) with a singular-entity write-persistence method (create/update/delete taking a DB connection) on the domain type and no separate pure-domain layer — the domain entity IS the ORM row (active-record). A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
Orphaned knowledge crates/smithy/src/lib.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/hyperswitch_connectors/src/connectors/archipel.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/hyperswitch_connectors/src/connectors/getnet.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/hyperswitch_connectors/src/connectors/payjustnow.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/hyperswitch_connectors/src/connectors/tokenio.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/hyperswitch_connectors/src/connectors/inespay.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/hyperswitch_connectors/src/connectors/powertranz.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/hyperswitch_constraint_graph/src/graph.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/hyperswitch_connectors/src/connectors/paystack.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/hyperswitch_connectors/src/connectors/tokenio/transformers.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/hyperswitch_connectors/src/connectors/sift.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/hyperswitch_connectors/src/connectors/mpgs.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/hyperswitch_connectors/src/connectors/thunes.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/analytics/src/payments/core.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge crates/hyperswitch_connectors/src/connectors/inespay/transformers.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
D30 · Dependency Vulnerabilities· High vulnerability · ×2
REDACTED
REDACTED
AC2 · Forms & labels· Custom control with no accessible name on <div> · ×1
Custom control with no accessible name on <div> crates/router/src/core/payment_link/payment_link_initiate/payment_link.html:205— This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
AC4 · Keyboard semantics· Click handler on a non-interactive <div> · ×1
Click handler on a non-interactive <div> crates/router/src/core/payment_link/payment_link_initiate/payment_link.html:205— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
AC4 · Keyboard semantics· Click handler on a non-interactive <svg> · ×1
Click handler on a non-interactive <svg> crates/router/src/core/payment_link/payment_link_initiate/payment_link.html— A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
Unlisted import 'fs-extra' cypress-tests-v2/cypress.config.js:2— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
TodoComment cypress-tests/cypress/e2e/configs/mock-server/router.ts:15— // TODO: Update to import from TypeScript version once fully tested — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/subscriptions/src/workflows/invoice_sync.rs:280— // TODO: Handle retries here on failure — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/lib.rs:250— // TODO: This needs to be removed after the removal of diesel_models dependency from domain_models is done — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/lib.rs:368— // TODO: This needs to be removed after the removal of diesel_models dependency from domain_models is done — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/lib.rs:456— // TODO: create an error enum and return proper error here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/lib.rs:480— // TODO: This should not be used beyond this crate — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/merchant_account.rs:833— // TODO: we will not have default profile in v2 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/merchant_account.rs:1224— // TODO: Verify this change — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/merchant_account.rs:1317— // TODO: Verify this change — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/mock_db.rs:171— /// TODO: Remove this once diesel_model dependency is removed from domain_models — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/mock_db.rs:216— /// TODO: Remove this once diesel_model dependency is removed from domain_models — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/mock_db.rs:272— /// TODO: Remove this once diesel_model dependency is removed from domain_models — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/mock_db.rs:337— /// TODO: Remove this once diesel_model dependency is removed from domain_models — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/platform_wrapper.rs:20— // TODO: Type the remaining interfaces the same way payments are typed, then drop this module. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/payouts/payout_attempt.rs:356— // TODO: Move all key generation logic to a common function — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/payouts/payouts.rs:516— // TODO: Fetch partial columns for this query since we only need some columns — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/payouts/payouts.rs:533— // TODO: Fetch partial columns for this query since we only need some columns — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/payments/payment_intent.rs:923— // TODO: Fetch partial columns for this query since we only need some columns — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/payments/payment_intent.rs:941— // TODO: Fetch partial columns for this query since we only need some columns — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/payments/payment_intent.rs:1418— // TODO: Fetch partial columns for this query since we only need some columns — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/payments/payment_intent.rs:1436— // TODO: Fetch partial columns for this query since we only need some columns — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/payments/payment_intent.rs:1638— // TODO: Fetch partial columns for this query since we only need some columns — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/payments/payment_intent.rs:1655— // TODO: Fetch partial columns for this query since we only need some columns — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/payments/payment_intent.rs:1293— // TODO: Remove this redundant function — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/storage_impl/src/mock_db/payout_attempt.rs:23— // TODO: Implement function for `MockDb` — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FileTooLong: core/payments.rs crates/router/src/core/payments.rs— FileTooLong — 13714 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 165 free functions. The bar is 500 significant lines; this is 13214 over it, 27.43× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/enums.rs crates/common_enums/src/enums.rs— FileTooLong — 11125 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 10625 over it, 22.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/payments.rs crates/api_models/src/payments.rs— FileTooLong — 9560 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 9060 over it, 19.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: unified_connector_service/transformers.rs crates/router/src/core/unified_connector_service/transformers.rs— FileTooLong — 8999 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 8499 over it, 18.00× 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: payments/helpers.rs crates/router/src/core/payments/helpers.rs— FileTooLong — 7464 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 174 free functions. The bar is 500 significant lines; this is 6964 over it, 14.93× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: payments/transformers.rs crates/router/src/core/payments/transformers.rs— FileTooLong — 6979 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 34 free functions. The bar is 500 significant lines; this is 6479 over it, 13.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: core/payment_methods.rs crates/router/src/core/payment_methods.rs— FileTooLong — 6941 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 107 free functions. The bar is 500 significant lines; this is 6441 over it, 13.88× 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/utils.rs crates/hyperswitch_connectors/src/utils.rs— FileTooLong — 6751 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 59 free functions. The bar is 500 significant lines; this is 6251 over it, 13.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: payment_methods/cards.rs crates/router/src/core/payment_methods/cards.rs— FileTooLong — 6251 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 81 free functions. The bar is 500 significant lines; this is 5751 over it, 12.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: adyen/transformers.rs crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs— FileTooLong — 5839 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 49 free functions. The bar is 500 significant lines; this is 5339 over it, 11.68× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: services/authentication.rs crates/router/src/services/authentication.rs— FileTooLong — 4982 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 41 free functions. The bar is 500 significant lines; this is 4482 over it, 9.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: worldpayvantiv/transformers.rs crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs— FileTooLong — 4641 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 4141 over it, 9.28× 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: operations/payment_response.rs crates/router/src/core/payments/operations/payment_response.rs— FileTooLong — 4356 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 3856 over it, 8.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: stripe/transformers.rs crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs— FileTooLong — 4304 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 3804 over it, 8.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: cybersource/transformers.rs crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs— FileTooLong — 4248 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 3748 over it, 8.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: db/kafka_store.rs crates/router/src/db/kafka_store.rs— FileTooLong — 4075 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: KafkaStore (57 blocks, 109-5065). The bar is 500 significant lines; this is 3575 over it, 8.15× 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: core/admin.rs crates/router/src/core/admin.rs— FileTooLong — 4001 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 43 free functions. The bar is 500 significant lines; this is 3501 over it, 8.00× 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/payment_method_data.rs crates/hyperswitch_domain_models/src/payment_method_data.rs— FileTooLong — 3806 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 3306 over it, 7.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: core/payouts.rs crates/router/src/core/payouts.rs— FileTooLong — 3759 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 53 free functions. The bar is 500 significant lines; this is 3259 over it, 7.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: REDACTED crates/router/src/routes/payments.rs— FileTooLong — 3659 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 65 free functions. The bar is 500 significant lines; this is 3159 over it, 7.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: worldpayxml/transformers.rs crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs— FileTooLong — 3563 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 33 free functions. The bar is 500 significant lines; this is 3063 over it, 7.13× 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/payment_attempt.rs crates/diesel_models/src/payment_attempt.rs— FileTooLong — 3521 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 74% of them inside a single declaration: PaymentAttemptUpdateInternal (5 blocks, 1047-4732). The bar is 500 significant lines; this is 3021 over it, 7.04× 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: core/unified_connector_service.rs crates/router/src/core/unified_connector_service.rs— FileTooLong — 3518 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 66 free functions. The bar is 500 significant lines; this is 3018 over it, 7.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: paypal/transformers.rs crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs— FileTooLong — 3497 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 2997 over it, 6.99× 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: payments/routing.rs crates/router/src/core/payments/routing.rs— FileTooLong — 3497 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 56 free functions. The bar is 500 significant lines; this is 2997 over it, 6.99× 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.
MethodTooLong: PaymentAttemptUpdateInternal.from crates/diesel_models/src/payment_attempt.rs:2505— MethodTooLong — from runs 2193 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 2093 over it, 21.93× 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: PaymentIntentUpdateInternal.from REDACTED:877— MethodTooLong — from runs 1210 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 1110 over it, 12.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ConnectorSpecificConfig.foreign_try_from crates/router/src/core/unified_connector_service/connector_config.rs:893— MethodTooLong — foreign_try_from runs 1033 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 933 over it, 10.33× 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: BankNames.foreign_try_from crates/router/src/core/unified_connector_service/transformers.rs:5711— MethodTooLong — foreign_try_from runs 770 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 670 over it, 7.70× 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: BankNames.foreign_try_from crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs:1148— MethodTooLong — foreign_try_from runs 754 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 654 over it, 7.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: ProfileUpdateInternal.foreign_from crates/storage_impl/src/business_profile.rs:600— MethodTooLong — foreign_from runs 731 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 631 over it, 7.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PaymentConfirm.get_trackers crates/router/src/core/payments/operations/payment_confirm.rs:78— MethodTooLong — get_trackers runs 716 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 616 over it, 7.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ProfileUpdateInternal.foreign_from crates/storage_impl/src/business_profile.rs:1697— MethodTooLong — foreign_from runs 696 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 596 over it, 6.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Klarna.get_url crates/hyperswitch_connectors/src/connectors/klarna.rs:515— MethodTooLong — get_url runs 614 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 514 over it, 6.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RequiredField.to_tuple crates/payment_methods/src/configs/payment_connector_required_fields.rs:216— MethodTooLong — to_tuple runs 609 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 509 over it, 6.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PaymentAttemptUpdate.to_storage_model crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:2357— MethodTooLong — to_storage_model runs 557 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 457 over it, 5.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ConnectorAuthTypeAndMetadataValidation.validate_auth_and_metadata_type_with_connector crates/router/src/core/connector_validation.rs:46— MethodTooLong — validate_auth_and_metadata_type_with_connector runs 547 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 447 over it, 5.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PaymentIntentUpdateInternal.try_from crates/hyperswitch_domain_models/src/payments/payment_intent.rs:563— MethodTooLong — try_from runs 543 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 443 over it, 5.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PaymentMethodUpdateInternal.from crates/diesel_models/src/payment_method.rs:523— MethodTooLong — from runs 539 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 439 over it, 5.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PaymentCreate.get_trackers crates/router/src/core/payments/operations/payment_create.rs:74— MethodTooLong — get_trackers runs 534 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 434 over it, 5.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: PaymentMethodData.foreign_try_from crates/router/src/core/unified_connector_service.rs:105— MethodTooLong — foreign_try_from runs 468 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 368 over it, 4.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: PaymentsRequest.try_from crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:762— MethodTooLong — try_from runs 457 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 357 over it, 4.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PaymentConfirm.update_trackers crates/router/src/core/payments/operations/payment_confirm.rs:2724— MethodTooLong — update_trackers runs 432 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 332 over it, 4.32× 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: PaymentUpdate.get_trackers crates/router/src/core/payments/operations/payment_update.rs:56— MethodTooLong — get_trackers runs 432 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 332 over it, 4.32× 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: PaymentConfirm.call_unified_authentication_service_if_eligible crates/router/src/core/payments/operations/payment_confirm.rs:1957— MethodTooLong — call_unified_authentication_service_if_eligible runs 397 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 297 over it, 3.97× 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: MultisafepayPaymentsRequest.try_from crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:386— MethodTooLong — try_from runs 384 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 284 over it, 3.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: PaymentIntentRequest.try_from crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:2231— MethodTooLong — try_from runs 381 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 281 over it, 3.81× 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: ApiIdentifier.from crates/router/src/routes/lock_utils.rs:61— MethodTooLong — from runs 379 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 279 over it, 3.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PaypalPaymentsRequest.try_from crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1089— MethodTooLong — try_from runs 369 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 269 over it, 3.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PaymentAttemptUpdateInternal.foreign_from crates/storage_impl/src/payments/payment_attempt.rs:2899— MethodTooLong — foreign_from runs 350 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 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.
FunctionTooLong: router::core::payments::tokenization::save_payment_method crates/router/src/core/payments/tokenization.rs:191— FunctionTooLong — router::core::payments::tokenization::save_payment_method runs 777 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 677 over it, 7.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: router::core::payments::operations::payment_response::payment_response_update_tracker crates/router/src/core/payments/operations/payment_response.rs:2587— FunctionTooLong — router::core::payments::operations::payment_response::payment_response_update_tracker runs 753 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 653 over it, 7.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: router::core::unified_connector_service::build_unified_connector_service_payment_method crates/router/src/core/unified_connector_service.rs:1572— FunctionTooLong — router::core::unified_connector_service::build_unified_connector_service_payment_method runs 752 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 652 over it, 7.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: router::core::payments::helpers::get_additional_payment_data crates/router/src/core/payments/helpers.rs:6247— FunctionTooLong — router::core::payments::helpers::get_additional_payment_data runs 697 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 597 over it, 6.97× 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: router::core::payments::transformers::payments_to_payments_response crates/router/src/core/payments/transformers.rs:3862— FunctionTooLong — router::core::payments::transformers::payments_to_payments_response runs 568 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 468 over it, 5.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.
FunctionTooLong: router::core::payment_methods::cards::build_merchant_enabled_pms_context crates/router/src/core/payment_methods/cards.rs:4663— FunctionTooLong — router::core::payment_methods::cards::build_merchant_enabled_pms_context runs 526 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 426 over it, 5.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: payment_methods::configs::payment_connector_required_fields::get_bank_redirect_required_fields crates/payment_methods/src/configs/payment_connector_required_fields.rs:1999— FunctionTooLong — payment_methods::configs::payment_connector_required_fields::get_bank_redirect_required_fields runs 475 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 375 over it, 4.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: router::utils::user::sample_data::generate_sample_data crates/router/src/utils/user/sample_data.rs:28— FunctionTooLong — router::utils::user::sample_data::generate_sample_data runs 417 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 317 over it, 4.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: router::core::payouts::helpers::save_payout_data_to_locker crates/router/src/core/payouts/helpers.rs:378— FunctionTooLong — router::core::payouts::helpers::save_payout_data_to_locker runs 395 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 295 over it, 3.95× 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: hyperswitch_connectors::connectors::worldpayvantiv::transformers::get_attempt_status crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:4070— FunctionTooLong — hyperswitch_connectors::connectors::worldpayvantiv::transformers::get_attempt_status runs 375 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 275 over it, 3.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: router::core::payment_methods::cards::list_payment_methods crates/router/src/core/payment_methods/cards.rs:5387— FunctionTooLong — router::core::payment_methods::cards::list_payment_methods runs 370 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 270 over it, 3.70× 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: router::core::routing::link_routing_config crates/router/src/core/routing.rs:1127— FunctionTooLong — router::core::routing::link_routing_config runs 370 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 270 over it, 3.70× 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: payment_methods::configs::payment_connector_required_fields::get_wallet_required_fields crates/payment_methods/src/configs/payment_connector_required_fields.rs:2717— FunctionTooLong — payment_methods::configs::payment_connector_required_fields::get_wallet_required_fields runs 367 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 267 over it, 3.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: hyperswitch_connectors::connectors::worldpayvantiv::transformers::get_post_capture_void_status crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:3703— FunctionTooLong — hyperswitch_connectors::connectors::worldpayvantiv::transformers::get_post_capture_void_status runs 364 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 264 over it, 3.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: payment_methods::configs::payment_connector_required_fields::get_cards_required_fields crates/payment_methods/src/configs/payment_connector_required_fields.rs:1429— FunctionTooLong — payment_methods::configs::payment_connector_required_fields::get_cards_required_fields runs 355 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 255 over it, 3.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: router::core::user::dashboard_metadata::insert_metadata crates/router/src/core/user/dashboard_metadata.rs:278— FunctionTooLong — router::core::user::dashboard_metadata::insert_metadata runs 347 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 247 over it, 3.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: router::core::payments::payment_external_authentication crates/router/src/core/payments.rs:13778— FunctionTooLong — router::core::payments::payment_external_authentication runs 325 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 225 over it, 3.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: router::core::payments::transformers::construct_payment_router_data crates/router/src/core/payments/transformers.rs:1985— FunctionTooLong — router::core::payments::transformers::construct_payment_router_data runs 301 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 201 over it, 3.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: router::core::revenue_recovery::perform_calculate_workflow crates/router/src/core/revenue_recovery.rs:776— FunctionTooLong — router::core::revenue_recovery::perform_calculate_workflow runs 300 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 200 over it, 3.00× 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: router::configs::secrets_transformers::fetch_raw_secrets crates/router/src/configs/secrets_transformers.rs:478— FunctionTooLong — router::configs::secrets_transformers::fetch_raw_secrets runs 292 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 192 over it, 2.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: router::core::payments::helpers::get_token_pm_type_mandate_details crates/router/src/core/payments/helpers.rs:466— FunctionTooLong — router::core::payments::helpers::get_token_pm_type_mandate_details runs 285 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 185 over it, 2.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: router::core::payment_methods::migration::update_payment_method_record crates/router/src/core/payment_methods/migration.rs:45— FunctionTooLong — router::core::payment_methods::migration::update_payment_method_record 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.
FunctionTooLong: router::core::routing::helpers::push_metrics_with_update_window_for_success_based_routing crates/router/src/core/routing/helpers.rs:889— FunctionTooLong — router::core::routing::helpers::push_metrics_with_update_window_for_success_based_routing 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.
FunctionTooLong: smithy::generate_enum_impl crates/smithy/src/lib.rs:358— FunctionTooLong — smithy::generate_enum_impl runs 278 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 178 over it, 2.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: router::core::payouts::make_payout_data crates/router/src/core/payouts.rs:3821— FunctionTooLong — router::core::payouts::make_payout_data 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.
ClassTooLong: KafkaStore crates/router/src/db/kafka_store.rs:109— ClassTooLong — 3911 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, 57 blocks, lines 109-5065. The bar is 400 significant lines; this is 3511 over it, 9.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: PaymentConfirm crates/router/src/core/payments/operations/payment_confirm.rs:69— ClassTooLong — 2532 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, 6 blocks, lines 74-3298. The bar is 400 significant lines; this is 2132 over it, 6.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Stripe crates/hyperswitch_connectors/src/connectors/stripe.rs:101— ClassTooLong — 2530 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, 31 blocks, lines 101-3868. The bar is 400 significant lines; this is 2130 over it, 6.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Santander crates/hyperswitch_connectors/src/connectors/santander.rs:102— ClassTooLong — 2072 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, 24 blocks, lines 102-2967. The bar is 400 significant lines; this is 1672 over it, 5.18× 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: Paypal crates/hyperswitch_connectors/src/connectors/paypal.rs:97— ClassTooLong — 2046 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, 30 blocks, lines 97-2926. The bar is 400 significant lines; this is 1646 over it, 5.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: Adyen crates/hyperswitch_connectors/src/connectors/adyen.rs:122— ClassTooLong — 2000 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, 29 blocks, lines 122-3504. The bar is 400 significant lines; this is 1600 over it, 5.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Cybersource crates/hyperswitch_connectors/src/connectors/cybersource.rs:89— ClassTooLong — 1803 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, 25 blocks, lines 89-2516. The bar is 400 significant lines; this is 1403 over it, 4.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: PmCards crates/router/src/core/payment_methods/cards.rs:123— ClassTooLong — 1610 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 123-2157. The bar is 400 significant lines; this is 1210 over it, 4.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PaymentCreate crates/router/src/core/payments/operations/payment_create.rs:65— ClassTooLong — 1569 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, 5 blocks, lines 72-2034. The bar is 400 significant lines; this is 1169 over it, 3.92× 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: ConnectorSpecificConfig crates/router/src/core/unified_connector_service/connector_config.rs:250— ClassTooLong — 1440 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, 3 blocks, lines 250-2228. The bar is 400 significant lines; this is 1040 over it, 3.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RouterData crates/hyperswitch_domain_models/src/router_data.rs:31— ClassTooLong — 1311 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, 7 blocks, lines 31-2806. The bar is 400 significant lines; this is 911 over it, 3.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AdyenPaymentRequest crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:351— ClassTooLong — 1196 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, 13 blocks, lines 351-7017. The bar is 400 significant lines; this is 796 over it, 2.99× 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: Checkout crates/hyperswitch_connectors/src/connectors/checkout.rs:75— ClassTooLong — 1181 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, 24 blocks, lines 75-1719. The bar is 400 significant lines; this is 781 over it, 2.95× 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: Klarna crates/hyperswitch_connectors/src/connectors/klarna.rs:64— ClassTooLong — 1178 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, 16 blocks, lines 64-1534. The bar is 400 significant lines; this is 778 over it, 2.95× 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: PaymentUpdate crates/router/src/core/payments/operations/payment_update.rs:49— ClassTooLong — 1165 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, 5 blocks, lines 54-1508. The bar is 400 significant lines; this is 765 over it, 2.91× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Worldpayvantiv crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:74— ClassTooLong — 1160 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, 24 blocks, lines 74-1833. The bar is 400 significant lines; this is 760 over it, 2.90× 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: Barclaycard crates/hyperswitch_connectors/src/connectors/barclaycard.rs:74— ClassTooLong — 1107 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, 21 blocks, lines 74-1604. The bar is 400 significant lines; this is 707 over it, 2.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Nuvei crates/hyperswitch_connectors/src/connectors/nuvei.rs:77— ClassTooLong — 1090 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, 21 blocks, lines 77-1760. The bar is 400 significant lines; this is 690 over it, 2.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WorldpayvantivResponseCode crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:2597— ClassTooLong — 1075 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. The bar is 400 significant lines; this is 675 over it, 2.69× 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: Worldpayxml crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:73— ClassTooLong — 1057 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, 20 blocks, lines 73-1641. The bar is 400 significant lines; this is 657 over it, 2.64× 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: PaymentIntentUpdateInternal crates/hyperswitch_domain_models/src/payments/payment_intent.rs:495— ClassTooLong — 1043 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, 4 blocks, lines 495-1838. The bar is 400 significant lines; this is 643 over it, 2.61× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Bluesnap crates/hyperswitch_connectors/src/connectors/bluesnap.rs:77— ClassTooLong — 1016 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, 19 blocks, lines 77-1527. The bar is 400 significant lines; this is 616 over it, 2.54× 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: Worldpay crates/hyperswitch_connectors/src/connectors/worldpay.rs:93— ClassTooLong — 1015 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, 18 blocks, lines 93-1547. The bar is 400 significant lines; this is 615 over it, 2.54× 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: CybersourcePaymentsRequest crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:508— ClassTooLong — 987 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, 14 blocks, lines 508-4198. The bar is 400 significant lines; this is 587 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.
ClassTooLong: Wellsfargo crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:72— ClassTooLong — 975 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, 17 blocks, lines 72-1437. The bar is 400 significant lines; this is 575 over it, 2.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (11 lines × 2) crates/analytics/src/api_event/metrics/api_count.rs:97— crates/analytics/src/api_event/metrics/api_count.rs:97-107 | crates/analytics/src/api_event/metrics/status_code_count.rs:94-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/analytics/src/payment_intents/accumulator.rs:146— crates/analytics/src/payment_intents/accumulator.rs:146-156 | crates/analytics/src/payment_intents/accumulator.rs:276-286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/analytics/src/sqlx.rs:1115— crates/analytics/src/sqlx.rs:1115-1125 | crates/analytics/src/sqlx.rs:1214-1224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/api_models/src/payments.rs:12763— crates/api_models/src/payments.rs:12763-12773 | crates/api_models/src/payments.rs:12890-12900 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/diesel_models/src/payment_method.rs:1882— crates/diesel_models/src/payment_method.rs:1882-1892 | crates/hyperswitch_domain_models/src/mandates.rs:390-400 — 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) crates/diesel_models/src/query/blocklist.rs:927— crates/diesel_models/src/query/blocklist.rs:927-937 | crates/diesel_models/src/query/blocklist.rs:1015-1025 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/euclid_wasm/src/lib.rs:410— crates/euclid_wasm/src/lib.rs:410-420 | crates/euclid_wasm/src/lib.rs:532-542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs:441— crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs:441-451 | crates/hyperswitch_connectors/src/connectors/gotyme_sanlam.rs:586-596 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs` and `crates/hyperswitch_connectors/src/connectors/gotyme_sanlam.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1594— crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1594-1604 | crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1839-1849 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3517— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3517-3527 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3736-3746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1217— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1217-1227 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1322-1332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/bambora.rs:431— crates/hyperswitch_connectors/src/connectors/bambora.rs:431-441 | crates/hyperswitch_connectors/src/connectors/bambora.rs:612-622 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1148— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1148-1158 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2787-2797 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 47 separate duplicated blocks between them, totalling at least 513 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 (11 lines × 2) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:417— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:417-427 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:447-457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/breadpay.rs:314— crates/hyperswitch_connectors/src/connectors/breadpay.rs:314-324 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:688-698 — 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) crates/hyperswitch_connectors/src/connectors/celero/transformers.rs:196— crates/hyperswitch_connectors/src/connectors/celero/transformers.rs:196-206 | crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs:217-227 — 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) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2387— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2387-2397 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2456-2466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/fiuu.rs:605— crates/hyperswitch_connectors/src/connectors/fiuu.rs:605-615 | crates/hyperswitch_connectors/src/connectors/paybox.rs:382-392 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/fiuu.rs` and `crates/hyperswitch_connectors/src/connectors/paybox.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/fiuu.rs:803— crates/hyperswitch_connectors/src/connectors/fiuu.rs:803-813 | crates/hyperswitch_connectors/src/connectors/paybox.rs:537-547 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/fiuu.rs` and `crates/hyperswitch_connectors/src/connectors/paybox.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs:207— crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs:207-217 | crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs:541-551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/gigadat.rs:775— crates/hyperswitch_connectors/src/connectors/gigadat.rs:775-785 | crates/hyperswitch_connectors/src/connectors/gigadat.rs:858-868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/globepay.rs:450— crates/hyperswitch_connectors/src/connectors/globepay.rs:450-460 | crates/hyperswitch_connectors/src/connectors/globepay.rs:524-534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/gocardless.rs:511— crates/hyperswitch_connectors/src/connectors/gocardless.rs:511-521 | crates/hyperswitch_connectors/src/connectors/gocardless.rs:585-595 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/gotyme_sanlam.rs:248— crates/hyperswitch_connectors/src/connectors/gotyme_sanlam.rs:248-258 | crates/hyperswitch_connectors/src/connectors/gotyme_sanlam.rs:325-335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/hyperswitch_connectors/src/connectors/mollie.rs:381— crates/hyperswitch_connectors/src/connectors/mollie.rs:381-391 | crates/hyperswitch_connectors/src/connectors/mollie.rs:467-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/api_models/src/payment_methods.rs:2895— crates/api_models/src/payment_methods.rs:2895-2904 | crates/api_models/src/payment_methods.rs:3006-3015 — both copies are in the same file, so extract the block into 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) crates/api_models/src/payments.rs:4080— crates/api_models/src/payments.rs:4080-4089 | crates/hyperswitch_domain_models/src/payment_method_data.rs:4111-4120 — before extracting anything, compare `crates/api_models/src/payments.rs` and `crates/hyperswitch_domain_models/src/payment_method_data.rs` as WHOLE FILES: this scan already matched 14 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 (10 lines × 2) crates/api_models/src/payments.rs:6727— crates/api_models/src/payments.rs:6727-6736 | crates/hyperswitch_domain_models/src/address.rs:52-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/diesel_models/src/customers.rs:53— crates/diesel_models/src/customers.rs:53-62 | crates/diesel_models/src/customers.rs:121-130 — both copies are in the same file, so extract the block into 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) crates/diesel_models/src/merchant_account.rs:129— crates/diesel_models/src/merchant_account.rs:129-138 | crates/hyperswitch_domain_models/src/merchant_account.rs:121-130 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/diesel_models/src/payment_method.rs:1916— crates/diesel_models/src/payment_method.rs:1916-1925 | crates/diesel_models/src/payment_method.rs:1959-1968 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/diesel_models/src/query/blocklist.rs:87— crates/diesel_models/src/query/blocklist.rs:87-96 | crates/diesel_models/src/query/blocklist.rs:1035-1044 — both copies are in the same file, so extract the block into 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) crates/diesel_models/src/query/blocklist.rs:372— crates/diesel_models/src/query/blocklist.rs:372-381 | crates/diesel_models/src/query/blocklist.rs:1116-1125 — both copies are in the same file, so extract the block into 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) crates/diesel_models/src/query/blocklist.rs:901— crates/diesel_models/src/query/blocklist.rs:901-910 | crates/diesel_models/src/query/blocklist.rs:988-997 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/aci.rs:709— crates/hyperswitch_connectors/src/connectors/aci.rs:709-718 | crates/hyperswitch_connectors/src/connectors/adyen.rs:1811-1820 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/aci.rs` and `crates/hyperswitch_connectors/src/connectors/adyen.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/adyen.rs:2339— crates/hyperswitch_connectors/src/connectors/adyen.rs:2339-2348 | crates/hyperswitch_connectors/src/connectors/checkout.rs:1152-1161 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/checkout.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3119— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3119-3128 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3170-3179 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/affirm.rs:591— crates/hyperswitch_connectors/src/connectors/affirm.rs:591-600 | crates/hyperswitch_connectors/src/connectors/getnet.rs:526-535 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/affirm.rs` and `crates/hyperswitch_connectors/src/connectors/getnet.rs` as WHOLE FILES: this scan already matched 10 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 lines × 2) crates/hyperswitch_connectors/src/connectors/bambora.rs:496— crates/hyperswitch_connectors/src/connectors/bambora.rs:496-505 | crates/hyperswitch_connectors/src/connectors/xendit.rs:634-643 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bambora.rs` and `crates/hyperswitch_connectors/src/connectors/xendit.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:405— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:405-414 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:534-543 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2580— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2580-2589 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3417-3426 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 2) crates/hyperswitch_connectors/src/connectors/barclaycard.rs:756— crates/hyperswitch_connectors/src/connectors/barclaycard.rs:756-765 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1373-1382 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:679— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:679-688 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4241-4250 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 527 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 2) crates/hyperswitch_connectors/src/connectors/bluesnap.rs:547— crates/hyperswitch_connectors/src/connectors/bluesnap.rs:547-556 | crates/hyperswitch_connectors/src/connectors/klarna.rs:364-373 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bluesnap.rs` and `crates/hyperswitch_connectors/src/connectors/klarna.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:250— crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:250-259 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:461-470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/hyperswitch_connectors/src/connectors/braintree.rs:703— crates/hyperswitch_connectors/src/connectors/braintree.rs:703-712 | crates/hyperswitch_connectors/src/connectors/noon.rs:630-639 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/braintree.rs` and `crates/hyperswitch_connectors/src/connectors/noon.rs` as WHOLE FILES: this scan already matched 10 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.
Duplicated block (10 lines × 2) crates/hyperswitch_connectors/src/connectors/braintree.rs:944— crates/hyperswitch_connectors/src/connectors/braintree.rs:944-953 | crates/hyperswitch_connectors/src/connectors/tsys.rs:591-600 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/braintree.rs` and `crates/hyperswitch_connectors/src/connectors/tsys.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/hyperswitch_connectors/src/connectors/breadpay/transformers.rs:118— crates/hyperswitch_connectors/src/connectors/breadpay/transformers.rs:118-127 | crates/hyperswitch_connectors/src/connectors/celero/transformers.rs:205-214 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/hyperswitch_connectors/src/connectors/checkout.rs:1099— crates/hyperswitch_connectors/src/connectors/checkout.rs:1099-1108 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2264-2273 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/checkout.rs` and `crates/hyperswitch_connectors/src/connectors/stripe.rs` as WHOLE FILES: this scan already matched 13 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 (10 lines × 2) crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:164— crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:164-173 | crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs:203-212 — `crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 61 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 (12 lines × 2) crates/analytics/src/clickhouse.rs:632— crates/analytics/src/clickhouse.rs:632-643 | crates/analytics/src/sqlx.rs:1634-1645 — before extracting anything, compare `crates/analytics/src/clickhouse.rs` and `crates/analytics/src/sqlx.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/analytics/src/disputes/metrics/dispute_status_metric.rs:109— crates/analytics/src/disputes/metrics/dispute_status_metric.rs:109-120 | crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs:109-120 — before extracting anything, compare `crates/analytics/src/disputes/metrics/dispute_status_metric.rs` and `crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs` as WHOLE FILES: this scan already matched 6 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. 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) crates/analytics/src/frm/metrics/frm_blocked_rate.rs:82— crates/analytics/src/frm/metrics/frm_blocked_rate.rs:82-93 | crates/analytics/src/frm/metrics/frm_triggered_attempts.rs:84-95 — before extracting anything, compare `crates/analytics/src/frm/metrics/frm_blocked_rate.rs` and `crates/analytics/src/frm/metrics/frm_triggered_attempts.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/analytics/src/payment_intents/accumulator.rs:198— crates/analytics/src/payment_intents/accumulator.rs:198-209 | crates/analytics/src/payments/accumulator.rs:353-364 — `crates/analytics/src/payment_intents/accumulator.rs` and `crates/analytics/src/payments/accumulator.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 96 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 (12 lines × 2) crates/analytics/src/payment_intents/core.rs:181— crates/analytics/src/payment_intents/core.rs:181-192 | crates/analytics/src/payments/core.rs:227-238 — `crates/analytics/src/payment_intents/core.rs` and `crates/analytics/src/payments/core.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 60 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 (12 lines × 2) crates/analytics/src/payments/accumulator.rs:429— crates/analytics/src/payments/accumulator.rs:429-440 | crates/analytics/src/sdk_events/accumulator.rs:62-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs:165— crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs:165-176 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs:157-168 — before extracting anything, compare `crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs` and `crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/api_models/src/payment_methods.rs:2391— crates/api_models/src/payment_methods.rs:2391-2402 | crates/api_models/src/payment_methods.rs:2446-2457 — both copies are in the same file, so extract the block into 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) crates/api_models/src/payments.rs:3928— crates/api_models/src/payments.rs:3928-3939 | crates/hyperswitch_domain_models/src/payment_method_data.rs:3967-3978 — before extracting anything, compare `crates/api_models/src/payments.rs` and `crates/hyperswitch_domain_models/src/payment_method_data.rs` as WHOLE FILES: this scan already matched 14 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 (12 lines × 2) crates/diesel_models/src/query/blocklist.rs:872— crates/diesel_models/src/query/blocklist.rs:872-883 | crates/diesel_models/src/query/blocklist.rs:958-969 — both copies are in the same file, so extract the block into 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) crates/diesel_models/src/query/user/sample_data.rs:94— crates/diesel_models/src/query/user/sample_data.rs:94-105 | crates/diesel_models/src/query/user/sample_data.rs:121-132 — both copies are in the same file, so extract the block into 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) crates/euclid/src/frontend/ast/lowering.rs:172— crates/euclid/src/frontend/ast/lowering.rs:172-183 | crates/euclid/src/frontend/ast/lowering.rs:198-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:2193— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:2193-2204 | crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:512-523 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:796— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:796-807 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1833-1844 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/hyperswitch_connectors/src/connectors/braintree.rs:644— crates/hyperswitch_connectors/src/connectors/braintree.rs:644-655 | crates/hyperswitch_connectors/src/connectors/braintree.rs:1306-1317 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs:895— crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs:895-906 | crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs:1077-1088 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2597— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2597-2608 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2697-2708 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3151— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3151-3162 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1489-1500 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 46 separate duplicated blocks between them, totalling at least 601 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 (12 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4442— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4442-4453 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1980-1991 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 46 separate duplicated blocks between them, totalling at least 601 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 (12 lines × 2) crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:395— crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:395-406 | crates/hyperswitch_connectors/src/connectors/zift/transformers.rs:347-358 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) crates/hyperswitch_connectors/src/connectors/elavon.rs:268— crates/hyperswitch_connectors/src/connectors/elavon.rs:268-279 | crates/hyperswitch_connectors/src/connectors/zift.rs:397-408 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/elavon.rs` and `crates/hyperswitch_connectors/src/connectors/zift.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:1141— crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:1141-1152 | crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:1251-1262 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:520— crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:520-531 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:151-162 — `crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/volt/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 2) crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:184— crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:184-195 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:293-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/hyperswitch_connectors/src/connectors/nmi.rs:875— crates/hyperswitch_connectors/src/connectors/nmi.rs:875-886 | crates/hyperswitch_connectors/src/connectors/nmi.rs:901-912 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
TooManyFields: ConnectorConfig crates/connector_configs/src/connector.rs:267— TooManyFields — 184 stored fields beside 8 methods. The bar is 30 stored fields; this is 154 over it, 6.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Connectors crates/hyperswitch_domain_models/src/connector_endpoints.rs:12— TooManyFields — 169 stored fields beside 1 method. The bar is 30 stored fields; this is 139 over it, 5.63× 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: PaymentsResponse crates/api_models/src/payments.rs:7531— TooManyFields — 124 stored fields. The bar is 30 stored fields; this is 94 over it, 4.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Settings crates/router/src/configs/settings.rs:79— TooManyFields — 111 stored fields beside 6 methods. The bar is 30 stored fields; this is 81 over it, 3.70× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: PaymentAttempt crates/diesel_models/src/payment_attempt.rs:214— TooManyFields — 97 stored fields. The bar is 30 stored fields; this is 67 over it, 3.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: PaymentsRequest crates/api_models/src/payments.rs:1205— TooManyFields — 92 stored fields beside 11 methods. The bar is 30 stored fields; this is 62 over it, 3.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: PaymentAttempt crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:1391— TooManyFields — 90 stored fields. The bar is 30 stored fields; this is 60 over it, 3.00× 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: PaymentAttemptNew crates/diesel_models/src/payment_attempt.rs:489— TooManyFields — 89 stored fields. The bar is 30 stored fields; this is 59 over it, 2.97× 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: PaymentAttempt crates/diesel_models/src/payment_attempt.rs:101— TooManyFields — 88 stored fields beside 17 methods. The bar is 30 stored fields; this is 58 over it, 2.93× 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: PaymentIntent REDACTED:132— TooManyFields — 83 stored fields. The bar is 30 stored fields; this is 53 over it, 2.77× 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: PaymentIntentNew REDACTED:457— TooManyFields — 83 stored fields. The bar is 30 stored fields; this is 53 over it, 2.77× 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: PaymentIntent REDACTED:24— TooManyFields — 82 stored fields beside 8 methods. The bar is 30 stored fields; this is 52 over it, 2.73× 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: PaymentIntent crates/hyperswitch_domain_models/src/payments.rs:70— TooManyFields — 80 stored fields beside 42 methods. The bar is 30 stored fields; this is 50 over it, 2.67× 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: PaymentAttemptNew crates/diesel_models/src/payment_attempt.rs:398— TooManyFields — 79 stored fields beside 2 methods. The bar is 30 stored fields; this is 49 over it, 2.63× 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: PaymentAttemptUpdateInternal crates/diesel_models/src/payment_attempt.rs:1100— TooManyFields — 79 stored fields. The bar is 30 stored fields; this is 49 over it, 2.63× 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: Authentication crates/diesel_models/src/authentication.rs:11— TooManyFields — 76 stored fields beside 9 methods. The bar is 30 stored fields; this is 46 over it, 2.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Authentication crates/hyperswitch_domain_models/src/authentication.rs:26— TooManyFields — 76 stored fields beside 4 methods. The bar is 30 stored fields; this is 46 over it, 2.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: AuthenticationNew crates/diesel_models/src/authentication.rs:127— TooManyFields — 76 stored fields beside 2 methods. The bar is 30 stored fields; this is 46 over it, 2.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: PaymentIntentNew REDACTED:370— TooManyFields — 74 stored fields beside 2 methods. The bar is 30 stored fields; this is 44 over it, 2.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: Profile crates/diesel_models/src/business_profile.rs:265— TooManyFields — 71 stored fields. The bar is 30 stored fields; this is 41 over it, 2.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: KafkaPaymentAttempt crates/router/src/services/kafka/payment_attempt.rs:150— TooManyFields — 70 stored fields. The bar is 30 stored fields; this is 40 over it, 2.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: KafkaPaymentAttemptEvent crates/router/src/services/kafka/payment_attempt_event.rs:152— TooManyFields — 70 stored fields. The bar is 30 stored fields; this is 40 over it, 2.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Profile crates/diesel_models/src/business_profile.rs:32— TooManyFields — 68 stored fields beside 7 methods. 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: ConfigMetadata crates/connector_configs/src/connector.rs:147— TooManyFields — 67 stored fields. The bar is 30 stored fields; this is 37 over it, 2.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: KafkaPaymentIntent crates/router/src/services/kafka/payment_intent.rs:117— TooManyFields — 67 stored fields. The bar is 30 stored fields; this is 37 over it, 2.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.
Duplicated block (9 lines × 2) crates/analytics/src/auth_events/core.rs:45— crates/analytics/src/auth_events/core.rs:45-53 | crates/analytics/src/sdk_events/core.rs:54-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) crates/analytics/src/payment_intents/core.rs:311— crates/analytics/src/payment_intents/core.rs:311-319 | crates/analytics/src/refunds/core.rs:253-261 — `crates/analytics/src/payment_intents/core.rs` and `crates/analytics/src/refunds/core.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 57 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) crates/api_models/src/payments.rs:455— crates/api_models/src/payments.rs:455-463 | crates/api_models/src/payments.rs:1849-1857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/api_models/src/routing.rs:1062— crates/api_models/src/routing.rs:1062-1070 | crates/api_models/src/routing.rs:1630-1638 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/common_types/src/payments.rs:715— crates/common_types/src/payments.rs:715-723 | crates/common_types/src/payments.rs:868-876 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/common_utils/src/id_type.rs:166— crates/common_utils/src/id_type.rs:166-174 | crates/common_utils/src/id_type.rs:200-208 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) REDACTED:1006— REDACTED:1006-1014 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1138-1146 — before extracting anything, compare `REDACTED` and `crates/hyperswitch_domain_models/src/payments/payment_intent.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) crates/diesel_models/src/query/blocklist.rs:702— crates/diesel_models/src/query/blocklist.rs:702-710 | crates/diesel_models/src/query/blocklist.rs:745-753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:920— crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:920-928 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:482-490 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:927— crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:927-935 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:610-618 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4594— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4594-4602 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4858-4866 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:874— crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:874-882 | crates/hyperswitch_connectors/src/connectors/payme.rs:1028-1036 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs` and `crates/hyperswitch_connectors/src/connectors/payme.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:415— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:415-423 | crates/router/src/core/payout_link.rs:420-428 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:866— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:866-874 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1707-1715 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1097— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1097-1106 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1324-1332 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 38 separate duplicated blocks between them, totalling at least 451 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1422— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1422-1430 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1656-1664 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 527 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) crates/hyperswitch_connectors/src/connectors/checkout.rs:998— crates/hyperswitch_connectors/src/connectors/checkout.rs:998-1006 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2542-2550 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/checkout.rs` and `crates/hyperswitch_connectors/src/connectors/stripe.rs` as WHOLE FILES: this scan already matched 13 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 (9 lines × 2) crates/hyperswitch_connectors/src/connectors/checkout.rs:1123— crates/hyperswitch_connectors/src/connectors/checkout.rs:1123-1131 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2287-2295 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/checkout.rs` and `crates/hyperswitch_connectors/src/connectors/stripe.rs` as WHOLE FILES: this scan already matched 13 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 (9 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource.rs:589— crates/hyperswitch_connectors/src/connectors/cybersource.rs:589-597 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:516-524 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersource.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 506 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:675— crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:675-683 | crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:930-938 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rs:286— crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rs:286-294 | crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rs:306-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.
Duplicated block (9 lines × 2) crates/hyperswitch_connectors/src/connectors/fiuu.rs:506— crates/hyperswitch_connectors/src/connectors/fiuu.rs:506-514 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1509-1517 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/fiuu.rs` and `crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/gocardless.rs:754— crates/hyperswitch_connectors/src/connectors/gocardless.rs:754-762 | crates/hyperswitch_connectors/src/connectors/gocardless.rs:790-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 (9 lines × 2) crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs:202— crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs:202-210 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:213-221 — `crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/volt/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 33 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) crates/hyperswitch_connectors/src/connectors/nmi.rs:317— crates/hyperswitch_connectors/src/connectors/nmi.rs:317-325 | crates/hyperswitch_connectors/src/connectors/payload.rs:392-400 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) crates/analytics/src/payment_intents/accumulator.rs:169— crates/analytics/src/payment_intents/accumulator.rs:169-181 | crates/analytics/src/payments/accumulator.rs:307-319 — `crates/analytics/src/payment_intents/accumulator.rs` and `crates/analytics/src/payments/accumulator.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 96 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 2) crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:40— crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:40-52 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs:43-55 — before extracting anything, compare `crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs` and `crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs` as WHOLE FILES: this scan already matched 5 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 (13 lines × 2) crates/api_models/src/payment_methods.rs:2339— crates/api_models/src/payment_methods.rs:2339-2351 | crates/api_models/src/payment_methods.rs:2369-2381 — both copies are in the same file, so extract the block into 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) crates/diesel_models/src/query/blocklist.rs:725— crates/diesel_models/src/query/blocklist.rs:725-737 | crates/diesel_models/src/query/blocklist.rs:764-776 — both copies are in the same file, so extract the block into 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) crates/euclid/src/dssa/state_machine.rs:358— crates/euclid/src/dssa/state_machine.rs:358-370 | crates/euclid/src/dssa/state_machine.rs:490-502 — both copies are in the same file, so extract the block into 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) crates/external_services/src/grpc_client.rs:296— crates/external_services/src/grpc_client.rs:296-308 | crates/external_services/src/grpc_client/revenue_recovery.rs:26-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:677— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:677-689 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:754-766 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1233— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1233-1245 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2539-2551 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 47 separate duplicated blocks between them, totalling at least 513 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 2) crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:903— crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:903-915 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:163-175 — `crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 70 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:177— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:177-189 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:986-998 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:953— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:953-965 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:619-631 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 46 separate duplicated blocks between them, totalling at least 601 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2299— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2299-2311 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1024-1036 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 46 separate duplicated blocks between them, totalling at least 601 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 2) crates/hyperswitch_connectors/src/connectors/fiuu.rs:404— crates/hyperswitch_connectors/src/connectors/fiuu.rs:404-416 | crates/hyperswitch_connectors/src/connectors/paybox.rs:227-239 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/fiuu.rs` and `crates/hyperswitch_connectors/src/connectors/paybox.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:301— crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:301-313 | crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:383-395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:619— crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:619-631 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:288-300 — `crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 31 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 2) crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:882— crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:882-894 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1034-1046 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:1304— crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:1304-1316 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:1384-1396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:817— crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:817-829 | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:1283-1295 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:1524— crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:1524-1536 | crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:1566-1578 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/peachpayments.rs:151— crates/hyperswitch_connectors/src/connectors/peachpayments.rs:151-163 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:766-778 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:828— crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:828-840 | crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:853-865 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/shift4.rs:404— crates/hyperswitch_connectors/src/connectors/shift4.rs:404-416 | crates/hyperswitch_connectors/src/connectors/square.rs:563-575 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/shift4.rs` and `crates/hyperswitch_connectors/src/connectors/square.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:1013— crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:1013-1025 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:1087-1099 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:136— crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:136-148 | crates/hyperswitch_connectors/src/connectors/tsys_transit.rs:50-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers.rs:262— crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers.rs:262-274 | crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers.rs:308-320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Low cohesion: Store (LCOM4 258) crates/drainer/src/services.rs:12— Store's methods fall into 258 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 258 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: RouterStore (LCOM4 67) crates/storage_impl/src/lib.rs:71— RouterStore's methods fall into 67 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 67 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: Stripe (LCOM4 63) crates/hyperswitch_connectors/src/connectors/stripe.rs:101— Stripe's methods fall into 63 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 63 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: Adyen (LCOM4 61) crates/hyperswitch_connectors/src/connectors/adyen.rs:122— Adyen's methods fall into 61 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 61 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: Paypal (LCOM4 50) crates/hyperswitch_connectors/src/connectors/paypal.rs:97— Paypal's methods fall into 50 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 50 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: Nuvei (LCOM4 39) crates/hyperswitch_connectors/src/connectors/nuvei.rs:77— Nuvei's methods fall into 39 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 39 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: Santander (LCOM4 32) crates/hyperswitch_connectors/src/connectors/santander.rs:102— Santander's methods fall into 32 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 32 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: Worldpayvantiv (LCOM4 31) crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:74— Worldpayvantiv's methods fall into 31 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 31 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: Payme (LCOM4 30) crates/hyperswitch_connectors/src/connectors/payme.rs:67— Payme's methods fall into 30 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 30 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: Airwallex (LCOM4 29) crates/hyperswitch_connectors/src/connectors/airwallex.rs:71— Airwallex's methods fall into 29 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 29 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: Checkout (LCOM4 29) crates/hyperswitch_connectors/src/connectors/checkout.rs:75— Checkout's methods fall into 29 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 29 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: Wise (LCOM4 28) crates/hyperswitch_connectors/src/connectors/wise.rs:63— Wise's methods fall into 28 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 28 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Cybersource (LCOM4 27) crates/hyperswitch_connectors/src/connectors/cybersource.rs:89— Cybersource's methods fall into 27 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 27 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: Worldpay (LCOM4 27) crates/hyperswitch_connectors/src/connectors/worldpay.rs:93— Worldpay's methods fall into 27 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 27 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: Bluesnap (LCOM4 26) crates/hyperswitch_connectors/src/connectors/bluesnap.rs:77— Bluesnap's methods fall into 26 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 26 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Braintree (LCOM4 26) crates/hyperswitch_connectors/src/connectors/braintree.rs:80— Braintree's methods fall into 26 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 26 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Payload (LCOM4 26) crates/hyperswitch_connectors/src/connectors/payload.rs:85— Payload's methods fall into 26 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 26 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Truelayer (LCOM4 25) crates/hyperswitch_connectors/src/connectors/truelayer.rs:62— Truelayer's methods fall into 25 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 25 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: Finix (LCOM4 24) crates/hyperswitch_connectors/src/connectors/finix.rs:65— Finix's methods fall into 24 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 24 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: Fiuu (LCOM4 24) crates/hyperswitch_connectors/src/connectors/fiuu.rs:175— Fiuu's methods fall into 24 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 24 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: MockDb (LCOM4 24) crates/storage_impl/src/mock_db.rs:30— MockDb's methods fall into 24 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 24 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: Authorizedotnet (LCOM4 23) crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:66— Authorizedotnet's methods fall into 23 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 23 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: Nmi (LCOM4 23) crates/hyperswitch_connectors/src/connectors/nmi.rs:65— Nmi's methods fall into 23 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 23 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: Novalnet (LCOM4 23) crates/hyperswitch_connectors/src/connectors/novalnet.rs:58— Novalnet's methods fall into 23 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 23 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: Trustpay (LCOM4 23) crates/hyperswitch_connectors/src/connectors/trustpay.rs:66— Trustpay's methods fall into 23 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 23 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Duplicated block (8 lines × 2) crates/api_models/src/payment_methods.rs:2389— crates/api_models/src/payment_methods.rs:2389-2396 | crates/api_models/src/payment_methods.rs:2419-2426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/api_models/src/payment_methods.rs:2846— crates/api_models/src/payment_methods.rs:2846-2853 | crates/api_models/src/payment_methods.rs:2964-2971 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/api_models/src/payments.rs:6218— crates/api_models/src/payments.rs:6218-6225 | crates/api_models/src/payments.rs:6227-6234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/common_utils/src/new_type.rs:258— crates/common_utils/src/new_type.rs:258-265 | crates/common_utils/src/new_type.rs:286-293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/diesel_models/src/query/blocklist.rs:103— crates/diesel_models/src/query/blocklist.rs:103-110 | crates/diesel_models/src/query/blocklist.rs:1052-1059 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/diesel_models/src/query/blocklist.rs:389— crates/diesel_models/src/query/blocklist.rs:389-396 | crates/diesel_models/src/query/blocklist.rs:1133-1140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/hyperswitch_connectors/src/connectors/aci.rs:386— crates/hyperswitch_connectors/src/connectors/aci.rs:386-393 | crates/hyperswitch_connectors/src/connectors/adyen.rs:723-730 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/aci.rs` and `crates/hyperswitch_connectors/src/connectors/adyen.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/aci.rs:662— crates/hyperswitch_connectors/src/connectors/aci.rs:662-669 | crates/hyperswitch_connectors/src/connectors/adyen.rs:1764-1771 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/aci.rs` and `crates/hyperswitch_connectors/src/connectors/adyen.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:228— crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:228-235 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:757-764 — 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) crates/hyperswitch_connectors/src/connectors/adyen.rs:2183— crates/hyperswitch_connectors/src/connectors/adyen.rs:2183-2190 | crates/hyperswitch_connectors/src/connectors/checkout.rs:970-977 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/checkout.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/adyen.rs:2261— crates/hyperswitch_connectors/src/connectors/adyen.rs:2261-2268 | crates/hyperswitch_connectors/src/connectors/checkout.rs:1229-1236 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/checkout.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:6371— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:6371-6378 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:6430-6437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs:268— crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs:268-275 | crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs:323-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.
Duplicated block (8 lines × 2) crates/hyperswitch_connectors/src/connectors/bambora.rs:146— crates/hyperswitch_connectors/src/connectors/bambora.rs:146-153 | crates/hyperswitch_connectors/src/connectors/volt.rs:293-300 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bambora.rs` and `crates/hyperswitch_connectors/src/connectors/volt.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:670— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:670-677 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4232-4239 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 527 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 2) crates/hyperswitch_connectors/src/connectors/checkout.rs:193— crates/hyperswitch_connectors/src/connectors/checkout.rs:193-201 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:197-204 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/checkout.rs` and `crates/hyperswitch_connectors/src/connectors/trustpay.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 156 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:2632— crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:2632-2639 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:5391-5398 — `crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 60 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1859— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1859-1866 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:940-947 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 46 separate duplicated blocks between them, totalling at least 601 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 2) crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs:332— crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs:332-339 | crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs:353-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.
Duplicated block (8 lines × 2) crates/hyperswitch_connectors/src/connectors/fiserv.rs:76— crates/hyperswitch_connectors/src/connectors/fiserv.rs:76-83 | crates/hyperswitch_connectors/src/connectors/fiservemea.rs:78-85 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/fiserv.rs` and `crates/hyperswitch_connectors/src/connectors/fiservemea.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 (8 lines × 2) crates/hyperswitch_connectors/src/connectors/fiuu.rs:261— crates/hyperswitch_connectors/src/connectors/fiuu.rs:261-268 | crates/hyperswitch_connectors/src/connectors/redsys.rs:136-143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/hyperswitch_connectors/src/connectors/fiuu.rs:311— crates/hyperswitch_connectors/src/connectors/fiuu.rs:311-318 | crates/hyperswitch_connectors/src/connectors/hipay.rs:73-80 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/fiuu.rs` and `crates/hyperswitch_connectors/src/connectors/hipay.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) crates/hyperswitch_connectors/src/connectors/hipay.rs:456— crates/hyperswitch_connectors/src/connectors/hipay.rs:456-463 | crates/hyperswitch_connectors/src/connectors/hipay.rs:609-616 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs:239— crates/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs:239-246 | crates/hyperswitch_connectors/src/connectors/silverflow.rs:238-245 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs` and `crates/hyperswitch_connectors/src/connectors/silverflow.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs:169— crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs:169-176 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:738-745 — `crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 34 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.
router::core::payments::tokenization::save_payment_method (cognitive 188) crates/router/src/core/payments/tokenization.rs:191— router::core::payments::tokenization::save_payment_method has cognitive complexity 188 (threshold 15). Drivers by points: if/else 47 (127 pts), match/switch 17 (60 pts), boolean chains 1 (nesting depth added 123). 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.
router::core::payment_methods::cards::build_merchant_enabled_pms_context (cognitive 172) crates/router/src/core/payment_methods/cards.rs:4663— router::core::payment_methods::cards::build_merchant_enabled_pms_context has cognitive complexity 172 (threshold 15). Drivers by points: if/else 53 (123 pts), loops 13 (37 pts), match/switch 6 (10 pts), boolean chains 2 (nesting depth added 98). 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.
router::core::payments::operations::payment_response::payment_response_update_tracker (cognitive 112) crates/router/src/core/payments/operations/payment_response.rs:2587— router::core::payments::operations::payment_response::payment_response_update_tracker has cognitive complexity 112 (threshold 15). Drivers by points: match/switch 22 (63 pts), if/else 24 (45 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 63). 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.
router::core::payments::payments_operation_core (cognitive 95) crates/router/src/core/payments.rs:780— router::core::payments::payments_operation_core has cognitive complexity 95 (threshold 15). Drivers by points: if/else 27 (74 pts), match/switch 5 (17 pts), boolean chains 4 (nesting depth added 59). 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.
router::core::payment_methods::migration::update_payment_method_record (cognitive 90) crates/router/src/core/payment_methods/migration.rs:45— router::core::payment_methods::migration::update_payment_method_record has cognitive complexity 90 (threshold 15). Drivers by points: if/else 30 (71 pts), match/switch 6 (12 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
router::core::superposition_sdk_config::get_profile_superposition_sdk_config (cognitive 88) crates/router/src/core/superposition_sdk_config.rs:139— router::core::superposition_sdk_config::get_profile_superposition_sdk_config has cognitive complexity 88 (threshold 15). Drivers by points: if/else 12 (72 pts), loops 4 (16 pts) (nesting depth added 72). 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.
router::core::payments::helpers::validate_platform_request_for_marketplace (cognitive 62) crates/router/src/core/payments/helpers.rs:9880— router::core::payments::helpers::validate_platform_request_for_marketplace has cognitive complexity 62 (threshold 15). Drivers by points: if/else 15 (45 pts), match/switch 7 (14 pts), boolean chains 3 (nesting depth added 37). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
router::core::payment_methods::cards::filter_payment_methods (cognitive 57) crates/router/src/core/payment_methods/cards.rs:6049— router::core::payment_methods::cards::filter_payment_methods has cognitive complexity 57 (threshold 15). Drivers by points: if/else 15 (50 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
router::core::payments::transformers::payments_to_payments_response (cognitive 53) crates/router/src/core/payments/transformers.rs:3862— router::core::payments::transformers::payments_to_payments_response has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (29 pts), match/switch 8 (20 pts), boolean chains 4 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
router::core::routing::link_routing_config (cognitive 44) crates/router/src/core/routing.rs:1127— router::core::routing::link_routing_config has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (30 pts), match/switch 5 (12 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
router::core::payments::helpers::get_token_pm_type_mandate_details (cognitive 40) crates/router/src/core/payments/helpers.rs:466— router::core::payments::helpers::get_token_pm_type_mandate_details has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 7 (18 pts) (nesting depth added 24). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
router::core::payouts::helpers::save_payout_data_to_locker (cognitive 40) crates/router/src/core/payouts/helpers.rs:378— router::core::payouts::helpers::save_payout_data_to_locker has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (29 pts), match/switch 6 (11 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.
router::core::payments::operations::payment_response::update_modular_pm_and_mandate_impl (cognitive 39) crates/router/src/core/payments/operations/payment_response.rs:169— router::core::payments::operations::payment_response::update_modular_pm_and_mandate_impl has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 4 (16 pts), boolean chains 2 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
router::core::card_testing_guard::utils::increment_blocked_count_in_cache (cognitive 37) crates/router/src/core/card_testing_guard/utils.rs:190— router::core::card_testing_guard::utils::increment_blocked_count_in_cache has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (37 pts) (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
router::core::webhooks::incoming::external_authentication_incoming_webhook_flow (cognitive 36) crates/router/src/core/webhooks/incoming.rs:1994— router::core::webhooks::incoming::external_authentication_incoming_webhook_flow has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 3 (11 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.
router::core::merchant_connector_webhook_management::register_connector_webhook (cognitive 35) crates/router/src/core/merchant_connector_webhook_management.rs:175— router::core::merchant_connector_webhook_management::register_connector_webhook has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 3 (6 pts), match/switch 3, boolean chains 1 (nesting depth added 19). 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.
router::core::payments::helpers::get_additional_payment_data (cognitive 35) crates/router/src/core/payments/helpers.rs:6247— router::core::payments::helpers::get_additional_payment_data has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 4 (7 pts), boolean chains 4 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
router::core::card_testing_guard::utils::validate_card_testing_guard_checks (cognitive 32) crates/router/src/core/card_testing_guard/utils.rs:17— router::core::card_testing_guard::utils::validate_card_testing_guard_checks has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 6 (19 pts), if/else 8 (12 pts), boolean chains 1 (nesting depth added 17). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
router::core::payments::flows::session_flow::create_applepay_session_token (cognitive 32) crates/router/src/core/payments/flows/session_flow.rs:272— router::core::payments::flows::session_flow::create_applepay_session_token has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 4 (10 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.
router::core::routing::retrieve_linked_routing_config (cognitive 32) crates/router/src/core/routing.rs:2160— router::core::routing::retrieve_linked_routing_config has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 3 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
router::core::payment_methods::cards::list_payment_methods (cognitive 30) crates/router/src/core/payment_methods/cards.rs:5387— router::core::payment_methods::cards::list_payment_methods has cognitive complexity 30 (threshold 15). Drivers by points: loops 9 (15 pts), if/else 12 (13 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
router::core::payments::operations::payment_response::create_or_update_payment_method_from_payment_response (cognitive 30) crates/router/src/core/payments/operations/payment_response.rs:3974— router::core::payments::operations::payment_response::create_or_update_payment_method_from_payment_response has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (27 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
router::core::payout_link::filter_payout_methods (cognitive 30) crates/router/src/core/payout_link.rs:331— router::core::payout_link::filter_payout_methods has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 3 (12 pts), if/else 3 (10 pts), loops 4 (8 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.
router::routes::payments::authorize_verify_select (cognitive 30) crates/router/src/routes/payments.rs:2833— router::routes::payments::authorize_verify_select has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 2 (8 pts), boolean chains 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
router::workflows::revenue_recovery::get_token_with_schedule_time_based_on_retry_algorithm_type (cognitive 30) crates/router/src/workflows/revenue_recovery.rs:783— router::workflows::revenue_recovery::get_token_with_schedule_time_based_on_retry_algorithm_type has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 5 (12 pts), boolean chains 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Duplicated block (14 lines × 2) crates/analytics/src/auth_events/core.rs:225— crates/analytics/src/auth_events/core.rs:225-238 | crates/analytics/src/payment_intents/core.rs:53-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.
Duplicated block (14 lines × 2) crates/analytics/src/clickhouse.rs:592— crates/analytics/src/clickhouse.rs:592-605 | crates/analytics/src/sqlx.rs:1594-1607 — before extracting anything, compare `crates/analytics/src/clickhouse.rs` and `crates/analytics/src/sqlx.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/analytics/src/sqlx.rs:629— crates/analytics/src/sqlx.rs:629-642 | crates/analytics/src/sqlx.rs:1358-1371 — both copies are in the same file, so extract the block into 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) crates/api_models/src/payments.rs:4035— crates/api_models/src/payments.rs:4035-4048 | crates/hyperswitch_domain_models/src/payment_method_data.rs:4066-4079 — before extracting anything, compare `crates/api_models/src/payments.rs` and `crates/hyperswitch_domain_models/src/payment_method_data.rs` as WHOLE FILES: this scan already matched 14 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 (14 lines × 2) crates/diesel_models/src/payment_attempt.rs:1486— crates/diesel_models/src/payment_attempt.rs:1486-1499 | crates/diesel_models/src/payment_attempt.rs:4375-4389 — both copies are in the same file, so extract the block into 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) REDACTED:1022— REDACTED:1022-1035 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1153-1166 — before extracting anything, compare `REDACTED` and `crates/hyperswitch_domain_models/src/payments/payment_intent.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/drainer/src/settings.rs:170— crates/drainer/src/settings.rs:170-183 | crates/router/src/configs/settings.rs:2032-2045 — 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) crates/external_services/src/http_client/client.rs:44— crates/external_services/src/http_client/client.rs:44-57 | crates/injector/src/injector.rs:106-119 — 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) crates/external_services/src/superposition.rs:332— crates/external_services/src/superposition.rs:332-345 | crates/external_services/src/superposition.rs:585-598 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/hyperswitch_connectors/src/connectors/adyen.rs:1579— crates/hyperswitch_connectors/src/connectors/adyen.rs:1579-1592 | crates/hyperswitch_connectors/src/connectors/paypal.rs:1405-1418 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/paypal.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3537— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3537-3550 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3671-3684 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs:472— crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs:472-485 | crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs:2025-2038 — 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) crates/hyperswitch_connectors/src/connectors/archipel.rs:453— crates/hyperswitch_connectors/src/connectors/archipel.rs:453-466 | crates/hyperswitch_connectors/src/connectors/archipel.rs:853-866 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:407— crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:407-420 | crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:677-690 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/barclaycard.rs:400— crates/hyperswitch_connectors/src/connectors/barclaycard.rs:400-413 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:701-714 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 291 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/barclaycard.rs:494— crates/hyperswitch_connectors/src/connectors/barclaycard.rs:494-507 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:795-808 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 291 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/bluesnap.rs:630— crates/hyperswitch_connectors/src/connectors/bluesnap.rs:630-643 | crates/hyperswitch_connectors/src/connectors/klarna.rs:251-264 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bluesnap.rs` and `crates/hyperswitch_connectors/src/connectors/klarna.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/hyperswitch_connectors/src/connectors/dwolla.rs:739— crates/hyperswitch_connectors/src/connectors/dwolla.rs:739-752 | crates/hyperswitch_connectors/src/connectors/jpmorgan.rs:696-709 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/dwolla.rs` and `crates/hyperswitch_connectors/src/connectors/jpmorgan.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs:520— crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs:520-533 | crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:324-337 — `crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 104 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 (14 lines × 2) crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:482— crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:482-495 | crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:670-683 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/fiuu.rs:296— crates/hyperswitch_connectors/src/connectors/fiuu.rs:296-309 | crates/hyperswitch_connectors/src/connectors/hipay.rs:57-70 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/fiuu.rs` and `crates/hyperswitch_connectors/src/connectors/hipay.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/hyperswitch_connectors/src/connectors/gpayments.rs:393— crates/hyperswitch_connectors/src/connectors/gpayments.rs:393-406 | crates/hyperswitch_connectors/src/connectors/threedsecureio.rs:485-498 — 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) crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:164— crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:164-177 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:273-286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/hyperswitch_connectors/src/connectors/inespay/transformers.rs:125— crates/hyperswitch_connectors/src/connectors/inespay/transformers.rs:125-138 | crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs:125-138 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:373— crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:373-386 | crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs:339-352 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) crates/analytics/src/connector_events/events.rs:40— crates/analytics/src/connector_events/events.rs:40-54 | crates/analytics/src/outgoing_webhook_event/events.rs:28-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) crates/api_models/src/payment_methods.rs:2856— crates/api_models/src/payment_methods.rs:2856-2870 | crates/api_models/src/payment_methods.rs:2974-2988 — both copies are in the same file, so extract the block into 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) crates/diesel_models/src/payment_attempt.rs:2568— crates/diesel_models/src/payment_attempt.rs:2568-2582 | crates/diesel_models/src/payment_attempt.rs:2782-2796 — both copies are in the same file, so extract the block into 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) crates/diesel_models/src/payment_method.rs:632— crates/diesel_models/src/payment_method.rs:632-646 | crates/diesel_models/src/payment_method.rs:897-911 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:608— crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:608-622 | crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs:609-623 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:628— crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:628-642 | crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs:629-643 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:953— crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:953-967 | crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:969-983 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/hyperswitch_connectors/src/connectors/adyen.rs:831— crates/hyperswitch_connectors/src/connectors/adyen.rs:831-845 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:620-634 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/globalpay.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3262— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3262-3276 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:6924-6938 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:216— crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:216-230 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:173-187 — `crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 71 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 (15 lines × 2) crates/hyperswitch_connectors/src/connectors/breadpay/transformers.rs:249— crates/hyperswitch_connectors/src/connectors/breadpay/transformers.rs:249-263 | crates/hyperswitch_connectors/src/connectors/flexiti/transformers.rs:285-299 — `crates/hyperswitch_connectors/src/connectors/breadpay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/flexiti/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 37 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 (15 lines × 2) crates/hyperswitch_connectors/src/connectors/celero/transformers.rs:718— crates/hyperswitch_connectors/src/connectors/celero/transformers.rs:718-732 | crates/hyperswitch_connectors/src/connectors/celero/transformers.rs:793-807 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4496— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4496-4510 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:2033-2047 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 46 separate duplicated blocks between them, totalling at least 601 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 (15 lines × 2) crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:68— crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:68-82 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:175-189 — `crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 145 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 (15 lines × 2) crates/hyperswitch_connectors/src/connectors/hipay.rs:312— crates/hyperswitch_connectors/src/connectors/hipay.rs:312-326 | crates/hyperswitch_connectors/src/connectors/shift4.rs:244-258 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/hipay.rs` and `crates/hyperswitch_connectors/src/connectors/shift4.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) crates/hyperswitch_connectors/src/connectors/klarna.rs:575— crates/hyperswitch_connectors/src/connectors/klarna.rs:575-589 | crates/hyperswitch_connectors/src/connectors/klarna.rs:867-881 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs:349— crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs:349-363 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:683-697 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) crates/hyperswitch_connectors/src/connectors/payu/transformers.rs:255— crates/hyperswitch_connectors/src/connectors/payu/transformers.rs:255-269 | crates/hyperswitch_connectors/src/connectors/payu/transformers.rs:386-400 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1783— crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1783-1797 | crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1835-1849 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/stripe.rs:738— crates/hyperswitch_connectors/src/connectors/stripe.rs:738-752 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1143-1157 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:3627— crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:3627-3641 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:3971-3985 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:1045— crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:1045-1059 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:1837-1851 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/utils.rs:7743— crates/hyperswitch_connectors/src/utils.rs:7743-7757 | crates/router/src/types.rs:1419-1433 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/types.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 2) crates/hyperswitch_domain_models/src/business_profile.rs:325— crates/hyperswitch_domain_models/src/business_profile.rs:325-339 | crates/hyperswitch_domain_models/src/business_profile.rs:473-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/payment_methods/src/client/delete.rs:77— crates/payment_methods/src/client/delete.rs:77-91 | crates/payment_methods/src/client/retrieve.rs:87-101 — 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) crates/analytics/src/lib.rs:317— crates/analytics/src/lib.rs:317-332 | crates/analytics/src/lib.rs:649-664 — both copies are in the same file, so extract the block into 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) crates/analytics/src/payment_intents/accumulator.rs:214— crates/analytics/src/payment_intents/accumulator.rs:214-229 | crates/analytics/src/payments/accumulator.rs:369-384 — `crates/analytics/src/payment_intents/accumulator.rs` and `crates/analytics/src/payments/accumulator.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 96 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 (16 lines × 2) crates/analytics/src/payment_intents/accumulator.rs:233— crates/analytics/src/payment_intents/accumulator.rs:233-248 | crates/analytics/src/payments/accumulator.rs:388-403 — `crates/analytics/src/payment_intents/accumulator.rs` and `crates/analytics/src/payments/accumulator.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 96 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 (16 lines × 2) crates/analytics/src/payments/distribution/payment_error_message.rs:75— crates/analytics/src/payments/distribution/payment_error_message.rs:75-90 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs:75-90 — before extracting anything, compare `crates/analytics/src/payments/distribution/payment_error_message.rs` and `crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) crates/analytics/src/sqlx.rs:609— crates/analytics/src/sqlx.rs:609-624 | crates/analytics/src/sqlx.rs:1338-1353 — both copies are in the same file, so extract the block into 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) crates/api_models/src/payment_methods.rs:2269— crates/api_models/src/payment_methods.rs:2269-2284 | crates/api_models/src/payment_methods.rs:2299-2314 — both copies are in the same file, so extract the block into 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) crates/api_models/src/payouts.rs:1405— crates/api_models/src/payouts.rs:1405-1420 | crates/api_models/src/payouts.rs:1547-1562 — both copies are in the same file, so extract the block into 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) crates/api_models/src/payouts.rs:1422— crates/api_models/src/payouts.rs:1422-1437 | crates/api_models/src/payouts.rs:1564-1579 — both copies are in the same file, so extract the block into 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) crates/api_models/src/payouts.rs:1439— crates/api_models/src/payouts.rs:1439-1454 | crates/api_models/src/payouts.rs:1581-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 (16 lines × 2) crates/diesel_models/src/merchant_account.rs:109— crates/diesel_models/src/merchant_account.rs:109-124 | crates/hyperswitch_domain_models/src/merchant_account.rs:101-116 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (16 lines × 2) crates/diesel_models/src/query/generics.rs:347— crates/diesel_models/src/query/generics.rs:347-362 | crates/diesel_models/src/query/generics.rs:393-408 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:301— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:301-316 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:324-339 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1114— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1114-1129 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:415-430 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 47 separate duplicated blocks between them, totalling at least 513 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 (16 lines × 2) crates/hyperswitch_connectors/src/connectors/barclaycard.rs:588— crates/hyperswitch_connectors/src/connectors/barclaycard.rs:588-603 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:889-904 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 291 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1432— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1432-1447 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1666-1681 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 527 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 (16 lines × 2) crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:1138— crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:1138-1153 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:1212-1227 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:341— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:341-356 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:166-181 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 46 separate duplicated blocks between them, totalling at least 601 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 (16 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2329— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2329-2346 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2470-2485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2392— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2392-2407 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2515-2530 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:416— crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:416-431 | crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:451-466 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/dlocal.rs:164— crates/hyperswitch_connectors/src/connectors/dlocal.rs:164-179 | crates/hyperswitch_connectors/src/connectors/volt.rs:296-311 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/dlocal.rs` and `crates/hyperswitch_connectors/src/connectors/volt.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) crates/hyperswitch_connectors/src/connectors/globalpay.rs:145— crates/hyperswitch_connectors/src/connectors/globalpay.rs:145-160 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:347-362 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:239— crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:239-254 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:316-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/hyperswitch_connectors/src/connectors/itaubank.rs:617— crates/hyperswitch_connectors/src/connectors/itaubank.rs:617-632 | crates/hyperswitch_connectors/src/connectors/itaubank.rs:719-734 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/hyperswitch_connectors/src/connectors/nuvei.rs:1056— crates/hyperswitch_connectors/src/connectors/nuvei.rs:1056-1071 | crates/hyperswitch_connectors/src/connectors/shift4.rs:526-541 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/nuvei.rs` and `crates/hyperswitch_connectors/src/connectors/shift4.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Hotspot: crates/router/src/core/unified_connector_service/transformers.rs crates/router/src/core/unified_connector_service/transformers.rs:5711— crates/router/src/core/unified_connector_service/transformers.rs changed 69 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 685 in BankNames::foreign_try_from at line 5711. 15 of those changes were fix/bug commits, and the other 54 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/core/unified_connector_service/transformers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs:1148— crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 651 in BankNames::foreign_try_from at line 1148. 6 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/common_enums/src/enums.rs crates/common_enums/src/enums.rs:2790— crates/common_enums/src/enums.rs changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 127 in PaymentMethodType::to_display_name at line 2790. 2 of those changes were fix/bug commits, and the other 44 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/common_enums/src/enums.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/router/src/core/unified_connector_service/connector_config.rs crates/router/src/core/unified_connector_service/connector_config.rs:893— crates/router/src/core/unified_connector_service/connector_config.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 220 in ConnectorSpecificConfig::foreign_try_from at line 893. 5 of those changes were fix/bug commits, and the other 21 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/core/unified_connector_service/connector_config.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/router/src/core/unified_connector_service.rs crates/router/src/core/unified_connector_service.rs:1572— crates/router/src/core/unified_connector_service.rs changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in router::core::unified_connector_service::build_unified_connector_service_payment_method at line 1572. 10 of those changes were fix/bug commits, and the other 26 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/core/unified_connector_service.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/connector_configs/src/connector.rs crates/connector_configs/src/connector.rs:578— crates/connector_configs/src/connector.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 167 in ConnectorConfig::get_connector_config at line 578. 1 of those changes was a fix/bug commit, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/connector_configs/src/connector.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/hyperswitch_connectors/src/utils.rs crates/hyperswitch_connectors/src/utils.rs:6951— crates/hyperswitch_connectors/src/utils.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 135 in PaymentMethodDataType::from at line 6951. 3 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/hyperswitch_connectors/src/utils.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/euclid/src/enums.rs crates/euclid/src/enums.rs:577— crates/euclid/src/enums.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 162 in Connector::from at line 577. 1 of those changes was a fix/bug commit, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/euclid/src/enums.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/router/src/core/payments/helpers.rs crates/router/src/core/payments/helpers.rs:6247— crates/router/src/core/payments/helpers.rs changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in router::core::payments::helpers::get_additional_payment_data at line 6247. 7 of those changes were fix/bug commits, and the other 41 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/core/payments/helpers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/router/src/core/payments.rs crates/router/src/core/payments.rs:780— crates/router/src/core/payments.rs changed 68 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in router::core::payments::payments_operation_core at line 780. 12 of those changes were fix/bug commits, and the other 56 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/core/payments.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/router/src/core/connector_validation.rs crates/router/src/core/connector_validation.rs:46— crates/router/src/core/connector_validation.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 160 in ConnectorAuthTypeAndMetadataValidation::validate_auth_and_metadata_type_with_connector at line 46. 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 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/core/connector_validation.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: cypress-tests/cypress/support/commands.js cypress-tests/cypress/support/commands.js:3576— cypress-tests/cypress/support/commands.js changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in (anonymous) at line 3576. 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 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- cypress-tests/cypress/support/commands.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/router/src/types/connector_transformers.rs crates/router/src/types/connector_transformers.rs:8— crates/router/src/types/connector_transformers.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 167 in RoutableConnectors::foreign_try_from at line 8. 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 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/types/connector_transformers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/router/src/types/api/feature_matrix.rs crates/router/src/types/api/feature_matrix.rs:16— crates/router/src/types/api/feature_matrix.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 166 in FeatureMatrixConnectorData::convert_connector at line 16. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/types/api/feature_matrix.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/router/src/types/api/connector_mapping.rs crates/router/src/types/api/connector_mapping.rs:103— crates/router/src/types/api/connector_mapping.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 159 in ConnectorData::convert_connector at line 103. 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 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/types/api/connector_mapping.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/router/src/core/payments/operations/payment_response.rs crates/router/src/core/payments/operations/payment_response.rs:2587— crates/router/src/core/payments/operations/payment_response.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in router::core::payments::operations::payment_response::payment_response_update_tracker at line 2587. 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 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/core/payments/operations/payment_response.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/api_models/src/payments.rs crates/api_models/src/payments.rs:3900— crates/api_models/src/payments.rs changed 51 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in WalletData::get_payment_method_type at line 3900. 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 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/api_models/src/payments.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/router/src/routes/lock_utils.rs crates/router/src/routes/lock_utils.rs:61— crates/router/src/routes/lock_utils.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in ApiIdentifier::from at line 61. 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 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/routes/lock_utils.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/router/src/core/payment_methods/cards.rs crates/router/src/core/payment_methods/cards.rs:4663— crates/router/src/core/payment_methods/cards.rs changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in router::core::payment_methods::cards::build_merchant_enabled_pms_context at line 4663. 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 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/core/payment_methods/cards.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/hyperswitch_domain_models/src/payment_method_data.rs crates/hyperswitch_domain_models/src/payment_method_data.rs:2898— crates/hyperswitch_domain_models/src/payment_method_data.rs changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in WalletData::from at line 2898. 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 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/hyperswitch_domain_models/src/payment_method_data.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/common_enums/src/transformers.rs crates/common_enums/src/transformers.rs:1800— crates/common_enums/src/transformers.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 126 in PaymentMethod::from at line 1800. 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 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/common_enums/src/transformers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:2231— crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in PaymentIntentRequest::try_from at line 2231. 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 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:762— crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in PaymentsRequest::try_from at line 762. 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 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/router/src/core/payments/transformers.rs crates/router/src/core/payments/transformers.rs:3862— crates/router/src/core/payments/transformers.rs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in router::core::payments::transformers::payments_to_payments_response at line 3862. 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 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/core/payments/transformers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/router/src/core/payments/operations/payment_confirm.rs crates/router/src/core/payments/operations/payment_confirm.rs:78— crates/router/src/core/payments/operations/payment_confirm.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in PaymentConfirm::get_trackers at line 78. 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 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/core/payments/operations/payment_confirm.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.
+ 52 more in this group — see findings.md.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×73
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/api_models/src/payments.rs:12691— crates/api_models/src/payments.rs:12691-12715 | crates/api_models/src/payments.rs:12720-12744 | crates/api_models/src/payments.rs:12930-12954 | crates/api_models/src/payments.rs:12959-12983 — 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) crates/diesel_models/src/authentication.rs:441— crates/diesel_models/src/authentication.rs:441-648 | crates/diesel_models/src/payment_attempt.rs:2505-4731 | crates/diesel_models/src/payouts.rs:184-248 | crates/hyperswitch_domain_models/src/payouts/payouts.rs:231-295 — 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) crates/diesel_models/src/query/blocklist.rs:83— crates/diesel_models/src/query/blocklist.rs:83-96 | crates/diesel_models/src/query/blocklist.rs:101-110 | crates/diesel_models/src/query/blocklist.rs:1031-1044 | crates/diesel_models/src/query/blocklist.rs:1050-1059 — 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) crates/diesel_models/src/query/blocklist.rs:368— crates/diesel_models/src/query/blocklist.rs:368-381 | crates/diesel_models/src/query/blocklist.rs:387-396 | crates/diesel_models/src/query/blocklist.rs:1112-1125 | crates/diesel_models/src/query/blocklist.rs:1131-1140 — 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) crates/diesel_models/src/query/blocklist.rs:450— crates/diesel_models/src/query/blocklist.rs:450-470 | crates/diesel_models/src/query/blocklist.rs:478-494 | crates/diesel_models/src/query/blocklist.rs:503-528 | crates/diesel_models/src/query/blocklist.rs:537-558 — 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) crates/diesel_models/src/query/blocklist.rs:564— crates/diesel_models/src/query/blocklist.rs:564-581 | crates/diesel_models/src/query/blocklist.rs:587-600 | crates/diesel_models/src/query/blocklist.rs:647-669 | crates/diesel_models/src/query/blocklist.rs:676-694 — 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) crates/diesel_models/src/query/customers.rs:164— crates/diesel_models/src/query/customers.rs:164-187 | crates/diesel_models/src/query/customers.rs:194-217 | crates/diesel_models/src/query/customers.rs:224-265 | crates/diesel_models/src/query/customers.rs:272-313 — 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) crates/diesel_models/src/query/user/sample_data.rs:27— crates/diesel_models/src/query/user/sample_data.rs:27-37 | crates/diesel_models/src/query/user/sample_data.rs:43-53 | crates/diesel_models/src/query/user/sample_data.rs:58-68 | crates/diesel_models/src/query/user/sample_data.rs:73-83 — 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) crates/hyperswitch_connectors/src/connectors/adyen.rs:1369— crates/hyperswitch_connectors/src/connectors/adyen.rs:1369-1379 | crates/hyperswitch_connectors/src/connectors/ebanx.rs:197-207 | crates/hyperswitch_connectors/src/connectors/stripe.rs:3208-3218 | crates/hyperswitch_connectors/src/connectors/wise.rs:612-622 — 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) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3797— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3797-3870 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3907-4037 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4052-4133 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4148-4223 — 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) crates/hyperswitch_connectors/src/connectors/airwallex.rs:95— crates/hyperswitch_connectors/src/connectors/airwallex.rs:95-118 | crates/hyperswitch_connectors/src/connectors/iatapay.rs:98-114 | crates/hyperswitch_connectors/src/connectors/payu.rs:79-96 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:92-109 — 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) crates/hyperswitch_connectors/src/connectors/airwallex.rs:244— crates/hyperswitch_connectors/src/connectors/airwallex.rs:244-256 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:177-189 | crates/hyperswitch_connectors/src/connectors/payload.rs:161-173 | crates/hyperswitch_connectors/src/connectors/stripe.rs:334-346 — 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) crates/hyperswitch_connectors/src/connectors/airwallex.rs:692— crates/hyperswitch_connectors/src/connectors/airwallex.rs:692-707 | crates/hyperswitch_connectors/src/connectors/breadpay.rs:344-359 | crates/hyperswitch_connectors/src/connectors/paybox.rs:641-656 | crates/hyperswitch_connectors/src/connectors/shift4.rs:617-632 — 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) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:917— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:917-1022 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1059-1114 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1129-1227 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1242-1332 — 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) crates/hyperswitch_connectors/src/connectors/bambora.rs:594— crates/hyperswitch_connectors/src/connectors/bambora.rs:594-604 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1857-1867 | crates/hyperswitch_connectors/src/connectors/redsys.rs:658-668 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:961-971 — 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) crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:127— crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:127-163 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:180-322 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:255-384 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:162-288 — 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2089— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2089-2101 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3089-3101 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:5028-5040 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:2185-2197 — 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) crates/hyperswitch_connectors/src/connectors/blackhawknetwork/transformers.rs:246— crates/hyperswitch_connectors/src/connectors/blackhawknetwork/transformers.rs:246-289 | crates/hyperswitch_connectors/src/connectors/celero/transformers.rs:687-732 | crates/hyperswitch_connectors/src/connectors/celero/transformers.rs:766-807 | crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs:222-278 — 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) crates/hyperswitch_connectors/src/connectors/bluesnap.rs:769— crates/hyperswitch_connectors/src/connectors/bluesnap.rs:769-820 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:332-357 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:558-602 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:759-785 — 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) crates/hyperswitch_connectors/src/connectors/coinbase.rs:233— crates/hyperswitch_connectors/src/connectors/coinbase.rs:233-244 | crates/hyperswitch_connectors/src/connectors/nmi.rs:389-400 | crates/hyperswitch_connectors/src/connectors/opennode.rs:235-246 | crates/hyperswitch_connectors/src/connectors/payeezy.rs:416-427 — 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) crates/hyperswitch_connectors/src/connectors/cybersource.rs:2174— crates/hyperswitch_connectors/src/connectors/cybersource.rs:2174-2190 | crates/hyperswitch_connectors/src/connectors/paypal.rs:1512-1528 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1290-1306 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:1246-1262 — 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) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:145— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:145-503 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1704-1839 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1854-1961 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1976-2087 — 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) crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:492— crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:492-502 | crates/hyperswitch_connectors/src/connectors/riskified.rs:251-261 | crates/hyperswitch_connectors/src/connectors/sanlam_payshield.rs:200-210 | crates/hyperswitch_connectors/src/connectors/signifyd.rs:374-384 — 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) crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:734— crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:734-747 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:764-777 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:675-688 | crates/hyperswitch_connectors/src/connectors/moneris.rs:921-934 — 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) crates/hyperswitch_connectors/src/connectors/fiuu.rs:241— crates/hyperswitch_connectors/src/connectors/fiuu.rs:241-291 | crates/hyperswitch_connectors/src/connectors/mifinity.rs:150-214 | crates/hyperswitch_connectors/src/connectors/redsys.rs:114-166 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:356-411 — 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 (7 lines × 2) crates/api_models/src/payment_methods.rs:2443— crates/api_models/src/payment_methods.rs:2443-2449 | crates/hyperswitch_domain_models/src/payment_method_data.rs:4614-4620 — before extracting anything, compare `crates/api_models/src/payment_methods.rs` and `crates/hyperswitch_domain_models/src/payment_method_data.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) crates/api_models/src/payments.rs:3951— crates/api_models/src/payments.rs:3951-3957 | crates/hyperswitch_domain_models/src/payment_method_data.rs:3990-3996 — before extracting anything, compare `crates/api_models/src/payments.rs` and `crates/hyperswitch_domain_models/src/payment_method_data.rs` as WHOLE FILES: this scan already matched 14 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 (7 lines × 2) crates/api_models/src/payments.rs:8740— crates/api_models/src/payments.rs:8740-8746 | crates/router/src/core/payments/transformers.rs:2631-2637 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/diesel_models/src/query/blocklist.rs:203— crates/diesel_models/src/query/blocklist.rs:203-209 | crates/diesel_models/src/query/blocklist.rs:228-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/diesel_models/src/query/blocklist.rs:404— crates/diesel_models/src/query/blocklist.rs:404-410 | crates/diesel_models/src/query/blocklist.rs:429-435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/diesel_models/src/query/blocklist.rs:607— crates/diesel_models/src/query/blocklist.rs:607-613 | crates/diesel_models/src/query/blocklist.rs:625-631 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/diesel_models/src/query/blocklist.rs:1067— crates/diesel_models/src/query/blocklist.rs:1067-1073 | crates/diesel_models/src/query/blocklist.rs:1092-1098 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/diesel_models/src/query/blocklist.rs:1148— crates/diesel_models/src/query/blocklist.rs:1148-1154 | crates/diesel_models/src/query/blocklist.rs:1173-1179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1538— crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1538-1544 | crates/hyperswitch_connectors/src/connectors/redsys.rs:1035-1041 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` and `crates/hyperswitch_connectors/src/connectors/redsys.rs` 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.
Duplicated block (7 lines × 2) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2242— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2242-2248 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4084-4090 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 527 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 (7 lines × 2) crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:1056— crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:1056-1062 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:1101-1107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/hyperswitch_connectors/src/connectors/gigadat.rs:151— crates/hyperswitch_connectors/src/connectors/gigadat.rs:151-157 | crates/hyperswitch_connectors/src/connectors/gigadat.rs:488-495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:342— crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:342-348 | crates/hyperswitch_connectors/src/connectors/payload/transformers.rs:256-262 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:592— crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:592-598 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:168-174 — `crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/noon/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 118 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 (7 lines × 2) crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:231— crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:231-237 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:259-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 (7 lines × 2) crates/hyperswitch_connectors/src/connectors/rapyd.rs:778— crates/hyperswitch_connectors/src/connectors/rapyd.rs:778-784 | crates/hyperswitch_connectors/src/connectors/rapyd.rs:825-831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1722— crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1722-1728 | crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1739-1745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/hyperswitch_connectors/src/connectors/stripe.rs:1847— crates/hyperswitch_connectors/src/connectors/stripe.rs:1847-1853 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2043-2049 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/hyperswitch_connectors/src/connectors/trustpay.rs:699— crates/hyperswitch_connectors/src/connectors/trustpay.rs:699-705 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:804-810 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:2126— crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:2126-2132 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:2223-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 (7 lines × 2) crates/hyperswitch_domain_models/src/type_encryption.rs:325— crates/hyperswitch_domain_models/src/type_encryption.rs:325-331 | crates/hyperswitch_domain_models/src/type_encryption.rs:562-568 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/router/src/analytics.rs:1802— crates/router/src/analytics.rs:1802-1808 | crates/router/src/analytics.rs:2265-2271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/router/src/core/fraud_check/flows/checkout_flow.rs:85— crates/router/src/core/fraud_check/flows/checkout_flow.rs:85-91 | crates/router/src/core/payments/transformers.rs:885-891 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/router/src/core/merchant_connector_webhook_management/transformers.rs:79— crates/router/src/core/merchant_connector_webhook_management/transformers.rs:79-85 | crates/router/src/core/merchant_connector_webhook_management/transformers.rs:161-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/router/src/core/payment_methods.rs:5481— crates/router/src/core/payment_methods.rs:5481-5487 | crates/router/src/core/payment_methods.rs:5499-5505 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/analytics/src/payments/core.rs:78— crates/analytics/src/payments/core.rs:78-94 | crates/analytics/src/refunds/core.rs:73-89 — `crates/analytics/src/payments/core.rs` and `crates/analytics/src/refunds/core.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 107 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) crates/api_models/src/errors/types.rs:122— crates/api_models/src/errors/types.rs:122-138 | crates/api_models/src/errors/types.rs:141-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/api_models/src/payments.rs:2881— crates/api_models/src/payments.rs:2881-2897 | crates/api_models/src/payments.rs:2914-2930 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/diesel_models/src/payment_attempt.rs:1242— crates/diesel_models/src/payment_attempt.rs:1242-1258 | crates/diesel_models/src/payment_attempt.rs:1295-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 (17 lines × 2) crates/diesel_models/src/payment_attempt.rs:2919— crates/diesel_models/src/payment_attempt.rs:2919-2935 | crates/diesel_models/src/payment_attempt.rs:4126-4142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/diesel_models/src/payment_attempt.rs:3086— crates/diesel_models/src/payment_attempt.rs:3086-3102 | crates/diesel_models/src/payment_attempt.rs:3170-3186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/diesel_models/src/payment_method.rs:1721— crates/diesel_models/src/payment_method.rs:1721-1737 | crates/hyperswitch_domain_models/src/mandates.rs:362-378 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) crates/diesel_models/src/refund.rs:394— crates/diesel_models/src/refund.rs:394-410 | crates/diesel_models/src/refund.rs:416-432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/external_services/src/superposition.rs:388— crates/external_services/src/superposition.rs:388-404 | crates/external_services/src/superposition.rs:410-426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:528— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:528-544 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:578-594 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 12 separate duplicated blocks between them, totalling at least 115 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2649— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2649-2665 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3436-3452 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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) crates/hyperswitch_connectors/src/connectors/cryptopay.rs:190— crates/hyperswitch_connectors/src/connectors/cryptopay.rs:190-206 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:151-167 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cryptopay.rs` and `crates/hyperswitch_connectors/src/connectors/dummyconnector.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3553— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3553-3569 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1827-1843 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 46 separate duplicated blocks between them, totalling at least 601 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) crates/hyperswitch_connectors/src/connectors/fiuu.rs:271— crates/hyperswitch_connectors/src/connectors/fiuu.rs:271-287 | crates/hyperswitch_connectors/src/connectors/payload.rs:306-322 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/fiuu.rs` and `crates/hyperswitch_connectors/src/connectors/payload.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1667— crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1667-1683 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:2062-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 (17 lines × 2) crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs:339— crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs:339-355 | crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs:357-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:213— crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:213-229 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1329-1345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1231— crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1231-1247 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1282-1298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2707— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2707-2723 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2766-2782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/hyperswitch_connectors/src/utils.rs:195— crates/hyperswitch_connectors/src/utils.rs:195-211 | crates/router/src/connector/utils.rs:2083-2099 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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 (17 lines × 2) crates/hyperswitch_domain_models/src/business_profile.rs:801— crates/hyperswitch_domain_models/src/business_profile.rs:801-817 | crates/hyperswitch_domain_models/src/business_profile.rs:931-947 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/hyperswitch_domain_models/src/merchant_key_store.rs:45— crates/hyperswitch_domain_models/src/merchant_key_store.rs:45-61 | crates/router/src/types/domain/user_key_store.rs:44-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) crates/hyperswitch_domain_models/src/router_data.rs:1507— crates/hyperswitch_domain_models/src/router_data.rs:1507-1523 | crates/hyperswitch_domain_models/src/router_data.rs:2635-2651 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/hyperswitch_domain_models/src/router_data.rs:2150— crates/hyperswitch_domain_models/src/router_data.rs:2150-2166 | crates/hyperswitch_domain_models/src/router_data.rs:2417-2433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/router/src/core/authentication.rs:777— crates/router/src/core/authentication.rs:777-793 | crates/router/src/core/authentication.rs:1121-1137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/analytics/src/payment_intents/accumulator.rs:161— crates/analytics/src/payment_intents/accumulator.rs:161-166 | crates/analytics/src/payment_intents/accumulator.rs:291-296 — both copies are in the same file, so extract the block into 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) crates/analytics/src/payments/accumulator.rs:409— crates/analytics/src/payments/accumulator.rs:409-414 | crates/analytics/src/refunds/accumulator.rs:182-187 — 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) crates/analytics/src/query.rs:176— crates/analytics/src/query.rs:176-181 | crates/analytics/src/query.rs:202-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/analytics/src/sqlx.rs:241— crates/analytics/src/sqlx.rs:241-246 | crates/analytics/src/sqlx.rs:421-426 — both copies are in the same file, so extract the block into 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) crates/api_models/src/payments.rs:3916— crates/api_models/src/payments.rs:3916-3921 | crates/hyperswitch_domain_models/src/payment_method_data.rs:3954-3959 — before extracting anything, compare `crates/api_models/src/payments.rs` and `crates/hyperswitch_domain_models/src/payment_method_data.rs` as WHOLE FILES: this scan already matched 14 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 (6 lines × 2) crates/api_models/src/payments.rs:4091— crates/api_models/src/payments.rs:4091-4096 | crates/hyperswitch_domain_models/src/payment_method_data.rs:4122-4127 — before extracting anything, compare `crates/api_models/src/payments.rs` and `crates/hyperswitch_domain_models/src/payment_method_data.rs` as WHOLE FILES: this scan already matched 14 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 (6 lines × 2) crates/diesel_models/src/query/blocklist.rs:249— crates/diesel_models/src/query/blocklist.rs:249-254 | crates/diesel_models/src/query/blocklist.rs:277-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/diesel_models/src/query/blocklist.rs:862— crates/diesel_models/src/query/blocklist.rs:862-867 | crates/diesel_models/src/query/blocklist.rs:893-898 — both copies are in the same file, so extract the block into 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) crates/diesel_models/src/query/blocklist.rs:947— crates/diesel_models/src/query/blocklist.rs:947-952 | crates/diesel_models/src/query/blocklist.rs:979-984 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/external_services/src/superposition.rs:359— crates/external_services/src/superposition.rs:359-364 | crates/external_services/src/superposition.rs:440-445 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2425— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2425-2430 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2513-2518 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:813— crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:813-819 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:979-984 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2193— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2193-2198 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4139-4144 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:288— crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:288-293 | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:1775-1780 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1166— crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1166-1171 | crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1230-1235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs:384— crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs:384-389 | crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs:435-440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/hyperswitch_domain_models/src/bulk_tokenization.rs:217— crates/hyperswitch_domain_models/src/bulk_tokenization.rs:217-222 | crates/router/src/core/payment_methods/cards.rs:422-427 — 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) crates/hyperswitch_domain_models/src/lib.rs:164— crates/hyperswitch_domain_models/src/lib.rs:164-169 | crates/hyperswitch_domain_models/src/lib.rs:786-791 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/redis_interface/src/module/redis_rs.rs:121— crates/redis_interface/src/module/redis_rs.rs:121-126 | crates/redis_interface/src/module/redis_rs/types.rs:108-114 — 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) crates/router/src/analytics.rs:2033— crates/router/src/analytics.rs:2033-2038 | crates/router/src/analytics.rs:2065-2070 — both copies are in the same file, so extract the block into 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) crates/router/src/core/hierarchical_resources.rs:586— crates/router/src/core/hierarchical_resources.rs:586-591 | crates/router/src/core/hierarchical_resources.rs:734-739 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/router/src/core/payment_methods/cards.rs:6298— crates/router/src/core/payment_methods/cards.rs:6298-6303 | crates/router/src/core/payments/payment_methods.rs:698-703 — 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) crates/router/src/core/payment_methods/network_tokenization.rs:668— crates/router/src/core/payment_methods/network_tokenization.rs:668-673 | crates/router/src/core/payment_methods/network_tokenization.rs:789-794 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/helpers.rs:8049— crates/router/src/core/payments/helpers.rs:8049-8054 | crates/router/src/core/payments/helpers.rs:8172-8177 — both copies are in the same file, so extract the block into 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) crates/router/src/core/unified_connector_service.rs:784— crates/router/src/core/unified_connector_service.rs:784-789 | crates/router/src/core/unified_connector_service.rs:815-820 — both copies are in the same file, so extract the block into 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) crates/analytics/src/payments/core.rs:215— crates/analytics/src/payments/core.rs:215-233 | crates/analytics/src/refunds/core.rs:190-208 — `crates/analytics/src/payments/core.rs` and `crates/analytics/src/refunds/core.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 107 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 (19 lines × 2) crates/analytics/src/refunds/metrics/refund_success_rate.rs:76— crates/analytics/src/refunds/metrics/refund_success_rate.rs:76-94 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs:76-94 — before extracting anything, compare `crates/analytics/src/refunds/metrics/refund_success_rate.rs` and `crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (19 lines × 2) crates/cards/src/validate.rs:219— crates/cards/src/validate.rs:219-237 | crates/cards/src/validate.rs:248-266 — both copies are in the same file, so extract the block into 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) crates/common_enums/src/enums.rs:2486— crates/common_enums/src/enums.rs:2486-2504 | crates/common_enums/src/enums.rs:11396-11414 — both copies are in the same file, so extract the block into 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) REDACTED:1088— REDACTED:1088-1106 | REDACTED:1219-1237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) crates/diesel_models/src/payment_method.rs:1197— crates/diesel_models/src/payment_method.rs:1197-1215 | crates/diesel_models/src/payment_method.rs:1289-1307 — both copies are in the same file, so extract the block into 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) crates/diesel_models/src/query/customers.rs:169— crates/diesel_models/src/query/customers.rs:169-187 | crates/diesel_models/src/query/customers.rs:199-217 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3654— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3654-3672 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3739-3757 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2002— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2002-2020 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3004-3022 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (19 lines × 2) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2348— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2348-2366 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3349-3367 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (19 lines × 2) crates/hyperswitch_connectors/src/connectors/cryptopay.rs:293— crates/hyperswitch_connectors/src/connectors/cryptopay.rs:293-311 | crates/hyperswitch_connectors/src/connectors/cryptopay.rs:390-408 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2251— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2251-2269 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4179-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 (19 lines × 2) crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:985— crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:985-1003 | crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:1179-1197 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:816— crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:816-834 | crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:1022-1040 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1950— crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1950-1968 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1989-2007 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:541— crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:541-559 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:915-933 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:1576— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:1576-1594 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:1623-1641 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:2627— crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:2627-2645 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:2773-2791 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_domain_models/src/router_data.rs:1663— crates/hyperswitch_domain_models/src/router_data.rs:1663-1681 | crates/hyperswitch_domain_models/src/router_data.rs:2554-2572 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_interfaces/src/api/gateway.rs:450— crates/hyperswitch_interfaces/src/api/gateway.rs:450-468 | crates/hyperswitch_interfaces/src/api/gateway.rs:595-613 — both copies are in the same file, so extract the block into 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) crates/router/src/core/debit_routing.rs:306— crates/router/src/core/debit_routing.rs:306-324 | crates/router/src/core/debit_routing.rs:571-589 — both copies are in the same file, so extract the block into 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) crates/router/src/core/disputes.rs:498— crates/router/src/core/disputes.rs:498-516 | crates/router/src/core/disputes.rs:983-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.
Duplicated block (19 lines × 2) crates/router/src/core/payment_methods.rs:1577— crates/router/src/core/payment_methods.rs:1577-1595 | crates/router/src/core/payment_methods.rs:1690-1708 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payment_methods/network_tokenization.rs:551— crates/router/src/core/payment_methods/network_tokenization.rs:551-569 | crates/router/src/core/payment_methods/network_tokenization.rs:612-630 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payment_methods/transformers.rs:1047— crates/router/src/core/payment_methods/transformers.rs:1047-1065 | crates/router/src/core/payment_methods/transformers.rs:1158-1176 — both copies are in the same file, so extract the block into 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) crates/analytics/src/disputes/accumulators.rs:42— crates/analytics/src/disputes/accumulators.rs:42-47 | crates/analytics/src/payment_intents/accumulator.rs:104-108 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/api_models/src/payments.rs:3970— crates/api_models/src/payments.rs:3970-3974 | crates/hyperswitch_domain_models/src/payment_method_data.rs:4001-4005 — before extracting anything, compare `crates/api_models/src/payments.rs` and `crates/hyperswitch_domain_models/src/payment_method_data.rs` as WHOLE FILES: this scan already matched 14 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) crates/api_models/src/payments.rs:4059— crates/api_models/src/payments.rs:4059-4063 | crates/hyperswitch_domain_models/src/payment_method_data.rs:4090-4094 — before extracting anything, compare `crates/api_models/src/payments.rs` and `crates/hyperswitch_domain_models/src/payment_method_data.rs` as WHOLE FILES: this scan already matched 14 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) crates/api_models/src/revenue_recovery_data_backfill.rs:302— crates/api_models/src/revenue_recovery_data_backfill.rs:302-307 | crates/api_models/src/revenue_recovery_data_backfill.rs:345-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/diesel_models/src/query/blocklist.rs:84— crates/diesel_models/src/query/blocklist.rs:84-90 | crates/diesel_models/src/query/blocklist.rs:102-106 — both copies are in the same file, so extract the block into 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) crates/diesel_models/src/query/blocklist.rs:369— crates/diesel_models/src/query/blocklist.rs:369-375 | crates/diesel_models/src/query/blocklist.rs:388-392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/diesel_models/src/query/blocklist.rs:1032— crates/diesel_models/src/query/blocklist.rs:1032-1038 | crates/diesel_models/src/query/blocklist.rs:1051-1055 — both copies are in the same file, so extract the block into 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) crates/diesel_models/src/query/blocklist.rs:1113— crates/diesel_models/src/query/blocklist.rs:1113-1119 | crates/diesel_models/src/query/blocklist.rs:1132-1136 — both copies are in the same file, so extract the block into 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) crates/diesel_models/src/query/generics.rs:1030— crates/diesel_models/src/query/generics.rs:1030-1034 | crates/diesel_models/src/query/generics.rs:1253-1257 — both copies are in the same file, so extract the block into 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) crates/euclid/src/frontend/ast/lowering.rs:252— crates/euclid/src/frontend/ast/lowering.rs:252-256 | crates/euclid/src/frontend/ast/lowering.rs:266-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/external_services/src/superposition.rs:351— crates/external_services/src/superposition.rs:351-355 | crates/external_services/src/superposition.rs:432-436 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs:301— crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs:301-305 | crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs:467-471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource.rs:318— crates/hyperswitch_connectors/src/connectors/cybersource.rs:318-322 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:380-384 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersource.rs` and `crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs:372— crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs:372-376 | crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs:406-410 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs:172— crates/hyperswitch_connectors/src/connectors/gpayments/transformers.rs:172-176 | crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs:259-264 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:296— crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:296-300 | crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:378-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.
Duplicated block (5 lines × 2) crates/hyperswitch_connectors/src/connectors/silverflow/transformers.rs:404— crates/hyperswitch_connectors/src/connectors/silverflow/transformers.rs:404-408 | crates/hyperswitch_connectors/src/connectors/silverflow/transformers.rs:502-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 (5 lines × 2) crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:3566— crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:3566-3570 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:4020-4024 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/worldpay/payout_transformers.rs:153— crates/hyperswitch_connectors/src/connectors/worldpay/payout_transformers.rs:153-157 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3908-3912 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/hyperswitch_connectors/src/utils.rs:7240— crates/hyperswitch_connectors/src/utils.rs:7240-7244 | crates/router/src/connector/utils.rs:1628-1632 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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) crates/hyperswitch_constraint_graph/src/graph.rs:307— crates/hyperswitch_constraint_graph/src/graph.rs:307-311 | crates/hyperswitch_constraint_graph/src/graph.rs:479-483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/kgraph_utils/src/mca.rs:600— crates/kgraph_utils/src/mca.rs:600-606 | crates/kgraph_utils/src/mca.rs:664-668 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/list.rs:170— crates/router/src/core/payments/list.rs:170-174 | crates/router/src/core/payments/list.rs:245-250 — both copies are in the same file, so extract the block into 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) crates/router/src/core/routing.rs:1729— crates/router/src/core/routing.rs:1729-1735 | crates/router/src/core/routing.rs:1962-1966 — both copies are in the same file, so extract the block into 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) crates/router/src/core/unified_connector_service/transformers.rs:5009— crates/router/src/core/unified_connector_service/transformers.rs:5009-5013 | crates/router/src/core/unified_connector_service/transformers.rs:5076-5080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
router::core::unified_connector_service::build_unified_connector_service_payment_method (cyclomatic 104) crates/router/src/core/unified_connector_service.rs:1572— router::core::unified_connector_service::build_unified_connector_service_payment_method has cyclomatic complexity 104 (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.
router::core::payment_methods::cards::build_merchant_enabled_pms_context (cyclomatic 57) crates/router/src/core/payment_methods/cards.rs:4663— router::core::payment_methods::cards::build_merchant_enabled_pms_context has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
router::core::payments::operations::payment_response::payment_response_update_tracker (cyclomatic 57) crates/router/src/core/payments/operations/payment_response.rs:2587— router::core::payments::operations::payment_response::payment_response_update_tracker has cyclomatic complexity 57 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
router::core::payments::tokenization::save_payment_method (cyclomatic 52) crates/router/src/core/payments/tokenization.rs:191— router::core::payments::tokenization::save_payment_method 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.
router::core::payments::helpers::get_additional_payment_data (cyclomatic 47) crates/router/src/core/payments/helpers.rs:6247— router::core::payments::helpers::get_additional_payment_data has cyclomatic complexity 47 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
router::core::payment_methods::migration::update_payment_method_record (cyclomatic 33) crates/router/src/core/payment_methods/migration.rs:45— router::core::payment_methods::migration::update_payment_method_record 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.
router::core::payments::payments_operation_core (cyclomatic 33) crates/router/src/core/payments.rs:780— router::core::payments::payments_operation_core 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.
router::core::user::dashboard_metadata::insert_metadata (cyclomatic 32) crates/router/src/core/user/dashboard_metadata.rs:278— router::core::user::dashboard_metadata::insert_metadata has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
router::core::payments::helpers::validate_platform_request_for_marketplace (cyclomatic 29) crates/router/src/core/payments/helpers.rs:9880— router::core::payments::helpers::validate_platform_request_for_marketplace 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.
router::core::payments::routing::make_dsl_input (cyclomatic 29) crates/router/src/core/payments/routing.rs:372— router::core::payments::routing::make_dsl_input has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
router::core::payments::should_call_connector (cyclomatic 28) crates/router/src/core/payments.rs:11264— router::core::payments::should_call_connector 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.
router::core::webhooks::incoming_v2::incoming_webhooks_core (cyclomatic 24) crates/router/src/core/webhooks/incoming_v2.rs:100— router::core::webhooks::incoming_v2::incoming_webhooks_core has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
router::core::payments::routing::utils::convert_backend_input_to_routing_eval (cyclomatic 23) crates/router/src/core/payments/routing/utils.rs:1360— router::core::payments::routing::utils::convert_backend_input_to_routing_eval 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.
router::core::payments::transformers::payments_to_payments_response (cyclomatic 22) crates/router/src/core/payments/transformers.rs:3862— router::core::payments::transformers::payments_to_payments_response 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.
router::services::api::server_wrap (cyclomatic 22) crates/router/src/services/api.rs:405— router::services::api::server_wrap 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.
router::compatibility::wrap::compatibility_api_wrap (cyclomatic 21) crates/router/src/compatibility/wrap.rs:19— router::compatibility::wrap::compatibility_api_wrap has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
router::core::payouts::make_payout_data (cyclomatic 21) crates/router/src/core/payouts.rs:3821— router::core::payouts::make_payout_data has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
router::core::payment_methods::cards::list_payment_methods (cyclomatic 20) crates/router/src/core/payment_methods/cards.rs:5387— router::core::payment_methods::cards::list_payment_methods has cyclomatic complexity 20 (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.
router::core::payments::helpers::get_token_pm_type_mandate_details (cyclomatic 20) crates/router/src/core/payments/helpers.rs:466— router::core::payments::helpers::get_token_pm_type_mandate_details 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.
router::core::routing::retrieve_linked_routing_config (cyclomatic 20) crates/router/src/core/routing.rs:2160— router::core::routing::retrieve_linked_routing_config 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.
router::core::routing::routing_migration_status (cyclomatic 20) crates/router/src/core/routing.rs:3752— router::core::routing::routing_migration_status has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
router::core::routing::link_routing_config (cyclomatic 19) crates/router/src/core/routing.rs:1127— router::core::routing::link_routing_config 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.
router::core::webhooks::webhook_events::list_initial_delivery_attempts (cyclomatic 19) crates/router/src/core/webhooks/webhook_events.rs:20— router::core::webhooks::webhook_events::list_initial_delivery_attempts 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.
router::core::payments::helpers::make_pm_data (cyclomatic 18) crates/router/src/core/payments/helpers.rs:3916— router::core::payments::helpers::make_pm_data has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: router::core::payments::helpers::get_key_params_for_surcharge_details (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
router::core::payouts::helpers::save_payout_data_to_locker (cyclomatic 18) crates/router/src/core/payouts/helpers.rs:378— router::core::payouts::helpers::save_payout_data_to_locker 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.
Change coupling: connector_mapping.rs ↔ connector_transformers.rs crates/router/src/types/api/connector_mapping.rs:1— `crates/router/src/types/api/connector_mapping.rs` and `crates/router/src/types/connector_transformers.rs` change together 97% of the time (29 of the 30 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 29 shared commits counted here, the most recent 3 are `9209eb9c` feat(connector): add Global Payments RealEx routing via unified conne…; `306b68f6` feat(connector): add merchante ucs only connector (#14116); `e8e30d10` feat(connector): add etisalat ucs only connector (#14113) — run `git show` on any of them.
Change coupling: connector_mapping.rs ↔ feature_matrix.rs crates/router/src/types/api/connector_mapping.rs:1— `crates/router/src/types/api/connector_mapping.rs` and `crates/router/src/types/api/feature_matrix.rs` change together 96% of the time (27 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 27 shared commits counted here, the most recent 3 are `9209eb9c` feat(connector): add Global Payments RealEx routing via unified conne…; `306b68f6` feat(connector): add merchante ucs only connector (#14116); `e8e30d10` feat(connector): add etisalat ucs only connector (#14113) — run `git show` on any of them.
Change coupling: feature_matrix.rs ↔ connector_transformers.rs crates/router/src/types/api/feature_matrix.rs:1— `crates/router/src/types/api/feature_matrix.rs` and `crates/router/src/types/connector_transformers.rs` change together 82% of the time (23 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 23 shared commits counted here, the most recent 3 are `9209eb9c` feat(connector): add Global Payments RealEx routing via unified conne…; `306b68f6` feat(connector): add merchante ucs only connector (#14116); `e8e30d10` feat(connector): add etisalat ucs only connector (#14113) — run `git show` on any of them.
Change coupling: connector_enums.rs ↔ configs.rs crates/common_enums/src/connector_enums.rs:1— `crates/common_enums/src/connector_enums.rs` and `crates/hyperswitch_domain_models/src/configs.rs` change together 81% of the time (13 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `dfed2be2` feat(connector): [Celero] add Connector Template Code (#8489); `7f5ec743` feat(connector): [payload] template code (#8526); `95077c64` feat(connector): [CHECKBOOK] Add Template Code (#8494) — run `git show` on any of them.
Change coupling: user.rs ↔ user.rs crates/api_models/src/user.rs:1— `crates/api_models/src/user.rs` and `crates/router/src/core/errors/user.rs` change together 81% of the time (25 of the 31 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 25 shared commits counted here, the most recent 3 are `256e7fee` feat(platform): convert organization to platform organization (#10910); `9039a5e8` feat(auth): implemented embedded tokens (#10424); `82f15e95` feat(connector_cloning): Create API for cloning connectors between me… — run `git show` on any of them.
Change coupling: clickhouse.rs ↔ sqlx.rs crates/analytics/src/clickhouse.rs:1— `crates/analytics/src/clickhouse.rs` and `crates/analytics/src/sqlx.rs` change together 79% of the time (11 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `c2b8d14d` feat(analytics): surface connector-event dimensions + ucs_api_events …; `4593f6ab` feat(analytics): infer payout_audit table for payout analytics (#10842); `ebe44b9d` feat(routing): Add audit trail for routing (#8188) — run `git show` on any of them.
Change coupling: configs.rs ↔ REDACTED crates/hyperswitch_interfaces/src/configs.rs:1— `crates/hyperswitch_interfaces/src/configs.rs` and `crates/router/src/types/transformers.rs` change together 78% of the time (31 of the 40 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 31 shared commits counted here, the most recent 3 are `99885b69` refactor(connector): Move connector mappings and endpoints to dedicat…; `3e7db573` feat(connector): [Hipay] Add Card Payments Flow (#7475); `add51526` feat(hipay): Add Template PR (#7360) — run `git show` on any of them.
Change coupling: REDACTED ↔ REDACTED crates/hyperswitch_domain_models/src/payments.rs:1— `crates/hyperswitch_domain_models/src/payments.rs` and `crates/router/src/core/revenue_recovery/transformers.rs` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `814aeedd` refactor(revenue_recovery): decide the recovery api action from the s…; `4fafe505` feat(revenue_recovery): persist customer details for retry requests (…; `e7fe4804` feat(revenue_recovery): Enable multiple retries for partial charged p… — run `git show` on any of them.
Change coupling: REDACTED ↔ REDACTED crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs:1— `crates/hyperswitch_connectors/src/connectors/netcetera/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `89774f3a` feat(core): Added additional authentication fields for 3ds external a…; `33cd60e6` feat(core): add support for consuming eci for AuthNResponse in Authen…; `dbaf5679` refactor(authentication): moved cavv storing from table to temp locke… (at that commit the file was still `crates/router/src/connector/threedsecureio/transformers.rs`) — run `git show` on any of them.
Change coupling: info.rs ↔ permissions.rs crates/router/src/services/authorization/info.rs:1— `crates/router/src/services/authorization/info.rs` and `crates/router/src/services/authorization/permissions.rs` change together 65% of the time (17 of the 26 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 17 shared commits counted here, the most recent 3 are `c4bb215f` feat: add merchant alert read permission (#14344); `726526d3` feat(router): add token validation API for external services (#13858); `cb6312c2` feat(superposition): add backend apis to support dashboard's superpos… — run `git show` on any of them.
Change coupling: info.rs ↔ permission_groups.rs crates/router/src/services/authorization/info.rs:1— `crates/router/src/services/authorization/info.rs` and `crates/router/src/services/authorization/permission_groups.rs` change together 64% of the time (16 of the 25 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `c4bb215f` feat: add merchant alert read permission (#14344); `726526d3` feat(router): add token validation API for external services (#13858); `cb6312c2` feat(superposition): add backend apis to support dashboard's superpos… — run `git show` on any of them.
Change coupling: payment_start.rs ↔ payment_update.rs crates/router/src/core/payments/operations/payment_start.rs:1— `crates/router/src/core/payments/operations/payment_start.rs` and `crates/router/src/core/payments/operations/payment_update.rs` change together 64% of the time (16 of the 25 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `3bbdfb5a` refactor(router): changed payment method token TTL to api contract ba…; `c980f016` feat(customer): Customer kv impl (#4267); `0a97a1eb` refactor(blocklist): separate utility function & kill switch for vali… — run `git show` on any of them.
Change coupling: locker_mock_up.rs ↔ merchant_connector_account.rs crates/router/src/db/locker_mock_up.rs:1— `crates/router/src/db/locker_mock_up.rs` and `crates/router/src/db/merchant_connector_account.rs` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `9668dccb` fix(encryption-service): re-introduce legacy key store decryption beh…; `a392fb16` refactor: get connection pool based on olap/oltp features (#743); `f1e3bf48` refactor: Throw 500 error on database connection error instead of pan… — run `git show` on any of them.
Change coupling: consumer.rs ↔ producer.rs crates/scheduler/src/consumer.rs:1— `crates/scheduler/src/consumer.rs` and `crates/scheduler/src/producer.rs` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `07062212` fix(log): adding span metadata to `tokio` spawned futures (#4118); `94ac5c03` fix(router/scheduler): replace the occurrences of gen_range with a sa…; `13185999` feat(Core): gracefully shutdown router/scheduler if Redis is unavaila… (at that commit the files were still `crates/router/src/scheduler/consumer.rs` and `crates/router/src/scheduler/producer.rs`) — run `git show` on any of them.
Change coupling: events.rs ↔ locker_mock_up.rs crates/router/src/db/events.rs:1— `crates/router/src/db/events.rs` and `crates/router/src/db/locker_mock_up.rs` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `9668dccb` fix(encryption-service): re-introduce legacy key store decryption beh…; `a392fb16` refactor: get connection pool based on olap/oltp features (#743); `f1e3bf48` refactor: Throw 500 error on database connection error instead of pan… — run `git show` on any of them.
Change coupling: flow_common_types.rs ↔ subscriptions.rs crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs:1— `crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs` and `crates/hyperswitch_domain_models/src/router_response_types/subscriptions.rs` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `2be1452d` feat(subscriptions): Update get plans to get items (#10434); `15bc0a3b` feat(subscription): Add endpoint to get Subscription estimate (#9637); `f02d1803` feat(subscriptions): Add Subscription confirm handler (#9353) — run `git show` on any of them.
Change coupling: payment_complete_authorize.rs ↔ payment_update.rs crates/router/src/core/payments/operations/payment_complete_authorize.rs:1— `crates/router/src/core/payments/operations/payment_complete_authorize.rs` and `crates/router/src/core/payments/operations/payment_update.rs` change together 62% of the time (20 of the 32 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 20 shared commits counted here, the most recent 3 are `1929f56e` fix(router): add payment_method check in `get_mandate_type` (#5828); `c555a88c` refactor(customer_v2): fixed customer_v2 create panic issue (#5699); `53cb9537` fix(payments_create): save the `customer_id` in payments create (#5262) — run `git show` on any of them.
Change coupling: kafka_store.rs ↔ REDACTED crates/router/src/db/kafka_store.rs:1— `crates/router/src/db/kafka_store.rs` and `crates/storage_impl/src/payment_method.rs` change together 62% of the time (10 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `b6f71b02` feat(payment_methods): inactivate payment methods sharing an auxiliar…; `df55de90` feat(modular): harden compatibility workflows for revert use cases (…; `c33e788c` feat(locker): add legacy locker support for payment methods (#11941) — run `git show` on any of them.
Change coupling: REDACTED ↔ REDACTED crates/kgraph_utils/src/transformers.rs:1— `crates/kgraph_utils/src/transformers.rs` and `crates/router/src/types/transformers.rs` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `fafc25c0` feat(connector): add support for santander ted bank transfer (#14378); `e3e58bdf` feat(payouts): add support for pix_emv and pix_key for payouts (#11831); `4abbf307` feat(connector): [xendit] add QRIS payment methods (#10759) — run `git show` on any of them.
Change coupling: lib.rs ↔ storage.rs crates/diesel_models/src/lib.rs:1— `crates/diesel_models/src/lib.rs` and `crates/router/src/types/storage.rs` change together 60% of the time (12 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `61949c55` feat: add invoice table (#9348); `144f3852` feat(core): add subscription table (#9133); `043cf8e0` feat(core): diesel models, domain models and db interface changes for… — run `git show` on any of them.
Change coupling: chargebee.rs ↔ recurly.rs crates/hyperswitch_connectors/src/connectors/chargebee.rs:1— `crates/hyperswitch_connectors/src/connectors/chargebee.rs` and `crates/hyperswitch_connectors/src/connectors/recurly.rs` change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `d8a07c8d` feat(revenue_recovery): add DisputeRecordBack flow and implement it f…; `2be1452d` feat(subscriptions): Update get plans to get items (#10434); `0a35c617` feat(subscriptions): Invoice record back workflow (#9529) — run `git show` on any of them.
Change coupling: health_check.rs ↔ errors.rs crates/api_models/src/health_check.rs:1— `crates/api_models/src/health_check.rs` and `crates/storage_impl/src/errors.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `8bbb7684` feat(v2): introduce configs and health endpoints for v2 (#8835); `5ab769d1` feat(health): Health check for Decision engine (#8243); `e922f96c` feat: Added grpc based health check (#6441) — run `git show` on any of them.
Change coupling: external_vault_proxy_payment_intent.rs ↔ payment_confirm_intent.rs crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:1— `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/payment_confirm_intent.rs` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `9dc7e744` perf(payment-methods): pay then vault operations using redis (#13832); `47724b1d` refactor(payment_methods): remove `psp_tokenization` from API request…; `30650bf1` feat(payment): add storage type to PaymentMethodSession create call (… — run `git show` on any of them.
Change coupling: payment_session.rs ↔ payment_start.rs crates/router/src/core/payments/operations/payment_session.rs:1— `crates/router/src/core/payments/operations/payment_session.rs` and `crates/router/src/core/payments/operations/payment_start.rs` change together 56% of the time (14 of the 25 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `3bbdfb5a` refactor(router): changed payment method token TTL to api contract ba…; `c980f016` feat(customer): Customer kv impl (#4267); `0a97a1eb` refactor(blocklist): separate utility function & kill switch for vali… — run `git show` on any of them.
Change coupling: REDACTED ↔ REDACTED REDACTED:1— `REDACTED` and `REDACTED` change together 56% of the time (14 of the 25 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `67585f70` feat(payment_link): add profile-level config to display merchant name…; `be3fc6c7` fix: payment link styling for dynamic classes (#8273); `fa465930` feat(payment-link): alternate text for manual captures (#7574) — run `git show` on any of them.
+ 13 more in this group — see findings.md.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×37
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/analytics/src/lib.rs:128— crates/analytics/src/lib.rs:128-222 | crates/analytics/src/lib.rs:343-437 | crates/analytics/src/lib.rs:464-554 | crates/analytics/src/lib.rs:674-764 | crates/analytics/src/lib.rs:774-864 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/analytics/src/payment_intents/accumulator.rs:91— crates/analytics/src/payment_intents/accumulator.rs:91-112 | crates/analytics/src/payment_intents/accumulator.rs:197-229 | crates/analytics/src/payments/accumulator.rs:352-384 | crates/analytics/src/payments/accumulator.rs:408-417 | crates/analytics/src/refunds/accumulator.rs:181-196 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/api_models/src/cards_info.rs:355— crates/api_models/src/cards_info.rs:355-405 | crates/router/src/core/cards_info.rs:346-423 | crates/router/src/types/transformers.rs:891-929 | crates/router/src/types/transformers.rs:2854-2897 | crates/router/src/types/transformers.rs:2901-2944 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/external_services/src/utils.rs:41— crates/external_services/src/utils.rs:41-73 | crates/payment_methods/src/configs/settings.rs:163-195 | crates/router/src/configs/settings.rs:1861-1893 | crates/router/src/configs/settings.rs:1912-1944 | crates/router/src/configs/settings.rs:1978-2008 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/absa_sanlam/transformers.rs:90— crates/hyperswitch_connectors/src/connectors/absa_sanlam/transformers.rs:90-139 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:1124-1177 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:1198-1251 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:2312-2358 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:2437-2489 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/adyen.rs:795— crates/hyperswitch_connectors/src/connectors/adyen.rs:795-819 | crates/hyperswitch_connectors/src/connectors/braintree.rs:543-553 | crates/hyperswitch_connectors/src/connectors/payme.rs:656-666 | crates/hyperswitch_connectors/src/connectors/plaid.rs:300-310 | crates/hyperswitch_connectors/src/connectors/tsys.rs:259-269 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/adyen.rs:1937— crates/hyperswitch_connectors/src/connectors/adyen.rs:1937-1966 | crates/hyperswitch_connectors/src/connectors/payme.rs:1128-1172 | crates/hyperswitch_connectors/src/connectors/rapyd.rs:805-836 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:1308-1335 | crates/hyperswitch_interfaces/src/webhooks.rs:284-313 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3026— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3026-3246 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3252-3384 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3400-3480 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3797-3870 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:6914-7016 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:225— crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:225-291 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:169-260 | crates/hyperswitch_connectors/src/connectors/redsys.rs:114-166 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:356-411 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:170-227 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:105— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:105-137 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:99-131 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:114-156 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:92-134 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:96-138 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:154— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:154-202 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:165-213 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:335-386 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:165-218 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:301-352 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:555— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:555-582 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:311-338 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:5613-5640 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager/transformers.rs:493-520 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:1701-1727 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2753— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2753-2772 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3473-3492 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:5592-5611 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager/transformers.rs:293-312 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:2473-2492 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/billwerk.rs:579— crates/hyperswitch_connectors/src/connectors/billwerk.rs:579-588 | crates/hyperswitch_connectors/src/connectors/celero.rs:494-503 | crates/hyperswitch_connectors/src/connectors/dlocal.rs:490-499 | crates/hyperswitch_connectors/src/connectors/square.rs:636-645 | crates/hyperswitch_connectors/src/connectors/stax.rs:653-662 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/calida.rs:252— crates/hyperswitch_connectors/src/connectors/calida.rs:252-279 | crates/hyperswitch_connectors/src/connectors/calida.rs:343-370 | crates/hyperswitch_connectors/src/connectors/santander.rs:1267-1302 | crates/hyperswitch_connectors/src/connectors/santander.rs:1540-1588 | crates/hyperswitch_connectors/src/connectors/santander.rs:1965-1994 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs:58— crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs:58-75 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/transformers.rs:58-75 | crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs:78-95 | crates/hyperswitch_connectors/src/connectors/thunes/transformers.rs:56-73 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout/transformers.rs:58-75 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/nomupay.rs:707— crates/hyperswitch_connectors/src/connectors/nomupay.rs:707-721 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:204-217 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:767-780 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:1212-1225 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:1136-1149 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/paybox.rs:318— crates/hyperswitch_connectors/src/connectors/paybox.rs:318-328 | crates/hyperswitch_connectors/src/connectors/paybox.rs:399-410 | crates/hyperswitch_connectors/src/connectors/paybox.rs:480-490 | crates/hyperswitch_connectors/src/connectors/paybox.rs:554-564 | crates/hyperswitch_connectors/src/connectors/paybox.rs:662-672 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/santander.rs:270— crates/hyperswitch_connectors/src/connectors/santander.rs:270-334 | crates/hyperswitch_connectors/src/connectors/santander.rs:1105-1207 | crates/hyperswitch_connectors/src/connectors/santander.rs:1338-1514 | crates/hyperswitch_connectors/src/connectors/santander.rs:1711-1781 | crates/hyperswitch_connectors/src/connectors/santander.rs:1880-1911 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:227— crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:227-239 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:313-333 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:561-581 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:655-668 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:742-755 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_connectors/src/utils.rs:2967— crates/hyperswitch_connectors/src/utils.rs:2967-2975 | crates/router/src/connector/utils.rs:868-876 | crates/router/src/connector/utils.rs:1134-1142 | crates/router/src/connector/utils.rs:1198-1206 | crates/router/src/connector/utils.rs:1224-1232 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_domain_models/src/lib.rs:1119— crates/hyperswitch_domain_models/src/lib.rs:1119-1164 | crates/router/src/core/payments/transformers.rs:8023-8066 | crates/router/src/core/payments/transformers.rs:8101-8146 | crates/router/src/types/transformers.rs:2703-2736 | crates/router/src/types/transformers.rs:2742-2776 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/hyperswitch_interfaces/src/conversion_impls.rs:117— crates/hyperswitch_interfaces/src/conversion_impls.rs:117-127 | crates/hyperswitch_interfaces/src/conversion_impls.rs:154-164 | crates/hyperswitch_interfaces/src/conversion_impls.rs:716-726 | crates/hyperswitch_interfaces/src/conversion_impls.rs:1010-1020 | crates/hyperswitch_interfaces/src/conversion_impls.rs:1049-1059 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/router/src/core/payment_methods.rs:5590— crates/router/src/core/payment_methods.rs:5590-5665 | crates/router/src/core/payment_methods.rs:5759-5824 | crates/router/src/core/payment_methods/vault.rs:2743-2816 | crates/router/src/core/payment_methods/vault.rs:3293-3357 | crates/router/src/core/payment_methods/vault.rs:3447-3508 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/router/src/core/payments.rs:222— crates/router/src/core/payments.rs:222-515 | crates/router/src/core/payments.rs:2147-2246 | crates/router/src/core/payments.rs:2266-2326 | crates/router/src/core/payments.rs:2346-2410 | crates/router/src/core/payments/session_operation.rs:138-225 — 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 (18 lines × 2) crates/analytics/src/auth_events/core.rs:55— crates/analytics/src/auth_events/core.rs:55-72 | crates/analytics/src/sdk_events/core.rs:64-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (18 lines × 2) crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs:52— crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs:52-69 | crates/analytics/src/payments/metrics/payment_processed_amount.rs:43-60 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs` and `crates/analytics/src/payments/metrics/payment_processed_amount.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:145— crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:145-162 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs:137-154 — before extracting anything, compare `crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs` and `crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/diesel_models/src/payment_attempt.rs:3470— crates/diesel_models/src/payment_attempt.rs:3470-3487 | crates/diesel_models/src/payment_attempt.rs:3743-3760 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1663— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1663-1680 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1773-1790 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:868— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:868-885 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:996-1013 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3877— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3877-3894 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4024-4041 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/ebanx/transformers.rs:227— crates/hyperswitch_connectors/src/connectors/ebanx/transformers.rs:227-244 | crates/hyperswitch_connectors/src/connectors/ebanx/transformers.rs:321-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/hyperswitch_connectors/src/connectors/gpayments.rs:285— crates/hyperswitch_connectors/src/connectors/gpayments.rs:285-302 | crates/hyperswitch_connectors/src/connectors/netcetera.rs:395-412 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/gpayments.rs` and `crates/hyperswitch_connectors/src/connectors/netcetera.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) crates/hyperswitch_connectors/src/connectors/gpayments.rs:458— crates/hyperswitch_connectors/src/connectors/gpayments.rs:458-475 | crates/hyperswitch_connectors/src/connectors/netcetera.rs:292-309 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/gpayments.rs` and `crates/hyperswitch_connectors/src/connectors/netcetera.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:1541— crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:1541-1558 | crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:1581-1598 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:674— crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:674-691 | crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:828-845 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs:691— crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs:691-708 | crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs:759-776 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1077— crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1077-1094 | crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1098-1115 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs:354— crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs:354-371 | crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs:640-657 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2797— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2797-2814 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3292-3309 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_domain_models/src/router_request_types.rs:1206— crates/hyperswitch_domain_models/src/router_request_types.rs:1206-1223 | crates/hyperswitch_domain_models/src/router_request_types.rs:1229-1246 — both copies are in the same file, so extract the block into 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) crates/payment_methods/src/helpers.rs:297— crates/payment_methods/src/helpers.rs:297-314 | crates/router/src/types/transformers.rs:122-139 — before extracting anything, compare `crates/payment_methods/src/helpers.rs` and `crates/router/src/types/transformers.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) crates/router/src/core/payment_methods.rs:999— crates/router/src/core/payment_methods.rs:999-1016 | crates/router/src/core/payment_methods.rs:1019-1036 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payment_methods/cards.rs:7291— crates/router/src/core/payment_methods/cards.rs:7291-7308 | crates/router/src/core/payment_methods/cards.rs:7399-7416 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:235— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:235-252 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:214-231 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/proxy_payments_intent.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 289 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/payments/operations/payment_confirm.rs:2780— crates/router/src/core/payments/operations/payment_confirm.rs:2780-2797 | crates/router/src/core/payments/operations/payment_recurrence.rs:577-594 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_recurrence.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/payments/transformers.rs:289— crates/router/src/core/payments/transformers.rs:289-306 | crates/router/src/core/payments/transformers.rs:1412-1429 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/transformers.rs:2542— crates/router/src/core/payments/transformers.rs:2542-2559 | crates/router/src/core/payments/transformers.rs:8542-8559 — both copies are in the same file, so extract the block into 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) crates/router/src/core/refunds.rs:1002— crates/router/src/core/refunds.rs:1002-1020 | crates/router/src/core/refunds.rs:1576-1593 — both copies are in the same file, so extract the block into 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) crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs:68— crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs:68-88 | crates/analytics/src/payment_intents/metrics/total_smart_retries.rs:68-88 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs` and `crates/analytics/src/payment_intents/metrics/total_smart_retries.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 159 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 (21 lines × 2) crates/analytics/src/payments/metrics/avg_ticket_size.rs:43— crates/analytics/src/payments/metrics/avg_ticket_size.rs:43-63 | crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs:44-64 — before extracting anything, compare `crates/analytics/src/payments/metrics/avg_ticket_size.rs` and `crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (21 lines × 2) crates/api_models/src/payouts.rs:1520— crates/api_models/src/payouts.rs:1520-1540 | crates/api_models/src/payouts.rs:1689-1709 — both copies are in the same file, so extract the block into 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) crates/common_enums/src/enums.rs:1503— crates/common_enums/src/enums.rs:1503-1523 | crates/common_enums/src/enums.rs:1821-1841 — both copies are in the same file, so extract the block into 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) crates/common_enums/src/enums.rs:1534— crates/common_enums/src/enums.rs:1534-1554 | crates/common_enums/src/enums.rs:1854-1874 — both copies are in the same file, so extract the block into 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) REDACTED:1862— REDACTED:1862-1882 | REDACTED:1994-2014 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1610— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1610-1630 | crates/hyperswitch_connectors/src/connectors/celero/transformers.rs:1038-1058 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (21 lines × 2) crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1305— crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1305-1325 | crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1374-1394 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/sanlam_payshield/transformers.rs:118— crates/hyperswitch_connectors/src/connectors/sanlam_payshield/transformers.rs:118-138 | crates/hyperswitch_connectors/src/connectors/sanlam_payshield/transformers.rs:183-203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/hyperswitch_connectors/src/connectors/tokenex/transformers.rs:117— crates/hyperswitch_connectors/src/connectors/tokenex/transformers.rs:117-137 | crates/hyperswitch_connectors/src/connectors/tokenex/transformers.rs:208-228 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs:559— crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs:559-579 | crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs:747-767 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2680— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2680-2700 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2732-2752 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/xendit.rs:434— crates/hyperswitch_connectors/src/connectors/xendit.rs:434-454 | crates/hyperswitch_connectors/src/connectors/xendit.rs:558-578 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/hyperswitch_constraint_graph/src/graph.rs:592— crates/hyperswitch_constraint_graph/src/graph.rs:592-612 | crates/hyperswitch_constraint_graph/src/graph.rs:614-634 — both copies are in the same file, so extract the block into 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) crates/router/src/core/authentication/utils.rs:217— crates/router/src/core/authentication/utils.rs:217-237 | crates/router/src/core/authentication/utils.rs:285-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/router/src/core/payment_methods.rs:3040— crates/router/src/core/payment_methods.rs:3040-3060 | crates/router/src/core/payment_methods.rs:3726-3746 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payment_methods.rs:7474— crates/router/src/core/payment_methods.rs:7474-7494 | crates/router/src/core/payment_methods.rs:7524-7544 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payment_methods/utils.rs:651— crates/router/src/core/payment_methods/utils.rs:651-671 | crates/router/src/core/payment_methods/utils.rs:775-795 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/routing.rs:279— crates/router/src/core/payments/routing.rs:279-299 | crates/router/src/core/payments/routing.rs:399-419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/router/src/core/payments/routing.rs:578— crates/router/src/core/payments/routing.rs:578-598 | crates/router/src/core/payments/routing.rs:629-649 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payouts.rs:425— crates/router/src/core/payouts.rs:425-445 | crates/router/src/core/payouts.rs:489-509 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payouts.rs:2190— crates/router/src/core/payouts.rs:2190-2210 | crates/router/src/core/payouts.rs:2441-2461 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payouts/helpers.rs:1249— crates/router/src/core/payouts/helpers.rs:1249-1269 | crates/router/src/core/payouts/helpers.rs:1279-1299 — both copies are in the same file, so extract the block into 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) crates/router/src/core/refunds.rs:576— crates/router/src/core/refunds.rs:576-596 | crates/router/src/core/refunds.rs:1271-1291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/router/src/core/routing.rs:1135— crates/router/src/core/routing.rs:1135-1155 | crates/router/src/core/routing.rs:1655-1675 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
+ 10 more in this group — see findings.md.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×34
Duplicated block (20 lines × 2) crates/analytics/src/lib.rs:234— crates/analytics/src/lib.rs:234-253 | crates/analytics/src/lib.rs:566-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 (20 lines × 2) crates/api_models/src/payments.rs:12667— crates/api_models/src/payments.rs:12667-12686 | crates/api_models/src/payments.rs:12841-12860 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:961— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:961-980 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1784-1803 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (20 lines × 2) crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:645— crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:645-664 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:725-744 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:295— crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:295-314 | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:567-586 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs:1650— crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs:1650-1669 | crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs:1673-1692 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1016— crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1016-1035 | crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1039-1058 — both copies are in the same file, so extract the block into 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) crates/router/src/core/admin.rs:1766— crates/router/src/core/admin.rs:1766-1785 | crates/router/src/core/admin.rs:1851-1870 — both copies are in the same file, so extract the block into 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) crates/router/src/core/fraud_check/flows/record_return.rs:105— crates/router/src/core/fraud_check/flows/record_return.rs:105-124 | crates/router/src/core/fraud_check/flows/sale_flow.rs:157-176 — before extracting anything, compare `crates/router/src/core/fraud_check/flows/record_return.rs` and `crates/router/src/core/fraud_check/flows/sale_flow.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/fraud_check/operation/fraud_check_pre.rs:309— crates/router/src/core/fraud_check/operation/fraud_check_pre.rs:309-328 | crates/router/src/core/fraud_check/operation/fraud_check_pre.rs:362-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/router/src/core/payment_link.rs:174— crates/router/src/core/payment_link.rs:174-193 | crates/router/src/core/payment_link.rs:991-1010 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payment_methods.rs:3398— crates/router/src/core/payment_methods.rs:3398-3417 | crates/router/src/core/payment_methods.rs:3646-3665 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payment_methods/cards.rs:2618— crates/router/src/core/payment_methods/cards.rs:2618-2637 | crates/router/src/core/payment_methods/cards.rs:2724-2743 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/router/src/core/payment_methods/cards.rs:5964— crates/router/src/core/payment_methods/cards.rs:5964-5983 | crates/router/src/core/payment_methods/cards.rs:6024-6043 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payment_methods/surcharge_decision_configs.rs:245— crates/router/src/core/payment_methods/surcharge_decision_configs.rs:245-264 | crates/router/src/core/payment_methods/surcharge_decision_configs.rs:296-315 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments.rs:14579— crates/router/src/core/payments.rs:14579-14598 | crates/router/src/core/payments.rs:14666-14685 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/gateway.rs:86— crates/router/src/core/payments/gateway.rs:86-105 | crates/router/src/core/payouts/gateway.rs:51-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (20 lines × 2) crates/router/src/core/payments/operations/payment_confirm.rs:798— crates/router/src/core/payments/operations/payment_confirm.rs:798-817 | crates/router/src/core/payments/operations/payment_create.rs:540-559 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_create.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) crates/router/src/core/payments/routing/utils.rs:387— crates/router/src/core/payments/routing/utils.rs:387-406 | crates/router/src/core/payments/routing/utils.rs:425-444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/router/src/core/refunds.rs:2278— crates/router/src/core/refunds.rs:2278-2297 | crates/router/src/core/refunds.rs:2351-2370 — both copies are in the same file, so extract the block into 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) crates/router/src/core/user.rs:1035— crates/router/src/core/user.rs:1035-1054 | crates/router/src/core/user.rs:1190-1209 — both copies are in the same file, so extract the block into 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) crates/router/src/core/user/dashboard_metadata.rs:378— crates/router/src/core/user/dashboard_metadata.rs:378-397 | crates/router/src/core/user/dashboard_metadata.rs:403-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/router/src/routes/payment_methods.rs:708— crates/router/src/routes/payment_methods.rs:708-727 | crates/router/src/routes/payment_methods.rs:1208-1227 — both copies are in the same file, so extract the block into 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) crates/router/src/routes/payments.rs:1695— crates/router/src/routes/payments.rs:1695-1714 | crates/router/src/routes/payments.rs:1743-1762 — both copies are in the same file, so extract the block into 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) crates/router/src/services/authentication.rs:2320— crates/router/src/services/authentication.rs:2320-2339 | crates/router/src/services/authentication.rs:2446-2465 — both copies are in the same file, so extract the block into 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 × 3) crates/analytics/src/payments/metrics/debit_routing.rs:43— crates/analytics/src/payments/metrics/debit_routing.rs:43-53 | crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs:44-54 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs:46-57 — before extracting anything, compare `crates/analytics/src/payments/metrics/debit_routing.rs` and `crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 167 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:41— crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:41-53 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs:44-56 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs:46-56 — before extracting anything, compare `crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs` and `crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs` as WHOLE FILES: this scan already matched 5 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 (11 lines × 3) crates/analytics/src/sqlx.rs:585— crates/analytics/src/sqlx.rs:585-595 | crates/analytics/src/sqlx.rs:1268-1278 | crates/analytics/src/sqlx.rs:1322-1332 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/diesel_models/src/query/generics.rs:694— crates/diesel_models/src/query/generics.rs:694-704 | crates/diesel_models/src/query/generics.rs:897-907 | crates/diesel_models/src/query/generics.rs:1030-1040 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/diesel_models/src/query/generics.rs:797— crates/diesel_models/src/query/generics.rs:797-807 | crates/diesel_models/src/query/generics.rs:983-993 | crates/diesel_models/src/query/generics.rs:1105-1115 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1454— crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1454-1464 | crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:1408-1418 | crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:1497-1507 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 3) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:331— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:331-341 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:435-445 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:245-255 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 47 separate duplicated blocks between them, totalling at least 513 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 (11 lines × 3) crates/hyperswitch_connectors/src/connectors/boku.rs:278— crates/hyperswitch_connectors/src/connectors/boku.rs:278-288 | crates/hyperswitch_connectors/src/connectors/boku.rs:362-372 | crates/hyperswitch_connectors/src/connectors/boku.rs:442-452 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/hyperswitch_connectors/src/connectors/checkout.rs:188— crates/hyperswitch_connectors/src/connectors/checkout.rs:188-198 | crates/hyperswitch_connectors/src/connectors/paypal.rs:208-218 | crates/hyperswitch_connectors/src/connectors/paypal.rs:414-425 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/checkout.rs` and `crates/hyperswitch_connectors/src/connectors/paypal.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/nmi.rs:614— crates/hyperswitch_connectors/src/connectors/nmi.rs:614-624 | crates/hyperswitch_connectors/src/connectors/payeezy.rs:323-333 | crates/hyperswitch_connectors/src/connectors/paypal.rs:2011-2021 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/nmi.rs` and `crates/hyperswitch_connectors/src/connectors/payeezy.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) crates/hyperswitch_connectors/src/connectors/payme.rs:336— crates/hyperswitch_connectors/src/connectors/payme.rs:336-346 | crates/hyperswitch_connectors/src/connectors/razorpay.rs:267-277 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:606-616 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/payme.rs` and `crates/hyperswitch_connectors/src/connectors/trustpay.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) crates/hyperswitch_connectors/src/utils.rs:2247— crates/hyperswitch_connectors/src/utils.rs:2247-2257 | crates/hyperswitch_connectors/src/utils.rs:2303-2313 | crates/hyperswitch_connectors/src/utils.rs:2356-2366 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/hyperswitch_domain_models/src/payments.rs:786— crates/hyperswitch_domain_models/src/payments.rs:786-796 | crates/hyperswitch_domain_models/src/payments.rs:840-850 | crates/hyperswitch_domain_models/src/payments.rs:878-888 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/hyperswitch_domain_models/src/type_encryption.rs:175— crates/hyperswitch_domain_models/src/type_encryption.rs:175-186 | crates/hyperswitch_domain_models/src/type_encryption.rs:414-424 | crates/hyperswitch_domain_models/src/type_encryption.rs:887-897 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/hyperswitch_interfaces/src/conversion_impls.rs:547— crates/hyperswitch_interfaces/src/conversion_impls.rs:547-558 | crates/hyperswitch_interfaces/src/conversion_impls.rs:797-807 | crates/hyperswitch_interfaces/src/conversion_impls.rs:1233-1243 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/router/src/core/fraud_check/flows/checkout_flow.rs:153— crates/router/src/core/fraud_check/flows/checkout_flow.rs:153-163 | crates/router/src/core/fraud_check/flows/sale_flow.rs:150-160 | crates/router/src/core/fraud_check/flows/transaction_flow.rs:117-127 — before extracting anything, compare `crates/router/src/core/fraud_check/flows/checkout_flow.rs` and `crates/router/src/core/fraud_check/flows/sale_flow.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) crates/router/src/core/fraud_check/flows/record_return.rs:113— crates/router/src/core/fraud_check/flows/record_return.rs:113-123 | crates/router/src/core/fraud_check/flows/sale_flow.rs:165-175 | crates/router/src/core/fraud_check/flows/transaction_flow.rs:131-141 — before extracting anything, compare `crates/router/src/core/fraud_check/flows/record_return.rs` and `crates/router/src/core/fraud_check/flows/sale_flow.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/payment_link.rs:234— crates/router/src/core/payment_link.rs:234-244 | crates/router/src/core/payment_link.rs:268-278 | crates/router/src/core/payment_link.rs:903-913 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/router/src/core/payment_methods.rs:3432— crates/router/src/core/payment_methods.rs:3432-3442 | crates/router/src/core/payment_methods.rs:3749-3759 | crates/router/src/core/payment_methods.rs:4094-4104 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/router/src/core/payment_methods/network_tokenization.rs:129— crates/router/src/core/payment_methods/network_tokenization.rs:129-139 | crates/router/src/core/payment_methods/network_tokenization.rs:301-311 | crates/router/src/core/payment_methods/network_tokenization.rs:1170-1180 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/router/src/core/payments/helpers.rs:423— crates/router/src/core/payments/helpers.rs:423-433 | crates/router/src/utils.rs:823-833 | crates/router/src/utils.rs:964-974 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 3) crates/router/src/core/payments/operations/payment_complete_authorize.rs:295— crates/router/src/core/payments/operations/payment_complete_authorize.rs:295-305 | crates/router/src/core/payments/operations/payment_confirm.rs:498-508 | crates/router/src/core/payments/operations/payment_update.rs:280-290 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_complete_authorize.rs` and `crates/router/src/core/payments/operations/payment_confirm.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) crates/router/src/core/payments/operations/payment_confirm.rs:420— crates/router/src/core/payments/operations/payment_confirm.rs:420-430 | crates/router/src/core/payments/operations/payment_confirm_external_vault_proxy.rs:428-438 | crates/router/src/core/payments/operations/payment_recurrence.rs:129-139 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_confirm_external_vault_proxy.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) crates/router/src/core/payments/operations/payment_confirm_intent.rs:62— crates/router/src/core/payments/operations/payment_confirm_intent.rs:62-72 | crates/router/src/core/payments/operations/payment_update_intent.rs:68-78 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:63-73 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm_intent.rs` and `crates/router/src/core/payments/operations/payment_update_intent.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/payments/operations/payment_create.rs:900— crates/router/src/core/payments/operations/payment_create.rs:900-910 | crates/router/src/core/payments/operations/payment_update.rs:754-764 | crates/router/src/core/payments/operations/tax_calculation.rs:318-328 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_create.rs` and `crates/router/src/core/payments/operations/payment_update.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 181 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/analytics/src/payments/core.rs:190— crates/analytics/src/payments/core.rs:190-212 | crates/analytics/src/refunds/core.rs:162-184 — `crates/analytics/src/payments/core.rs` and `crates/analytics/src/refunds/core.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 107 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 (23 lines × 2) crates/diesel_models/src/payment_attempt.rs:4474— crates/diesel_models/src/payment_attempt.rs:4474-4496 | crates/diesel_models/src/payment_attempt.rs:4647-4669 — both copies are in the same file, so extract the block into 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) REDACTED:914— REDACTED:914-936 | REDACTED:977-999 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/diesel_models/src/refund.rs:438— crates/diesel_models/src/refund.rs:438-460 | crates/diesel_models/src/refund.rs:566-588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/diesel_models/src/refund.rs:533— crates/diesel_models/src/refund.rs:533-555 | crates/diesel_models/src/refund.rs:651-673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1601— crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1601-1623 | crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1667-1689 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:1155— crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:1155-1177 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:1229-1251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1205— crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1205-1227 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1247-1269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/hyperswitch_connectors/src/connectors/riskified.rs:581— crates/hyperswitch_connectors/src/connectors/riskified.rs:581-603 | crates/hyperswitch_connectors/src/connectors/signifyd.rs:691-713 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/riskified.rs` and `crates/hyperswitch_connectors/src/connectors/signifyd.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:1979— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:1979-2001 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3030-3052 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/router/src/core/admin.rs:1798— crates/router/src/core/admin.rs:1798-1820 | crates/router/src/core/admin.rs:1887-1909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/router/src/core/payment_methods/transformers.rs:1002— crates/router/src/core/payment_methods/transformers.rs:1002-1024 | crates/router/src/core/payment_methods/transformers.rs:1113-1135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/router/src/core/payments.rs:1238— crates/router/src/core/payments.rs:1238-1260 | crates/router/src/core/payments.rs:1444-1466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/router/src/core/payments.rs:4489— crates/router/src/core/payments.rs:4489-4511 | crates/router/src/core/payments.rs:4533-4555 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/router/src/core/payments/helpers.rs:5777— crates/router/src/core/payments/helpers.rs:5777-5799 | crates/router/src/core/payments/helpers.rs:6162-6184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/router/src/core/payments/retry.rs:689— crates/router/src/core/payments/retry.rs:689-711 | crates/router/src/core/payments/retry.rs:761-783 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/router/src/core/payments/transformers.rs:224— crates/router/src/core/payments/transformers.rs:224-246 | crates/router/src/core/payments/transformers.rs:8524-8546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/router/src/core/payments/transformers.rs:2349— crates/router/src/core/payments/transformers.rs:2349-2371 | crates/router/src/core/payments/transformers.rs:8385-8407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/router/src/core/payments/transformers.rs:2373— crates/router/src/core/payments/transformers.rs:2373-2395 | crates/router/src/core/payments/transformers.rs:8409-8431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/router/src/core/payouts/helpers.rs:1121— crates/router/src/core/payouts/helpers.rs:1121-1143 | crates/router/src/core/payouts/helpers.rs:1171-1193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/router/src/core/refunds.rs:2823— crates/router/src/core/refunds.rs:2823-2845 | crates/router/src/core/refunds_v2.rs:1553-1575 — before extracting anything, compare `crates/router/src/core/refunds.rs` and `crates/router/src/core/refunds_v2.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/revenue_recovery/types.rs:599— crates/router/src/core/revenue_recovery/types.rs:599-621 | crates/router/src/core/revenue_recovery/types.rs:706-728 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/router/src/core/user/theme.rs:67— crates/router/src/core/user/theme.rs:67-89 | crates/router/src/core/user/theme.rs:526-548 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/router/src/db/refund.rs:1444— crates/router/src/db/refund.rs:1444-1466 | crates/router/src/db/refund.rs:1499-1521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) crates/router/src/routes/payments.rs:422— crates/router/src/routes/payments.rs:422-444 | crates/router/src/routes/payments.rs:489-511 — both copies are in the same file, so extract the block into 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 × 3) crates/analytics/src/payments/distribution/payment_error_message.rs:78— crates/analytics/src/payments/distribution/payment_error_message.rs:78-90 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs:85-98 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs:78-90 — before extracting anything, compare `crates/analytics/src/payments/distribution/payment_error_message.rs` and `crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 115 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) crates/diesel_models/src/payment_attempt.rs:1444— crates/diesel_models/src/payment_attempt.rs:1444-1456 | crates/diesel_models/src/payment_attempt.rs:1493-1505 | crates/diesel_models/src/payment_attempt.rs:4112-4124 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4663— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4663-4675 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4744-4756 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4823-4835 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1479— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1479-1491 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1544-1556 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:847-859 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/payme/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 138 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 3) crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:993— crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:993-1005 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:1012-1024 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:1109-1121 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/digitalvirgo/transformers.rs:164— crates/hyperswitch_connectors/src/connectors/digitalvirgo/transformers.rs:164-177 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:229-242 | crates/hyperswitch_connectors/src/connectors/prophetpay/transformers.rs:402-414 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (13 lines × 3) crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:314— crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:314-326 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:374-386 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:517-529 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs:289— crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs:289-301 | crates/hyperswitch_connectors/src/connectors/hyperpg/transformers.rs:75-87 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital/transformers.rs:91-103 — `crates/hyperswitch_connectors/src/connectors/hyperpg/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 3) crates/hyperswitch_connectors/src/connectors/klarna.rs:563— crates/hyperswitch_connectors/src/connectors/klarna.rs:563-575 | crates/hyperswitch_connectors/src/connectors/klarna.rs:702-714 | crates/hyperswitch_connectors/src/connectors/klarna.rs:993-1005 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/nordea.rs:281— crates/hyperswitch_connectors/src/connectors/nordea.rs:281-293 | crates/hyperswitch_connectors/src/connectors/nordea.rs:466-478 | crates/hyperswitch_connectors/src/connectors/nordea.rs:631-643 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:1034— crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:1034-1047 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:413-425 | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs:588-600 — `crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/volt/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 72 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 3) crates/hyperswitch_connectors/src/connectors/worldpay.rs:410— crates/hyperswitch_connectors/src/connectors/worldpay.rs:410-422 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:570-582 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:675-687 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1289— crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1289-1301 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1955-1967 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1994-2006 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/utils.rs:1310— crates/hyperswitch_connectors/src/utils.rs:1310-1322 | crates/hyperswitch_connectors/src/utils.rs:1417-1429 | crates/hyperswitch_connectors/src/utils.rs:7415-7427 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/utils.rs:2216— crates/hyperswitch_connectors/src/utils.rs:2216-2228 | crates/hyperswitch_connectors/src/utils.rs:2270-2282 | crates/hyperswitch_connectors/src/utils.rs:2323-2335 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_domain_models/src/address.rs:112— crates/hyperswitch_domain_models/src/address.rs:112-124 | crates/hyperswitch_domain_models/src/address.rs:150-162 | crates/hyperswitch_domain_models/src/bulk_tokenization.rs:320-332 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (13 lines × 3) crates/router/src/core/payment_methods/cards.rs:2614— crates/router/src/core/payment_methods/cards.rs:2614-2626 | crates/router/src/core/payment_methods/cards.rs:3004-3016 | crates/router/src/core/payment_methods/cards.rs:3081-3093 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payments.rs:818— crates/router/src/core/payments.rs:818-830 | crates/router/src/core/payments.rs:1802-1814 | crates/router/src/core/payments.rs:3225-3237 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payments/helpers.rs:6312— crates/router/src/core/payments/helpers.rs:6312-6324 | crates/router/src/core/payments/helpers.rs:6461-6473 | crates/router/src/core/payments/helpers.rs:6896-6908 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payments/transformers.rs:3247— crates/router/src/core/payments/transformers.rs:3247-3259 | crates/router/src/core/payments/transformers.rs:3404-3416 | crates/router/src/core/payments/transformers.rs:3531-3543 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payouts.rs:1985— crates/router/src/core/payouts.rs:1985-1997 | crates/router/src/core/payouts.rs:3100-3112 | crates/router/src/core/payouts.rs:3309-3321 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/user.rs:578— crates/router/src/core/user.rs:578-590 | crates/router/src/core/user.rs:1362-1374 | crates/router/src/core/user.rs:2254-2266 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/webhooks/outgoing.rs:1231— crates/router/src/core/webhooks/outgoing.rs:1231-1244 | crates/router/src/core/webhooks/outgoing.rs:1329-1341 | crates/router/src/core/webhooks/outgoing_v2.rs:607-619 — before extracting anything, compare `crates/router/src/core/webhooks/outgoing.rs` and `crates/router/src/core/webhooks/outgoing_v2.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/db/events.rs:353— crates/router/src/db/events.rs:353-365 | crates/router/src/db/events.rs:429-441 | crates/router/src/db/events.rs:497-509 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/db/events.rs:396— crates/router/src/db/events.rs:396-408 | crates/router/src/db/events.rs:462-474 | crates/router/src/db/events.rs:530-542 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/external_services/src/utils.rs:42— crates/external_services/src/utils.rs:42-51 | crates/payment_methods/src/configs/settings.rs:164-173 | crates/router/src/configs/settings.rs:1913-1922 — before extracting anything, compare `crates/external_services/src/utils.rs` and `crates/payment_methods/src/configs/settings.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/hyperswitch_connectors/src/connectors/cybersource.rs:1217— crates/hyperswitch_connectors/src/connectors/cybersource.rs:1217-1226 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1386-1395 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:829-838 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersource.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 506 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/cybersource.rs:2009— crates/hyperswitch_connectors/src/connectors/cybersource.rs:2009-2018 | crates/hyperswitch_connectors/src/connectors/redsys.rs:734-743 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:1083-1092 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersource.rs` and `crates/hyperswitch_connectors/src/connectors/redsys.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:588— crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:588-597 | crates/hyperswitch_connectors/src/connectors/riskified.rs:369-378 | crates/hyperswitch_connectors/src/connectors/signifyd.rs:455-464 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs` and `crates/hyperswitch_connectors/src/connectors/signifyd.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:406— crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:406-415 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:666-675 | crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:415-424 — `crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 69 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 3) crates/hyperswitch_connectors/src/connectors/nexixpay.rs:247— crates/hyperswitch_connectors/src/connectors/nexixpay.rs:247-256 | crates/hyperswitch_connectors/src/connectors/paypal.rs:231-240 | crates/hyperswitch_connectors/src/connectors/paypal.rs:438-447 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/nexixpay.rs` and `crates/hyperswitch_connectors/src/connectors/paypal.rs` 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.
Duplicated block (10 lines × 3) crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1302— crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1302-1311 | crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1371-1380 | crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1566-1575 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/worldpay.rs:185— crates/hyperswitch_connectors/src/connectors/worldpay.rs:185-194 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:510-519 | crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs:117-126 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/worldpay.rs` and `crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:173— crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:173-182 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1588-1597 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1630-1639 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:4608— crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:4608-4617 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:4626-4635 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:4644-4653 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/utils.rs:2469— crates/hyperswitch_connectors/src/utils.rs:2469-2478 | crates/hyperswitch_connectors/src/utils.rs:3329-3338 | crates/hyperswitch_connectors/src/utils.rs:3359-3368 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/disputes.rs:96— crates/router/src/core/disputes.rs:96-107 | crates/router/src/core/disputes.rs:478-487 | crates/router/src/core/disputes.rs:608-618 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payment_methods/transformers.rs:2162— crates/router/src/core/payment_methods/transformers.rs:2162-2171 | crates/router/src/core/payment_methods/transformers.rs:2432-2441 | crates/router/src/core/payment_methods/transformers.rs:2493-2502 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payments.rs:5535— crates/router/src/core/payments.rs:5535-5544 | crates/router/src/core/payments/operations/payment_update_intent.rs:61-70 | crates/router/src/core/payments/payment_methods.rs:788-797 — before extracting anything, compare `crates/router/src/core/payments.rs` and `crates/router/src/core/payments/operations/payment_update_intent.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/router/src/core/payments/transformers.rs:5639— crates/router/src/core/payments/transformers.rs:5639-5648 | crates/router/src/core/payments/transformers.rs:7287-7296 | crates/router/src/core/payments/transformers.rs:7582-7591 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payments/transformers.rs:5783— crates/router/src/core/payments/transformers.rs:5783-5792 | crates/router/src/core/payments/transformers.rs:6264-6273 | crates/router/src/core/payments/transformers.rs:6300-6309 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payouts.rs:2191— crates/router/src/core/payouts.rs:2191-2200 | crates/router/src/core/payouts.rs:2442-2451 | crates/router/src/core/payouts.rs:3092-3101 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/user.rs:647— crates/router/src/core/user.rs:647-656 | crates/router/src/core/user.rs:1395-1404 | crates/router/src/core/user.rs:1548-1557 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/routes/payments.rs:255— crates/router/src/routes/payments.rs:255-264 | crates/router/src/routes/payments.rs:961-970 | crates/router/src/routes/payments.rs:1267-1276 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/routes/payments.rs:1692— crates/router/src/routes/payments.rs:1692-1701 | crates/router/src/routes/payments.rs:1788-1797 | crates/router/src/routes/payments.rs:3329-3340 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/services/authentication.rs:1867— crates/router/src/services/authentication.rs:1867-1876 | crates/router/src/services/authentication.rs:2396-2405 | crates/router/src/services/authentication.rs:2637-2646 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/types/storage/dispute.rs:113— crates/router/src/types/storage/dispute.rs:113-122 | crates/router/src/types/storage/dispute.rs:181-190 | crates/router/src/types/storage/payment_link.rs:69-78 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 3) crates/router/src/workflows/payment_method_modular_backward_compat.rs:920— crates/router/src/workflows/payment_method_modular_backward_compat.rs:920-930 | crates/router/src/workflows/payment_method_modular_forward_compat.rs:598-608 | crates/router/src/workflows/payment_method_status_update.rs:84-93 — before extracting anything, compare `crates/router/src/workflows/payment_method_modular_backward_compat.rs` and `crates/router/src/workflows/payment_method_modular_forward_compat.rs` as WHOLE FILES: this scan already matched 5 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 × 3) crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:654— crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:654-663 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:668-677 | crates/router/src/types/transformers.rs:938-947 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 3) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:454— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:454-463 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:539-548 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:322-331 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/payment_confirm_intent.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 3) REDACTED:2067— REDACTED:2067-2081 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1363-1377 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1424-1438 — before extracting anything, compare `REDACTED` and `crates/hyperswitch_domain_models/src/payments/payment_intent.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3633— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3633-3647 | crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs:165-179 | crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:99-113 — `crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 104 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 (15 lines × 3) crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:942— crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:942-956 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2463-2477 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:379-393 — `crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 52 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 (15 lines × 3) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:734— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:734-748 | crates/hyperswitch_connectors/src/connectors/bamboraapac/transformers.rs:481-496 | crates/hyperswitch_connectors/src/connectors/finix/transformers.rs:464-479 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (15 lines × 3) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:962— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:962-976 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1785-1799 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1114-1128 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (15 lines × 3) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1012— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1012-1026 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2588-2602 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1225-1239 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 47 separate duplicated blocks between them, totalling at least 513 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 (15 lines × 3) crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:694— crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:694-708 | crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:949-963 | crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:1041-1055 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs:192— crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs:192-206 | crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:127-141 | crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs:181-195 — `crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 104 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 (15 lines × 3) crates/hyperswitch_connectors/src/connectors/fiuu.rs:273— crates/hyperswitch_connectors/src/connectors/fiuu.rs:273-287 | crates/hyperswitch_connectors/src/connectors/nmi.rs:156-170 | crates/hyperswitch_connectors/src/connectors/payload.rs:308-322 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/fiuu.rs` and `crates/hyperswitch_connectors/src/connectors/payload.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 3) crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:303— crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:303-317 | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:575-589 | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:1790-1804 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/xendit.rs:231— crates/hyperswitch_connectors/src/connectors/xendit.rs:231-245 | crates/hyperswitch_connectors/src/connectors/xendit.rs:445-459 | crates/hyperswitch_connectors/src/connectors/xendit.rs:569-583 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/compatibility/stripe/setup_intents.rs:127— crates/router/src/compatibility/stripe/setup_intents.rs:127-141 | crates/router/src/compatibility/stripe/setup_intents.rs:213-227 | crates/router/src/compatibility/stripe/setup_intents.rs:300-314 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payment_methods.rs:5622— crates/router/src/core/payment_methods.rs:5622-5636 | crates/router/src/core/payment_methods.rs:5781-5795 | crates/router/src/core/payment_methods/vault.rs:2780-2794 — before extracting anything, compare `crates/router/src/core/payment_methods.rs` and `crates/router/src/core/payment_methods/vault.rs` as WHOLE FILES: this scan already matched 6 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 (15 lines × 3) crates/router/src/core/payment_methods/utils.rs:331— crates/router/src/core/payment_methods/utils.rs:331-345 | crates/router/src/core/payment_methods/utils.rs:352-366 | crates/router/src/core/payment_methods/utils.rs:405-419 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payments/operations/payment_post_session_tokens.rs:136— crates/router/src/core/payments/operations/payment_post_session_tokens.rs:136-150 | crates/router/src/core/payments/operations/payment_session.rs:183-197 | crates/router/src/core/payments/operations/tax_calculation.rs:152-166 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_post_session_tokens.rs` and `crates/router/src/core/payments/operations/payment_session.rs` as WHOLE FILES: this scan already matched 12 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 (15 lines × 3) crates/router/src/core/payments/transformers.rs:1015— crates/router/src/core/payments/transformers.rs:1015-1029 | crates/router/src/core/payments/transformers.rs:2507-2521 | crates/router/src/core/payments/transformers.rs:8511-8525 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payments/transformers.rs:2079— crates/router/src/core/payments/transformers.rs:2079-2093 | crates/router/src/core/payments/transformers.rs:2416-2430 | crates/router/src/core/utils.rs:706-720 — before extracting anything, compare `crates/router/src/core/payments/transformers.rs` and `crates/router/src/core/utils.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) crates/router/src/core/user.rs:1281— crates/router/src/core/user.rs:1281-1295 | crates/router/src/core/user_role.rs:210-224 | crates/router/src/core/user_role.rs:565-579 — before extracting anything, compare `crates/router/src/core/user.rs` and `crates/router/src/core/user_role.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 3) crates/router/src/db/events.rs:1023— crates/router/src/db/events.rs:1023-1037 | crates/router/src/db/events.rs:1058-1072 | crates/router/src/db/events.rs:1095-1109 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/routes/disputes.rs:154— crates/router/src/routes/disputes.rs:154-168 | crates/router/src/routes/disputes.rs:354-368 | crates/router/src/routes/disputes.rs:707-721 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/routes/payments.rs:1124— crates/router/src/routes/payments.rs:1124-1138 | crates/router/src/routes/payments.rs:1442-1456 | crates/router/src/routes/payments.rs:1600-1614 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/routes/routing.rs:95— crates/router/src/routes/routing.rs:95-109 | crates/router/src/routes/routing.rs:186-200 | crates/router/src/routes/routing.rs:503-517 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/services/authentication.rs:1813— crates/router/src/services/authentication.rs:1813-1827 | crates/router/src/services/authentication.rs:2104-2118 | crates/router/src/services/authentication.rs:2341-2355 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/storage_impl/src/merchant_connector_account.rs:432— crates/storage_impl/src/merchant_connector_account.rs:432-446 | crates/storage_impl/src/merchant_connector_account.rs:488-502 | crates/storage_impl/src/merchant_connector_account.rs:561-575 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 3) crates/analytics/src/lib.rs:540— crates/analytics/src/lib.rs:540-554 | crates/analytics/src/lib.rs:750-764 | crates/analytics/src/lib.rs:850-864 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/analytics/src/payment_intents/core.rs:98— crates/analytics/src/payment_intents/core.rs:98-109 | crates/analytics/src/payments/core.rs:78-89 | crates/analytics/src/refunds/core.rs:73-84 — `crates/analytics/src/payment_intents/core.rs` and `crates/analytics/src/payments/core.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 60 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 (12 lines × 3) REDACTED:1202— REDACTED:1202-1213 | REDACTED:1344-1355 | REDACTED:2171-2182 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/api_models/src/payment_methods.rs:2496— crates/api_models/src/payment_methods.rs:2496-2507 | crates/hyperswitch_domain_models/src/payment_method_data.rs:4511-4522 | crates/hyperswitch_domain_models/src/payment_method_data.rs:4595-4606 — before extracting anything, compare `crates/api_models/src/payment_methods.rs` and `crates/hyperswitch_domain_models/src/payment_method_data.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) crates/common_types/src/payments.rs:734— crates/common_types/src/payments.rs:734-745 | crates/common_types/src/payments.rs:890-901 | crates/common_types/src/payments.rs:909-920 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1315— crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1315-1326 | crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1558-1569 | crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1729-1740 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs:82— crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs:82-93 | crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:698-709 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:284-295 — `crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 45 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 (12 lines × 3) crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs:64— crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs:64-75 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/transformers.rs:64-75 | crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs:84-95 — `crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 3) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:176— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:176-187 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:985-996 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1427-1438 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1760— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1760-1771 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1885-1896 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2010-2021 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/dwolla.rs:333— crates/hyperswitch_connectors/src/connectors/dwolla.rs:333-344 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:559-570 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:760-771 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/finix.rs:532— crates/hyperswitch_connectors/src/connectors/finix.rs:532-543 | crates/hyperswitch_connectors/src/connectors/finix.rs:713-724 | crates/hyperswitch_connectors/src/connectors/finix.rs:798-809 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:416— crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:416-427 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:676-687 | crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:429-440 — `crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 69 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 (12 lines × 3) crates/hyperswitch_connectors/src/connectors/worldpay/payout_transformers.rs:52— crates/hyperswitch_connectors/src/connectors/worldpay/payout_transformers.rs:52-63 | crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs:735-746 | crates/hyperswitch_connectors/src/connectors/worldpaymodular/transformers.rs:228-239 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (12 lines × 3) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2934— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2934-2945 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3252-3263 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3433-3444 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/analytics_report.rs:480— crates/router/src/core/analytics_report.rs:480-491 | crates/router/src/workflows/blocklist_export.rs:255-266 | crates/router/src/workflows/blocklist_profile_clone.rs:167-178 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (12 lines × 3) crates/router/src/core/payments/helpers.rs:6383— crates/router/src/core/payments/helpers.rs:6383-6394 | crates/router/src/core/payments/helpers.rs:6532-6543 | crates/router/src/core/payments/helpers.rs:6967-6978 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payments/tokenization.rs:471— crates/router/src/core/payments/tokenization.rs:471-484 | crates/router/src/core/payments/tokenization.rs:534-545 | crates/router/src/core/payments/tokenization.rs:947-960 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/unified_connector_service.rs:3247— crates/router/src/core/unified_connector_service.rs:3247-3258 | crates/router/src/core/unified_connector_service.rs:3459-3470 | crates/router/src/core/unified_connector_service.rs:3500-3511 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/webhooks/incoming.rs:1103— crates/router/src/core/webhooks/incoming.rs:1103-1114 | crates/router/src/core/webhooks/incoming.rs:3210-3221 | crates/router/src/core/webhooks/incoming.rs:3454-3465 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/routes/admin.rs:667— crates/router/src/routes/admin.rs:667-678 | crates/router/src/routes/admin.rs:948-959 | crates/router/src/routes/admin.rs:1216-1227 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/routes/webhooks.rs:25— crates/router/src/routes/webhooks.rs:25-36 | crates/router/src/routes/webhooks.rs:104-115 | crates/router/src/routes/webhooks.rs:147-158 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_domain_models/src/lib.rs:1359— crates/hyperswitch_domain_models/src/lib.rs:1359-1370 | crates/hyperswitch_domain_models/src/lib.rs:1376-1387 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:282-293 — 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 (12 lines × 3) crates/router_derive/src/macros/diesel.rs:117— crates/router_derive/src/macros/diesel.rs:117-128 | crates/router_derive/src/macros/operation.rs:330-341 | crates/router_derive/src/macros/operation.rs:347-358 — 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 (12 lines × 3) crates/storage_impl/src/authentication.rs:364— crates/storage_impl/src/authentication.rs:364-375 | crates/storage_impl/src/payments/payment_attempt.rs:836-847 | crates/storage_impl/src/payouts/payout_attempt.rs:138-149 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (12 lines × 3) crates/router/src/workflows/dispute_list.rs:44— crates/router/src/workflows/dispute_list.rs:44-55 | crates/router/src/workflows/post_capture_void_sync.rs:46-57 | crates/router/src/workflows/process_dispute.rs:41-52 — before extracting anything, compare `crates/router/src/workflows/dispute_list.rs` and `crates/router/src/workflows/process_dispute.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/external_services/src/http_client.rs:140— crates/external_services/src/http_client.rs:140-148 | crates/external_services/src/http_client.rs:154-162 | crates/external_services/src/http_client.rs:168-176 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2449— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2449-2457 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:365-373 | crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs:159-167 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/noon/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 25 separate duplicated blocks between them, totalling at least 231 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:724— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:724-732 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:533-541 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:910-918 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:513— crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:513-521 | crates/hyperswitch_connectors/src/connectors/riskified.rs:272-280 | crates/hyperswitch_connectors/src/connectors/signifyd.rs:395-403 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs` and `crates/hyperswitch_connectors/src/connectors/signifyd.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:527— crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:527-535 | crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs:170-178 | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs:400-408 — `crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:672— crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:672-680 | crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:826-834 | crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:1032-1040 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/volt.rs:533— crates/hyperswitch_connectors/src/connectors/volt.rs:533-541 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:367-375 | crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs:198-206 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/volt.rs` and `crates/hyperswitch_connectors/src/connectors/worldpay.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:948— crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:948-957 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:1052-1060 | crates/router/src/core/split_payments.rs:519-528 — 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 (9 lines × 3) crates/router/src/analytics.rs:1456— crates/router/src/analytics.rs:1456-1464 | crates/router/src/analytics.rs:1525-1533 | crates/router/src/analytics.rs:2822-2830 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/authentication.rs:695— crates/router/src/core/authentication.rs:695-703 | crates/router/src/core/authentication.rs:1080-1088 | crates/router/src/core/authentication.rs:1361-1369 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payments/operations/payment_confirm.rs:3270— crates/router/src/core/payments/operations/payment_confirm.rs:3270-3278 | crates/router/src/core/payments/operations/payment_create.rs:1312-1320 | crates/router/src/core/payments/operations/payment_update.rs:1023-1031 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_create.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/router/src/core/payments/operations/payment_session.rs:358— crates/router/src/core/payments/operations/payment_session.rs:358-366 | crates/router/src/core/payments/operations/payment_status.rs:98-107 | crates/router/src/core/payments/operations/payments_incremental_authorization.rs:359-368 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_session.rs` and `crates/router/src/core/payments/operations/payment_status.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/router/src/db/events.rs:264— crates/router/src/db/events.rs:264-272 | crates/router/src/db/events.rs:289-297 | crates/router/src/db/events.rs:725-733 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/routes/admin.rs:786— crates/router/src/routes/admin.rs:786-794 | crates/router/src/routes/admin.rs:822-833 | crates/router/src/routes/profiles.rs:563-574 — before extracting anything, compare `crates/router/src/routes/admin.rs` and `crates/router/src/routes/profiles.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/router/src/routes/blocklist.rs:164— crates/router/src/routes/blocklist.rs:164-172 | crates/router/src/routes/payments.rs:3535-3544 | crates/router/src/routes/payments.rs:3582-3591 — 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 (9 lines × 3) crates/router/src/routes/payment_methods.rs:718— crates/router/src/routes/payment_methods.rs:718-727 | crates/router/src/routes/payment_methods.rs:827-835 | crates/router/src/routes/payment_methods.rs:1218-1227 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/subscriptions/src/core.rs:523— crates/subscriptions/src/core.rs:523-531 | crates/subscriptions/src/core.rs:574-582 | crates/subscriptions/src/core.rs:625-633 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payment_methods/cards.rs:5251— crates/router/src/core/payment_methods/cards.rs:5251-5259 | crates/router/src/core/payment_methods/cards.rs:5262-5270 | crates/router/src/core/payment_methods/cards.rs:5272-5281 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:621— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:621-629 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1482-1490 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:848-856 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 47 separate duplicated blocks between them, totalling at least 513 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) crates/hyperswitch_connectors/src/connectors/coinbase.rs:310— crates/hyperswitch_connectors/src/connectors/coinbase.rs:310-318 | crates/hyperswitch_connectors/src/connectors/opennode.rs:313-321 | crates/hyperswitch_connectors/src/connectors/paypal.rs:1918-1926 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/coinbase.rs` and `crates/hyperswitch_connectors/src/connectors/opennode.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/hyperswitch_connectors/src/connectors/coinbase/transformers.rs:77— crates/hyperswitch_connectors/src/connectors/coinbase/transformers.rs:77-85 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:826-834 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:65-73 — `crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/zen/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs:29— crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs:29-37 | crates/hyperswitch_connectors/src/connectors/flexiti/transformers.rs:190-198 | crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs:81-89 — `crates/hyperswitch_connectors/src/connectors/flexiti/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) crates/router/src/core/payment_methods.rs:1888— crates/router/src/core/payment_methods.rs:1888-1896 | crates/router/src/core/payment_methods.rs:2004-2012 | crates/router/src/core/payment_methods.rs:4491-4501 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payments/flows/complete_authorize_flow.rs:942— crates/router/src/core/payments/flows/complete_authorize_flow.rs:942-952 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:1060-1068 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:1196-1206 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:455— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:455-465 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:550-558 | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs:251-259 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 115 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) crates/hyperswitch_connectors/src/connectors/adyen.rs:1274— crates/hyperswitch_connectors/src/connectors/adyen.rs:1274-1281 | crates/hyperswitch_connectors/src/connectors/ebanx.rs:353-360 | crates/hyperswitch_connectors/src/connectors/stripe.rs:3137-3144 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/stripe.rs` as WHOLE FILES: this scan already matched 10 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.
Duplicated block (8 lines × 3) crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:941— crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:941-948 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:221-228 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1337-1344 — 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:903— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:903-910 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2297-2304 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1022-1029 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 47 separate duplicated blocks between them, totalling at least 513 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2340— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2340-2347 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3341-3348 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:2417-2424 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) crates/hyperswitch_connectors/src/connectors/bluesnap.rs:367— crates/hyperswitch_connectors/src/connectors/bluesnap.rs:367-374 | crates/hyperswitch_connectors/src/connectors/datatrans.rs:583-590 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:372-379 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bluesnap.rs` and `crates/hyperswitch_connectors/src/connectors/datatrans.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/hyperswitch_connectors/src/connectors/iatapay.rs:292— crates/hyperswitch_connectors/src/connectors/iatapay.rs:292-299 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:300-307 | crates/hyperswitch_connectors/src/connectors/vgs.rs:255-262 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/iatapay.rs` and `crates/hyperswitch_connectors/src/connectors/truelayer.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:441— crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:441-448 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:619-626 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:288-295 — `crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 12 separate duplicated blocks between them, totalling at least 103 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) crates/hyperswitch_connectors/src/connectors/nexixpay.rs:824— crates/hyperswitch_connectors/src/connectors/nexixpay.rs:824-831 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:924-931 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:1031-1038 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:924— crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:924-931 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1076-1083 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:608-615 — 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) crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:819— crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:819-826 | crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:427-434 | crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:711-718 — `crates/hyperswitch_connectors/src/connectors/payme/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1613— crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1613-1620 | crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:480-487 | crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs:157-164 — `crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 80 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) crates/router/src/compatibility/stripe/payment_intents.rs:130— crates/router/src/compatibility/stripe/payment_intents.rs:130-137 | crates/router/src/compatibility/stripe/setup_intents.rs:116-123 | crates/router/src/routes/payments.rs:1892-1899 — before extracting anything, compare `crates/router/src/compatibility/stripe/payment_intents.rs` and `crates/router/src/compatibility/stripe/setup_intents.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/compatibility/stripe/payment_intents.rs:399— crates/router/src/compatibility/stripe/payment_intents.rs:399-406 | crates/router/src/routes/payments.rs:3529-3536 | crates/router/src/routes/payments.rs:3576-3583 — before extracting anything, compare `crates/router/src/compatibility/stripe/payment_intents.rs` and `crates/router/src/routes/payments.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 (8 lines × 3) crates/router/src/core/admin.rs:3630— crates/router/src/core/admin.rs:3630-3637 | crates/router/src/core/admin.rs:3859-3866 | crates/router/src/types/api/admin.rs:456-463 — 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) crates/router/src/core/payments/operations/payment_confirm.rs:1102— crates/router/src/core/payments/operations/payment_confirm.rs:1102-1109 | crates/router/src/core/payments/operations/payment_recurrence.rs:447-454 | crates/router/src/core/payments/operations/payment_update.rs:630-638 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_recurrence.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/routes/disputes.rs:442— crates/router/src/routes/disputes.rs:442-449 | crates/router/src/routes/disputes.rs:553-560 | crates/router/src/routes/disputes.rs:605-612 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/routes/payments.rs:2282— crates/router/src/routes/payments.rs:2282-2289 | crates/router/src/routes/payments.rs:2401-2408 | crates/router/src/routes/payments.rs:2435-2445 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/routes/payments.rs:2645— crates/router/src/routes/payments.rs:2645-2652 | crates/router/src/routes/payments.rs:4030-4040 | crates/router/src/routes/payments.rs:4062-4072 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/smithy-core/src/generator.rs:103— crates/smithy-core/src/generator.rs:103-110 | crates/smithy-core/src/generator.rs:136-143 | crates/smithy-core/src/generator.rs:169-176 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/paypal.rs:1309— crates/hyperswitch_connectors/src/connectors/paypal.rs:1309-1317 | crates/hyperswitch_connectors/src/connectors/paypal.rs:1319-1326 | crates/hyperswitch_connectors/src/connectors/paypal.rs:1327-1335 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/adyenplatform.rs:94— crates/hyperswitch_connectors/src/connectors/adyenplatform.rs:94-101 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:132-139 | crates/hyperswitch_connectors/src/connectors/wise.rs:110-117 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) crates/hyperswitch_connectors/src/connectors/mifinity.rs:169— crates/hyperswitch_connectors/src/connectors/mifinity.rs:169-176 | crates/hyperswitch_connectors/src/connectors/redsys.rs:134-142 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:376-386 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/mifinity.rs` and `crates/hyperswitch_connectors/src/connectors/trustpay.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/globalpay.rs:343— crates/hyperswitch_connectors/src/connectors/globalpay.rs:343-350 | crates/hyperswitch_connectors/src/connectors/gotyme_sanlam.rs:153-162 | crates/hyperswitch_connectors/src/connectors/loonio.rs:157-166 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/globalpay.rs` and `crates/hyperswitch_connectors/src/connectors/gotyme_sanlam.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1590— crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1590-1598 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:29-36 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:795-803 — `crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/square/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 12 separate duplicated blocks between them, totalling at least 101 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) crates/hyperswitch_connectors/src/utils.rs:1630— crates/hyperswitch_connectors/src/utils.rs:1630-1637 | crates/hyperswitch_connectors/src/utils.rs:1739-1746 | crates/hyperswitch_connectors/src/utils.rs:7413-7420 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×24
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/analytics/src/api_event/core.rs:96— crates/analytics/src/api_event/core.rs:96-178 | crates/analytics/src/disputes/core.rs:32-137 | crates/analytics/src/frm/core.rs:29-111 | crates/analytics/src/payment_intents/core.rs:74-363 | crates/analytics/src/payments/core.rs:54-360 | crates/analytics/src/refunds/core.rs:53-277 — 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) crates/diesel_models/src/query/blocklist.rs:118— crates/diesel_models/src/query/blocklist.rs:118-142 | crates/diesel_models/src/query/blocklist.rs:148-168 | crates/diesel_models/src/query/blocklist.rs:304-331 | crates/diesel_models/src/query/blocklist.rs:338-361 | crates/diesel_models/src/query/blocklist.rs:815-833 | crates/diesel_models/src/query/blocklist.rs:838-852 — 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) crates/hyperswitch_connectors/src/connectors/archipel.rs:248— crates/hyperswitch_connectors/src/connectors/archipel.rs:248-264 | crates/hyperswitch_connectors/src/connectors/archipel.rs:359-375 | crates/hyperswitch_connectors/src/connectors/archipel.rs:555-571 | crates/hyperswitch_connectors/src/connectors/archipel.rs:654-670 | crates/hyperswitch_connectors/src/connectors/archipel.rs:759-775 | crates/hyperswitch_connectors/src/connectors/archipel.rs:972-988 — 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) crates/hyperswitch_connectors/src/connectors/authipay.rs:299— crates/hyperswitch_connectors/src/connectors/authipay.rs:299-311 | crates/hyperswitch_connectors/src/connectors/authipay.rs:381-393 | crates/hyperswitch_connectors/src/connectors/authipay.rs:472-484 | crates/hyperswitch_connectors/src/connectors/authipay.rs:562-574 | crates/hyperswitch_connectors/src/connectors/authipay.rs:652-664 | crates/hyperswitch_connectors/src/connectors/authipay.rs:734-746 — 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:49— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:49-64 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:58-73 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3274-3289 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager/transformers.rs:76-91 | crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:735-750 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1604-1619 — 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1570— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1570-1621 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2671-2711 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2498-2549 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4586-4663 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4684-4801 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4822-4939 — 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) crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1546— crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1546-1568 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1570-1592 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:2446-2468 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:2470-2492 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:747-768 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:774-795 — 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) crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:315— crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:315-338 | crates/hyperswitch_connectors/src/connectors/dummyconnector/transformers.rs:303-326 | crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs:306-339 | crates/hyperswitch_connectors/src/connectors/payjustnow/transformers.rs:239-260 | crates/hyperswitch_connectors/src/connectors/payjustnowinstore/transformers.rs:148-168 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:1020-1042 — 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) crates/hyperswitch_connectors/src/connectors/braintree.rs:361— crates/hyperswitch_connectors/src/connectors/braintree.rs:361-371 | crates/hyperswitch_connectors/src/connectors/checkout.rs:312-322 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:410-420 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:396-406 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:160-170 | crates/hyperswitch_connectors/src/connectors/stripe.rs:526-536 — 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) crates/hyperswitch_connectors/src/connectors/gigadat.rs:359— crates/hyperswitch_connectors/src/connectors/gigadat.rs:359-389 | crates/hyperswitch_connectors/src/connectors/gigadat.rs:559-589 | crates/hyperswitch_connectors/src/connectors/loonio.rs:339-384 | crates/hyperswitch_connectors/src/connectors/loonio.rs:537-567 | crates/hyperswitch_connectors/src/connectors/loonio.rs:623-653 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:481-550 — 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) crates/hyperswitch_connectors/src/connectors/worldline.rs:249— crates/hyperswitch_connectors/src/connectors/worldline.rs:249-264 | crates/hyperswitch_connectors/src/connectors/worldline.rs:340-357 | crates/hyperswitch_connectors/src/connectors/worldline.rs:426-443 | crates/hyperswitch_connectors/src/connectors/worldline.rs:520-535 | crates/hyperswitch_connectors/src/connectors/worldline.rs:603-617 | crates/hyperswitch_connectors/src/connectors/worldline.rs:681-695 — 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) crates/hyperswitch_domain_models/src/router_data.rs:1229— crates/hyperswitch_domain_models/src/router_data.rs:1229-1360 | crates/hyperswitch_domain_models/src/router_data.rs:1600-1689 | crates/hyperswitch_domain_models/src/router_data.rs:1921-2028 | crates/hyperswitch_domain_models/src/router_data.rs:2195-2326 | crates/hyperswitch_domain_models/src/router_data.rs:2458-2580 | crates/hyperswitch_domain_models/src/router_data.rs:2717-2772 — 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) crates/hyperswitch_domain_models/src/type_encryption.rs:152— crates/hyperswitch_domain_models/src/type_encryption.rs:152-186 | crates/hyperswitch_domain_models/src/type_encryption.rs:261-294 | crates/hyperswitch_domain_models/src/type_encryption.rs:391-424 | crates/hyperswitch_domain_models/src/type_encryption.rs:499-532 | crates/hyperswitch_domain_models/src/type_encryption.rs:864-897 | crates/hyperswitch_domain_models/src/type_encryption.rs:967-1000 — 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) crates/router/src/core/admin.rs:441— crates/router/src/core/admin.rs:441-691 | crates/router/src/core/admin.rs:1156-1336 | crates/router/src/core/admin.rs:3550-3797 | crates/router/src/core/admin.rs:3805-3973 | crates/router/src/core/admin.rs:4167-4420 | crates/router/src/core/admin.rs:4431-4590 — 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) crates/router/src/core/payments/flows/authorize_flow.rs:1658— crates/router/src/core/payments/flows/authorize_flow.rs:1658-1754 | crates/router/src/core/payments/flows/authorize_flow.rs:1785-1899 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:777-873 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:909-1024 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:1047-1140 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:1172-1278 — 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) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:178— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:178-309 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:166-291 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:304-421 | crates/router/src/core/payments/operations/payment_get.rs:165-256 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:157-280 | crates/router/src/core/webhooks/incoming_v2.rs:600-692 — 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) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:602— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:602-651 | crates/router/src/core/payments/operations/payment_response.rs:4312-4360 | crates/router/src/core/payments/operations/payment_response.rs:4384-4527 | crates/router/src/core/payments/operations/payment_response.rs:4860-4908 | crates/router/src/core/payments/operations/payment_response.rs:4932-4979 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:484-531 — 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) crates/router/src/core/payments/operations/payment_cancel.rs:322— crates/router/src/core/payments/operations/payment_cancel.rs:322-332 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:404-414 | crates/router/src/core/payments/operations/payment_capture.rs:364-374 | crates/router/src/core/payments/operations/payment_reject.rs:327-337 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:327-337 | crates/router/src/core/payments/operations/payments_incremental_authorization.rs:316-326 — 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) crates/router/src/core/unified_authentication_service.rs:1036— crates/router/src/core/unified_authentication_service.rs:1036-1336 | crates/router/src/core/unified_authentication_service.rs:1344-1502 | crates/router/src/core/unified_authentication_service.rs:1674-1718 | crates/router/src/core/unified_authentication_service.rs:2059-2363 | crates/router/src/core/unified_authentication_service.rs:2370-2475 | crates/router/src/core/unified_authentication_service.rs:2499-2562 — 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) crates/router/src/core/user.rs:280— crates/router/src/core/user.rs:280-309 | crates/router/src/core/user.rs:1386-1534 | crates/router/src/core/user.rs:1541-1643 | crates/router/src/core/user.rs:2171-2213 | crates/router/src/core/user.rs:2305-2330 | crates/router/src/core/user_role.rs:449-520 — 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) crates/router/src/db/dispute.rs:432— crates/router/src/db/dispute.rs:432-498 | crates/router/src/db/dispute.rs:506-573 | crates/router/src/db/mandate.rs:137-187 | crates/router/src/db/refund.rs:574-641 | crates/router/src/db/refund.rs:1037-1107 | crates/router/src/db/refund.rs:1117-1190 — 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) crates/router/src/db/events.rs:981— crates/router/src/db/events.rs:981-1037 | crates/router/src/db/events.rs:1153-1210 | crates/router/src/db/events.rs:1332-1352 | crates/router/src/db/events.rs:1365-1428 | crates/router/src/db/events.rs:1564-1584 | crates/router/src/db/events.rs:1596-1622 — 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) crates/router/src/db/refund.rs:173— crates/router/src/db/refund.rs:173-204 | crates/router/src/db/refund.rs:298-328 | crates/router/src/db/refund.rs:338-371 | crates/router/src/db/refund.rs:574-641 | crates/router/src/db/refund.rs:1037-1107 | crates/router/src/db/refund.rs:1117-1190 — 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) crates/router/src/routes/disputes.rs:38— crates/router/src/routes/disputes.rs:38-69 | crates/router/src/routes/disputes.rs:78-106 | crates/router/src/routes/disputes.rs:297-328 | crates/router/src/routes/disputes.rs:386-415 | crates/router/src/routes/disputes.rs:601-635 | crates/router/src/routes/disputes.rs:729-761 — 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 (9 lines × 4) crates/diesel_models/src/query/blocklist.rs:233— crates/diesel_models/src/query/blocklist.rs:233-241 | crates/diesel_models/src/query/blocklist.rs:434-442 | crates/diesel_models/src/query/blocklist.rs:1097-1105 | crates/diesel_models/src/query/blocklist.rs:1178-1186 — 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) crates/diesel_models/src/query/generics.rs:717— crates/diesel_models/src/query/generics.rs:717-725 | crates/diesel_models/src/query/generics.rs:820-828 | crates/diesel_models/src/query/generics.rs:920-928 | crates/diesel_models/src/query/generics.rs:1053-1061 — 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) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:827— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:827-835 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:955-963 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1457-1465 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1522-1530 — 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) crates/hyperswitch_connectors/src/connectors/bitpay.rs:255— crates/hyperswitch_connectors/src/connectors/bitpay.rs:255-263 | crates/hyperswitch_connectors/src/connectors/bitpay.rs:332-340 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:310-319 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:995-1003 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 4) crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs:197— crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs:197-205 | crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:132-140 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:601-609 | crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs:186-194 — `crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 104 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 4) crates/hyperswitch_connectors/src/connectors/gigadat.rs:914— crates/hyperswitch_connectors/src/connectors/gigadat.rs:914-922 | crates/hyperswitch_connectors/src/connectors/loonio.rs:784-792 | crates/hyperswitch_connectors/src/connectors/paypal.rs:856-864 | crates/hyperswitch_connectors/src/connectors/wise.rs:457-465 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/gigadat.rs` and `crates/hyperswitch_connectors/src/connectors/loonio.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:248— crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:248-256 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:439-447 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:122-130 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:282-290 — `crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/stax/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 4) crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:488— crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:488-496 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:195-203 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:324-332 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:5334-5342 — `crates/hyperswitch_connectors/src/connectors/payme/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/square/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 11 separate duplicated blocks between them, totalling at least 96 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 4) crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:888— crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:888-896 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:902-910 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:916-924 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:930-938 — 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) crates/router/src/services/authentication.rs:724— crates/router/src/services/authentication.rs:724-732 | crates/router/src/services/authentication.rs:973-981 | crates/router/src/services/authentication.rs:1058-1066 | crates/router/src/services/authentication.rs:1211-1219 — 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) crates/router/src/types/storage/dispute.rs:122— crates/router/src/types/storage/dispute.rs:122-130 | crates/router/src/types/storage/refund.rs:179-187 | crates/router/src/types/storage/refund.rs:264-272 | crates/router/src/types/storage/refund.rs:418-428 — before extracting anything, compare `crates/router/src/types/storage/dispute.rs` and `crates/router/src/types/storage/refund.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) crates/hyperswitch_connectors/src/connectors/digitalvirgo/transformers.rs:93— crates/hyperswitch_connectors/src/connectors/digitalvirgo/transformers.rs:93-101 | crates/hyperswitch_connectors/src/connectors/envoy/transformers.rs:90-98 | crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs:85-93 | crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs:1497-1505 — `crates/hyperswitch_connectors/src/connectors/digitalvirgo/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/envoy/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 31 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 4) crates/hyperswitch_connectors/src/utils.rs:1298— crates/hyperswitch_connectors/src/utils.rs:1298-1306 | crates/hyperswitch_connectors/src/utils.rs:1405-1413 | crates/router/src/connector/utils.rs:1457-1465 | crates/router/src/connector/utils.rs:1530-1538 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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 × 4) crates/hyperswitch_connectors/src/utils.rs:1329— crates/hyperswitch_connectors/src/utils.rs:1329-1337 | crates/hyperswitch_connectors/src/utils.rs:1436-1444 | crates/router/src/connector/utils.rs:1472-1480 | crates/router/src/connector/utils.rs:1545-1553 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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 × 4) crates/hyperswitch_connectors/src/utils.rs:1338— crates/hyperswitch_connectors/src/utils.rs:1338-1346 | crates/hyperswitch_connectors/src/utils.rs:1445-1453 | crates/router/src/connector/utils.rs:1481-1489 | crates/router/src/connector/utils.rs:1554-1562 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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 × 4) crates/hyperswitch_connectors/src/utils.rs:1347— crates/hyperswitch_connectors/src/utils.rs:1347-1355 | crates/hyperswitch_connectors/src/utils.rs:1454-1462 | crates/router/src/connector/utils.rs:1490-1498 | crates/router/src/connector/utils.rs:1563-1571 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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 × 4) crates/hyperswitch_connectors/src/utils.rs:1620— crates/hyperswitch_connectors/src/utils.rs:1620-1628 | crates/hyperswitch_connectors/src/utils.rs:1729-1737 | crates/hyperswitch_connectors/src/utils.rs:7403-7411 | crates/router/src/connector/utils.rs:1382-1390 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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 × 4) crates/hyperswitch_connectors/src/utils.rs:1652— crates/hyperswitch_connectors/src/utils.rs:1652-1660 | crates/hyperswitch_connectors/src/utils.rs:1761-1769 | crates/hyperswitch_connectors/src/utils.rs:7434-7442 | crates/router/src/connector/utils.rs:1397-1405 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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 × 4) crates/hyperswitch_connectors/src/utils.rs:1661— crates/hyperswitch_connectors/src/utils.rs:1661-1669 | crates/hyperswitch_connectors/src/utils.rs:1770-1778 | crates/hyperswitch_connectors/src/utils.rs:7443-7451 | crates/router/src/connector/utils.rs:1406-1414 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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 × 4) crates/hyperswitch_connectors/src/utils.rs:1670— crates/hyperswitch_connectors/src/utils.rs:1670-1678 | crates/hyperswitch_connectors/src/utils.rs:1779-1787 | crates/hyperswitch_connectors/src/utils.rs:7452-7460 | crates/router/src/connector/utils.rs:1415-1423 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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 × 4) crates/router/src/workflows/outgoing_webhook_retry.rs:464— crates/router/src/workflows/outgoing_webhook_retry.rs:464-473 | crates/router/src/workflows/outgoing_webhook_retry.rs:487-496 | crates/router/src/workflows/revenue_recovery.rs:246-254 | crates/router/src/workflows/revenue_recovery.rs:265-273 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 4) crates/router/src/core/conditional_config.rs:105— crates/router/src/core/conditional_config.rs:105-113 | crates/router/src/core/conditional_config.rs:240-248 | crates/router/src/core/surcharge_decision_config.rs:39-47 | crates/router/src/core/surcharge_decision_config.rs:177-185 — before extracting anything, compare `crates/router/src/core/conditional_config.rs` and `crates/router/src/core/surcharge_decision_config.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) crates/router/src/core/payments/routing.rs:3985— crates/router/src/core/payments/routing.rs:3985-3993 | crates/router/src/core/payments/routing.rs:4118-4126 | crates/router/src/core/payments/routing.rs:4304-4312 | crates/router/src/core/payments/routing.rs:4516-4524 — 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) crates/smithy-core/src/generator.rs:185— crates/smithy-core/src/generator.rs:185-193 | crates/smithy-core/src/generator.rs:195-203 | crates/smithy-core/src/generator.rs:205-213 | crates/smithy-core/src/generator.rs:215-223 — 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.
D30 · Dependency Vulnerabilities· Medium CVE · ×22
Duplicated block (25 lines × 2) crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs:75— crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs:75-99 | crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs:74-98 — before extracting anything, compare `crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs` and `crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) crates/analytics/src/payments/metrics/connector_success_rate.rs:64— crates/analytics/src/payments/metrics/connector_success_rate.rs:64-88 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:65-89 — before extracting anything, compare `crates/analytics/src/payments/metrics/connector_success_rate.rs` and `crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) crates/api_models/src/enums.rs:99— crates/api_models/src/enums.rs:99-123 | crates/api_models/src/enums.rs:129-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 (25 lines × 2) REDACTED:1159— REDACTED:1159-1183 | REDACTED:1624-1648 — both copies are in the same file, so extract the block into 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 × 2) REDACTED:1748— REDACTED:1748-1772 | REDACTED:1874-1898 — both copies are in the same file, so extract the block into 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 × 2) crates/diesel_models/src/payment_method.rs:717— crates/diesel_models/src/payment_method.rs:717-741 | crates/diesel_models/src/payment_method.rs:831-855 — both copies are in the same file, so extract the block into 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 × 2) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:5025— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:5025-5049 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:5140-5164 — both copies are in the same file, so extract the block into 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 × 2) crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:1411— crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:1411-1435 | crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:1500-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 (25 lines × 2) crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:390— crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:390-414 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:2626-2650 — both copies are in the same file, so extract the block into 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 × 2) crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:1420— crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:1420-1444 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:1454-1478 — both copies are in the same file, so extract the block into 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 × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3527— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3527-3551 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1801-1825 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 46 separate duplicated blocks between them, totalling at least 601 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 (25 lines × 2) crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:419— crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:419-443 | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:1902-1926 — both copies are in the same file, so extract the block into 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 × 2) crates/hyperswitch_connectors/src/connectors/square/transformers.rs:186— crates/hyperswitch_connectors/src/connectors/square/transformers.rs:186-210 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:315-339 — both copies are in the same file, so extract the block into 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 × 2) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2894— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2894-2918 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3393-3417 — both copies are in the same file, so extract the block into 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 × 2) crates/router/src/core/payment_methods/transformers.rs:1526— crates/router/src/core/payment_methods/transformers.rs:1526-1550 | crates/router/src/core/payment_methods/transformers.rs:1650-1674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2) crates/router/src/core/payments/transformers.rs:2493— crates/router/src/core/payments/transformers.rs:2493-2517 | crates/router/src/core/payments/transformers.rs:8497-8521 — both copies are in the same file, so extract the block into 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 × 2) crates/router/src/core/payments/transformers.rs:5327— crates/router/src/core/payments/transformers.rs:5327-5351 | crates/router/src/core/payments/transformers.rs:5575-5599 — both copies are in the same file, so extract the block into 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 × 2) crates/router/src/core/unified_authentication_service.rs:1346— crates/router/src/core/unified_authentication_service.rs:1346-1370 | crates/router/src/core/unified_authentication_service.rs:2061-2085 — both copies are in the same file, so extract the block into 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 × 2) crates/router/src/core/unified_connector_service.rs:4181— crates/router/src/core/unified_connector_service.rs:4181-4205 | crates/router/src/core/unified_connector_service.rs:4424-4448 — both copies are in the same file, so extract the block into 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 × 2) crates/router/src/workflows/network_tokenization.rs:131— crates/router/src/workflows/network_tokenization.rs:131-155 | crates/router/src/workflows/network_tokenization.rs:241-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 (25 lines × 2) crates/router/src/workflows/outgoing_webhook_retry.rs:120— crates/router/src/workflows/outgoing_webhook_retry.rs:120-144 | crates/router/src/workflows/outgoing_webhook_retry.rs:385-409 — both copies are in the same file, so extract the block into 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 × 2) crates/storage_impl/src/business_profile.rs:777— crates/storage_impl/src/business_profile.rs:777-801 | crates/storage_impl/src/business_profile.rs:829-853 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:75— crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:75-98 | crates/analytics/src/disputes/metrics/total_amount_disputed.rs:74-97 — before extracting anything, compare `crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs` and `crates/analytics/src/disputes/metrics/total_amount_disputed.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 137 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 (24 lines × 2) crates/analytics/src/sqlx.rs:773— crates/analytics/src/sqlx.rs:773-796 | crates/analytics/src/sqlx.rs:909-932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) crates/api_models/src/payments.rs:3975— crates/api_models/src/payments.rs:3975-3998 | crates/hyperswitch_domain_models/src/payment_method_data.rs:4006-4029 — before extracting anything, compare `crates/api_models/src/payments.rs` and `crates/hyperswitch_domain_models/src/payment_method_data.rs` as WHOLE FILES: this scan already matched 14 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 (24 lines × 2) crates/common_enums/src/enums.rs:1704— crates/common_enums/src/enums.rs:1704-1727 | crates/common_enums/src/enums.rs:1869-1892 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) REDACTED:1355— REDACTED:1355-1378 | REDACTED:1421-1444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) REDACTED:2068— REDACTED:2068-2091 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1425-1448 — before extracting anything, compare `REDACTED` and `crates/hyperswitch_domain_models/src/payments/payment_intent.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (24 lines × 2) crates/hyperswitch_connectors/src/connectors/silverflow/transformers.rs:661— crates/hyperswitch_connectors/src/connectors/silverflow/transformers.rs:661-684 | crates/hyperswitch_connectors/src/connectors/silverflow/transformers.rs:705-728 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1353— crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1353-1376 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1414-1437 — both copies are in the same file, so extract the block into 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) crates/router/src/core/admin.rs:1823— crates/router/src/core/admin.rs:1823-1846 | crates/router/src/core/admin.rs:1914-1937 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payment_methods/access_token.rs:60— crates/router/src/core/payment_methods/access_token.rs:60-83 | crates/router/src/core/payouts/access_token.rs:80-103 — `crates/router/src/core/payment_methods/access_token.rs` and `crates/router/src/core/payouts/access_token.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 120 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 (24 lines × 2) crates/router/src/core/payments/operations/payment_response.rs:1607— crates/router/src/core/payments/operations/payment_response.rs:1607-1630 | crates/router/src/core/payments/operations/payment_response.rs:1763-1786 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payouts.rs:2227— crates/router/src/core/payouts.rs:2227-2250 | crates/router/src/core/payouts.rs:2986-3009 — both copies are in the same file, so extract the block into 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) crates/router/src/core/refunds.rs:2863— crates/router/src/core/refunds.rs:2863-2886 | crates/router/src/core/refunds_v2.rs:1513-1536 — before extracting anything, compare `crates/router/src/core/refunds.rs` and `crates/router/src/core/refunds_v2.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 2) crates/router/src/core/routing/helpers.rs:2549— crates/router/src/core/routing/helpers.rs:2549-2572 | crates/router/src/core/routing/helpers.rs:2627-2650 — both copies are in the same file, so extract the block into 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) crates/router/src/core/user_role.rs:207— crates/router/src/core/user_role.rs:207-230 | crates/router/src/core/user_role.rs:562-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 (24 lines × 2) crates/router/src/core/user_role.rs:291— crates/router/src/core/user_role.rs:291-314 | crates/router/src/core/user_role.rs:637-660 — both copies are in the same file, so extract the block into 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) crates/router/src/db/address.rs:707— crates/router/src/db/address.rs:707-730 | crates/router/src/db/address.rs:740-763 — both copies are in the same file, so extract the block into 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) crates/router/src/db/dispute.rs:475— crates/router/src/db/dispute.rs:475-498 | crates/router/src/db/dispute.rs:550-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 (24 lines × 2) crates/router/src/db/events.rs:1293— crates/router/src/db/events.rs:1293-1316 | crates/router/src/db/events.rs:1526-1549 — both copies are in the same file, so extract the block into 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) crates/router/src/db/refund.rs:1867— crates/router/src/db/refund.rs:1867-1890 | crates/router/src/db/refund.rs:2196-2219 — both copies are in the same file, so extract the block into 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) crates/router/src/services/authentication.rs:802— crates/router/src/services/authentication.rs:802-825 | crates/router/src/services/authentication.rs:1509-1532 — both copies are in the same file, so extract the block into 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) crates/router/src/services/kafka/payment_intent.rs:80— crates/router/src/services/kafka/payment_intent.rs:80-103 | crates/router/src/services/kafka/payment_intent_event.rs:175-198 — before extracting anything, compare `crates/router/src/services/kafka/payment_intent.rs` and `crates/router/src/services/kafka/payment_intent_event.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 185 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Change-coupling hub: connector_auth.rs → connectors.rs, default_implementations_v2.rs, configs.rs, connector_endpoints.rs, configs.rs, connector.rs crates/test_utils/src/connector_auth.rs— `crates/test_utils/src/connector_auth.rs` changes together with 6 other files — `crates/hyperswitch_connectors/src/connectors.rs`, `crates/hyperswitch_connectors/src/default_implementations_v2.rs`, `crates/hyperswitch_domain_models/src/configs.rs`, `crates/hyperswitch_domain_models/src/connector_endpoints.rs`, `crates/hyperswitch_interfaces/src/configs.rs`, `crates/router/src/connector.rs` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 6.
Change-coupling hub: connector.rs → configs.rs, connector_endpoints.rs, configs.rs, flows.rs crates/router/src/connector.rs— `crates/router/src/connector.rs` changes together with 4 other files — `crates/hyperswitch_domain_models/src/configs.rs`, `crates/hyperswitch_domain_models/src/connector_endpoints.rs`, `crates/hyperswitch_interfaces/src/configs.rs`, `crates/router/src/core/payments/flows.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: default_implementations_v2.rs → connector_enums.rs, configs.rs, connector_endpoints.rs, configs.rs crates/hyperswitch_connectors/src/default_implementations_v2.rs— `crates/hyperswitch_connectors/src/default_implementations_v2.rs` changes together with 4 other files — `crates/common_enums/src/connector_enums.rs`, `crates/hyperswitch_domain_models/src/configs.rs`, `crates/hyperswitch_domain_models/src/connector_endpoints.rs`, `crates/hyperswitch_interfaces/src/configs.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: connectors.rs → connector_enums.rs, configs.rs, connector_endpoints.rs, configs.rs crates/hyperswitch_connectors/src/connectors.rs— `crates/hyperswitch_connectors/src/connectors.rs` changes together with 4 other files — `crates/common_enums/src/connector_enums.rs`, `crates/hyperswitch_domain_models/src/configs.rs`, `crates/hyperswitch_domain_models/src/connector_endpoints.rs`, `crates/hyperswitch_interfaces/src/configs.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: connector_validation.rs → connector_mapping.rs, feature_matrix.rs, connector_transformers.rs crates/router/src/core/connector_validation.rs— `crates/router/src/core/connector_validation.rs` changes together with 3 other files — `crates/router/src/types/api/connector_mapping.rs`, `crates/router/src/types/api/feature_matrix.rs`, `crates/router/src/types/connector_transformers.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: connector.rs → response_modifier.rs, connectors.rs, default_implementations_v2.rs, configs.rs, connector_endpoints.rs, connector_transformers.rs crates/connector_configs/src/connector.rs— `crates/connector_configs/src/connector.rs` changes together with 6 other files — `crates/connector_configs/src/response_modifier.rs`, `crates/hyperswitch_connectors/src/connectors.rs`, `crates/hyperswitch_connectors/src/default_implementations_v2.rs`, `crates/hyperswitch_domain_models/src/configs.rs`, `crates/hyperswitch_domain_models/src/connector_endpoints.rs`, `crates/router/src/types/connector_transformers.rs` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 6.
Change-coupling hub: lock_utils.rs → payment.rs, refund.rs, user.rs, user_role.rs, lib.rs, user_role.rs, role.rs, user.rs, subscription.rs, user.rs, user_role.rs crates/router/src/routes/lock_utils.rs— `crates/router/src/routes/lock_utils.rs` changes together with 11 other files — `crates/api_models/src/events/payment.rs`, `crates/api_models/src/events/refund.rs`, `crates/api_models/src/events/user.rs`, `crates/api_models/src/events/user_role.rs`, `crates/api_models/src/lib.rs`, `crates/api_models/src/user_role.rs`, `crates/api_models/src/user_role/role.rs`, `crates/router/src/core/errors/user.rs`, `crates/router/src/routes/subscription.rs`, `crates/router/src/routes/user.rs`, `crates/router/src/routes/user_role.rs` — none of which declares a dependency on it: one file is the hub of 11 separate couplings, not 11 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 11.
Change-coupling hub: types.rs → payment.rs, refund.rs, user.rs, user_role.rs, lib.rs, user_role.rs, role.rs, routes.rs crates/router_env/src/logger/types.rs— `crates/router_env/src/logger/types.rs` changes together with 8 other files — `crates/api_models/src/events/payment.rs`, `crates/api_models/src/events/refund.rs`, `crates/api_models/src/events/user.rs`, `crates/api_models/src/events/user_role.rs`, `crates/api_models/src/lib.rs`, `crates/api_models/src/user_role.rs`, `crates/api_models/src/user_role/role.rs`, `crates/router/src/routes.rs` — none of which declares a dependency on it: one file is the hub of 8 separate couplings, not 8 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 8.
Change-coupling hub: authorize_flow.rs → complete_authorize_flow.rs, external_proxy_flow.rs, psync_flow.rs, setup_mandate_flow.rs crates/router/src/core/payments/flows/authorize_flow.rs— `crates/router/src/core/payments/flows/authorize_flow.rs` changes together with 4 other files — `crates/router/src/core/payments/flows/complete_authorize_flow.rs`, `crates/router/src/core/payments/flows/external_proxy_flow.rs`, `crates/router/src/core/payments/flows/psync_flow.rs`, `crates/router/src/core/payments/flows/setup_mandate_flow.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: payment_create.rs → sample_data.rs, payment_complete_authorize.rs, payment_start.rs, payment_update.rs, sample_data.rs crates/router/src/core/payments/operations/payment_create.rs— `crates/router/src/core/payments/operations/payment_create.rs` changes together with 5 other files — `crates/diesel_models/src/user/sample_data.rs`, `crates/router/src/core/payments/operations/payment_complete_authorize.rs`, `crates/router/src/core/payments/operations/payment_start.rs`, `crates/router/src/core/payments/operations/payment_update.rs`, `crates/router/src/utils/user/sample_data.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
Change-coupling hub: app.rs → payment.rs, refund.rs, role.rs, refund.rs crates/router/src/routes/app.rs— `crates/router/src/routes/app.rs` changes together with 4 other files — `crates/api_models/src/events/payment.rs`, `crates/api_models/src/events/refund.rs`, `crates/api_models/src/user_role/role.rs`, `crates/router/src/types/storage/refund.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: default_implementations.rs → REDACTED, flow_common_types.rs, connector_validation.rs, connector_mapping.rs, feature_matrix.rs crates/hyperswitch_connectors/src/default_implementations.rs— `crates/hyperswitch_connectors/src/default_implementations.rs` changes together with 5 other files — `crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs`, `crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs`, `crates/router/src/core/connector_validation.rs`, `crates/router/src/types/api/connector_mapping.rs`, `crates/router/src/types/api/feature_matrix.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
Change-coupling hub: predefined_roles.rs → user.rs, info.rs, permission_groups.rs, permissions.rs crates/router/src/services/authorization/roles/predefined_roles.rs— `crates/router/src/services/authorization/roles/predefined_roles.rs` changes together with 4 other files — `crates/router/src/core/user.rs`, `crates/router/src/services/authorization/info.rs`, `crates/router/src/services/authorization/permission_groups.rs`, `crates/router/src/services/authorization/permissions.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: conversion_impls.rs → chargebee.rs, REDACTED, recurly.rs, subscriptions.rs crates/hyperswitch_interfaces/src/conversion_impls.rs— `crates/hyperswitch_interfaces/src/conversion_impls.rs` changes together with 4 other files — `crates/hyperswitch_connectors/src/connectors/chargebee.rs`, `crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs`, `crates/hyperswitch_connectors/src/connectors/recurly.rs`, `crates/hyperswitch_domain_models/src/router_response_types/subscriptions.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: secure_payment_link_initiator.js → REDACTED, REDACTED, business_profile.rs, REDACTED, lib.rs, payment_link.rs, REDACTED crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js— `crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js` changes together with 7 other files — `REDACTED`, `crates/api_models/src/payments.rs`, `crates/diesel_models/src/business_profile.rs`, `REDACTED`, `crates/hyperswitch_domain_models/src/lib.rs`, `crates/router/src/core/payment_link.rs`, `crates/router/src/types/transformers.rs` — none of which declares a dependency on it: one file is the hub of 7 separate couplings, not 7 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 7.
Change-coupling hub: lowering.rs → adyen.rs, REDACTED, REDACTED, REDACTED crates/euclid/src/frontend/dir/lowering.rs— `crates/euclid/src/frontend/dir/lowering.rs` changes together with 4 other files — `crates/hyperswitch_connectors/src/connectors/adyen.rs`, `crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs`, `crates/kgraph_utils/src/transformers.rs`, `crates/router/src/types/transformers.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: payment_link_initiator.js → REDACTED, lib.rs, payment_link.rs, REDACTED crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js— `crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js` changes together with 4 other files — `REDACTED`, `crates/hyperswitch_domain_models/src/lib.rs`, `crates/router/src/core/payment_link.rs`, `crates/router/src/types/transformers.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: mandates.rs → REDACTED, customers.rs, payment_methods.rs, refunds.rs crates/router/src/routes/mandates.rs— `crates/router/src/routes/mandates.rs` changes together with 4 other files — `crates/router/src/routes/admin.rs`, `crates/router/src/routes/customers.rs`, `crates/router/src/routes/payment_methods.rs`, `crates/router/src/routes/refunds.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: sample_data.rs → payment_confirm.rs, retry.rs, REDACTED crates/diesel_models/src/user/sample_data.rs— `crates/diesel_models/src/user/sample_data.rs` changes together with 3 other files — `crates/router/src/core/payments/operations/payment_confirm.rs`, `crates/router/src/core/payments/retry.rs`, `crates/router/src/core/payments/transformers.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: adyen.rs → cashtocode.rs, rapyd.rs, worldline.rs crates/hyperswitch_connectors/src/connectors/adyen.rs— `crates/hyperswitch_connectors/src/connectors/adyen.rs` changes together with 3 other files — `crates/hyperswitch_connectors/src/connectors/cashtocode.rs`, `crates/hyperswitch_connectors/src/connectors/rapyd.rs`, `crates/hyperswitch_connectors/src/connectors/worldline.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Duplicated block (22 lines × 2) crates/analytics/src/active_payments/core.rs:66— crates/analytics/src/active_payments/core.rs:66-87 | crates/analytics/src/sdk_events/core.rs:112-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 (22 lines × 2) crates/analytics/src/refunds/metrics/refund_count.rs:75— crates/analytics/src/refunds/metrics/refund_count.rs:75-96 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:76-97 — before extracting anything, compare `crates/analytics/src/refunds/metrics/refund_count.rs` and `crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 153 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 (22 lines × 2) crates/diesel_models/src/payment_method.rs:1928— crates/diesel_models/src/payment_method.rs:1928-1949 | crates/diesel_models/src/payment_method.rs:1971-1992 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/diesel_models/src/refund.rs:511— crates/diesel_models/src/refund.rs:511-532 | crates/diesel_models/src/refund.rs:631-652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:107— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:107-128 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:101-122 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1844— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1844-1865 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1044-1065 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 33 separate duplicated blocks between them, totalling at least 409 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 (22 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4461— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4461-4482 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1998-2019 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 46 separate duplicated blocks between them, totalling at least 601 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 (22 lines × 2) crates/router/src/core/payment_methods.rs:4184— crates/router/src/core/payment_methods.rs:4184-4205 | crates/router/src/core/payment_methods.rs:4296-4317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/router/src/core/payment_methods/access_token.rs:100— crates/router/src/core/payment_methods/access_token.rs:100-121 | crates/router/src/core/payouts/access_token.rs:122-143 — `crates/router/src/core/payment_methods/access_token.rs` and `crates/router/src/core/payouts/access_token.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 120 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 (22 lines × 2) crates/router/src/core/payment_methods/cards.rs:3007— crates/router/src/core/payment_methods/cards.rs:3007-3028 | crates/router/src/core/payment_methods/cards.rs:3084-3105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/router/src/core/payment_methods/cards.rs:7557— crates/router/src/core/payment_methods/cards.rs:7557-7578 | crates/router/src/core/payment_methods/cards.rs:7643-7664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs:68— crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs:68-89 | crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs:237-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 (22 lines × 2) crates/router/src/core/payments/transformers.rs:703— crates/router/src/core/payments/transformers.rs:703-724 | crates/router/src/core/payments/transformers.rs:1801-1822 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/router/src/core/relay.rs:751— crates/router/src/core/relay.rs:751-772 | crates/router/src/core/relay.rs:1011-1032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/router/src/core/user.rs:3559— crates/router/src/core/user.rs:3559-3580 | crates/router/src/core/user.rs:3886-3907 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/router/src/core/user_role/role.rs:119— crates/router/src/core/user_role/role.rs:119-140 | crates/router/src/core/user_role/role.rs:252-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/router/src/db/address.rs:777— crates/router/src/db/address.rs:777-798 | crates/router/src/db/address.rs:814-835 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/router/src/db/user/theme.rs:158— crates/router/src/db/user/theme.rs:158-179 | crates/router/src/db/user/theme.rs:209-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/storage_impl/src/connection.rs:14— crates/storage_impl/src/connection.rs:14-35 | crates/storage_impl/src/utils.rs:136-157 — before extracting anything, compare `crates/storage_impl/src/connection.rs` and `crates/storage_impl/src/utils.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (22 lines × 2) crates/storage_impl/src/merchant_connector_account.rs:1295— crates/storage_impl/src/merchant_connector_account.rs:1295-1316 | crates/storage_impl/src/merchant_connector_account.rs:1414-1435 — both copies are in the same file, so extract the block into 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) crates/diesel_models/src/authentication.rs:532— crates/diesel_models/src/authentication.rs:532-558 | crates/diesel_models/src/payment_attempt.rs:2723-2749 — 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 (27 lines × 2) REDACTED:1174— REDACTED:1174-1200 | REDACTED:1314-1340 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1289— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1289-1315 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1416-1442 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 38 separate duplicated blocks between them, totalling at least 451 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 (27 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource.rs:235— crates/hyperswitch_connectors/src/connectors/cybersource.rs:235-261 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:297-323 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersource.rs` and `crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (27 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2624— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2624-2650 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1252-1278 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 46 separate duplicated blocks between them, totalling at least 601 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 (27 lines × 2) crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:808— crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:808-834 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:973-999 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2) crates/hyperswitch_connectors/src/connectors/stripe.rs:1931— crates/hyperswitch_connectors/src/connectors/stripe.rs:1931-1957 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2094-2120 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/worldpay.rs:167— crates/hyperswitch_connectors/src/connectors/worldpay.rs:167-193 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:492-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2) crates/router/src/core/payment_methods/access_token.rs:145— crates/router/src/core/payment_methods/access_token.rs:145-171 | crates/router/src/core/payouts/access_token.rs:171-197 — `crates/router/src/core/payment_methods/access_token.rs` and `crates/router/src/core/payouts/access_token.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 120 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 (27 lines × 2) crates/router/src/core/payment_methods/cards.rs:3441— crates/router/src/core/payment_methods/cards.rs:3441-3467 | crates/router/src/core/payment_methods/cards.rs:3517-3543 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments.rs:1155— crates/router/src/core/payments.rs:1155-1181 | crates/router/src/core/payments.rs:1361-1387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2) crates/router/src/core/payments/operations/payment_confirm.rs:722— crates/router/src/core/payments/operations/payment_confirm.rs:722-748 | crates/router/src/core/payments/operations/payment_create.rs:561-587 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_create.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (27 lines × 2) crates/router/src/core/payments/routing.rs:2983— crates/router/src/core/payments/routing.rs:2983-3009 | crates/router/src/core/payments/routing.rs:3147-3173 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/transformers.rs:3155— crates/router/src/core/payments/transformers.rs:3155-3181 | crates/router/src/core/payments/transformers.rs:3315-3341 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payouts.rs:2239— crates/router/src/core/payouts.rs:2239-2265 | crates/router/src/core/payouts.rs:2487-2513 — both copies are in the same file, so extract the block into 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) crates/router/src/core/webhooks/outgoing.rs:1348— crates/router/src/core/webhooks/outgoing.rs:1348-1374 | crates/router/src/core/webhooks/outgoing_v2.rs:627-653 — before extracting anything, compare `crates/router/src/core/webhooks/outgoing.rs` and `crates/router/src/core/webhooks/outgoing_v2.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/routes/payments.rs:620— crates/router/src/routes/payments.rs:620-646 | crates/router/src/routes/payments.rs:4578-4604 — both copies are in the same file, so extract the block into 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) crates/router/src/types/api/connector_mapping.rs:164— crates/router/src/types/api/connector_mapping.rs:164-190 | crates/router/src/types/api/feature_matrix.rs:77-103 — before extracting anything, compare `crates/router/src/types/api/connector_mapping.rs` and `crates/router/src/types/api/feature_matrix.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 401 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:88— crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:88-98 | crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs:89-99 | crates/analytics/src/disputes/metrics/total_amount_disputed.rs:87-97 | crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs:88-98 — before extracting anything, compare `crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs` and `crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:918— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:918-928 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1064-1074 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1172-1182 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1278-1288 — 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) crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:208— crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:208-218 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:133-143 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:72-82 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:723-733 — `crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/forte/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 77 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 (11 lines × 4) crates/hyperswitch_connectors/src/connectors/coinbase.rs:234— crates/hyperswitch_connectors/src/connectors/coinbase.rs:234-244 | crates/hyperswitch_connectors/src/connectors/nmi.rs:390-400 | crates/hyperswitch_connectors/src/connectors/opennode.rs:236-246 | crates/hyperswitch_connectors/src/connectors/payeezy.rs:417-427 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/coinbase.rs` and `crates/hyperswitch_connectors/src/connectors/opennode.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 92 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:265— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:265-277 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1819-1829 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1941-1951 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2067-2077 — 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) crates/hyperswitch_connectors/src/connectors/klarna.rs:659— crates/hyperswitch_connectors/src/connectors/klarna.rs:659-669 | crates/hyperswitch_connectors/src/connectors/klarna.rs:800-810 | crates/hyperswitch_connectors/src/connectors/klarna.rs:949-959 | crates/hyperswitch_connectors/src/connectors/klarna.rs:1091-1101 — 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) crates/hyperswitch_connectors/src/connectors/shift4.rs:265— crates/hyperswitch_connectors/src/connectors/shift4.rs:265-275 | crates/hyperswitch_connectors/src/connectors/shift4.rs:364-374 | crates/hyperswitch_connectors/src/connectors/shift4.rs:424-434 | crates/hyperswitch_connectors/src/connectors/shift4.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) crates/hyperswitch_connectors/src/connectors/stripe.rs:953— crates/hyperswitch_connectors/src/connectors/stripe.rs:953-963 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1138-1148 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1937-1947 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2100-2110 — 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) crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:1025— crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:1025-1035 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:1123-1133 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:1228-1238 | crates/router/src/core/split_payments.rs:595-605 — 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 (11 lines × 4) crates/router/src/core/payments/helpers.rs:6344— crates/router/src/core/payments/helpers.rs:6344-6354 | crates/router/src/core/payments/helpers.rs:6493-6503 | crates/router/src/core/payments/helpers.rs:6928-6938 | crates/router/src/core/payments/helpers.rs:7046-7056 — 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) crates/router/src/core/payments/transformers.rs:134— crates/router/src/core/payments/transformers.rs:134-144 | crates/router/src/core/payments/transformers.rs:825-835 | crates/router/src/core/payments/transformers.rs:2351-2361 | crates/router/src/core/payments/transformers.rs:8387-8397 — 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) crates/router/src/db/refund.rs:401— crates/router/src/db/refund.rs:401-411 | crates/router/src/db/refund.rs:423-433 | crates/router/src/db/refund.rs:1263-1273 | crates/router/src/db/refund.rs:1285-1295 — 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) crates/router/src/db/refund.rs:1734— crates/router/src/db/refund.rs:1734-1744 | crates/router/src/db/refund.rs:1848-1858 | crates/router/src/db/refund.rs:2065-2075 | crates/router/src/db/refund.rs:2177-2187 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 4) crates/router/src/services/authentication.rs:1122— crates/router/src/services/authentication.rs:1122-1132 | crates/router/src/services/authentication.rs:2650-2660 | crates/router/src/services/authentication.rs:2927-2937 | crates/router/src/services/authentication.rs:2993-3003 — 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) crates/router/src/types/transformers.rs:1025— crates/router/src/types/transformers.rs:1025-1035 | crates/router/src/types/transformers.rs:1100-1110 | crates/router/src/types/transformers.rs:1173-1183 | crates/router/src/types/transformers.rs:1342-1352 — 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) crates/router/src/utils.rs:796— crates/router/src/utils.rs:796-806 | crates/router/src/utils.rs:861-871 | crates/router/src/utils.rs:938-948 | crates/router/src/utils.rs:1002-1012 — 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) crates/hyperswitch_connectors/src/connectors/getnet.rs:181— crates/hyperswitch_connectors/src/connectors/getnet.rs:181-192 | crates/hyperswitch_connectors/src/connectors/jpmorgan.rs:187-197 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:205-216 | crates/hyperswitch_connectors/src/connectors/payjustnow.rs:209-220 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/getnet.rs` and `crates/hyperswitch_connectors/src/connectors/jpmorgan.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) crates/router/src/core/disputes.rs:1245— crates/router/src/core/disputes.rs:1245-1256 | crates/router/src/core/payments.rs:14262-14272 | crates/router/src/core/payments.rs:14539-14550 | crates/router/src/core/payments.rs:14622-14633 — 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 (14 lines × 3) REDACTED:1351— REDACTED:1351-1364 | REDACTED:1610-1623 | REDACTED:1674-1687 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1136— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1136-1149 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2769-2782 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1361-1374 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 47 separate duplicated blocks between them, totalling at least 513 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 (14 lines × 3) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2045— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2045-2058 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3047-3060 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1563-1576 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (14 lines × 3) crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:303— crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:303-316 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:392-405 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:411-424 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2333— crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2333-2346 | crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2565-2578 | crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2628-2641 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs:980— crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs:980-993 | crates/hyperswitch_domain_models/src/router_request_types.rs:1207-1220 | crates/hyperswitch_domain_models/src/router_request_types.rs:1230-1243 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (14 lines × 3) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2908— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2908-2921 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3226-3239 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3407-3420 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_interfaces/src/api.rs:288— crates/hyperswitch_interfaces/src/api.rs:288-301 | crates/hyperswitch_interfaces/src/connector_integration_v2.rs:198-211 | crates/pm_auth/src/types/api.rs:80-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (14 lines × 3) crates/router/src/core/payment_methods.rs:5591— crates/router/src/core/payment_methods.rs:5591-5604 | crates/router/src/core/payment_methods/vault.rs:2749-2762 | crates/router/src/core/payment_methods/vault.rs:3297-3310 — before extracting anything, compare `crates/router/src/core/payment_methods.rs` and `crates/router/src/core/payment_methods/vault.rs` as WHOLE FILES: this scan already matched 6 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 (14 lines × 3) crates/router/src/core/payments.rs:5235— crates/router/src/core/payments.rs:5235-5248 | crates/router/src/core/payments.rs:5430-5443 | crates/router/src/core/payments.rs:6009-6022 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:494— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:494-507 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:772-785 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:376-389 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/payment_confirm_intent.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) crates/router/src/core/payments/transformers.rs:6053— crates/router/src/core/payments/transformers.rs:6053-6066 | crates/router/src/core/payments/transformers.rs:6121-6134 | crates/router/src/core/payments/transformers.rs:6190-6203 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/services/authentication.rs:1122— crates/router/src/services/authentication.rs:1122-1135 | crates/router/src/services/authentication.rs:2650-2663 | crates/router/src/services/authentication.rs:2927-2940 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/storage_impl/src/business_profile.rs:197— crates/storage_impl/src/business_profile.rs:197-210 | crates/storage_impl/src/business_profile.rs:245-258 | crates/storage_impl/src/merchant_account.rs:185-198 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (14 lines × 3) crates/storage_impl/src/merchant_connector_account.rs:1622— crates/storage_impl/src/merchant_connector_account.rs:1622-1635 | crates/storage_impl/src/merchant_connector_account.rs:1654-1667 | crates/storage_impl/src/merchant_connector_account.rs:1688-1701 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1629— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1629-1642 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2557-2570 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3509-3522 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (14 lines × 3) crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:77— crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:77-90 | crates/router/src/core/payments/operations/payment_update_metadata.rs:80-93 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:82-95 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs` and `crates/router/src/core/payments/operations/payment_update_metadata.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 196 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 2) crates/external_services/src/grpc_client/deja_transport.rs:260— crates/external_services/src/grpc_client/deja_transport.rs:260-270 | crates/external_services/src/superposition.rs:200-209 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10–11 lines × 2) crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:412— crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:412-422 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:475-484 — `crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/payme/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 90 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10–11 lines × 2) crates/hyperswitch_connectors/src/connectors/payload/transformers.rs:174— crates/hyperswitch_connectors/src/connectors/payload/transformers.rs:174-183 | crates/hyperswitch_connectors/src/connectors/payload/transformers.rs:426-436 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/router/src/bin/router.rs:11— crates/router/src/bin/router.rs:11-21 | crates/router/src/bin/scheduler.rs:33-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 both call sites, so a change lands once.
Duplicated block (10–11 lines × 2) crates/router/src/core/customers.rs:1469— crates/router/src/core/customers.rs:1469-1478 | crates/router/src/core/customers.rs:1623-1633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/router/src/core/fraud_check/flows/sale_flow.rs:129— crates/router/src/core/fraud_check/flows/sale_flow.rs:129-138 | crates/router/src/core/fraud_check/flows/transaction_flow.rs:89-99 — before extracting anything, compare `crates/router/src/core/fraud_check/flows/sale_flow.rs` and `crates/router/src/core/fraud_check/flows/transaction_flow.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 108 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 2) crates/router/src/core/payments/operations/payment_confirm_intent.rs:52— crates/router/src/core/payments/operations/payment_confirm_intent.rs:52-61 | crates/router/src/core/payments/operations/payment_session_intent.rs:36-46 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm_intent.rs` and `crates/router/src/core/payments/operations/payment_session_intent.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 2) crates/router/src/core/payments/operations/payment_post_session_tokens.rs:115— crates/router/src/core/payments/operations/payment_post_session_tokens.rs:115-124 | crates/router/src/core/payments/operations/tax_calculation.rs:118-128 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_post_session_tokens.rs` and `crates/router/src/core/payments/operations/tax_calculation.rs` as WHOLE FILES: this scan already matched 16 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 (10–11 lines × 2) crates/router/src/core/payments/routing.rs:4206— crates/router/src/core/payments/routing.rs:4206-4215 | crates/router/src/core/payments/routing.rs:4613-4623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/router/src/core/payouts.rs:773— crates/router/src/core/payouts.rs:773-782 | crates/router/src/core/payouts.rs:843-853 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/router/src/core/refunds.rs:760— crates/router/src/core/refunds.rs:760-770 | crates/router/src/core/refunds.rs:1402-1411 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/router/src/core/superposition_proxy.rs:212— crates/router/src/core/superposition_proxy.rs:212-221 | crates/router/src/core/superposition_proxy.rs:281-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/router/src/core/unified_connector_service/connector_config.rs:907— crates/router/src/core/unified_connector_service/connector_config.rs:907-917 | crates/router/src/core/unified_connector_service/connector_config.rs:925-934 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/router/src/routes/disputes.rs:551— crates/router/src/routes/disputes.rs:551-560 | crates/router/src/routes/payouts.rs:91-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10–11 lines × 2) crates/router/src/types/storage/dispute.rs:50— crates/router/src/types/storage/dispute.rs:50-60 | crates/router/src/types/storage/refund.rs:99-108 — before extracting anything, compare `crates/router/src/types/storage/dispute.rs` and `crates/router/src/types/storage/refund.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 2) crates/smithy/src/lib.rs:744— crates/smithy/src/lib.rs:744-753 | crates/smithy/src/lib.rs:906-916 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/storage_impl/src/merchant_connector_account.rs:1935— crates/storage_impl/src/merchant_connector_account.rs:1935-1944 | crates/storage_impl/src/merchant_connector_account.rs:2074-2084 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 3) crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs:53— crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs:53-68 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:53-68 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs:52-67 — before extracting anything, compare `crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs` and `crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) crates/diesel_models/src/payment_attempt.rs:3922— crates/diesel_models/src/payment_attempt.rs:3922-3937 | crates/diesel_models/src/payment_attempt.rs:4187-4202 | crates/diesel_models/src/payment_attempt.rs:4457-4472 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 3) crates/diesel_models/src/payment_attempt.rs:4301— crates/diesel_models/src/payment_attempt.rs:4301-4316 | crates/diesel_models/src/payment_attempt.rs:4482-4497 | crates/diesel_models/src/payment_attempt.rs:4655-4670 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 3) crates/diesel_models/src/payment_method.rs:1097— crates/diesel_models/src/payment_method.rs:1097-1112 | crates/diesel_models/src/payment_method.rs:1120-1135 | crates/diesel_models/src/payment_method.rs:1148-1163 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 3) crates/hyperswitch_connectors/src/connectors/cybersource.rs:271— crates/hyperswitch_connectors/src/connectors/cybersource.rs:271-286 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:333-348 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:237-252 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersource.rs` and `crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) crates/hyperswitch_connectors/src/connectors/paypal.rs:578— crates/hyperswitch_connectors/src/connectors/paypal.rs:578-593 | crates/hyperswitch_connectors/src/connectors/paypal.rs:713-728 | crates/hyperswitch_connectors/src/connectors/vgs.rs:258-273 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/paypal.rs` and `crates/hyperswitch_connectors/src/connectors/vgs.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:3725— crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:3725-3740 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:4100-4115 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:4466-4481 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 3) crates/hyperswitch_connectors/src/utils.rs:2230— crates/hyperswitch_connectors/src/utils.rs:2230-2245 | crates/hyperswitch_connectors/src/utils.rs:2285-2300 | crates/hyperswitch_connectors/src/utils.rs:2338-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.
Duplicated block (16 lines × 3) crates/hyperswitch_domain_models/src/lib.rs:1143— crates/hyperswitch_domain_models/src/lib.rs:1143-1158 | crates/router/src/core/payments/transformers.rs:8045-8060 | crates/router/src/core/payments/transformers.rs:8125-8140 — before extracting anything, compare `crates/hyperswitch_domain_models/src/lib.rs` and `crates/router/src/core/payments/transformers.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (16 lines × 3) crates/router/src/core/payment_methods.rs:1451— crates/router/src/core/payment_methods.rs:1451-1466 | crates/router/src/core/payment_methods.rs:1579-1594 | crates/router/src/core/payment_methods.rs:1692-1707 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 3) crates/router/src/core/payment_methods/cards.rs:7183— crates/router/src/core/payment_methods/cards.rs:7183-7198 | crates/router/src/core/payment_methods/cards.rs:7291-7306 | crates/router/src/core/payment_methods/cards.rs:7399-7414 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 3) crates/router/src/core/payments/operations/payment_confirm.rs:823— crates/router/src/core/payments/operations/payment_confirm.rs:823-838 | crates/router/src/core/payments/operations/payment_create.rs:612-627 | crates/router/src/core/payments/operations/payment_recurrence.rs:311-326 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_create.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) crates/router/src/db/address.rs:846— crates/router/src/db/address.rs:846-861 | crates/router/src/db/address.rs:870-885 | crates/router/src/db/events.rs:819-834 — 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 (16 lines × 3) crates/router/src/routes/files.rs:51— crates/router/src/routes/files.rs:51-66 | crates/router/src/routes/files.rs:103-118 | crates/router/src/routes/files.rs:157-172 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 3) crates/router/src/routes/superposition_proxy.rs:69— crates/router/src/routes/superposition_proxy.rs:69-84 | crates/router/src/routes/superposition_proxy.rs:113-128 | crates/router/src/routes/superposition_proxy.rs:245-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.
Duplicated block (16 lines × 3) crates/storage_impl/src/customers.rs:1681— crates/storage_impl/src/customers.rs:1681-1696 | crates/storage_impl/src/customers.rs:1701-1716 | crates/storage_impl/src/customers.rs:2000-2015 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/adyen.rs:1370— crates/hyperswitch_connectors/src/connectors/adyen.rs:1370-1379 | crates/hyperswitch_connectors/src/connectors/ebanx.rs:198-207 | crates/hyperswitch_connectors/src/connectors/stripe.rs:3209-3218 | crates/hyperswitch_connectors/src/connectors/wise.rs:613-622 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/stripe.rs` as WHOLE FILES: this scan already matched 10 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.
Duplicated block (10 lines × 4) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3415— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3415-3424 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3506-3515 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3590-3599 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3723-3732 — 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) crates/hyperswitch_connectors/src/connectors/bambora.rs:595— crates/hyperswitch_connectors/src/connectors/bambora.rs:595-604 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1858-1867 | crates/hyperswitch_connectors/src/connectors/redsys.rs:659-668 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:962-971 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bambora.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:161— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:161-170 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:172-181 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:341-350 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:307-316 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1463— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1463-1472 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1528-1537 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2955-2964 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3036-3045 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 527 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 4) crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:493— crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:493-502 | crates/hyperswitch_connectors/src/connectors/riskified.rs:252-261 | crates/hyperswitch_connectors/src/connectors/sanlam_payshield.rs:201-210 | crates/hyperswitch_connectors/src/connectors/signifyd.rs:375-384 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs` and `crates/hyperswitch_connectors/src/connectors/signifyd.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) crates/hyperswitch_connectors/src/connectors/flexiti.rs:251— crates/hyperswitch_connectors/src/connectors/flexiti.rs:251-260 | crates/hyperswitch_connectors/src/connectors/iatapay.rs:253-262 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:260-269 | crates/hyperswitch_connectors/src/connectors/vgs.rs:215-224 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/flexiti.rs` and `crates/hyperswitch_connectors/src/connectors/iatapay.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) crates/hyperswitch_connectors/src/connectors/klarna.rs:673— crates/hyperswitch_connectors/src/connectors/klarna.rs:673-682 | crates/hyperswitch_connectors/src/connectors/klarna.rs:816-825 | crates/hyperswitch_connectors/src/connectors/klarna.rs:964-973 | crates/hyperswitch_connectors/src/connectors/klarna.rs:1107-1116 — 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) crates/hyperswitch_domain_models/src/business_profile.rs:288— crates/hyperswitch_domain_models/src/business_profile.rs:288-297 | crates/hyperswitch_domain_models/src/business_profile.rs:436-445 | crates/hyperswitch_domain_models/src/business_profile.rs:762-771 | crates/hyperswitch_domain_models/src/business_profile.rs:892-901 — 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) crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:950— crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:950-959 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:1053-1062 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:1158-1167 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:1289-1298 — 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) crates/hyperswitch_interfaces/src/conversion_impls.rs:510— crates/hyperswitch_interfaces/src/conversion_impls.rs:510-519 | crates/hyperswitch_interfaces/src/conversion_impls.rs:623-632 | crates/hyperswitch_interfaces/src/conversion_impls.rs:763-772 | crates/hyperswitch_interfaces/src/conversion_impls.rs:822-831 — 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) crates/router/src/compatibility/stripe/payment_intents.rs:128— crates/router/src/compatibility/stripe/payment_intents.rs:128-137 | crates/router/src/routes/payments.rs:1890-1899 | crates/router/src/routes/payments.rs:3529-3538 | crates/router/src/routes/payments.rs:3576-3585 — before extracting anything, compare `crates/router/src/compatibility/stripe/payment_intents.rs` and `crates/router/src/routes/payments.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) crates/router/src/compatibility/stripe/payment_intents.rs:212— crates/router/src/compatibility/stripe/payment_intents.rs:212-221 | crates/router/src/compatibility/stripe/payment_intents.rs:304-313 | crates/router/src/compatibility/stripe/payment_intents.rs:561-570 | crates/router/src/routes/payments.rs:884-893 — before extracting anything, compare `crates/router/src/compatibility/stripe/payment_intents.rs` and `crates/router/src/routes/payments.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) crates/router/src/core/payment_methods/utils.rs:1007— crates/router/src/core/payment_methods/utils.rs:1007-1016 | crates/router/src/core/payments/helpers.rs:3703-3712 | crates/router/src/core/payments/helpers.rs:9173-9182 | crates/router/src/core/payouts/helpers.rs:88-97 — `crates/router/src/core/payments/helpers.rs` and `crates/router/src/core/payouts/helpers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 75 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 4) crates/router/src/core/payments/flows/complete_authorize_flow.rs:817— crates/router/src/core/payments/flows/complete_authorize_flow.rs:817-826 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:979-988 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:1087-1096 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:1233-1242 — 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) crates/router/src/db/blocklist.rs:1087— crates/router/src/db/blocklist.rs:1087-1096 | crates/router/src/db/blocklist.rs:1116-1125 | crates/router/src/db/blocklist.rs:1142-1151 | crates/router/src/db/blocklist.rs:1169-1178 — 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) crates/diesel_models/src/query/blocklist.rs:565— crates/diesel_models/src/query/blocklist.rs:565-572 | crates/diesel_models/src/query/blocklist.rs:588-595 | crates/diesel_models/src/query/blocklist.rs:648-655 | crates/diesel_models/src/query/blocklist.rs:677-684 — 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2051— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2051-2058 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3053-3060 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3237-3246 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1569-1576 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 4) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:818— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:818-825 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:946-953 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3820-3827 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3969-3976 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 527 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 4) crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:673— crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:673-680 | crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:739-746 | crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:827-834 | crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs:1033-1040 — 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) crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1404— crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1404-1411 | crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1466-1473 | crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1530-1537 | crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1674-1681 — 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) crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:591— crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:591-598 | crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:668-675 | crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:745-752 | crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:822-829 — 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) crates/hyperswitch_connectors/src/utils.rs:2532— crates/hyperswitch_connectors/src/utils.rs:2532-2539 | crates/hyperswitch_connectors/src/utils.rs:2917-2924 | crates/hyperswitch_connectors/src/utils.rs:3105-3112 | crates/hyperswitch_connectors/src/utils.rs:3191-3198 — 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) crates/router/src/core/payments/transformers.rs:867— crates/router/src/core/payments/transformers.rs:867-876 | crates/router/src/core/payments/transformers.rs:5507-5516 | crates/router/src/core/payments/transformers.rs:7255-7264 | crates/router/src/core/utils.rs:724-731 — before extracting anything, compare `crates/router/src/core/payments/transformers.rs` and `crates/router/src/core/utils.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) crates/router/src/db/events.rs:216— crates/router/src/db/events.rs:216-224 | crates/router/src/db/relay.rs:51-58 | crates/router/src/db/user_key_store.rs:49-57 | crates/storage_impl/src/tokenization.rs:55-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (8 lines × 4) crates/router/src/services/authentication.rs:983— crates/router/src/services/authentication.rs:983-990 | crates/router/src/services/authentication.rs:1068-1075 | crates/router/src/services/authentication.rs:1984-1991 | crates/router/src/services/authentication.rs:2135-2142 — 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) crates/router/src/services/email/types.rs:415— crates/router/src/services/email/types.rs:415-422 | crates/router/src/services/email/types.rs:465-472 | crates/router/src/services/email/types.rs:515-522 | crates/router/src/services/email/types.rs:565-572 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 4) crates/hyperswitch_connectors/src/utils.rs:1373— crates/hyperswitch_connectors/src/utils.rs:1373-1380 | crates/hyperswitch_connectors/src/utils.rs:1480-1487 | crates/router/src/connector/utils.rs:1511-1518 | crates/router/src/connector/utils.rs:1584-1591 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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) crates/hyperswitch_connectors/src/utils.rs:1381— crates/hyperswitch_connectors/src/utils.rs:1381-1388 | crates/hyperswitch_connectors/src/utils.rs:1488-1495 | crates/router/src/connector/utils.rs:1519-1526 | crates/router/src/connector/utils.rs:1592-1599 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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) crates/hyperswitch_connectors/src/utils.rs:1696— crates/hyperswitch_connectors/src/utils.rs:1696-1703 | crates/hyperswitch_connectors/src/utils.rs:1805-1812 | crates/hyperswitch_connectors/src/utils.rs:7473-7480 | crates/router/src/connector/utils.rs:1436-1443 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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) crates/hyperswitch_connectors/src/utils.rs:1704— crates/hyperswitch_connectors/src/utils.rs:1704-1711 | crates/hyperswitch_connectors/src/utils.rs:1813-1820 | crates/hyperswitch_connectors/src/utils.rs:7481-7488 | crates/router/src/connector/utils.rs:1444-1451 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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) crates/hyperswitch_connectors/src/connectors/adyen.rs:145— crates/hyperswitch_connectors/src/connectors/adyen.rs:145-152 | crates/hyperswitch_connectors/src/connectors/authipay.rs:166-173 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:149-156 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:145-152 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/fiserv.rs` as WHOLE FILES: this scan already matched 6 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.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×15
Duplicated block (15 lines × 4) REDACTED:897— REDACTED:897-911 | REDACTED:960-974 | REDACTED:1157-1171 | REDACTED:1298-1312 — 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) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3201— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3201-3215 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3825-3839 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3992-4006 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:6971-6985 — 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) crates/hyperswitch_connectors/src/connectors/airwallex.rs:693— crates/hyperswitch_connectors/src/connectors/airwallex.rs:693-707 | crates/hyperswitch_connectors/src/connectors/breadpay.rs:345-359 | crates/hyperswitch_connectors/src/connectors/paybox.rs:642-656 | crates/hyperswitch_connectors/src/connectors/shift4.rs:618-632 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/airwallex.rs` and `crates/hyperswitch_connectors/src/connectors/breadpay.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 4) crates/router/src/compatibility/stripe/refunds.rs:38— crates/router/src/compatibility/stripe/refunds.rs:38-52 | crates/router/src/compatibility/stripe/refunds.rs:85-99 | crates/router/src/compatibility/stripe/refunds.rs:131-145 | crates/router/src/compatibility/stripe/refunds.rs:174-188 — 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) crates/router/src/core/payments/transformers.rs:612— crates/router/src/core/payments/transformers.rs:612-626 | crates/router/src/core/payments/transformers.rs:1029-1043 | crates/router/src/core/payments/transformers.rs:1204-1218 | crates/router/src/core/payments/transformers.rs:1950-1964 — 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) crates/router/src/routes/blocklist.rs:242— crates/router/src/routes/blocklist.rs:242-256 | crates/router/src/routes/blocklist.rs:298-312 | crates/router/src/routes/blocklist.rs:477-491 | crates/router/src/routes/blocklist.rs:528-542 — 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) crates/router/src/routes/disputes.rs:458— crates/router/src/routes/disputes.rs:458-472 | crates/router/src/routes/disputes.rs:510-524 | crates/router/src/routes/disputes.rs:564-578 | crates/router/src/routes/disputes.rs:668-682 — 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) crates/router/src/routes/payment_methods.rs:1921— crates/router/src/routes/payment_methods.rs:1921-1935 | crates/router/src/routes/payment_methods.rs:1995-2009 | crates/router/src/routes/payment_methods.rs:2051-2065 | crates/router/src/routes/payment_methods.rs:2107-2121 — 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) crates/router/src/routes/refunds.rs:179— crates/router/src/routes/refunds.rs:179-193 | crates/router/src/routes/refunds.rs:620-634 | crates/router/src/routes/refunds.rs:728-742 | crates/router/src/routes/refunds.rs:825-839 — 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) crates/router/src/routes/refunds.rs:469— crates/router/src/routes/refunds.rs:469-483 | crates/router/src/routes/refunds.rs:656-670 | crates/router/src/routes/refunds.rs:688-702 | crates/router/src/routes/refunds.rs:762-776 — 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) crates/router/src/routes/routing.rs:281— crates/router/src/routes/routing.rs:281-295 | crates/router/src/routes/routing.rs:411-425 | crates/router/src/routes/routing.rs:674-688 | crates/router/src/routes/routing.rs:1109-1123 — 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) crates/router/src/routes/subscription.rs:114— crates/router/src/routes/subscription.rs:114-128 | crates/router/src/routes/subscription.rs:150-164 | crates/router/src/routes/subscription.rs:186-200 | crates/router/src/routes/subscription.rs:478-492 — 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) crates/storage_impl/src/business_profile.rs:774— crates/storage_impl/src/business_profile.rs:774-788 | crates/storage_impl/src/business_profile.rs:826-840 | crates/storage_impl/src/business_profile.rs:1260-1274 | crates/storage_impl/src/business_profile.rs:1330-1344 — 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) crates/storage_impl/src/business_profile.rs:1952— crates/storage_impl/src/business_profile.rs:1952-1966 | crates/storage_impl/src/business_profile.rs:2251-2265 | crates/storage_impl/src/business_profile.rs:2313-2327 | crates/storage_impl/src/business_profile.rs:2374-2388 — 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) crates/storage_impl/src/payments/payment_attempt.rs:3065— crates/storage_impl/src/payments/payment_attempt.rs:3065-3079 | crates/storage_impl/src/payments/payment_attempt.rs:3136-3150 | crates/storage_impl/src/payments/payment_attempt.rs:3171-3185 | crates/storage_impl/src/payments/payment_attempt.rs:3247-3261 — 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 × 2) crates/hyperswitch_connectors/src/connectors/datatrans.rs:155— crates/hyperswitch_connectors/src/connectors/datatrans.rs:155-167 | crates/hyperswitch_connectors/src/connectors/helcim.rs:181-194 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/datatrans.rs` and `crates/hyperswitch_connectors/src/connectors/helcim.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 2) crates/hyperswitch_connectors/src/connectors/fiuu.rs:857— crates/hyperswitch_connectors/src/connectors/fiuu.rs:857-870 | crates/hyperswitch_connectors/src/connectors/fiuu.rs:887-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.
Duplicated block (13–14 lines × 2) crates/hyperswitch_connectors/src/connectors/netcetera.rs:372— crates/hyperswitch_connectors/src/connectors/netcetera.rs:372-384 | crates/hyperswitch_connectors/src/connectors/threedsecureio.rs:263-276 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13–14 lines × 2) crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:256— crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:256-268 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:276-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1136— crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1136-1148 | crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:1193-1206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) crates/hyperswitch_constraint_graph/src/graph.rs:214— crates/hyperswitch_constraint_graph/src/graph.rs:214-227 | crates/hyperswitch_constraint_graph/src/graph.rs:274-286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) crates/hyperswitch_domain_models/src/payment_method_data.rs:4535— crates/hyperswitch_domain_models/src/payment_method_data.rs:4535-4548 | crates/hyperswitch_domain_models/src/payment_method_data.rs:4616-4628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) crates/payment_methods/src/core/migration/payment_methods.rs:531— crates/payment_methods/src/core/migration/payment_methods.rs:531-544 | crates/payment_methods/src/core/migration/payment_methods.rs:664-676 — both copies are in the same file, so extract the block into 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) crates/router/src/core/authentication.rs:410— crates/router/src/core/authentication.rs:410-422 | crates/router/src/core/authentication.rs:1401-1414 — both copies are in the same file, so extract the block into 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) crates/router/src/core/customers.rs:230— crates/router/src/core/customers.rs:230-242 | crates/router/src/core/customers.rs:352-365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) crates/router/src/core/payment_methods.rs:3434— crates/router/src/core/payment_methods.rs:3434-3447 | crates/router/src/core/payment_methods.rs:4096-4108 — both copies are in the same file, so extract the block into 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) crates/router/src/core/unified_authentication_service.rs:1918— crates/router/src/core/unified_authentication_service.rs:1918-1930 | crates/router/src/core/unified_authentication_service.rs:2016-2029 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) crates/router/src/core/unified_connector_service.rs:1605— crates/router/src/core/unified_connector_service.rs:1605-1617 | crates/router/src/core/unified_connector_service.rs:1645-1658 — both copies are in the same file, so extract the block into 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) crates/storage_impl/src/customers.rs:440— crates/storage_impl/src/customers.rs:440-453 | crates/storage_impl/src/customers.rs:510-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 (13–14 lines × 2) crates/storage_impl/src/merchant_connector_account.rs:90— crates/storage_impl/src/merchant_connector_account.rs:90-102 | crates/storage_impl/src/merchant_connector_account.rs:127-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.
Duplicated block (12 lines × 4) crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs:77— crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs:77-88 | crates/analytics/src/payment_intents/metrics/total_smart_retries.rs:77-88 | crates/analytics/src/sdk_events/metrics/average_payment_time.rs:79-91 | crates/analytics/src/sdk_events/metrics/load_time.rs:79-91 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs` and `crates/analytics/src/payment_intents/metrics/total_smart_retries.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 159 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 × 4) crates/hyperswitch_connectors/src/connectors/airwallex.rs:245— crates/hyperswitch_connectors/src/connectors/airwallex.rs:245-256 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:178-189 | crates/hyperswitch_connectors/src/connectors/payload.rs:162-173 | crates/hyperswitch_connectors/src/connectors/stripe.rs:335-346 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/airwallex.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 4) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2090— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2090-2101 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3090-3101 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:5029-5040 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:2186-2197 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (12 lines × 4) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1502— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1502-1513 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1567-1578 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2049-2060 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2267-2278 — 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) crates/hyperswitch_connectors/src/connectors/cybersource.rs:2179— crates/hyperswitch_connectors/src/connectors/cybersource.rs:2179-2190 | crates/hyperswitch_connectors/src/connectors/paypal.rs:1517-1528 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1295-1306 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:1251-1262 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersource.rs` and `crates/hyperswitch_connectors/src/connectors/paypal.rs` as WHOLE FILES: this scan already matched 13 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 × 4) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2803— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2803-2814 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3006-3017 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3087-3098 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4112-4123 — 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) crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:64— crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:64-75 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:171-182 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:402-413 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:662-673 — `crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 145 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 (12 lines × 4) crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1238— crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1238-1249 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1289-1300 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1955-1966 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1994-2005 — 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) crates/hyperswitch_connectors/src/utils.rs:2575— crates/hyperswitch_connectors/src/utils.rs:2575-2586 | crates/hyperswitch_connectors/src/utils.rs:2948-2959 | crates/hyperswitch_domain_models/src/router_request_types.rs:1995-2006 | crates/hyperswitch_domain_models/src/router_request_types.rs:2023-2034 — 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 (12 lines × 4) crates/router/src/core/payments/operations/payment_cancel.rs:84— crates/router/src/core/payments/operations/payment_cancel.rs:84-95 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:84-95 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:84-95 | crates/router/src/core/payments/operations/tax_calculation.rs:101-112 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/payments/operations/payment_post_session_tokens.rs:307— crates/router/src/core/payments/operations/payment_post_session_tokens.rs:307-318 | crates/router/src/core/payments/operations/payment_session.rs:308-319 | crates/router/src/core/payments/operations/payment_update_metadata.rs:335-346 | crates/router/src/core/payments/operations/tax_calculation.rs:487-498 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_post_session_tokens.rs` and `crates/router/src/core/payments/operations/payment_session.rs` as WHOLE FILES: this scan already matched 12 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 (12 lines × 4) crates/router/src/core/relay.rs:190— crates/router/src/core/relay.rs:190-201 | crates/router/src/core/relay.rs:322-333 | crates/router/src/core/relay.rs:461-472 | crates/router/src/core/relay.rs:594-605 — 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) crates/router/src/core/user/theme.rs:32— crates/router/src/core/user/theme.rs:32-43 | crates/router/src/core/user/theme.rs:151-162 | crates/router/src/core/user/theme.rs:289-300 | crates/router/src/core/user/theme.rs:564-575 — 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) crates/router/src/routes/hierarchical_resources.rs:80— crates/router/src/routes/hierarchical_resources.rs:80-91 | crates/router/src/routes/hierarchical_resources.rs:125-136 | crates/router/src/routes/hierarchical_resources.rs:167-178 | crates/router/src/routes/hierarchical_resources.rs:209-220 — 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) crates/router/src/db/dispute.rs:403— crates/router/src/db/dispute.rs:403-414 | crates/router/src/db/mandate.rs:379-390 | crates/router/src/db/refund.rs:774-785 | crates/storage_impl/src/authentication.rs:362-373 — before extracting anything, compare `crates/router/src/db/dispute.rs` and `crates/router/src/db/mandate.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) crates/diesel_models/src/query/blocklist.rs:451— crates/diesel_models/src/query/blocklist.rs:451-457 | crates/diesel_models/src/query/blocklist.rs:479-485 | crates/diesel_models/src/query/blocklist.rs:504-510 | crates/diesel_models/src/query/blocklist.rs:538-544 — 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) crates/diesel_models/src/query/generics.rs:268— crates/diesel_models/src/query/generics.rs:268-274 | crates/diesel_models/src/query/generics.rs:346-352 | crates/diesel_models/src/query/generics.rs:392-398 | crates/diesel_models/src/query/generics.rs:528-534 — 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) crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1448— crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1448-1454 | crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1588-1594 | crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1658-1664 | crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:1833-1839 — 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:556— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:556-562 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:312-318 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:5614-5620 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager/transformers.rs:494-500 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (7 lines × 4) crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:969— crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:969-975 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:999-1006 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:1018-1025 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:1115-1122 — 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) crates/hyperswitch_connectors/src/connectors/paypal.rs:577— crates/hyperswitch_connectors/src/connectors/paypal.rs:577-583 | crates/hyperswitch_connectors/src/connectors/paypal.rs:712-718 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:302-308 | crates/hyperswitch_connectors/src/connectors/vgs.rs:257-263 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/paypal.rs` and `crates/hyperswitch_connectors/src/connectors/vgs.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/payments/helpers.rs:6315— crates/router/src/core/payments/helpers.rs:6315-6321 | crates/router/src/core/payments/helpers.rs:6464-6470 | crates/router/src/core/payments/helpers.rs:6899-6905 | crates/router/src/core/payments/helpers.rs:7013-7019 — 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) crates/router/src/routes/payments.rs:1682— crates/router/src/routes/payments.rs:1682-1688 | crates/router/src/routes/payments.rs:1729-1735 | crates/router/src/routes/payments.rs:1778-1784 | crates/router/src/routes/payments.rs:1827-1833 — 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) crates/router/src/types/storage/refund.rs:166— crates/router/src/types/storage/refund.rs:166-172 | crates/router/src/types/storage/refund.rs:251-257 | crates/router/src/types/storage/refund.rs:334-340 | crates/router/src/types/storage/refund.rs:569-575 — 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) crates/router/src/utils.rs:779— crates/router/src/utils.rs:779-785 | crates/router/src/utils.rs:844-850 | crates/router/src/utils.rs:921-927 | crates/router/src/utils.rs:985-991 — 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) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:779— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:779-785 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1002-1008 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1816-1822 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:920-926 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/utils.rs:1356— crates/hyperswitch_connectors/src/utils.rs:1356-1362 | crates/hyperswitch_connectors/src/utils.rs:1463-1469 | crates/router/src/connector/utils.rs:1499-1505 | crates/router/src/connector/utils.rs:1572-1578 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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) crates/hyperswitch_connectors/src/utils.rs:1570— crates/hyperswitch_connectors/src/utils.rs:1570-1576 | crates/hyperswitch_connectors/src/utils.rs:7537-7543 | crates/hyperswitch_connectors/src/utils.rs:7650-7656 | crates/router/src/connector/utils.rs:2548-2554 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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) crates/hyperswitch_connectors/src/utils.rs:1679— crates/hyperswitch_connectors/src/utils.rs:1679-1685 | crates/hyperswitch_connectors/src/utils.rs:1788-1794 | crates/hyperswitch_connectors/src/utils.rs:7461-7467 | crates/router/src/connector/utils.rs:1424-1430 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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) crates/hyperswitch_connectors/src/connectors/adyen.rs:179— crates/hyperswitch_connectors/src/connectors/adyen.rs:179-185 | crates/hyperswitch_connectors/src/connectors/paypal.rs:572-578 | crates/hyperswitch_connectors/src/connectors/paypal.rs:707-713 | crates/hyperswitch_connectors/src/connectors/threedsecureio.rs:141-147 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/paypal.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 136 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
FixmeComment crates/router_derive/src/lib.rs:172— // FIXME: Remove allowed warnings, raise compile errors in a better manner instead of panicking — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/router_derive/src/lib.rs:186— // FIXME: Use `compile_error!()` instead — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/router/tests/payments2.rs:34— // FIXME: broken test? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/router/tests/payments2.rs:360— // FIXME: broken test? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/router/tests/payments2.rs:292— // FIXME: broken test? It looks like we haven't updated the test after removing the `core::payments::payments_start_core` method from the codebase. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/router/src/types.rs:1— // FIXME: Why were these data types grouped this way? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/router/src/types/api/payments.rs:178— //#[test] // FIXME: Fix test — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/redis_interface/src/module/fred/commands.rs:2008— // FIXME: Replace with utils::when — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/hyperswitch_interfaces/src/api.rs:383— // FIXME write doc - think about this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/hyperswitch_domain_models/src/errors/api_error_response.rs:641— //FIXME: error message — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/hyperswitch_domain_models/src/errors/api_error_response.rs:715— //FIXME: error message — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3140— // FIXME: Remove hardcoding — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:6217— // FIXME: Remove hardcoding — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:6893— // FIXME: Remove hardcoding — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×14
Duplicated block (29 lines × 2) crates/hyperswitch_connectors/src/connectors/nordea.rs:503— crates/hyperswitch_connectors/src/connectors/nordea.rs:503-531 | crates/hyperswitch_connectors/src/connectors/nordea.rs:668-696 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29 lines × 2) crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:121— crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:121-149 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:281-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29 lines × 2) crates/hyperswitch_connectors/src/utils.rs:3677— crates/hyperswitch_connectors/src/utils.rs:3677-3705 | crates/router/src/connector/utils.rs:2021-2049 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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 (29 lines × 2) crates/hyperswitch_domain_models/src/payments.rs:788— crates/hyperswitch_domain_models/src/payments.rs:788-816 | crates/hyperswitch_domain_models/src/payments.rs:842-870 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29 lines × 2) crates/hyperswitch_interfaces/src/api.rs:287— crates/hyperswitch_interfaces/src/api.rs:287-315 | crates/hyperswitch_interfaces/src/connector_integration_v2.rs:197-225 — 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 (29 lines × 2) crates/router/src/core/payment_methods.rs:5198— crates/router/src/core/payment_methods.rs:5198-5226 | crates/router/src/core/payment_methods/vault.rs:2851-2879 — before extracting anything, compare `crates/router/src/core/payment_methods.rs` and `crates/router/src/core/payment_methods/vault.rs` as WHOLE FILES: this scan already matched 6 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 (29 lines × 2) crates/router/src/core/payment_methods/transformers.rs:277— crates/router/src/core/payment_methods/transformers.rs:277-305 | crates/router/src/core/payment_methods/transformers.rs:312-340 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29 lines × 2) crates/router/src/core/payments.rs:1205— crates/router/src/core/payments.rs:1205-1233 | crates/router/src/core/payments.rs:1411-1439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29 lines × 2) crates/router/src/core/payments/flows/complete_authorize_flow.rs:940— crates/router/src/core/payments/flows/complete_authorize_flow.rs:940-968 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:1194-1222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29 lines × 2) crates/router/src/core/payments/transformers.rs:381— crates/router/src/core/payments/transformers.rs:381-409 | crates/router/src/core/payments/transformers.rs:1781-1809 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29 lines × 2) crates/router/src/core/routing/helpers.rs:2220— crates/router/src/core/routing/helpers.rs:2220-2248 | crates/router/src/core/routing/helpers.rs:2367-2395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29 lines × 2) crates/router/src/services/authentication.rs:3389— crates/router/src/services/authentication.rs:3389-3417 | crates/router/src/services/authentication.rs:3452-3480 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29 lines × 2) crates/router/src/services/kafka/dispute.rs:47— crates/router/src/services/kafka/dispute.rs:47-75 | crates/router/src/services/kafka/dispute_event.rs:47-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (29 lines × 2) crates/storage_impl/src/business_profile.rs:2298— crates/storage_impl/src/business_profile.rs:2298-2326 | crates/storage_impl/src/business_profile.rs:2359-2387 — both copies are in the same file, so extract the block into 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) crates/analytics/src/payments/metrics/avg_ticket_size.rs:41— crates/analytics/src/payments/metrics/avg_ticket_size.rs:41-53 | crates/analytics/src/payments/metrics/payment_processed_amount.rs:41-52 — before extracting anything, compare `crates/analytics/src/payments/metrics/avg_ticket_size.rs` and `crates/analytics/src/payments/metrics/payment_processed_amount.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/common_utils/src/types.rs:654— crates/common_utils/src/types.rs:654-666 | crates/common_utils/src/types.rs:690-701 — both copies are in the same file, so extract the block into 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) crates/diesel_models/src/payment_attempt.rs:3371— crates/diesel_models/src/payment_attempt.rs:3371-3383 | crates/diesel_models/src/payment_attempt.rs:3753-3764 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3108— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3108-3119 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:2402-2414 — `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 61 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 (12–13 lines × 2) crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs:219— crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs:219-231 | crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs:440-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) crates/hyperswitch_connectors/src/connectors/nuvei.rs:648— crates/hyperswitch_connectors/src/connectors/nuvei.rs:648-660 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:1196-1207 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/santander.rs:1163— crates/hyperswitch_connectors/src/connectors/santander.rs:1163-1174 | crates/hyperswitch_connectors/src/connectors/santander.rs:1435-1447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) crates/router/src/core/payment_methods/cards.rs:7359— crates/router/src/core/payment_methods/cards.rs:7359-7371 | crates/router/src/core/payment_methods/cards.rs:7424-7435 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payment_methods/migration.rs:184— crates/router/src/core/payment_methods/migration.rs:184-195 | crates/router/src/core/payment_methods/migration.rs:301-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) crates/router/src/core/refunds.rs:787— crates/router/src/core/refunds.rs:787-799 | crates/router/src/core/refunds.rs:1419-1430 — both copies are in the same file, so extract the block into 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) crates/router/src/core/user.rs:169— crates/router/src/core/user.rs:169-181 | crates/router/src/core/user.rs:182-193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) crates/router/src/routes/payment_methods.rs:596— crates/router/src/routes/payment_methods.rs:596-607 | crates/router/src/routes/payment_methods.rs:1720-1732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) crates/router/src/services/authentication.rs:3757— crates/router/src/services/authentication.rs:3757-3768 | crates/router/src/services/authentication.rs:6635-6647 — both copies are in the same file, so extract the block into 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) crates/storage_impl/src/merchant_account.rs:237— crates/storage_impl/src/merchant_account.rs:237-248 | crates/storage_impl/src/merchant_account.rs:267-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–12 lines × 2) crates/api_models/src/payment_methods.rs:2474— crates/api_models/src/payment_methods.rs:2474-2484 | crates/hyperswitch_domain_models/src/payment_method_data.rs:4572-4583 — before extracting anything, compare `crates/api_models/src/payment_methods.rs` and `crates/hyperswitch_domain_models/src/payment_method_data.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:294— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:294-305 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:124-134 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 46 separate duplicated blocks between them, totalling at least 601 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 (11–12 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2287— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2287-2298 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2425-2435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) crates/hyperswitch_connectors/src/connectors/nmi.rs:1140— crates/hyperswitch_connectors/src/connectors/nmi.rs:1140-1151 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:1712-1722 — 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–12 lines × 2) crates/hyperswitch_connectors/src/connectors/square/transformers.rs:113— crates/hyperswitch_connectors/src/connectors/square/transformers.rs:113-124 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:494-504 — `crates/hyperswitch_connectors/src/connectors/square/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/zen/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 11 separate duplicated blocks between them, totalling at least 95 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 (11–12 lines × 2) crates/hyperswitch_domain_models/src/payments/payment_intent.rs:2086— crates/hyperswitch_domain_models/src/payments/payment_intent.rs:2086-2096 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:2141-2152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) crates/router/src/configs/secrets_transformers.rs:36— crates/router/src/configs/secrets_transformers.rs:36-46 | crates/router/src/configs/secrets_transformers.rs:292-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) crates/router/src/core/payment_methods.rs:3073— crates/router/src/core/payment_methods.rs:3073-3083 | crates/router/src/core/payment_methods.rs:3777-3788 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) crates/router/src/core/payments/operations/payment_confirm.rs:97— crates/router/src/core/payments/operations/payment_confirm.rs:97-108 | crates/router/src/core/payments/operations/payment_recurrence.rs:63-73 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_recurrence.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 2) crates/router/src/core/payments/operations/payment_confirm.rs:627— crates/router/src/core/payments/operations/payment_confirm.rs:627-638 | crates/router/src/core/payments/operations/payment_recurrence.rs:219-229 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_recurrence.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 2) crates/router/src/core/payments/operations/payment_reject.rs:170— crates/router/src/core/payments/operations/payment_reject.rs:170-180 | crates/router/src/core/payments/operations/payment_status.rs:598-609 — 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–12 lines × 2) crates/router/src/routes/customers.rs:313— crates/router/src/routes/customers.rs:313-324 | crates/router/src/routes/customers.rs:348-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 (11–12 lines × 2) crates/router/src/services/authentication/blacklist.rs:26— crates/router/src/services/authentication/blacklist.rs:26-37 | crates/router/src/services/authentication/blacklist.rs:43-53 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) crates/storage_impl/src/merchant_connector_account.rs:1450— crates/storage_impl/src/merchant_connector_account.rs:1450-1461 | crates/storage_impl/src/merchant_connector_account.rs:1799-1809 — both copies are in the same file, so extract the block into 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 × 3) crates/hyperswitch_connectors/src/connectors/adyen.rs:2381— crates/hyperswitch_connectors/src/connectors/adyen.rs:2381-2387 | crates/hyperswitch_connectors/src/connectors/checkout.rs:1191-1197 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2636-2642 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/checkout.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 165 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2312— crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2312-2318 | crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2544-2550 | crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2607-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 (7 lines × 3) crates/hyperswitch_connectors/src/connectors/redsys.rs:484— crates/hyperswitch_connectors/src/connectors/redsys.rs:484-490 | crates/hyperswitch_connectors/src/connectors/redsys.rs:561-567 | crates/hyperswitch_connectors/src/connectors/redsys.rs:722-728 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/utils.rs:905— crates/hyperswitch_connectors/src/utils.rs:905-911 | crates/hyperswitch_connectors/src/utils.rs:1999-2005 | crates/hyperswitch_connectors/src/utils.rs:2158-2164 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/configs/dimension_state.rs:274— crates/router/src/core/configs/dimension_state.rs:274-280 | crates/router/src/core/configs/dimension_state.rs:294-300 | crates/router/src/core/configs/dimension_state.rs:402-408 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/mandate/utils.rs:44— crates/router/src/core/mandate/utils.rs:44-50 | crates/router/src/core/utils.rs:2143-2149 | crates/router/src/core/webhooks/utils.rs:95-101 — before extracting anything, compare `crates/router/src/core/mandate/utils.rs` and `crates/router/src/core/utils.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/router/src/core/user.rs:110— crates/router/src/core/user.rs:110-116 | crates/router/src/core/user.rs:396-402 | crates/router/src/core/user.rs:2251-2257 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/routes/routing.rs:77— crates/router/src/routes/routing.rs:77-83 | crates/router/src/routes/routing.rs:168-174 | crates/router/src/routes/routing.rs:485-491 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/calida/transformers.rs:53— crates/hyperswitch_connectors/src/connectors/calida/transformers.rs:53-59 | crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:293-299 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:131-137 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 3) crates/hyperswitch_connectors/src/connectors/nomupay.rs:225— crates/hyperswitch_connectors/src/connectors/nomupay.rs:225-231 | crates/hyperswitch_connectors/src/connectors/worldpay/payout_transformers.rs:76-82 | crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs:63-69 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 3) crates/hyperswitch_connectors/src/utils.rs:2644— crates/hyperswitch_connectors/src/utils.rs:2644-2650 | crates/hyperswitch_connectors/src/utils.rs:3136-3142 | crates/router/src/connector/utils.rs:980-986 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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) crates/hyperswitch_connectors/src/connectors/bluesnap.rs:778— crates/hyperswitch_connectors/src/connectors/bluesnap.rs:778-786 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:344-350 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:771-778 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bluesnap.rs` and `crates/hyperswitch_connectors/src/connectors/dwolla.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/hyperswitch_connectors/src/connectors/multisafepay.rs:190— crates/hyperswitch_connectors/src/connectors/multisafepay.rs:190-196 | crates/hyperswitch_connectors/src/connectors/multisafepay.rs:375-383 | crates/hyperswitch_connectors/src/connectors/multisafepay.rs:470-478 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/smithy-core/src/types.rs:172— crates/smithy-core/src/types.rs:172-178 | crates/smithy-core/src/types.rs:213-219 | crates/smithy-core/src/types.rs:221-227 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17–18 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1882— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1882-1898 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2007-2024 — both copies are in the same file, so extract the block into 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–18 lines × 2) crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs:368— crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs:368-384 | crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs:271-288 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17–18 lines × 2) crates/hyperswitch_connectors/src/connectors/paypal.rs:205— crates/hyperswitch_connectors/src/connectors/paypal.rs:205-221 | crates/hyperswitch_connectors/src/connectors/paypal.rs:411-428 — both copies are in the same file, so extract the block into 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–18 lines × 2) crates/router/src/core/conditional_config.rs:179— crates/router/src/core/conditional_config.rs:179-195 | crates/router/src/core/surcharge_decision_config.rs:114-131 — before extracting anything, compare `crates/router/src/core/conditional_config.rs` and `crates/router/src/core/surcharge_decision_config.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–18 lines × 2) crates/router/src/core/payments/operations/payment_complete_authorize.rs:137— crates/router/src/core/payments/operations/payment_complete_authorize.rs:137-153 | crates/router/src/core/payments/operations/payment_update.rs:155-172 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_complete_authorize.rs` and `crates/router/src/core/payments/operations/payment_update.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–18 lines × 2) crates/router/src/core/payments/transformers.rs:1362— crates/router/src/core/payments/transformers.rs:1362-1379 | crates/router/src/core/relay/utils.rs:710-726 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17–18 lines × 2) crates/router/src/core/refunds.rs:1773— crates/router/src/core/refunds.rs:1773-1789 | crates/router/src/core/refunds_v2.rs:1261-1278 — before extracting anything, compare `crates/router/src/core/refunds.rs` and `crates/router/src/core/refunds_v2.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–18 lines × 2) crates/router/src/core/webhooks/incoming.rs:1411— crates/router/src/core/webhooks/incoming.rs:1411-1428 | crates/router/src/core/webhooks/incoming.rs:1492-1508 — both copies are in the same file, so extract the block into 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–18 lines × 2) crates/router/src/core/webhooks/outgoing.rs:983— crates/router/src/core/webhooks/outgoing.rs:983-999 | crates/router/src/core/webhooks/outgoing_v2.rs:305-322 — before extracting anything, compare `crates/router/src/core/webhooks/outgoing.rs` and `crates/router/src/core/webhooks/outgoing_v2.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–18 lines × 2) crates/router/src/db/api_keys.rs:78— crates/router/src/db/api_keys.rs:78-95 | crates/router/src/db/api_keys.rs:124-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.
Duplicated block (17–18 lines × 2) crates/router/src/services/authentication.rs:4476— crates/router/src/services/authentication.rs:4476-4493 | crates/router/src/services/authentication.rs:4743-4759 — both copies are in the same file, so extract the block into 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–18 lines × 2) crates/router/src/types/storage/payment_link.rs:51— crates/router/src/types/storage/payment_link.rs:51-67 | crates/router/src/types/storage/payment_link.rs:101-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.
Duplicated block (17–18 lines × 2) crates/storage_impl/src/business_profile.rs:1058— crates/storage_impl/src/business_profile.rs:1058-1075 | crates/storage_impl/src/business_profile.rs:1106-1122 — both copies are in the same file, so extract the block into 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 × 5) crates/diesel_models/src/query/user/sample_data.rs:102— crates/diesel_models/src/query/user/sample_data.rs:102-110 | crates/diesel_models/src/query/user/sample_data.rs:129-137 | crates/diesel_models/src/query/user/sample_data.rs:154-162 | crates/diesel_models/src/query/user/sample_data.rs:180-188 | crates/diesel_models/src/query/user/sample_data.rs:206-214 — 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 (9 lines × 5) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3156— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3156-3164 | crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:213-221 | crates/hyperswitch_connectors/src/connectors/breadpay/transformers.rs:115-123 | crates/hyperswitch_connectors/src/connectors/celero/transformers.rs:202-210 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:836-844 — `crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 76 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 5) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3285— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3285-3293 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3512-3520 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3820-3828 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3987-3995 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:6966-6974 — 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 (9 lines × 5) crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:947— crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:947-955 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2468-2476 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:384-392 | crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:428-436 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:511-519 — `crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 5) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1152— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1152-1160 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2035-2043 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:638-646 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2791-2799 | crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs:199-207 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 5) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1151— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1151-1159 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2034-2042 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:637-645 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2790-2798 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:421-429 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 5) crates/hyperswitch_connectors/src/connectors/billwerk.rs:580— crates/hyperswitch_connectors/src/connectors/billwerk.rs:580-588 | crates/hyperswitch_connectors/src/connectors/celero.rs:495-503 | crates/hyperswitch_connectors/src/connectors/dlocal.rs:491-499 | crates/hyperswitch_connectors/src/connectors/square.rs:637-645 | crates/hyperswitch_connectors/src/connectors/stax.rs:654-662 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/billwerk.rs` and `crates/hyperswitch_connectors/src/connectors/celero.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 5) crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:399— crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:399-407 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:141-149 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:83-91 | crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs:682-690 | crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs:182-190 — `crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 154 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 5) crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs:81— crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs:81-89 | crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:697-705 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:283-291 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:919-927 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1071-1079 — `crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 5) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:202— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:202-210 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2949-2957 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3030-3038 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3831-3839 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3978-3986 — 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 (9 lines × 5) crates/router/src/services/authentication.rs:1120— crates/router/src/services/authentication.rs:1120-1128 | crates/router/src/services/authentication.rs:1260-1268 | crates/router/src/services/authentication.rs:2165-2173 | crates/router/src/services/authentication.rs:2925-2933 | crates/router/src/services/authentication.rs:2991-2999 — 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 (9 lines × 5) crates/hyperswitch_connectors/src/connectors/bambora.rs:643— crates/hyperswitch_connectors/src/connectors/bambora.rs:643-651 | crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs:195-203 | crates/hyperswitch_connectors/src/connectors/mollie.rs:886-894 | crates/hyperswitch_connectors/src/connectors/noon.rs:841-849 | crates/hyperswitch_connectors/src/connectors/payme.rs:420-428 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bambora.rs` and `crates/hyperswitch_connectors/src/connectors/mollie.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 5) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:154— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:154-162 | crates/router/src/core/payments/operations/payment_capture_v2.rs:130-138 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:142-150 | crates/router/src/core/payments/operations/payment_get.rs:141-149 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:133-141 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/payment_capture_v2.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 2) crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:118— crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:118-143 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs:110-135 — before extracting anything, compare `crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs` and `crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/analytics/src/sdk_events/metrics/average_payment_time.rs:41— crates/analytics/src/sdk_events/metrics/average_payment_time.rs:41-66 | crates/analytics/src/sdk_events/metrics/load_time.rs:41-66 — before extracting anything, compare `crates/analytics/src/sdk_events/metrics/average_payment_time.rs` and `crates/analytics/src/sdk_events/metrics/load_time.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 2) crates/common_enums/src/enums.rs:1672— crates/common_enums/src/enums.rs:1672-1697 | crates/common_enums/src/enums.rs:1836-1861 — both copies are in the same file, so extract the block into 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) crates/router/src/core/disputes.rs:461— crates/router/src/core/disputes.rs:461-486 | crates/router/src/core/disputes.rs:591-616 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/flows/complete_authorize_flow.rs:568— crates/router/src/core/payments/flows/complete_authorize_flow.rs:568-593 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:631-656 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/transformers.rs:3190— crates/router/src/core/payments/transformers.rs:3190-3215 | crates/router/src/core/payments/transformers.rs:3347-3372 — both copies are in the same file, so extract the block into 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) crates/router/src/core/pm_auth.rs:56— crates/router/src/core/pm_auth.rs:56-81 | crates/router/src/core/pm_auth.rs:730-755 — both copies are in the same file, so extract the block into 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) crates/router/src/core/user_role.rs:390— crates/router/src/core/user_role.rs:390-415 | crates/router/src/core/user_role.rs:450-475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) crates/router/src/routes/profiles.rs:78— crates/router/src/routes/profiles.rs:78-103 | crates/router/src/routes/profiles.rs:313-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) crates/router/src/services/kafka/fraud_check.rs:38— crates/router/src/services/kafka/fraud_check.rs:38-63 | crates/router/src/services/kafka/fraud_check_event.rs:37-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 (26 lines × 2) crates/router/src/workflows/payment_method_modular_backward_compat.rs:918— crates/router/src/workflows/payment_method_modular_backward_compat.rs:918-943 | crates/router/src/workflows/payment_method_modular_forward_compat.rs:596-621 — before extracting anything, compare `crates/router/src/workflows/payment_method_modular_backward_compat.rs` and `crates/router/src/workflows/payment_method_modular_forward_compat.rs` as WHOLE FILES: this scan already matched 5 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 (26 lines × 2) crates/storage_impl/src/payments/payment_attempt.rs:1456— crates/storage_impl/src/payments/payment_attempt.rs:1456-1481 | crates/storage_impl/src/payments/payment_attempt.rs:1618-1643 — both copies are in the same file, so extract the block into 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 × 3) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1655— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1655-1672 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3533-3550 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1807-1824 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 47 separate duplicated blocks between them, totalling at least 513 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 (18 lines × 3) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2359— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2359-2376 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3360-3377 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:5542-5559 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (18 lines × 3) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4621— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4621-4638 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4759-4776 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4897-4914 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_domain_models/src/type_encryption.rs:154— crates/hyperswitch_domain_models/src/type_encryption.rs:154-171 | crates/hyperswitch_domain_models/src/type_encryption.rs:393-410 | crates/hyperswitch_domain_models/src/type_encryption.rs:866-883 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_domain_models/src/type_encryption.rs:263— crates/hyperswitch_domain_models/src/type_encryption.rs:263-280 | crates/hyperswitch_domain_models/src/type_encryption.rs:501-518 | crates/hyperswitch_domain_models/src/type_encryption.rs:969-986 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/admin.rs:3840— crates/router/src/core/admin.rs:3840-3857 | crates/router/src/core/admin.rs:4241-4258 | crates/router/src/core/admin.rs:4476-4493 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/fraud_check/flows/fulfillment_flow.rs:115— crates/router/src/core/fraud_check/flows/fulfillment_flow.rs:115-132 | crates/router/src/core/utils.rs:1608-1625 | crates/router/src/core/utils.rs:2173-2190 — before extracting anything, compare `crates/router/src/core/fraud_check/flows/fulfillment_flow.rs` and `crates/router/src/core/utils.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 99 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 × 3) crates/router/src/core/payments/transformers.rs:220— crates/router/src/core/payments/transformers.rs:220-237 | crates/router/src/core/payments/transformers.rs:1024-1041 | crates/router/src/core/payments/transformers.rs:8520-8537 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payouts.rs:2388— crates/router/src/core/payouts.rs:2388-2405 | crates/router/src/core/payouts.rs:2632-2649 | crates/router/src/core/payouts.rs:3222-3239 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/utils/user_role.rs:362— crates/router/src/utils/user_role.rs:362-379 | crates/router/src/utils/user_role.rs:407-424 | crates/router/src/utils/user_role.rs:453-470 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/storage_impl/src/business_profile.rs:774— crates/storage_impl/src/business_profile.rs:774-791 | crates/storage_impl/src/business_profile.rs:826-843 | crates/storage_impl/src/business_profile.rs:1260-1277 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/storage_impl/src/business_profile.rs:1953— crates/storage_impl/src/business_profile.rs:1953-1970 | crates/storage_impl/src/business_profile.rs:2314-2331 | crates/storage_impl/src/business_profile.rs:2375-2392 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/analytics/src/sqlx.rs:222— crates/analytics/src/sqlx.rs:222-227 | crates/analytics/src/sqlx.rs:407-412 | crates/analytics/src/sqlx.rs:892-897 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/analytics/src/sqlx.rs:732— crates/analytics/src/sqlx.rs:732-737 | crates/analytics/src/sqlx.rs:896-901 | crates/analytics/src/sqlx.rs:1000-1005 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/diesel_models/src/query/generics.rs:481— crates/diesel_models/src/query/generics.rs:481-486 | crates/diesel_models/src/query/generics.rs:575-580 | crates/diesel_models/src/query/generics.rs:619-624 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/diesel_models/src/query/user/sample_data.rs:94— crates/diesel_models/src/query/user/sample_data.rs:94-99 | crates/diesel_models/src/query/user/sample_data.rs:146-151 | crates/diesel_models/src/query/user/sample_data.rs:172-177 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4377— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4377-4382 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4606-4611 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4870-4875 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/router/src/core/payment_methods/transformers.rs:491— crates/router/src/core/payment_methods/transformers.rs:491-496 | crates/router/src/core/payment_methods/transformers.rs:517-522 | crates/router/src/core/payment_methods/transformers.rs:608-613 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/router/src/core/refunds.rs:2622— crates/router/src/core/refunds.rs:2622-2627 | crates/router/src/workflows/dispute_list.rs:185-190 | crates/router/src/workflows/process_dispute.rs:192-197 — before extracting anything, compare `crates/router/src/core/refunds.rs` and `crates/router/src/workflows/process_dispute.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/router/src/types/storage/refund.rs:342— crates/router/src/types/storage/refund.rs:342-347 | crates/router/src/types/storage/refund.rs:577-582 | crates/router/src/types/storage/refund.rs:646-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 (6 lines × 3) crates/hyperswitch_connectors/src/connectors/moneris.rs:215— crates/hyperswitch_connectors/src/connectors/moneris.rs:215-220 | crates/hyperswitch_connectors/src/connectors/payu.rs:276-281 | crates/hyperswitch_connectors/src/connectors/volt.rs:229-234 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/moneris.rs` and `crates/hyperswitch_connectors/src/connectors/payu.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 (6 lines × 3) crates/router/src/db/dispute.rs:251— crates/router/src/db/dispute.rs:251-256 | crates/router/src/db/file.rs:129-134 | crates/scheduler/src/db/process_tracker.rs:131-136 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) crates/router/src/core/unified_connector_service.rs:4551— crates/router/src/core/unified_connector_service.rs:4551-4558 | crates/router/src/core/unified_connector_service.rs:4648-4655 | crates/router/src/core/unified_connector_service.rs:4741-4746 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/router/src/services/authentication.rs:1754— crates/router/src/services/authentication.rs:1754-1759 | crates/router/src/services/authentication.rs:3038-3044 | crates/router/src/services/authentication.rs:3161-3167 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×11
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/diesel_models/src/query/generics.rs:266— crates/diesel_models/src/query/generics.rs:266-285 | crates/diesel_models/src/query/generics.rs:344-362 | crates/diesel_models/src/query/generics.rs:390-408 | crates/diesel_models/src/query/generics.rs:479-498 | crates/diesel_models/src/query/generics.rs:526-545 | crates/diesel_models/src/query/generics.rs:573-589 | crates/diesel_models/src/query/generics.rs:617-630 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/aci.rs:472— crates/hyperswitch_connectors/src/connectors/aci.rs:472-482 | crates/hyperswitch_connectors/src/connectors/aci.rs:573-583 | crates/hyperswitch_connectors/src/connectors/adyen.rs:883-893 | crates/hyperswitch_connectors/src/connectors/adyen.rs:988-998 | crates/hyperswitch_connectors/src/connectors/bambora.rs:95-105 | crates/hyperswitch_connectors/src/connectors/checkout.rs:97-107 | crates/hyperswitch_connectors/src/connectors/square.rs:87-97 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/adyen.rs:550— crates/hyperswitch_connectors/src/connectors/adyen.rs:550-560 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:330-340 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:360-370 | crates/hyperswitch_connectors/src/connectors/checkout.rs:410-420 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:447-457 | crates/hyperswitch_connectors/src/connectors/paypal.rs:947-957 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:405-415 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/facilitapay.rs:194— crates/hyperswitch_connectors/src/connectors/facilitapay.rs:194-210 | crates/hyperswitch_connectors/src/connectors/finix.rs:131-147 | crates/hyperswitch_connectors/src/connectors/gocardless.rs:213-229 | crates/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs:298-314 | crates/hyperswitch_connectors/src/connectors/mollie.rs:279-295 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:370-386 | crates/hyperswitch_connectors/src/connectors/stax.rs:211-227 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/worldpay.rs:281— crates/hyperswitch_connectors/src/connectors/worldpay.rs:281-306 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:387-425 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:535-582 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:652-690 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:783-808 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:907-930 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:1018-1047 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:178— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:178-309 | crates/router/src/core/payments/operations/payment_attempt_record.rs:126-237 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:166-291 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:304-421 | crates/router/src/core/payments/operations/payment_create_intent.rs:101-196 | crates/router/src/core/payments/operations/payment_update_intent.rs:149-332 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:157-280 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/router/src/core/payments/operations/payment_cancel.rs:54— crates/router/src/core/payments/operations/payment_cancel.rs:54-238 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:58-220 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:52-211 | crates/router/src/core/payments/operations/payment_confirm_external_vault_proxy.rs:191-527 | crates/router/src/core/payments/operations/payment_reject.rs:50-231 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:58-226 | crates/router/src/core/payments/operations/payments_incremental_authorization.rs:63-205 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/router/src/core/unified_connector_service.rs:3652— crates/router/src/core/unified_connector_service.rs:3652-3666 | crates/router/src/core/unified_connector_service.rs:3682-3696 | crates/router/src/core/unified_connector_service.rs:3742-3756 | crates/router/src/core/unified_connector_service.rs:3772-3786 | crates/router/src/core/unified_connector_service.rs:3802-3816 | crates/router/src/core/unified_connector_service.rs:3832-3846 | crates/router/src/core/unified_connector_service.rs:3862-3876 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/router/src/routes/payment_methods.rs:149— crates/router/src/routes/payment_methods.rs:149-187 | crates/router/src/routes/payment_methods.rs:286-326 | crates/router/src/routes/payment_methods.rs:335-379 | crates/router/src/routes/payment_methods.rs:387-428 | crates/router/src/routes/payment_methods.rs:961-1007 | crates/router/src/routes/payment_methods.rs:1761-1799 | crates/router/src/routes/payment_methods.rs:2160-2202 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/router/src/types/storage/dispute.rs:47— crates/router/src/types/storage/dispute.rs:47-130 | crates/router/src/types/storage/dispute.rs:137-198 | crates/router/src/types/storage/dispute.rs:205-261 | crates/router/src/types/storage/payment_link.rs:40-86 | crates/router/src/types/storage/refund.rs:96-187 | crates/router/src/types/storage/refund.rs:196-272 | crates/router/src/types/storage/refund.rs:358-428 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/storage_impl/src/payments/payment_attempt.rs:66— crates/storage_impl/src/payments/payment_attempt.rs:66-93 | crates/storage_impl/src/payments/payment_attempt.rs:134-161 | crates/storage_impl/src/payments/payment_attempt.rs:206-232 | crates/storage_impl/src/payments/payment_attempt.rs:242-267 | crates/storage_impl/src/payments/payment_attempt.rs:304-330 | crates/storage_impl/src/payments/payment_attempt.rs:371-399 | crates/storage_impl/src/payments/payment_attempt.rs:491-518 — 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 (34 lines × 2) crates/common_enums/src/enums.rs:1601— crates/common_enums/src/enums.rs:1601-1634 | crates/common_enums/src/enums.rs:1760-1793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (34 lines × 2) REDACTED:1476— REDACTED:1476-1509 | REDACTED:1541-1574 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (34 lines × 2) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1456— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1456-1489 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1521-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.
Duplicated block (34 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4768— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4768-4801 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4906-4939 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (34 lines × 2) crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:398— crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:398-431 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:658-691 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (34 lines × 2) crates/hyperswitch_interfaces/src/conversion_impls.rs:236— crates/hyperswitch_interfaces/src/conversion_impls.rs:236-269 | crates/hyperswitch_interfaces/src/conversion_impls.rs:1134-1167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (34 lines × 2) crates/router/src/core/disputes.rs:378— crates/router/src/core/disputes.rs:378-411 | crates/router/src/core/refunds.rs:2003-2036 — before extracting anything, compare `crates/router/src/core/disputes.rs` and `crates/router/src/core/refunds.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (34 lines × 2) crates/router/src/core/payments.rs:264— crates/router/src/core/payments.rs:264-297 | crates/router/src/core/payments.rs:375-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (34 lines × 2) crates/router/src/services/kafka/payment_attempt.rs:361— crates/router/src/services/kafka/payment_attempt.rs:361-394 | crates/router/src/services/kafka/payment_attempt_event.rs:363-396 — before extracting anything, compare `crates/router/src/services/kafka/payment_attempt.rs` and `crates/router/src/services/kafka/payment_attempt_event.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 230 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (34 lines × 2) crates/router/src/types/api/connector_mapping.rs:421— crates/router/src/types/api/connector_mapping.rs:421-454 | crates/router/src/types/api/feature_matrix.rs:349-382 — before extracting anything, compare `crates/router/src/types/api/connector_mapping.rs` and `crates/router/src/types/api/feature_matrix.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 401 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (34 lines × 2) crates/storage_impl/src/payouts/payout_attempt.rs:682— crates/storage_impl/src/payouts/payout_attempt.rs:682-715 | crates/storage_impl/src/payouts/payout_attempt.rs:761-794 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/authipay.rs:115— crates/hyperswitch_connectors/src/connectors/authipay.rs:115-142 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:99-126 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/authipay.rs` and `crates/hyperswitch_connectors/src/connectors/fiserv.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (28 lines × 2) crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1379— crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1379-1406 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1439-1466 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_interfaces/src/api/gateway.rs:395— crates/hyperswitch_interfaces/src/api/gateway.rs:395-422 | crates/hyperswitch_interfaces/src/api/gateway.rs:540-567 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28 lines × 2) crates/router/src/compatibility/stripe/payment_intents/types.rs:292— crates/router/src/compatibility/stripe/payment_intents/types.rs:292-319 | crates/router/src/compatibility/stripe/setup_intents/types.rs:185-212 — `crates/router/src/compatibility/stripe/payment_intents/types.rs` and `crates/router/src/compatibility/stripe/setup_intents/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 63 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 (28 lines × 2) crates/router/src/core/admin.rs:2103— crates/router/src/core/admin.rs:2103-2130 | crates/router/src/core/admin.rs:2281-2308 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payment_methods/network_tokenization.rs:858— crates/router/src/core/payment_methods/network_tokenization.rs:858-885 | crates/router/src/core/payment_methods/network_tokenization.rs:926-953 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/transformers.rs:357— crates/router/src/core/payments/transformers.rs:357-384 | crates/router/src/core/payments/transformers.rs:659-686 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payouts.rs:1901— crates/router/src/core/payouts.rs:1901-1928 | crates/router/src/core/payouts.rs:1943-1970 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28 lines × 2) crates/router/src/core/unified_authentication_service.rs:145— crates/router/src/core/unified_authentication_service.rs:145-172 | crates/router/src/core/unified_authentication_service.rs:370-397 — both copies are in the same file, so extract the block into 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) crates/router/src/db/ephemeral_key.rs:112— crates/router/src/db/ephemeral_key.rs:112-139 | crates/router/src/db/ephemeral_key.rs:209-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 (28 lines × 2) crates/router/src/services/authentication.rs:1870— crates/router/src/services/authentication.rs:1870-1897 | crates/router/src/services/authentication.rs:2399-2426 — both copies are in the same file, so extract the block into 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–15 lines × 2) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1905— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1905-1917 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:328-342 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 527 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13–15 lines × 2) crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:246— crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:246-258 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:435-449 — both copies are in the same file, so extract the block into 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–15 lines × 2) crates/hyperswitch_connectors/src/connectors/tokenio.rs:166— crates/hyperswitch_connectors/src/connectors/tokenio.rs:166-178 | crates/hyperswitch_connectors/src/connectors/tokenio.rs:189-203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–15 lines × 2) crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:88— crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:88-100 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:632-646 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–15 lines × 2) crates/hyperswitch_interfaces/src/integrity.rs:142— crates/hyperswitch_interfaces/src/integrity.rs:142-154 | crates/hyperswitch_interfaces/src/integrity.rs:216-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–15 lines × 2) crates/router/src/core/payment_methods.rs:1887— crates/router/src/core/payment_methods.rs:1887-1901 | crates/router/src/core/payment_methods.rs:2003-2015 — both copies are in the same file, so extract the block into 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–15 lines × 2) crates/router/src/core/payment_methods/cards.rs:5932— crates/router/src/core/payment_methods/cards.rs:5932-5946 | crates/router/src/core/payment_methods/cards.rs:5996-6008 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–15 lines × 2) crates/router/src/core/payments/operations/payment_confirm_intent.rs:217— crates/router/src/core/payments/operations/payment_confirm_intent.rs:217-229 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:363-377 — both copies are in the same file, so extract the block into 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–15 lines × 2) crates/router/src/core/unified_connector_service.rs:4865— crates/router/src/core/unified_connector_service.rs:4865-4877 | crates/router/src/core/unified_connector_service.rs:4999-5013 — both copies are in the same file, so extract the block into 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–15 lines × 2) crates/router/src/routes/payments.rs:827— crates/router/src/routes/payments.rs:827-841 | crates/router/src/routes/payments.rs:912-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.
Duplicated block (13–15 lines × 2) crates/router/src/routes/payouts.rs:140— crates/router/src/routes/payouts.rs:140-154 | crates/router/src/routes/payouts.rs:206-218 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
smithy::parse_serde_attributes (cognitive 78) crates/smithy/src/lib.rs:1137— smithy::parse_serde_attributes has cognitive complexity 78 (threshold 15). Drivers by points: if/else 31 (77 pts), loops 1 (nesting depth added 46). 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.
smithy::parse_smithy_field_attributes (cognitive 72) crates/smithy/src/lib.rs:1381— smithy::parse_smithy_field_attributes has cognitive complexity 72 (threshold 15). Drivers by points: if/else 20 (58 pts), match/switch 2 (12 pts), boolean chains 1, loops 1 (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
smithy::parse_serde_enum_attributes (cognitive 63) crates/smithy/src/lib.rs:1231— smithy::parse_serde_enum_attributes has cognitive complexity 63 (threshold 15). Drivers by points: if/else 24 (62 pts), loops 1 (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
smithy::generate_enum_impl (cognitive 47) crates/smithy/src/lib.rs:358— smithy::generate_enum_impl has cognitive complexity 47 (threshold 15). Drivers by points: if/else 22 (38 pts), match/switch 3 (5 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
smithy::extract_namespace_and_mixin (cognitive 25) crates/smithy/src/lib.rs:957— smithy::extract_namespace_and_mixin has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 1 (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.
smithy::generate_struct_impl (cognitive 19) crates/smithy/src/lib.rs:36— smithy::generate_struct_impl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, match/switch 1 (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.
smithy::extract_enum_variants (cognitive 19) crates/smithy/src/lib.rs:1031— smithy::extract_enum_variants has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (7 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.
smithy::parse_range (cognitive 19) crates/smithy/src/lib.rs:1503— smithy::parse_range has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (19 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. This shape REPEATS in the file: one other method here (smithy::parse_length) 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.
smithy::parse_length (cognitive 19) crates/smithy/src/lib.rs:1562— smithy::parse_length has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (19 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. This shape REPEATS in the file: one other method here (smithy::parse_range) 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.
smithy::extract_documentation (cognitive 17) crates/smithy/src/lib.rs:1481— smithy::extract_documentation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Duplicated block (19 lines × 3) crates/analytics/src/payment_intents/core.rs:107— crates/analytics/src/payment_intents/core.rs:107-125 | crates/analytics/src/payments/core.rs:115-133 | crates/analytics/src/refunds/core.rs:110-128 — `crates/analytics/src/payment_intents/core.rs` and `crates/analytics/src/payments/core.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 60 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 (19 lines × 3) crates/analytics/src/sqlx.rs:564— crates/analytics/src/sqlx.rs:564-582 | crates/analytics/src/sqlx.rs:1247-1265 | crates/analytics/src/sqlx.rs:1293-1311 — all 3 copies are in the same file, so extract the block into one function there and call 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 (19 lines × 3) REDACTED:955— REDACTED:955-973 | REDACTED:1152-1170 | REDACTED:1293-1311 — all 3 copies are in the same file, so extract the block into one function there and call 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 (19 lines × 3) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2963— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2963-2981 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4351-4369 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1891-1909 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 527 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 (19 lines × 3) crates/router/src/core/payments/operations/payment_session.rs:344— crates/router/src/core/payments/operations/payment_session.rs:344-362 | crates/router/src/core/payments/operations/payment_status.rs:84-102 | crates/router/src/core/payments/operations/payment_update.rs:603-621 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_session.rs` and `crates/router/src/core/payments/operations/payment_status.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 3) crates/router/src/services/authentication.rs:983— crates/router/src/services/authentication.rs:983-1001 | crates/router/src/services/authentication.rs:1068-1086 | crates/router/src/services/authentication.rs:1224-1242 — all 3 copies are in the same file, so extract the block into one function there and call 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 (19 lines × 3) crates/router/src/services/authentication.rs:4237— crates/router/src/services/authentication.rs:4237-4255 | crates/router/src/services/authentication.rs:4374-4392 | crates/router/src/services/authentication.rs:4463-4481 — all 3 copies are in the same file, so extract the block into one function there and call 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 (19 lines × 3) crates/storage_impl/src/business_profile.rs:891— crates/storage_impl/src/business_profile.rs:891-909 | crates/storage_impl/src/business_profile.rs:960-978 | crates/storage_impl/src/business_profile.rs:1038-1056 — all 3 copies are in the same file, so extract the block into one function there and call 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 (19 lines × 3) crates/storage_impl/src/business_profile.rs:1946— crates/storage_impl/src/business_profile.rs:1946-1964 | crates/storage_impl/src/business_profile.rs:2185-2203 | crates/storage_impl/src/business_profile.rs:2245-2263 — all 3 copies are in the same file, so extract the block into one function there and call 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 (19 lines × 3) crates/router/src/core/fraud_check/flows/checkout_flow.rs:280— crates/router/src/core/fraud_check/flows/checkout_flow.rs:280-298 | crates/router/src/core/fraud_check/flows/sale_flow.rs:232-250 | crates/router/src/core/fraud_check/flows/transaction_flow.rs:199-217 — before extracting anything, compare `crates/router/src/core/fraud_check/flows/checkout_flow.rs` and `crates/router/src/core/fraud_check/flows/sale_flow.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 3) crates/common_enums/src/enums.rs:1500— crates/common_enums/src/enums.rs:1500-1516 | crates/common_enums/src/enums.rs:1655-1671 | crates/common_enums/src/enums.rs:1818-1834 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 3) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3597— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3597-3613 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4330-4346 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1870-1886 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 46 separate duplicated blocks between them, totalling at least 601 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 × 3) crates/router/src/core/payments/operations/payment_approve.rs:82— crates/router/src/core/payments/operations/payment_approve.rs:82-98 | crates/router/src/core/payments/operations/payment_reject.rs:144-160 | crates/router/src/core/payments/operations/payments_incremental_authorization.rs:118-134 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_approve.rs` and `crates/router/src/core/payments/operations/payment_reject.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 3) crates/router/src/core/payments/operations/payment_approve.rs:148— crates/router/src/core/payments/operations/payment_approve.rs:148-164 | crates/router/src/core/payments/operations/payment_reject.rs:126-142 | crates/router/src/core/payments/operations/payment_status.rs:419-435 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_approve.rs` and `crates/router/src/core/payments/operations/payment_reject.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 3) crates/router/src/core/payments/operations/payment_confirm.rs:248— crates/router/src/core/payments/operations/payment_confirm.rs:248-264 | crates/router/src/core/payments/operations/payment_confirm.rs:276-292 | crates/router/src/core/payments/operations/payment_confirm.rs:602-618 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 3) crates/router/src/core/payments/operations/payment_response.rs:1336— crates/router/src/core/payments/operations/payment_response.rs:1336-1352 | crates/router/src/core/payments/operations/payment_response.rs:2438-2454 | crates/router/src/core/payments/operations/payment_response.rs:4722-4738 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 3) crates/router/src/core/user.rs:788— crates/router/src/core/user.rs:788-804 | crates/router/src/core/user_role/role.rs:507-523 | crates/router/src/types/domain/user.rs:548-564 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (17 lines × 3) crates/router/src/core/user.rs:3538— crates/router/src/core/user.rs:3538-3554 | crates/router/src/core/user.rs:3733-3749 | crates/router/src/core/user.rs:3865-3881 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 3) crates/router/src/services/authentication.rs:4050— crates/router/src/services/authentication.rs:4050-4066 | crates/router/src/services/authentication.rs:5305-5321 | crates/router/src/services/authentication.rs:5388-5404 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 3) crates/storage_impl/src/payments/payment_attempt.rs:3056— crates/storage_impl/src/payments/payment_attempt.rs:3056-3072 | crates/storage_impl/src/payments/payment_attempt.rs:3093-3109 | crates/storage_impl/src/payments/payment_attempt.rs:3237-3253 — all 3 copies are in the same file, so extract the block into one function there and call 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–15 lines × 2) crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs:783— crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs:783-797 | crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs:862-875 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2226— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2226-2239 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4147-4161 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:4364— crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:4364-4378 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:4417-4430 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/operations/payment_confirm.rs:840— crates/router/src/core/payments/operations/payment_confirm.rs:840-854 | crates/router/src/core/payments/operations/payment_create.rs:630-643 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_create.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 2) crates/router/src/core/payments/tokenization.rs:471— crates/router/src/core/payments/tokenization.rs:471-485 | crates/router/src/core/payments/tokenization.rs:948-961 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payouts/helpers.rs:546— crates/router/src/core/payouts/helpers.rs:546-560 | crates/router/src/core/payouts/helpers.rs:570-583 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) crates/router/src/core/user_role.rs:748— crates/router/src/core/user_role.rs:748-762 | crates/router/src/core/user_role.rs:834-847 — both copies are in the same file, so extract the block into 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) crates/router/src/core/user_role.rs:813— crates/router/src/core/user_role.rs:813-826 | crates/router/src/core/user_role.rs:856-870 — both copies are in the same file, so extract the block into 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) crates/router/src/db/address.rs:466— crates/router/src/db/address.rs:466-480 | crates/router/src/db/address.rs:551-564 — both copies are in the same file, so extract the block into 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) crates/router/src/routes/payouts.rs:268— crates/router/src/routes/payouts.rs:268-281 | crates/router/src/routes/payouts.rs:301-315 — both copies are in the same file, so extract the block into 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 × 4) crates/diesel_models/src/payment_method.rs:535— crates/diesel_models/src/payment_method.rs:535-547 | crates/diesel_models/src/payment_method.rs:568-580 | crates/diesel_models/src/payment_method.rs:598-610 | crates/diesel_models/src/payment_method.rs:751-763 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 4) crates/hyperswitch_connectors/src/connectors/affirm/transformers.rs:377— crates/hyperswitch_connectors/src/connectors/affirm/transformers.rs:377-389 | crates/hyperswitch_connectors/src/connectors/coingate/transformers.rs:192-204 | crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs:377-389 | crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs:411-423 — 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 (13 lines × 4) crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:235— crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:235-247 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:420-432 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:336-348 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:426-438 — `crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 60 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 4) crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:735— crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:735-747 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:765-777 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:676-688 | crates/hyperswitch_connectors/src/connectors/moneris.rs:922-934 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/elavon_pg.rs` and `crates/hyperswitch_connectors/src/connectors/ilixium.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 4) crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:302— crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:302-314 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:391-403 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:410-422 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:1502-1514 — `crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 85 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 4) crates/hyperswitch_connectors/src/utils.rs:2738— crates/hyperswitch_connectors/src/utils.rs:2738-2750 | crates/hyperswitch_connectors/src/utils.rs:3234-3246 | crates/router/src/connector/utils.rs:1037-1049 | crates/router/src/connector/utils.rs:1177-1189 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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 × 4) crates/router/src/core/payment_methods/cards.rs:5418— crates/router/src/core/payment_methods/cards.rs:5418-5430 | crates/router/src/core/payment_methods/cards.rs:5435-5447 | crates/router/src/core/superposition_sdk_config.rs:64-76 | crates/router/src/core/superposition_sdk_config.rs:81-93 — before extracting anything, compare `crates/router/src/core/payment_methods/cards.rs` and `crates/router/src/core/superposition_sdk_config.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 4) crates/router/src/core/payments/tokenization.rs:472— crates/router/src/core/payments/tokenization.rs:472-484 | crates/router/src/core/payments/tokenization.rs:498-511 | crates/router/src/core/payments/tokenization.rs:948-960 | crates/router/src/core/payments/tokenization.rs:2380-2393 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 4) crates/router/src/core/user/dashboard_metadata.rs:374— crates/router/src/core/user/dashboard_metadata.rs:374-386 | crates/router/src/core/user/dashboard_metadata.rs:399-411 | crates/router/src/core/user/dashboard_metadata.rs:493-505 | crates/router/src/core/user/dashboard_metadata.rs:672-684 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 4) crates/router/src/services/authentication.rs:627— crates/router/src/services/authentication.rs:627-639 | crates/router/src/services/authentication.rs:732-744 | crates/router/src/services/authentication.rs:1219-1231 | crates/router/src/services/authentication.rs:3055-3067 — 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 × 3) crates/analytics/src/payment_intents/accumulator.rs:162— crates/analytics/src/payment_intents/accumulator.rs:162-166 | crates/analytics/src/payment_intents/accumulator.rs:292-296 | crates/analytics/src/payments/accumulator.rs:277-281 — `crates/analytics/src/payment_intents/accumulator.rs` and `crates/analytics/src/payments/accumulator.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 96 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 (5 lines × 3) crates/analytics/src/payment_intents/accumulator.rs:224— crates/analytics/src/payment_intents/accumulator.rs:224-228 | crates/analytics/src/payments/accumulator.rs:379-383 | crates/analytics/src/refunds/accumulator.rs:192-196 — `crates/analytics/src/payment_intents/accumulator.rs` and `crates/analytics/src/payments/accumulator.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 96 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 (5 lines × 3) crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:1135— crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:1135-1139 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:1209-1213 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:2323-2327 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:184— crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:184-188 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1599-1603 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1641-1645 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/configs/secrets_transformers.rs:36— crates/router/src/configs/secrets_transformers.rs:36-40 | crates/router/src/configs/secrets_transformers.rs:58-62 | crates/router/src/configs/secrets_transformers.rs:292-296 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/user.rs:1052— crates/router/src/core/user.rs:1052-1056 | crates/router/src/core/user.rs:1207-1211 | crates/router/src/core/user.rs:1361-1365 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/routes/cards_info.rs:45— crates/router/src/routes/cards_info.rs:45-49 | crates/router/src/routes/payment_methods.rs:716-720 | crates/router/src/routes/payment_methods.rs:1216-1220 — 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 (5 lines × 3) crates/storage_impl/src/connection.rs:21— crates/storage_impl/src/connection.rs:21-25 | crates/storage_impl/src/utils.rs:143-147 | crates/storage_impl/src/utils.rs:236-247 — before extracting anything, compare `crates/storage_impl/src/connection.rs` and `crates/storage_impl/src/utils.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) crates/external_services/src/utils.rs:98— crates/external_services/src/utils.rs:98-102 | crates/payment_methods/src/configs/settings.rs:202-206 | crates/router/src/configs/settings.rs:1951-1955 — before extracting anything, compare `crates/external_services/src/utils.rs` and `crates/payment_methods/src/configs/settings.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:277— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:277-281 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1559-1563 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager/transformers.rs:487-491 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 527 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 (38 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource.rs:605— crates/hyperswitch_connectors/src/connectors/cybersource.rs:605-642 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:532-569 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersource.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 506 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (38 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3830— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3830-3867 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3977-4014 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38 lines × 2) crates/hyperswitch_domain_models/src/business_profile.rs:286— crates/hyperswitch_domain_models/src/business_profile.rs:286-323 | crates/hyperswitch_domain_models/src/business_profile.rs:434-471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38 lines × 2) crates/router/src/core/admin.rs:4265— crates/router/src/core/admin.rs:4265-4302 | crates/router/src/core/admin.rs:4492-4529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38 lines × 2) crates/router/src/core/payments.rs:6529— crates/router/src/core/payments.rs:6529-6566 | crates/router/src/core/payments.rs:7164-7201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38 lines × 2) crates/router/src/core/payments.rs:8765— crates/router/src/core/payments.rs:8765-8802 | crates/router/src/core/payments.rs:8892-8929 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38 lines × 2) crates/router/src/core/user_role.rs:578— crates/router/src/core/user_role.rs:578-615 | crates/router/src/core/user_role.rs:653-690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38 lines × 2) crates/router/src/services/kafka/authentication.rs:75— crates/router/src/services/kafka/authentication.rs:75-112 | crates/router/src/services/kafka/authentication_event.rs:54-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (38 lines × 2) crates/storage_impl/src/payments/payment_attempt.rs:1177— crates/storage_impl/src/payments/payment_attempt.rs:1177-1214 | crates/storage_impl/src/payments/payment_attempt.rs:1252-1289 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1761— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1761-1791 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2677-2707 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (31 lines × 2) crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs:1180— crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs:1180-1210 | crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs:277-307 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (31 lines × 2) crates/hyperswitch_connectors/src/connectors/klarna.rs:701— crates/hyperswitch_connectors/src/connectors/klarna.rs:701-731 | crates/hyperswitch_connectors/src/connectors/klarna.rs:992-1022 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:904— crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:904-934 | crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:2385-2415 — both copies are in the same file, so extract the block into 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) crates/kgraph_utils/src/mca.rs:225— crates/kgraph_utils/src/mca.rs:225-255 | crates/kgraph_utils/src/mca.rs:419-449 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/operations/payment_confirm.rs:1111— crates/router/src/core/payments/operations/payment_confirm.rs:1111-1141 | crates/router/src/core/payments/operations/payment_create.rs:797-827 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_create.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (31 lines × 2) crates/router/src/services/kafka/payment_attempt.rs:83— crates/router/src/services/kafka/payment_attempt.rs:83-113 | crates/router/src/services/kafka/payment_attempt_event.rs:84-114 — before extracting anything, compare `crates/router/src/services/kafka/payment_attempt.rs` and `crates/router/src/services/kafka/payment_attempt_event.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 230 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/services/kafka/payment_attempt.rs:115— crates/router/src/services/kafka/payment_attempt.rs:115-145 | crates/router/src/services/kafka/payment_attempt_event.rs:116-146 — before extracting anything, compare `crates/router/src/services/kafka/payment_attempt.rs` and `crates/router/src/services/kafka/payment_attempt_event.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 230 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/types/api/connector_mapping.rs:345— crates/router/src/types/api/connector_mapping.rs:345-375 | crates/router/src/types/api/feature_matrix.rs:254-284 — before extracting anything, compare `crates/router/src/types/api/connector_mapping.rs` and `crates/router/src/types/api/feature_matrix.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 401 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3855— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3855-3870 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4022-4037 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4118-4133 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4208-4223 — 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 (16 lines × 4) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:311— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:311-326 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:819-834 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:225-240 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1341-1356 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 156 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 (16 lines × 4) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2060— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2060-2075 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3062-3077 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3248-3263 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1578-1593 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (16 lines × 4) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:877— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:877-892 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1005-1020 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3886-3901 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4033-4048 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 527 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 (16 lines × 4) crates/router/src/connection.rs:55— crates/router/src/connection.rs:55-70 | crates/router/src/connection.rs:90-105 | crates/router/src/connection.rs:113-128 | crates/router/src/connection.rs:136-151 — 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 (16 lines × 4) crates/router/src/core/payments/transformers.rs:150— crates/router/src/core/payments/transformers.rs:150-165 | crates/router/src/core/payments/transformers.rs:2051-2066 | crates/router/src/core/payments/transformers.rs:2388-2403 | crates/router/src/core/payments/transformers.rs:8424-8439 — 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 (16 lines × 4) crates/router/src/db/blocklist.rs:260— crates/router/src/db/blocklist.rs:260-275 | crates/router/src/db/blocklist.rs:322-338 | crates/router/src/db/blocklist.rs:541-556 | crates/router/src/db/blocklist.rs:602-617 — 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 (16 lines × 4) crates/router/src/types/transformers.rs:1039— crates/router/src/types/transformers.rs:1039-1054 | crates/router/src/types/transformers.rs:1114-1129 | crates/router/src/types/transformers.rs:1186-1201 | crates/router/src/types/transformers.rs:1373-1388 — 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 (16 lines × 4) crates/storage_impl/src/business_profile.rs:1882— crates/storage_impl/src/business_profile.rs:1882-1897 | crates/storage_impl/src/business_profile.rs:2063-2078 | crates/storage_impl/src/business_profile.rs:2182-2197 | crates/storage_impl/src/business_profile.rs:2242-2257 — 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–16 lines × 2) crates/hyperswitch_constraint_graph/src/graph.rs:228— crates/hyperswitch_constraint_graph/src/graph.rs:228-242 | crates/hyperswitch_constraint_graph/src/graph.rs:290-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 2) crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:2647— crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:2647-2661 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:2793-2808 — both copies are in the same file, so extract the block into 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) crates/router/src/core/customers.rs:875— crates/router/src/core/customers.rs:875-890 | crates/router/src/core/customers.rs:1086-1100 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/vault_session.rs:444— crates/router/src/core/payments/vault_session.rs:444-459 | crates/router/src/core/payments/vault_session.rs:811-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.
Duplicated block (15–16 lines × 2) crates/router/src/core/user.rs:2349— crates/router/src/core/user.rs:2349-2363 | crates/router/src/core/user.rs:2386-2401 — both copies are in the same file, so extract the block into 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) crates/router/src/core/user.rs:3208— crates/router/src/core/user.rs:3208-3222 | crates/router/src/core/user.rs:3283-3298 — both copies are in the same file, so extract the block into 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) crates/router/src/db/api_keys.rs:98— crates/router/src/db/api_keys.rs:98-113 | crates/router/src/db/api_keys.rs:142-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 2) crates/router/src/types/api/admin.rs:178— crates/router/src/types/api/admin.rs:178-192 | crates/router/src/types/api/admin.rs:307-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.
Duplicated block (15–16 lines × 2) crates/storage_impl/src/customers.rs:1404— crates/storage_impl/src/customers.rs:1404-1419 | crates/storage_impl/src/merchant_account.rs:542-556 — 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 × 5) crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:226— crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:226-240 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:188-202 | crates/hyperswitch_connectors/src/connectors/redsys.rs:115-129 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:357-371 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:171-185 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs` and `crates/hyperswitch_connectors/src/connectors/nexixpay.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 5) crates/hyperswitch_connectors/src/connectors/calida.rs:265— crates/hyperswitch_connectors/src/connectors/calida.rs:265-279 | crates/hyperswitch_connectors/src/connectors/calida.rs:356-370 | crates/hyperswitch_connectors/src/connectors/santander.rs:1288-1302 | crates/hyperswitch_connectors/src/connectors/santander.rs:1574-1588 | crates/hyperswitch_connectors/src/connectors/santander.rs:1980-1994 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/calida.rs` and `crates/hyperswitch_connectors/src/connectors/santander.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 5) crates/hyperswitch_domain_models/src/lib.rs:1150— crates/hyperswitch_domain_models/src/lib.rs:1150-1164 | crates/router/src/core/payments/transformers.rs:8052-8066 | crates/router/src/core/payments/transformers.rs:8132-8146 | crates/router/src/types/transformers.rs:2722-2736 | crates/router/src/types/transformers.rs:2762-2776 — before extracting anything, compare `crates/hyperswitch_domain_models/src/lib.rs` and `crates/router/src/core/payments/transformers.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 5) crates/router/src/core/payments/operations/payment_cancel.rs:175— crates/router/src/core/payments/operations/payment_cancel.rs:175-189 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:157-171 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:148-162 | crates/router/src/core/payments/operations/payment_capture.rs:232-246 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:163-177 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 5) crates/router/src/routes/blocklist.rs:55— crates/router/src/routes/blocklist.rs:55-69 | crates/router/src/routes/blocklist.rs:114-128 | crates/router/src/routes/blocklist.rs:343-357 | crates/router/src/routes/blocklist.rs:430-444 | crates/router/src/routes/blocklist.rs:584-598 — 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 (15 lines × 5) crates/router/src/routes/routing.rs:1260— crates/router/src/routes/routing.rs:1260-1274 | crates/router/src/routes/routing.rs:1315-1329 | crates/router/src/routes/routing.rs:1508-1522 | crates/router/src/routes/routing.rs:1563-1577 | crates/router/src/routes/routing.rs:1615-1629 — 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 (15 lines × 5) crates/router/src/services/authentication.rs:671— crates/router/src/services/authentication.rs:671-685 | crates/router/src/services/authentication.rs:779-793 | crates/router/src/services/authentication.rs:3093-3107 | crates/router/src/services/authentication.rs:3392-3406 | crates/router/src/services/authentication.rs:3455-3469 — 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 (15 lines × 5) crates/storage_impl/src/business_profile.rs:1884— crates/storage_impl/src/business_profile.rs:1884-1898 | crates/storage_impl/src/business_profile.rs:1945-1959 | crates/storage_impl/src/business_profile.rs:2065-2079 | crates/storage_impl/src/business_profile.rs:2184-2198 | crates/storage_impl/src/business_profile.rs:2244-2258 — 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 (15 lines × 5) crates/storage_impl/src/business_profile.rs:2001— crates/storage_impl/src/business_profile.rs:2001-2015 | crates/storage_impl/src/business_profile.rs:2061-2075 | crates/storage_impl/src/business_profile.rs:2120-2134 | crates/storage_impl/src/business_profile.rs:2180-2194 | crates/storage_impl/src/business_profile.rs:2240-2254 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 3) crates/analytics/src/payments/metrics/debit_routing.rs:41— crates/analytics/src/payments/metrics/debit_routing.rs:41-52 | crates/analytics/src/payments/metrics/payment_count.rs:40-52 | crates/analytics/src/payments/metrics/payment_success_count.rs:41-53 — before extracting anything, compare `crates/analytics/src/payments/metrics/debit_routing.rs` and `crates/analytics/src/payments/metrics/payment_count.rs` 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.
Duplicated block (12–13 lines × 3) crates/router/src/core/payments/helpers.rs:3705— crates/router/src/core/payments/helpers.rs:3705-3717 | crates/router/src/core/payments/helpers.rs:9175-9186 | crates/router/src/core/payouts/helpers.rs:90-101 — `crates/router/src/core/payments/helpers.rs` and `crates/router/src/core/payouts/helpers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 75 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 (12–13 lines × 3) crates/router/src/core/payments/operations/payment_confirm.rs:1088— crates/router/src/core/payments/operations/payment_confirm.rs:1088-1100 | crates/router/src/core/payments/operations/payment_recurrence.rs:434-445 | crates/router/src/core/payments/operations/payment_update.rs:616-628 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_recurrence.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 3) crates/router/src/core/payments/operations/payment_status.rs:439— crates/router/src/core/payments/operations/payment_status.rs:439-451 | crates/router/src/core/refunds.rs:449-460 | crates/router/src/core/refunds.rs:1099-1111 — 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 (12–13 lines × 3) crates/router/src/core/payments/transformers.rs:964— crates/router/src/core/payments/transformers.rs:964-975 | crates/router/src/core/payments/transformers.rs:2468-2480 | crates/router/src/core/payments/transformers.rs:8472-8484 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 3) crates/router/src/core/payouts.rs:2200— crates/router/src/core/payouts.rs:2200-2211 | crates/router/src/core/payouts.rs:2451-2462 | crates/router/src/core/payouts.rs:2676-2688 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 3) crates/router/src/core/routing.rs:2985— crates/router/src/core/routing.rs:2985-2996 | crates/router/src/core/routing/helpers.rs:2227-2239 | crates/router/src/core/routing/helpers.rs:2374-2386 — 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 (12–13 lines × 3) crates/router/src/routes/payments.rs:1537— crates/router/src/routes/payments.rs:1537-1548 | crates/router/src/routes/payments.rs:4330-4342 | crates/router/src/routes/payments.rs:4405-4417 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 3) crates/storage_impl/src/connection.rs:27— crates/storage_impl/src/connection.rs:27-38 | crates/storage_impl/src/utils.rs:149-160 | crates/storage_impl/src/utils.rs:250-262 — before extracting anything, compare `crates/storage_impl/src/connection.rs` and `crates/storage_impl/src/utils.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 5) crates/hyperswitch_connectors/src/connectors/bluesnap.rs:811— crates/hyperswitch_connectors/src/connectors/bluesnap.rs:811-820 | crates/hyperswitch_connectors/src/connectors/braintree.rs:660-669 | crates/hyperswitch_connectors/src/connectors/braintree.rs:1322-1331 | crates/hyperswitch_connectors/src/connectors/payload.rs:434-444 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:551-560 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bluesnap.rs` and `crates/hyperswitch_connectors/src/connectors/braintree.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 (10 lines × 5) crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:230— crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:230-239 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:324-333 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:571-581 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:657-668 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:744-755 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 5) crates/hyperswitch_interfaces/src/conversion_impls.rs:118— crates/hyperswitch_interfaces/src/conversion_impls.rs:118-127 | crates/hyperswitch_interfaces/src/conversion_impls.rs:155-164 | crates/hyperswitch_interfaces/src/conversion_impls.rs:717-726 | crates/hyperswitch_interfaces/src/conversion_impls.rs:1011-1020 | crates/hyperswitch_interfaces/src/conversion_impls.rs:1050-1059 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 5) crates/router/src/core/payments/helpers.rs:391— crates/router/src/core/payments/helpers.rs:391-400 | crates/router/src/utils.rs:797-807 | crates/router/src/utils.rs:862-872 | crates/router/src/utils.rs:939-949 | crates/router/src/utils.rs:1003-1013 — 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 (10 lines × 5) crates/router/src/core/payments/operations/payment_cancel.rs:84— crates/router/src/core/payments/operations/payment_cancel.rs:84-95 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:84-95 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:84-95 | crates/router/src/core/payments/operations/payment_session.rs:87-96 | crates/router/src/core/payments/operations/tax_calculation.rs:101-112 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/utils.rs:1431— crates/router/src/core/utils.rs:1431-1440 | crates/router/src/core/utils.rs:1548-1557 | crates/router/src/core/utils.rs:1748-1757 | crates/router/src/core/utils.rs:2006-2015 | crates/router/src/core/utils.rs:2121-2131 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 5) crates/router/src/routes/payments.rs:1530— crates/router/src/routes/payments.rs:1530-1539 | crates/router/src/routes/payments.rs:2111-2120 | crates/router/src/routes/payments.rs:4202-4211 | crates/router/src/routes/payments.rs:4567-4576 | crates/router/src/routes/payments.rs:4754-4763 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 5) crates/router/src/routes/subscription.rs:103— crates/router/src/routes/subscription.rs:103-112 | crates/router/src/routes/subscription.rs:139-148 | crates/router/src/routes/subscription.rs:175-184 | crates/router/src/routes/subscription.rs:389-398 | crates/router/src/routes/subscription.rs:467-476 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 5) crates/router/src/services/authentication.rs:4195— crates/router/src/services/authentication.rs:4195-4204 | crates/router/src/services/authentication.rs:4234-4243 | crates/router/src/services/authentication.rs:4327-4336 | crates/router/src/services/authentication.rs:4371-4380 | crates/router/src/services/authentication.rs:4460-4469 — 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–8 lines × 2) crates/hyperswitch_connectors/src/connectors/billwerk.rs:130— crates/hyperswitch_connectors/src/connectors/billwerk.rs:130-136 | crates/hyperswitch_connectors/src/connectors/xendit.rs:138-145 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/billwerk.rs` and `crates/hyperswitch_connectors/src/connectors/xendit.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–8 lines × 2) crates/hyperswitch_connectors/src/connectors/payeezy.rs:512— crates/hyperswitch_connectors/src/connectors/payeezy.rs:512-518 | crates/hyperswitch_connectors/src/connectors/paypal.rs:2176-2183 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/payeezy.rs` and `crates/hyperswitch_connectors/src/connectors/paypal.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–8 lines × 2) crates/hyperswitch_connectors/src/connectors/payjustnow.rs:98— crates/hyperswitch_connectors/src/connectors/payjustnow.rs:98-104 | crates/hyperswitch_connectors/src/connectors/payjustnowinstore.rs:99-106 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/payjustnow.rs` and `crates/hyperswitch_connectors/src/connectors/payjustnowinstore.rs` 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.
Duplicated block (7–8 lines × 2) crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs:292— crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs:292-298 | crates/router/src/core/unified_connector_service/transformers.rs:4871-4878 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7–8 lines × 2) crates/router/src/core/payments.rs:14000— crates/router/src/core/payments.rs:14000-14006 | crates/router/src/core/payments/operations/payment_confirm.rs:2374-2381 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7–8 lines × 2) crates/router/src/core/routing/helpers.rs:2181— crates/router/src/core/routing/helpers.rs:2181-2188 | crates/router/src/core/routing/helpers.rs:2306-2312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) crates/router/src/routes/app.rs:808— crates/router/src/routes/app.rs:808-815 | crates/router/src/routes/app.rs:844-850 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) crates/router/src/workflows/payment_sync.rs:296— crates/router/src/workflows/payment_sync.rs:296-302 | crates/router/src/workflows/payment_sync.rs:332-339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) crates/scheduler/src/consumer.rs:49— crates/scheduler/src/consumer.rs:49-55 | crates/scheduler/src/producer.rs:37-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.
hyperswitch_connectors::connectors::adyen::transformers::get_adyen_webhook_event (cyclomatic 53) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:5669— hyperswitch_connectors::connectors::adyen::transformers::get_adyen_webhook_event has cyclomatic complexity 53 (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.
hyperswitch_connectors::connectors::cybersource::transformers::get_commerce_indicator_for_external_authentication (cyclomatic 34) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1248— hyperswitch_connectors::connectors::cybersource::transformers::get_commerce_indicator_for_external_authentication has cyclomatic complexity 34 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
hyperswitch_connectors::connectors::santander::transformers::decide_access_token_key_suffix (cyclomatic 33) crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:3145— hyperswitch_connectors::connectors::santander::transformers::decide_access_token_key_suffix 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.
hyperswitch_connectors::connectors::getnet::transformers::get_incoming_webhook_event (cyclomatic 21) crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs:1105— hyperswitch_connectors::connectors::getnet::transformers::get_incoming_webhook_event has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
hyperswitch_connectors::connectors::nuvei::transformers::get_payment_status (cyclomatic 20) crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2147— hyperswitch_connectors::connectors::nuvei::transformers::get_payment_status has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
hyperswitch_connectors::connectors::stripe::transformers::create_stripe_payment_method (cyclomatic 19) crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:1470— hyperswitch_connectors::connectors::stripe::transformers::create_stripe_payment_method has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: StripeBankNames::try_from (cyclomatic 60) 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.
hyperswitch_connectors::connectors::nexixpay::transformers::get_validated_address_details_generic (cyclomatic 16) crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:108— hyperswitch_connectors::connectors::nexixpay::transformers::get_validated_address_details_generic 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.
hyperswitch_connectors::connectors::novalnet::transformers::get_incoming_webhook_event (cyclomatic 16) crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:1650— hyperswitch_connectors::connectors::novalnet::transformers::get_incoming_webhook_event 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.
Duplicated block (18–19 lines × 2) crates/hyperswitch_connectors/src/connectors/boku.rs:159— crates/hyperswitch_connectors/src/connectors/boku.rs:159-176 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:165-183 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/boku.rs` and `crates/hyperswitch_connectors/src/connectors/novalnet.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–19 lines × 2) crates/router/src/core/payments.rs:15065— crates/router/src/core/payments.rs:15065-15082 | crates/router/src/core/payments.rs:15566-15584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) crates/router/src/core/payments/helpers.rs:1765— crates/router/src/core/payments/helpers.rs:1765-1783 | crates/router/src/core/payouts/helpers.rs:1577-1594 — `crates/router/src/core/payments/helpers.rs` and `crates/router/src/core/payouts/helpers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 75 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 (18–19 lines × 2) crates/router/src/core/payments/routing.rs:2716— crates/router/src/core/payments/routing.rs:2716-2734 | crates/router/src/core/payments/routing.rs:2787-2804 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) crates/router/src/core/revenue_recovery/types.rs:914— crates/router/src/core/revenue_recovery/types.rs:914-932 | crates/router/src/core/revenue_recovery/types.rs:1214-1231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) crates/router/src/core/user.rs:1704— crates/router/src/core/user.rs:1704-1721 | crates/router/src/core/user.rs:1758-1776 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) crates/router/src/services/authentication.rs:1858— crates/router/src/services/authentication.rs:1858-1875 | crates/router/src/services/authentication.rs:2627-2645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) crates/subscriptions/src/core.rs:37— crates/subscriptions/src/core.rs:37-55 | crates/subscriptions/src/core.rs:187-204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3777— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3777-3792 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3802-3818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) crates/router/src/core/payments/operations/payment_complete_authorize.rs:365— crates/router/src/core/payments/operations/payment_complete_authorize.rs:365-380 | crates/router/src/core/payments/operations/payment_update.rs:515-531 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_complete_authorize.rs` and `crates/router/src/core/payments/operations/payment_update.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16–17 lines × 2) crates/router/src/core/payments/operations/payment_post_session_tokens.rs:60— crates/router/src/core/payments/operations/payment_post_session_tokens.rs:60-75 | crates/router/src/core/payments/operations/tax_calculation.rs:65-81 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_post_session_tokens.rs` and `crates/router/src/core/payments/operations/tax_calculation.rs` as WHOLE FILES: this scan already matched 16 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 (16–17 lines × 2) crates/router/src/core/payments/operations/payment_session.rs:55— crates/router/src/core/payments/operations/payment_session.rs:55-71 | crates/router/src/core/payments/operations/payment_update_metadata.rs:55-70 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_session.rs` and `crates/router/src/core/payments/operations/payment_update_metadata.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16–17 lines × 2) crates/router/src/core/routing.rs:3350— crates/router/src/core/routing.rs:3350-3366 | crates/router/src/routes/payment_methods.rs:474-489 — 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–17 lines × 2) crates/router/src/core/routing/helpers.rs:2275— crates/router/src/core/routing/helpers.rs:2275-2291 | crates/router/src/core/routing/helpers.rs:2404-2419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) crates/router/src/core/unified_authentication_service.rs:1041— crates/router/src/core/unified_authentication_service.rs:1041-1057 | crates/router/src/core/unified_authentication_service.rs:2376-2391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) crates/router/src/core/utils.rs:581— crates/router/src/core/utils.rs:581-597 | crates/router/src/core/utils.rs:808-823 — both copies are in the same file, so extract the block into 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 × 3) crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs:41— crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs:41-53 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:40-53 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs:41-54 — before extracting anything, compare `crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs` and `crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 3) crates/router/src/analytics.rs:576— crates/router/src/analytics.rs:576-588 | crates/router/src/analytics.rs:623-635 | crates/router/src/analytics.rs:678-691 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/analytics.rs:731— crates/router/src/analytics.rs:731-743 | crates/router/src/analytics.rs:854-866 | crates/router/src/analytics.rs:909-922 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/analytics.rs:1242— crates/router/src/analytics.rs:1242-1254 | crates/router/src/analytics.rs:1281-1294 | crates/router/src/analytics.rs:1325-1337 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/analytics.rs:2893— crates/router/src/analytics.rs:2893-2905 | crates/router/src/analytics.rs:2931-2944 | crates/router/src/analytics.rs:2975-2987 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/user.rs:640— crates/router/src/core/user.rs:640-652 | crates/router/src/core/user.rs:1387-1400 | crates/router/src/core/user.rs:2306-2318 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/user/theme.rs:318— crates/router/src/core/user/theme.rs:318-330 | crates/router/src/core/user/theme.rs:353-365 | crates/router/src/core/user/theme.rs:512-525 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/db/events.rs:1340— crates/router/src/db/events.rs:1340-1352 | crates/router/src/db/events.rs:1571-1584 | crates/router/src/db/events.rs:1609-1622 — all 3 copies are in the same file, so extract the block into one function there and call 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–14 lines × 2) crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:2278— crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:2278-2289 | crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:2317-2330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–14 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:2069— crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:2069-2082 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:2166-2177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–14 lines × 2) crates/router/src/core/admin.rs:2068— crates/router/src/core/admin.rs:2068-2081 | crates/router/src/core/admin.rs:2245-2256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–14 lines × 2) crates/router/src/core/payment_link.rs:102— crates/router/src/core/payment_link.rs:102-115 | crates/router/src/core/payment_link.rs:890-901 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–14 lines × 2) crates/router/src/core/payment_methods.rs:3854— crates/router/src/core/payment_methods.rs:3854-3867 | crates/router/src/core/payment_methods.rs:3878-3889 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–14 lines × 2) crates/router/src/core/payments/operations/payment_update.rs:231— crates/router/src/core/payments/operations/payment_update.rs:231-242 | crates/router/src/core/payments/operations/payment_update.rs:245-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 (12–14 lines × 2) crates/router/src/core/webhooks/outgoing.rs:934— crates/router/src/core/webhooks/outgoing.rs:934-947 | crates/router/src/core/webhooks/outgoing_v2.rs:260-271 — before extracting anything, compare `crates/router/src/core/webhooks/outgoing.rs` and `crates/router/src/core/webhooks/outgoing_v2.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–14 lines × 2) crates/router/src/types/api/customers.rs:81— crates/router/src/types/api/customers.rs:81-92 | crates/router/src/types/api/customers.rs:96-109 — both copies are in the same file, so extract the block into 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 × 5) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:304— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:304-314 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:327-337 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:276-286 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:338-348 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:242-252 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 5) crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs:62— crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs:62-72 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/transformers.rs:62-72 | crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs:82-92 | crates/hyperswitch_connectors/src/connectors/thunes/transformers.rs:60-70 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout/transformers.rs:62-72 — `crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 5) crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs:204— crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs:204-214 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:613-623 | crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs:212-222 | crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:139-149 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:760-770 — `crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 104 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 (11 lines × 5) crates/hyperswitch_interfaces/src/conversion_impls.rs:312— crates/hyperswitch_interfaces/src/conversion_impls.rs:312-322 | crates/hyperswitch_interfaces/src/conversion_impls.rs:405-415 | crates/hyperswitch_interfaces/src/conversion_impls.rs:475-485 | crates/hyperswitch_interfaces/src/conversion_impls.rs:542-553 | crates/hyperswitch_interfaces/src/conversion_impls.rs:794-804 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 5) crates/router/src/core/payment_methods/network_tokenization.rs:186— crates/router/src/core/payment_methods/network_tokenization.rs:186-196 | crates/router/src/core/payment_methods/network_tokenization.rs:358-368 | crates/router/src/core/payment_methods/network_tokenization.rs:893-903 | crates/router/src/core/payment_methods/network_tokenization.rs:961-971 | crates/router/src/core/payment_methods/network_tokenization.rs:1121-1131 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 5) crates/router/src/core/payments.rs:237— crates/router/src/core/payments.rs:237-247 | crates/router/src/core/payments.rs:2157-2167 | crates/router/src/core/payments.rs:2299-2309 | crates/router/src/core/payments.rs:2384-2394 | crates/router/src/core/payments/session_operation.rs:157-167 — before extracting anything, compare `crates/router/src/core/payments.rs` and `crates/router/src/core/payments/session_operation.rs` as WHOLE FILES: this scan already matched 3 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 (11 lines × 5) crates/router/src/core/utils.rs:1313— crates/router/src/core/utils.rs:1313-1323 | crates/router/src/core/utils.rs:1432-1442 | crates/router/src/core/utils.rs:1549-1559 | crates/router/src/core/utils.rs:1749-1759 | crates/router/src/core/utils.rs:2007-2017 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 5) crates/storage_impl/src/payments/payment_attempt.rs:114— crates/storage_impl/src/payments/payment_attempt.rs:114-124 | crates/storage_impl/src/payments/payment_attempt.rs:186-196 | crates/storage_impl/src/payments/payment_attempt.rs:284-294 | crates/storage_impl/src/payments/payment_attempt.rs:350-360 | crates/storage_impl/src/payments/payment_attempt.rs:534-544 — 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 (9–10 lines × 2) crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:969— crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:969-977 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:999-1008 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:608— crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:608-617 | crates/hyperswitch_connectors/src/connectors/signifyd.rs:475-483 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs` and `crates/hyperswitch_connectors/src/connectors/signifyd.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 2) crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:924— crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:924-933 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:608-616 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9–10 lines × 2) crates/hyperswitch_connectors/src/connectors/paysafe.rs:534— crates/hyperswitch_connectors/src/connectors/paysafe.rs:534-542 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:636-645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs:1262— crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs:1262-1270 | crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs:1319-1328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3232— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3232-3241 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3257-3265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) crates/router/src/core/fraud_check/operation/fraud_check_post.rs:105— crates/router/src/core/fraud_check/operation/fraud_check_post.rs:105-113 | crates/router/src/core/fraud_check/operation/fraud_check_pre.rs:92-101 — before extracting anything, compare `crates/router/src/core/fraud_check/operation/fraud_check_post.rs` and `crates/router/src/core/fraud_check/operation/fraud_check_pre.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–10 lines × 2) crates/router/src/routes/disputes/utils.rs:42— crates/router/src/routes/disputes/utils.rs:42-50 | crates/router/src/routes/files/transformers.rs:30-39 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8–9 lines × 2) crates/hyperswitch_connectors/src/connectors/getnet.rs:135— crates/hyperswitch_connectors/src/connectors/getnet.rs:135-143 | crates/hyperswitch_connectors/src/connectors/klarna.rs:99-106 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/getnet.rs` and `crates/hyperswitch_connectors/src/connectors/klarna.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 94 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 2) crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs:708— crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs:708-715 | crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs:879-887 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) crates/hyperswitch_connectors/src/connectors/klarna.rs:1135— crates/hyperswitch_connectors/src/connectors/klarna.rs:1135-1142 | crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs:194-202 — 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–9 lines × 2) crates/hyperswitch_connectors/src/connectors/nomupay.rs:443— crates/hyperswitch_connectors/src/connectors/nomupay.rs:443-451 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:865-872 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/nomupay.rs` and `crates/hyperswitch_connectors/src/connectors/truelayer.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 2) crates/hyperswitch_connectors/src/connectors/taxjar.rs:138— crates/hyperswitch_connectors/src/connectors/taxjar.rs:138-145 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:281-289 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/taxjar.rs` and `crates/hyperswitch_connectors/src/connectors/tesouro.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. If that is what happened, the fix is to keep one copy and have the other call 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 × 2) crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1937— crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1937-1945 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:1978-1985 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) crates/router/src/core/payment_methods/cards.rs:5489— crates/router/src/core/payment_methods/cards.rs:5489-5496 | crates/router/src/core/superposition_sdk_config.rs:120-128 — before extracting anything, compare `crates/router/src/core/payment_methods/cards.rs` and `crates/router/src/core/superposition_sdk_config.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 2) crates/router/src/db/dashboard_metadata.rs:308— crates/router/src/db/dashboard_metadata.rs:308-315 | crates/router/src/db/dashboard_metadata.rs:334-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
AC3 · Page structure· Page without a main landmark · ×7
Page without a main landmark crates/router/src/core/generic_link/expired_link/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div>, so there is no content here to wrap — render the <main> from the component mounted into it.
Page without a main landmark crates/router/src/core/generic_link/payment_method_collect/initiate/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark crates/router/src/core/generic_link/payment_method_collect/status/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. This document's body is only the mount point <div>, so there is no content here to wrap — render the <main> from the component mounted into it.
Page without a main landmark crates/router/src/core/generic_link/payout_link/initiate/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark crates/router/src/core/generic_link/payout_link/status/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark crates/router/src/core/payment_link/payment_link_initiate/payment_link.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark crates/router/src/core/payment_link/payment_link_status/status.html:1— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
RouterStore::get_filtered_payment_intents_attempt (cognitive 31) crates/storage_impl/src/payments/payment_intent.rs:1349— RouterStore::get_filtered_payment_intents_attempt has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 12 (23 pts), if/else 5 (8 pts) (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RouterStore::get_filtered_payment_intents_attempt (cognitive 31) crates/storage_impl/src/payments/payment_intent.rs:1570— RouterStore::get_filtered_payment_intents_attempt has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 12 (23 pts), if/else 5 (8 pts) (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RouterStore::get_filtered_payment_intents_attempt_for_platform (cognitive 25) crates/storage_impl/src/payments/payment_intent.rs:1008— RouterStore::get_filtered_payment_intents_attempt_for_platform has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 3 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RouterStore::get_payment_intents_attempt_count_for_platform (cognitive 23) crates/storage_impl/src/payments/payment_intent.rs:1170— RouterStore::get_payment_intents_attempt_count_for_platform has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RouterStore::filter_payment_intent_by_constraints (cognitive 17) crates/storage_impl/src/payments/payment_intent.rs:889— RouterStore::filter_payment_intent_by_constraints has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 4 (8 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RouterStore::get_filtered_active_attempt_ids_for_total_count (cognitive 17) crates/storage_impl/src/payments/payment_intent.rs:1784— RouterStore::get_filtered_active_attempt_ids_for_total_count has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 4 (6 pts) (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RouterStore::filter_payouts_and_attempts (cognitive 17) crates/storage_impl/src/payouts/payouts.rs:582— RouterStore::filter_payouts_and_attempts has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 4 (6 pts) (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Duplicated block (32 lines × 2) crates/analytics/src/disputes/metrics/dispute_status_metric.rs:66— crates/analytics/src/disputes/metrics/dispute_status_metric.rs:66-97 | crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs:66-97 — before extracting anything, compare `crates/analytics/src/disputes/metrics/dispute_status_metric.rs` and `crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs` as WHOLE FILES: this scan already matched 6 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. 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 (32 lines × 2) crates/hyperswitch_domain_models/src/lib.rs:1018— crates/hyperswitch_domain_models/src/lib.rs:1018-1049 | crates/hyperswitch_domain_models/src/merchant_account.rs:166-197 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (32 lines × 2) crates/router/src/core/payments/transformers.rs:308— crates/router/src/core/payments/transformers.rs:308-339 | crates/router/src/core/payments/transformers.rs:1431-1462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (32 lines × 2) crates/router/src/core/superposition_sdk_config.rs:319— crates/router/src/core/superposition_sdk_config.rs:319-350 | crates/router/src/core/superposition_sdk_config.rs:429-460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (32 lines × 2) crates/router/src/routes/payments.rs:83— crates/router/src/routes/payments.rs:83-114 | crates/router/src/routes/payments.rs:259-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (32 lines × 2) crates/router/src/services/kafka/refund.rs:50— crates/router/src/services/kafka/refund.rs:50-81 | crates/router/src/services/kafka/refund_event.rs:51-82 — before extracting anything, compare `crates/router/src/services/kafka/refund.rs` and `crates/router/src/services/kafka/refund_event.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/storage_impl/src/business_profile.rs:601— crates/storage_impl/src/business_profile.rs:601-632 | crates/storage_impl/src/business_profile.rs:1698-1729 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/cybersource.rs:1026— crates/hyperswitch_connectors/src/connectors/cybersource.rs:1026-1055 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1901-1930 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:902— crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:902-931 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1054-1083 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_interfaces/src/conversion_impls.rs:281— crates/hyperswitch_interfaces/src/conversion_impls.rs:281-310 | crates/hyperswitch_interfaces/src/conversion_impls.rs:1179-1208 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payment_method_balance.rs:380— crates/router/src/core/payment_method_balance.rs:380-409 | crates/router/src/core/payment_method_balance.rs:437-466 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payment_methods/transformers.rs:1479— crates/router/src/core/payment_methods/transformers.rs:1479-1508 | crates/router/src/core/payment_methods/transformers.rs:1603-1632 — both copies are in the same file, so extract the block into 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) crates/router/src/core/proxy/utils.rs:247— crates/router/src/core/proxy/utils.rs:247-276 | crates/router/src/core/proxy/utils.rs:326-355 — both copies are in the same file, so extract the block into 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) crates/router/src/core/user_role/role.rs:86— crates/router/src/core/user_role/role.rs:86-115 | crates/router/src/core/user_role/role.rs:216-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–21 lines × 2) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1950— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1950-1969 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1287-1307 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 33 separate duplicated blocks between them, totalling at least 409 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 (20–21 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:2098— crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:2098-2117 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:2192-2212 — both copies are in the same file, so extract the block into 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–21 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2104— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2104-2124 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3119-3138 — both copies are in the same file, so extract the block into 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–21 lines × 2) crates/hyperswitch_domain_models/src/router_data.rs:1516— crates/hyperswitch_domain_models/src/router_data.rs:1516-1536 | crates/hyperswitch_domain_models/src/router_data.rs:2105-2124 — both copies are in the same file, so extract the block into 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–21 lines × 2) crates/router/src/core/payments/operations/payment_complete_authorize.rs:317— crates/router/src/core/payments/operations/payment_complete_authorize.rs:317-337 | crates/router/src/core/payments/operations/payment_update.rs:434-453 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_complete_authorize.rs` and `crates/router/src/core/payments/operations/payment_update.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/payouts/retry.rs:79— crates/router/src/core/payouts/retry.rs:79-99 | crates/router/src/core/payouts/retry.rs:148-167 — both copies are in the same file, so extract the block into 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–21 lines × 2) crates/router/src/core/routing.rs:2834— crates/router/src/core/routing.rs:2834-2854 | crates/router/src/core/routing.rs:3108-3127 — both copies are in the same file, so extract the block into 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–20 lines × 2) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1187— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1187-1206 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2562-2580 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 47 separate duplicated blocks between them, totalling at least 513 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 (19–20 lines × 2) crates/router/src/core/authentication.rs:451— crates/router/src/core/authentication.rs:451-470 | crates/router/src/core/authentication.rs:1253-1271 — both copies are in the same file, so extract the block into 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–20 lines × 2) crates/router/src/core/payments.rs:5887— crates/router/src/core/payments.rs:5887-5905 | crates/router/src/core/payments.rs:5910-5929 — both copies are in the same file, so extract the block into 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–20 lines × 2) crates/router/src/core/payments.rs:6284— crates/router/src/core/payments.rs:6284-6303 | crates/router/src/core/payments.rs:7029-7047 — both copies are in the same file, so extract the block into 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–20 lines × 2) crates/router/src/core/payments/operations/payment_complete_authorize.rs:130— crates/router/src/core/payments/operations/payment_complete_authorize.rs:130-148 | crates/router/src/core/payments/operations/payment_create.rs:123-142 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (19–20 lines × 2) crates/router/src/db/refund.rs:1411— crates/router/src/db/refund.rs:1411-1430 | crates/router/src/db/refund.rs:1629-1647 — both copies are in the same file, so extract the block into 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–20 lines × 2) crates/router/src/utils.rs:798— crates/router/src/utils.rs:798-817 | crates/router/src/utils.rs:940-958 — both copies are in the same file, so extract the block into 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 × 4) crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:46— crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:46-63 | crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs:46-63 | crates/analytics/src/disputes/metrics/total_amount_disputed.rs:45-62 | crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs:45-62 — before extracting anything, compare `crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs` and `crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 4) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:247— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:247-264 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:270-287 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:216-233 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:183-200 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/klarna.rs:544— crates/hyperswitch_connectors/src/connectors/klarna.rs:544-561 | crates/hyperswitch_connectors/src/connectors/klarna.rs:684-701 | crates/hyperswitch_connectors/src/connectors/klarna.rs:835-852 | crates/hyperswitch_connectors/src/connectors/klarna.rs:975-992 — 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 × 4) crates/router/src/core/payments/operations/payment_cancel.rs:166— crates/router/src/core/payments/operations/payment_cancel.rs:166-183 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:148-165 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:139-156 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:154-171 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/utils.rs:1477— crates/router/src/core/utils.rs:1477-1494 | crates/router/src/core/utils.rs:1601-1618 | crates/router/src/core/utils.rs:1797-1814 | crates/router/src/core/utils.rs:2055-2072 — 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 × 4) crates/router/src/services/authentication.rs:1807— crates/router/src/services/authentication.rs:1807-1824 | crates/router/src/services/authentication.rs:1872-1889 | crates/router/src/services/authentication.rs:2335-2352 | crates/router/src/services/authentication.rs:2401-2418 — 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 × 4) crates/storage_impl/src/payments/payment_attempt.rs:3102— crates/storage_impl/src/payments/payment_attempt.rs:3102-3119 | crates/storage_impl/src/payments/payment_attempt.rs:3137-3154 | crates/storage_impl/src/payments/payment_attempt.rs:3172-3189 | crates/storage_impl/src/payments/payment_attempt.rs:3248-3265 — 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–17 lines × 2) crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2681— crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2681-2695 | crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2827-2843 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/payload.rs:276— crates/hyperswitch_connectors/src/connectors/payload.rs:276-290 | crates/hyperswitch_connectors/src/connectors/paypal.rs:159-175 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/payload.rs` and `crates/hyperswitch_connectors/src/connectors/paypal.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–17 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1583— crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1583-1597 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1623-1639 — both copies are in the same file, so extract the block into 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) crates/router/src/connector/utils.rs:162— crates/router/src/connector/utils.rs:162-178 | crates/router/src/connector/utils.rs:241-255 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–17 lines × 2) crates/router/src/core/unified_authentication_service.rs:1581— crates/router/src/core/unified_authentication_service.rs:1581-1597 | crates/router/src/core/unified_authentication_service.rs:1726-1740 — both copies are in the same file, so extract the block into 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) crates/router/src/services/authentication.rs:4012— crates/router/src/services/authentication.rs:4012-4026 | crates/router/src/services/authentication.rs:5469-5485 — both copies are in the same file, so extract the block into 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) crates/storage_impl/src/customers.rs:85— crates/storage_impl/src/customers.rs:85-99 | crates/storage_impl/src/customers.rs:136-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 (14 lines × 5) crates/analytics/src/sqlx.rs:609— crates/analytics/src/sqlx.rs:609-622 | crates/analytics/src/sqlx.rs:771-784 | crates/analytics/src/sqlx.rs:907-920 | crates/analytics/src/sqlx.rs:1131-1144 | crates/analytics/src/sqlx.rs:1338-1351 — 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 (14 lines × 5) crates/diesel_models/src/payment_method.rs:533— crates/diesel_models/src/payment_method.rs:533-546 | crates/diesel_models/src/payment_method.rs:566-579 | crates/diesel_models/src/payment_method.rs:596-609 | crates/diesel_models/src/payment_method.rs:631-644 | crates/diesel_models/src/payment_method.rs:896-909 — 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 (14 lines × 5) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:569— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:569-582 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:325-338 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:5627-5640 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager/transformers.rs:507-520 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:1714-1727 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (14 lines × 5) crates/router/src/core/payments/operations/payment_cancel.rs:184— crates/router/src/core/payments/operations/payment_cancel.rs:184-197 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:166-179 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:157-170 | crates/router/src/core/payments/operations/payment_session.rs:198-211 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:172-185 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 5) crates/router/src/core/payments/transformers.rs:146— crates/router/src/core/payments/transformers.rs:146-159 | crates/router/src/core/payments/transformers.rs:876-889 | crates/router/src/core/payments/transformers.rs:2047-2060 | crates/router/src/core/payments/transformers.rs:2384-2397 | crates/router/src/core/payments/transformers.rs:8420-8433 — 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 (14 lines × 5) crates/storage_impl/src/payments/payment_attempt.rs:3066— crates/storage_impl/src/payments/payment_attempt.rs:3066-3079 | crates/storage_impl/src/payments/payment_attempt.rs:3102-3115 | crates/storage_impl/src/payments/payment_attempt.rs:3137-3150 | crates/storage_impl/src/payments/payment_attempt.rs:3172-3185 | crates/storage_impl/src/payments/payment_attempt.rs:3248-3261 — 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 (14 lines × 5) crates/storage_impl/src/utils.rs:155— crates/storage_impl/src/utils.rs:155-168 | crates/storage_impl/src/utils.rs:187-200 | crates/storage_impl/src/utils.rs:213-226 | crates/storage_impl/src/utils.rs:257-270 | crates/storage_impl/src/utils.rs:284-297 — 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–10 lines × 2) crates/hyperswitch_connectors/src/connectors/barclaycard.rs:424— crates/hyperswitch_connectors/src/connectors/barclaycard.rs:424-431 | crates/hyperswitch_connectors/src/connectors/shift4.rs:552-561 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` and `crates/hyperswitch_connectors/src/connectors/shift4.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–10 lines × 2) crates/hyperswitch_connectors/src/connectors/nexixpay.rs:1102— crates/hyperswitch_connectors/src/connectors/nexixpay.rs:1102-1109 | crates/hyperswitch_connectors/src/connectors/shift4.rs:728-737 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/nexixpay.rs` and `crates/hyperswitch_connectors/src/connectors/shift4.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–10 lines × 2) crates/hyperswitch_connectors/src/connectors/paypal.rs:1158— crates/hyperswitch_connectors/src/connectors/paypal.rs:1158-1167 | crates/hyperswitch_connectors/src/connectors/paypal.rs:1258-1265 — both copies are in the same file, so extract the block into 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–10 lines × 2) crates/hyperswitch_connectors/src/connectors/worldline.rs:253— crates/hyperswitch_connectors/src/connectors/worldline.rs:253-262 | crates/hyperswitch_connectors/src/connectors/worldline.rs:686-693 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 2) crates/payment_link/src/template_renderer.rs:57— crates/payment_link/src/template_renderer.rs:57-66 | crates/payment_link/src/template_renderer.rs:154-161 — both copies are in the same file, so extract the block into 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–10 lines × 2) crates/router/src/core/payments/operations/payment_create.rs:119— crates/router/src/core/payments/operations/payment_create.rs:119-128 | crates/router/src/core/payments/operations/payment_update.rs:146-153 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_create.rs` and `crates/router/src/core/payments/operations/payment_update.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 181 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–10 lines × 2) crates/router/src/services/authentication.rs:2537— crates/router/src/services/authentication.rs:2537-2546 | crates/router/src/services/authentication.rs:2922-2929 — both copies are in the same file, so extract the block into 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 × 6) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3155— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3155-3163 | crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:212-220 | crates/hyperswitch_connectors/src/connectors/celero/transformers.rs:201-209 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:914-922 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1066-1074 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:835-843 — `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 57 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 6) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1153— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1153-1161 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2036-2044 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:639-647 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2792-2800 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:536-544 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:753-761 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 6) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1575— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1575-1583 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2677-2685 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2503-2511 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4626-4634 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4764-4772 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4902-4910 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 6) crates/hyperswitch_connectors/src/connectors/worldline.rs:255— crates/hyperswitch_connectors/src/connectors/worldline.rs:255-264 | crates/hyperswitch_connectors/src/connectors/worldline.rs:348-357 | crates/hyperswitch_connectors/src/connectors/worldline.rs:434-443 | crates/hyperswitch_connectors/src/connectors/worldline.rs:527-535 | crates/hyperswitch_connectors/src/connectors/worldline.rs:609-617 | crates/hyperswitch_connectors/src/connectors/worldline.rs:687-695 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 6) crates/router/src/core/payments/operations/payment_cancel.rs:183— crates/router/src/core/payments/operations/payment_cancel.rs:183-191 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:165-173 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:156-164 | crates/router/src/core/payments/operations/payment_capture.rs:240-248 | crates/router/src/core/payments/operations/payment_session.rs:197-205 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:171-179 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_domain_models/src/mandates.rs:106— crates/hyperswitch_domain_models/src/mandates.rs:106-114 | crates/hyperswitch_domain_models/src/mandates.rs:118-126 | crates/hyperswitch_domain_models/src/mandates.rs:130-138 | crates/router/src/types/transformers.rs:257-265 | crates/router/src/types/transformers.rs:300-308 | crates/storage_impl/src/payments/payment_attempt.rs:1872-1880 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 6) crates/hyperswitch_connectors/src/connectors/ebanx.rs:137— crates/hyperswitch_connectors/src/connectors/ebanx.rs:137-145 | crates/hyperswitch_connectors/src/connectors/gpayments.rs:148-156 | crates/hyperswitch_connectors/src/connectors/netcetera.rs:133-141 | crates/hyperswitch_connectors/src/connectors/plaid.rs:143-151 | crates/hyperswitch_connectors/src/connectors/trustly.rs:145-153 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:139-147 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/gpayments.rs` and `crates/hyperswitch_connectors/src/connectors/netcetera.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Off the main sequence: card_metadata — card_metadata: 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: oci_kms — oci_kms: abstractness 0.06, instability 0.00, distance 0.94 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: router_env — router_env: abstractness 0.08, instability 0.00, distance 0.92 — zone of pain — concrete and depended on by 20 project(s), so it's rigid to change.
Off the main sequence: smithy-core — smithy-core: abstractness 0.14, instability 0.00, distance 0.86 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
Off the main sequence: cards — cards: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Off the main sequence: currency_conversion — currency_conversion: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: hyperswitch_constraint_graph — hyperswitch_constraint_graph: abstractness 0.25, instability 0.00, distance 0.75 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×6
Animation without a prefers-reduced-motion guard crates/router/src/core/payment_link/payment_link_initiate/payment_link.html:24— `#payment-details-shimmer` moves (`animation: shimmer 1.5s infinite linear`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard cypress-tests/dashboard/styles-minimal.css:273— `.connector-table h3::before` moves (`transition: transform 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard cypress-tests/dashboard/styles-minimal.css:376— `.failed-tests h2::before` moves (`transition: transform 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard cypress-tests/dashboard/styles-minimal.css:537— `.loading` moves (`animation: spin 1s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard crates/router/src/core/payment_link/payment_link_initiate/payment_link.css:671— `#submit-spinner` moves (`animation: loading 1s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard crates/router/src/core/payment_link/payment_link_initiate/payment_link.css:780— `#hyper-checkout-cart` moves (`animation: slide-from-right 0.3s linear`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Duplicated block (29–30 lines × 2) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4738— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4738-4766 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4817-4846 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29–30 lines × 2) crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:899— crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:899-927 | crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs:943-972 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29–30 lines × 2) crates/router/src/core/fraud_check/operation/fraud_check_post.rs:422— crates/router/src/core/fraud_check/operation/fraud_check_post.rs:422-450 | crates/router/src/core/fraud_check/operation/fraud_check_post.rs:467-496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29–30 lines × 2) crates/router/src/core/payment_methods/cards.rs:840— crates/router/src/core/payment_methods/cards.rs:840-869 | crates/router/src/core/payment_methods/cards.rs:948-976 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29–30 lines × 2) crates/router/src/core/payments/operations/payment_confirm.rs:2649— crates/router/src/core/payments/operations/payment_confirm.rs:2649-2678 | crates/router/src/core/payments/operations/payment_create.rs:1359-1387 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_create.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (29–30 lines × 2) crates/router/src/routes/subscription.rs:219— crates/router/src/routes/subscription.rs:219-248 | crates/router/src/routes/subscription.rs:287-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 3) crates/diesel_models/src/payment_attempt.rs:2540— crates/diesel_models/src/payment_attempt.rs:2540-2562 | crates/diesel_models/src/payment_attempt.rs:2768-2790 | crates/diesel_models/src/payment_attempt.rs:3391-3413 — all 3 copies are in the same file, so extract the block into one function there and call 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 (23 lines × 3) crates/hyperswitch_connectors/src/utils.rs:7785— crates/hyperswitch_connectors/src/utils.rs:7785-7807 | crates/router/src/types.rs:1463-1485 | crates/router/src/types.rs:1546-1568 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/types.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 3) crates/router/src/core/payments/operations/payment_cancel.rs:190— crates/router/src/core/payments/operations/payment_cancel.rs:190-212 | crates/router/src/core/payments/operations/payment_recurrence.rs:364-386 | crates/router/src/core/payments/operations/payment_session.rs:204-226 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_recurrence.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 3) crates/router/src/core/payments/operations/payment_response.rs:1618— crates/router/src/core/payments/operations/payment_response.rs:1618-1640 | crates/router/src/core/payments/operations/payment_response.rs:1774-1796 | crates/router/src/core/payments/operations/payment_response.rs:5535-5557 — all 3 copies are in the same file, so extract the block into one function there and call 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 (23 lines × 3) crates/router/src/core/relay/utils.rs:26— crates/router/src/core/relay/utils.rs:26-48 | crates/router/src/core/relay/utils.rs:171-193 | crates/router/src/core/relay/utils.rs:444-466 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (23 lines × 3) crates/router/src/db/events.rs:1005— crates/router/src/db/events.rs:1005-1027 | crates/router/src/db/events.rs:1178-1200 | crates/router/src/db/events.rs:1396-1418 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/common_enums/src/enums.rs:1528— crates/common_enums/src/enums.rs:1528-1547 | crates/common_enums/src/enums.rs:1684-1703 | crates/common_enums/src/enums.rs:1848-1867 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/adyenplatform.rs:337— crates/hyperswitch_connectors/src/connectors/adyenplatform.rs:337-356 | crates/hyperswitch_connectors/src/connectors/riskified.rs:581-600 | crates/hyperswitch_connectors/src/connectors/signifyd.rs:691-710 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/riskified.rs` and `crates/hyperswitch_connectors/src/connectors/signifyd.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:912— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:912-931 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1846-1865 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1046-1065 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (20 lines × 3) crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs:395— crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs:395-414 | crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs:485-504 | crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs:531-550 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/router/src/core/payments/transformers.rs:394— crates/router/src/core/payments/transformers.rs:394-413 | crates/router/src/core/payments/transformers.rs:696-715 | crates/router/src/core/payments/transformers.rs:1794-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.
Duplicated block (20 lines × 3) crates/router/src/core/unified_authentication_service.rs:1351— crates/router/src/core/unified_authentication_service.rs:1351-1370 | crates/router/src/core/unified_authentication_service.rs:2066-2085 | crates/router/src/core/unified_authentication_service.rs:2507-2526 — all 3 copies are in the same file, so extract the block into one function there and call 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–20 lines × 2) crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs:55— crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs:55-74 | crates/analytics/src/auth_events/metrics/challenge_flow_count.rs:55-72 — before extracting anything, compare `crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs` and `crates/analytics/src/auth_events/metrics/challenge_flow_count.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–20 lines × 2) crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs:55— crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs:55-72 | crates/analytics/src/auth_events/metrics/frictionless_success_count.rs:55-74 — before extracting anything, compare `crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs` and `crates/analytics/src/auth_events/metrics/frictionless_success_count.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–20 lines × 2) crates/router/src/core/customers.rs:855— crates/router/src/core/customers.rs:855-872 | crates/router/src/core/customers.rs:1065-1084 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–20 lines × 2) crates/router/src/core/payment_methods/cards.rs:157— crates/router/src/core/payment_methods/cards.rs:157-174 | crates/router/src/core/payment_methods/cards.rs:1275-1294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–20 lines × 2) crates/router/src/core/payments.rs:7841— crates/router/src/core/payments.rs:7841-7858 | crates/router/src/core/payments.rs:8047-8066 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–20 lines × 2) crates/router/src/core/payments/operations/payment_post_session_tokens.rs:78— crates/router/src/core/payments/operations/payment_post_session_tokens.rs:78-95 | crates/router/src/core/payments/operations/tax_calculation.rs:93-112 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_post_session_tokens.rs` and `crates/router/src/core/payments/operations/tax_calculation.rs` as WHOLE FILES: this scan already matched 16 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–19 lines × 3) crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:44— crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:44-61 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs:43-61 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs:43-60 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs` and `crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–19 lines × 3) crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1550— crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1550-1568 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:2450-2468 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:751-768 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 291 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–19 lines × 3) crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1574— crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1574-1592 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:2474-2492 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:778-795 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 291 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–19 lines × 3) crates/router/src/core/payments/operations/payment_session.rs:64— crates/router/src/core/payments/operations/payment_session.rs:64-81 | crates/router/src/core/payments/operations/payment_start.rs:64-82 | crates/router/src/core/payments/operations/tax_calculation.rs:74-91 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_session.rs` and `crates/router/src/core/payments/operations/payment_start.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–19 lines × 3) crates/router/src/core/user/dashboard_metadata.rs:375— crates/router/src/core/user/dashboard_metadata.rs:375-393 | crates/router/src/core/user/dashboard_metadata.rs:400-418 | crates/router/src/core/user/dashboard_metadata.rs:673-690 — all 3 copies are in the same file, so extract the block into one function there and call 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–19 lines × 3) crates/router/src/routes/authentication.rs:98— crates/router/src/routes/authentication.rs:98-116 | crates/router/src/routes/authentication.rs:143-161 | crates/router/src/routes/authentication.rs:223-240 — all 3 copies are in the same file, so extract the block into one function there and call 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–15 lines × 3) crates/router/src/analytics.rs:961— crates/router/src/analytics.rs:961-974 | crates/router/src/analytics.rs:1009-1022 | crates/router/src/analytics.rs:1064-1078 — all 3 copies are in the same file, so extract the block into one function there and call 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–15 lines × 3) crates/router/src/core/disputes.rs:351— crates/router/src/core/disputes.rs:351-364 | crates/router/src/core/payments/filters.rs:37-51 | crates/router/src/core/refunds.rs:1976-1989 — before extracting anything, compare `crates/router/src/core/disputes.rs` and `crates/router/src/core/refunds.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 3) crates/router/src/core/payments/operations/payment_capture_v2.rs:155— crates/router/src/core/payments/operations/payment_capture_v2.rs:155-168 | crates/router/src/core/payments/operations/payment_get.rs:166-179 | crates/router/src/core/payments/operations/payment_session_intent.rs:130-144 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_capture_v2.rs` and `crates/router/src/core/payments/operations/payment_get.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 3) crates/router/src/core/routing/helpers.rs:1861— crates/router/src/core/routing/helpers.rs:1861-1875 | crates/router/src/core/routing/helpers.rs:1903-1916 | crates/router/src/core/routing/helpers.rs:1944-1957 — all 3 copies are in the same file, so extract the block into one function there and call 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–15 lines × 3) crates/router/src/routes/payments.rs:1524— crates/router/src/routes/payments.rs:1524-1537 | crates/router/src/routes/payments.rs:2104-2118 | crates/router/src/routes/payments.rs:4196-4209 — all 3 copies are in the same file, so extract the block into one function there and call 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–15 lines × 3) crates/router/src/utils.rs:361— crates/router/src/utils.rs:361-375 | crates/router/src/utils.rs:419-432 | crates/router/src/utils.rs:506-519 — all 3 copies are in the same file, so extract the block into one function there and call 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–12 lines × 3) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1829— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1829-1839 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2303-2314 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1028-1039 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 527 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 (11–12 lines × 3) crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:228— crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:228-238 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:656-667 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:743-754 — all 3 copies are in the same file, so extract the block into one function there and call 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–12 lines × 3) crates/hyperswitch_domain_models/src/router_data.rs:1513— crates/hyperswitch_domain_models/src/router_data.rs:1513-1523 | crates/hyperswitch_domain_models/src/router_data.rs:2102-2112 | crates/hyperswitch_domain_models/src/router_data.rs:2641-2652 — all 3 copies are in the same file, so extract the block into one function there and call 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–12 lines × 3) crates/router/src/routes/app.rs:2947— crates/router/src/routes/app.rs:2947-2957 | crates/router/src/routes/app.rs:2996-3006 | crates/router/src/routes/app.rs:3099-3110 — all 3 copies are in the same file, so extract the block into one function there and call 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–12 lines × 3) crates/router/src/types/transformers.rs:1026— crates/router/src/types/transformers.rs:1026-1037 | crates/router/src/types/transformers.rs:1101-1112 | crates/router/src/types/transformers.rs:1174-1184 — all 3 copies are in the same file, so extract the block into one function there and call 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–12 lines × 3) crates/storage_impl/src/merchant_connector_account.rs:519— crates/storage_impl/src/merchant_connector_account.rs:519-530 | crates/storage_impl/src/merchant_connector_account.rs:672-682 | crates/storage_impl/src/merchant_connector_account.rs:969-979 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 6) crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:70— crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:70-79 | crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs:70-79 | crates/analytics/src/disputes/metrics/total_amount_disputed.rs:69-78 | crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs:69-78 | crates/analytics/src/refunds/metrics/refund_processed_amount.rs:71-80 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs:78-87 — before extracting anything, compare `crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs` and `crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 6) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1154— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1154-1163 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2037-2046 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:640-649 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2793-2802 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:537-546 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1379-1388 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 6) crates/hyperswitch_connectors/src/connectors/braintree.rs:362— crates/hyperswitch_connectors/src/connectors/braintree.rs:362-371 | crates/hyperswitch_connectors/src/connectors/checkout.rs:313-322 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:411-420 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:397-406 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:161-170 | crates/hyperswitch_connectors/src/connectors/stripe.rs:527-536 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/braintree.rs` and `crates/hyperswitch_connectors/src/connectors/checkout.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 6) crates/router/src/analytics.rs:685— crates/router/src/analytics.rs:685-694 | crates/router/src/analytics.rs:916-925 | crates/router/src/analytics.rs:1072-1081 | crates/router/src/analytics.rs:1288-1297 | crates/router/src/analytics.rs:2938-2947 | crates/router/src/analytics.rs:3110-3119 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 6) crates/router/src/core/payments/helpers.rs:6345— crates/router/src/core/payments/helpers.rs:6345-6354 | crates/router/src/core/payments/helpers.rs:6494-6503 | crates/router/src/core/payments/helpers.rs:6929-6938 | crates/router/src/core/payments/helpers.rs:7047-7056 | crates/router/src/core/payouts/helpers.rs:642-651 | crates/router/src/core/payouts/helpers.rs:1677-1686 — `crates/router/src/core/payments/helpers.rs` and `crates/router/src/core/payouts/helpers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 75 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 6) crates/router/src/core/payments/operations/payment_cancel.rs:323— crates/router/src/core/payments/operations/payment_cancel.rs:323-332 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:405-414 | crates/router/src/core/payments/operations/payment_capture.rs:365-374 | crates/router/src/core/payments/operations/payment_reject.rs:328-337 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:328-337 | crates/router/src/core/payments/operations/payments_incremental_authorization.rs:317-326 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 6) crates/analytics/src/sqlx.rs:261— crates/analytics/src/sqlx.rs:261-268 | crates/analytics/src/sqlx.rs:434-441 | crates/analytics/src/sqlx.rs:1054-1061 | crates/analytics/src/sqlx.rs:1161-1168 | crates/analytics/src/sqlx.rs:1397-1404 | crates/analytics/src/sqlx.rs:1427-1434 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 6) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1152— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1152-1159 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2035-2042 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:638-645 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2791-2798 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:422-429 | crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs:198-206 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 6) crates/hyperswitch_domain_models/src/type_encryption.rs:165— crates/hyperswitch_domain_models/src/type_encryption.rs:165-172 | crates/hyperswitch_domain_models/src/type_encryption.rs:274-281 | crates/hyperswitch_domain_models/src/type_encryption.rs:404-411 | crates/hyperswitch_domain_models/src/type_encryption.rs:512-519 | crates/hyperswitch_domain_models/src/type_encryption.rs:877-884 | crates/hyperswitch_domain_models/src/type_encryption.rs:980-987 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 6) crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:2096— crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:2096-2103 | crates/hyperswitch_connectors/src/connectors/finix/transformers.rs:116-123 | crates/hyperswitch_connectors/src/connectors/hyperswitch_vault/transformers.rs:119-126 | crates/hyperswitch_connectors/src/connectors/payload/transformers.rs:305-312 | crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs:1608-1615 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:4962-4969 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times.
Duplicated block (8 lines × 6) crates/hyperswitch_connectors/src/connectors/aci.rs:92— crates/hyperswitch_connectors/src/connectors/aci.rs:92-99 | crates/hyperswitch_connectors/src/connectors/checkout.rs:126-133 | crates/hyperswitch_connectors/src/connectors/coingate.rs:126-133 | crates/hyperswitch_connectors/src/connectors/mollie.rs:112-119 | crates/hyperswitch_connectors/src/connectors/stax.rs:117-125 | crates/hyperswitch_connectors/src/connectors/taxjar.rs:121-128 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/aci.rs` and `crates/hyperswitch_connectors/src/connectors/checkout.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 6) crates/hyperswitch_connectors/src/utils.rs:1315— crates/hyperswitch_connectors/src/utils.rs:1315-1322 | crates/hyperswitch_connectors/src/utils.rs:1422-1429 | crates/hyperswitch_connectors/src/utils.rs:1529-1536 | crates/hyperswitch_connectors/src/utils.rs:1637-1644 | crates/hyperswitch_connectors/src/utils.rs:1746-1753 | crates/hyperswitch_connectors/src/utils.rs:7420-7427 — 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.
Outbound HTTP without resilience crates/analytics/src/clickhouse.rs:68— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/common_utils/src/keymanager.rs:64— `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/external_services/src/grpc_client.rs:116— `hyper_util::client::legacy::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/external_services/src/grpc_client/deja_transport.rs:630— `hyper_util::client::legacy::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/external_services/src/http_client/client.rs:88— `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/injector/src/injector.rs:184— `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
smithy::generate_enum_impl (cyclomatic 40) crates/smithy/src/lib.rs:358— smithy::generate_enum_impl 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.
smithy::parse_serde_attributes (cyclomatic 33) crates/smithy/src/lib.rs:1137— smithy::parse_serde_attributes 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.
smithy::parse_serde_enum_attributes (cyclomatic 26) crates/smithy/src/lib.rs:1231— smithy::parse_serde_enum_attributes 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.
smithy::parse_smithy_field_attributes (cyclomatic 25) crates/smithy/src/lib.rs:1381— smithy::parse_smithy_field_attributes 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.
smithy::generate_struct_impl (cyclomatic 17) crates/smithy/src/lib.rs:36— smithy::generate_struct_impl 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.
analytics::payment_intents::core::get_metrics (cyclomatic 30) crates/analytics/src/payment_intents/core.rs:69— analytics::payment_intents::core::get_metrics 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.
analytics::payments::core::get_metrics (cyclomatic 30) crates/analytics/src/payments/core.rs:49— analytics::payments::core::get_metrics 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.
analytics::payments::core::get_filters (cyclomatic 24) crates/analytics/src/payments/core.rs:362— analytics::payments::core::get_filters has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
analytics::refunds::core::get_metrics (cyclomatic 24) crates/analytics/src/refunds/core.rs:48— analytics::refunds::core::get_metrics 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.
analytics::payment_intents::core::get_filters (cyclomatic 20) crates/analytics/src/payment_intents/core.rs:365— analytics::payment_intents::core::get_filters has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Repeated repair: crates/hyperswitch_connectors/src/connectors/zift/transformers.rs crates/hyperswitch_connectors/src/connectors/zift/transformers.rs:733— crates/hyperswitch_connectors/src/connectors/zift/transformers.rs changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is RouterData::try_from at line 733), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(connector): [zift] handle error responses with missing fields (#14873)”; “fix(connector): [Zift] Handle void transactions in Zift payment sync (#14637)”; “fix(ucs): map not-supported UCS errors to IR_19 instead of IR_00 (#14377)”; “fix(ucs): surface UCS client errors as proper 4xx API responses (#13709)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/hyperswitch_connectors/src/connectors/zift/transformers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/router/src/types/storage/revenue_recovery_redis_operation.rs crates/router/src/types/storage/revenue_recovery_redis_operation.rs:964— crates/router/src/types/storage/revenue_recovery_redis_operation.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is RedisTokenManager::get_token_based_on_retry_type at line 964), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(revenue_recovery): count card retries only in production (#14916)”; “fix(revenue-recovery): fix the token fetch for A/B routing (#14539)”; “revert(payments): expose card subtype, segment type and funding source (#14066)”; “fix(revenue_recovery): fix the token fetch for adaptive_retry (#13939)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/types/storage/revenue_recovery_redis_operation.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/router/src/core/payments/flows/setup_mandate_flow.rs crates/router/src/core/payments/flows/setup_mandate_flow.rs:86— crates/router/src/core/payments/flows/setup_mandate_flow.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is PaymentConfirmData::construct_router_data at line 86), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(core): Donot attempt step-up for GooglePay PAN_ONLY when authentication type is No3ds (#14470)”; “fix(router): allow post-authorization flows on disabled connectors (#14133)”; “fix(webhooks): delay outgoing webhook until recurrence flow completes (#13660)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/router/src/core/payments/flows/setup_mandate_flow.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs:451— crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is hyperswitch_connectors::connectors::truelayer::transformers::validate_fps_payout_reference at line 451), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ucs): map not-supported UCS errors to IR_19 instead of IR_00 (#14377)”; “fix(ucs): surface UCS client errors as proper 4xx API responses (#13709)”; “fix(connector): [truelayer] Payout benificiary reference validation (#13422)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/hyperswitch_connectors/src/connectors/peachpayments.rs crates/hyperswitch_connectors/src/connectors/peachpayments.rs:971— crates/hyperswitch_connectors/src/connectors/peachpayments.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is Peachpayments::get_webhook_event_type at line 971), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ucs): map not-supported UCS errors to IR_19 instead of IR_00 (#14377)”; “fix(ucs): surface UCS client errors as proper 4xx API responses (#13709)”; “fix(connector): [Peachpayments] Fix Setup Mandate Endpoint (#13734)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 20:26:16 +00:00' --until='2026-10-24 20:26:16 +00:00' --full-history --no-merges -- crates/hyperswitch_connectors/src/connectors/peachpayments.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.
TooManyMethods: RedisConnectionWithContext crates/redis_interface/src/module/fred.rs:188— TooManyMethods — 66 methods, declared across 2 files: fred/commands.rs (63), module/fred.rs (3). The bar is 30 methods; this is 36 over it, 2.20× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RedisConnectionWithContext crates/redis_interface/src/module/redis_rs.rs:370— TooManyMethods — 60 methods, declared across 2 files: redis_rs/commands.rs (58), module/redis_rs.rs (2). The bar is 30 methods; this is 30 over it, 2.00× 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: Blocklist crates/diesel_models/src/blocklist.rs:24— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PaymentIntent crates/hyperswitch_domain_models/src/payments.rs:70— 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: UnifiedConnectorServiceClient crates/external_services/src/grpc_client/unified_connector_service.rs:38— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Near-duplicate member pair (40 shared lines) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:462— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:462-588 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:783-869 — 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 (40 shared lines) crates/storage_impl/src/customers.rs:1539— crates/storage_impl/src/customers.rs:1539-1613 | crates/storage_impl/src/customers.rs:1788-1902 — 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 (40 shared lines) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3490— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3490-3564 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3714-3782 — 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 (40 shared lines) crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:1289— crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:1289-1340 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:1369-1424 — 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 (40 shared lines) crates/storage_impl/src/merchant_connector_account.rs:952— crates/storage_impl/src/merchant_connector_account.rs:952-1028 | crates/storage_impl/src/merchant_connector_account.rs:1037-1108 — 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.
D4 · Code Duplication· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (10 members, 50+ identical tokens) crates/diesel_models/src/query/generics.rs:690— crates/diesel_models/src/query/generics.rs:690-727 | crates/diesel_models/src/query/generics.rs:743-769 | crates/diesel_models/src/query/generics.rs:792-830 | crates/diesel_models/src/query/generics.rs:893-930 | crates/diesel_models/src/query/generics.rs:943-966 | crates/diesel_models/src/query/generics.rs:980-1016 | crates/diesel_models/src/query/generics.rs:1028-1063 | crates/diesel_models/src/query/generics.rs:1102-1138 | crates/diesel_models/src/query/generics.rs:1183-1237 | crates/diesel_models/src/query/generics.rs:1248-1274 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
Members sharing a duplicated core (10 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/aci.rs:610— crates/hyperswitch_connectors/src/connectors/aci.rs:610-620 | crates/hyperswitch_connectors/src/connectors/adyen.rs:1030-1040 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:689-699 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:822-832 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1043-1053 | crates/hyperswitch_connectors/src/connectors/braintree.rs:777-787 | crates/hyperswitch_connectors/src/connectors/checkout.rs:752-762 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:496-506 | crates/hyperswitch_connectors/src/connectors/noon.rs:560-570 | crates/hyperswitch_connectors/src/connectors/powertranz.rs:523-533 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
Members sharing a duplicated core (10 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/affirm.rs:324— crates/hyperswitch_connectors/src/connectors/affirm.rs:324-340 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1323-1339 | crates/hyperswitch_connectors/src/connectors/bluesnap.rs:876-892 | crates/hyperswitch_connectors/src/connectors/deutschebank.rs:531-547 | crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs:425-441 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:585-601 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:447-463 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:613-629 | crates/hyperswitch_connectors/src/connectors/prophetpay.rs:327-343 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:1023-1039 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
Members sharing a duplicated core (10 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:387— crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:387-399 | crates/hyperswitch_connectors/src/connectors/boku.rs:342-354 | crates/hyperswitch_connectors/src/connectors/celero.rs:330-342 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:463-475 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:617-629 | crates/hyperswitch_connectors/src/connectors/placetopay.rs:293-305 | crates/hyperswitch_connectors/src/connectors/prophetpay.rs:417-429 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:513-525 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:384-396 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:521-533 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
Members sharing a duplicated core (10 members, 50+ identical tokens) crates/hyperswitch_interfaces/src/conversion_impls.rs:230— crates/hyperswitch_interfaces/src/conversion_impls.rs:230-270 | crates/hyperswitch_interfaces/src/conversion_impls.rs:355-381 | crates/hyperswitch_interfaces/src/conversion_impls.rs:429-453 | crates/hyperswitch_interfaces/src/conversion_impls.rs:567-583 | crates/hyperswitch_interfaces/src/conversion_impls.rs:658-676 | crates/hyperswitch_interfaces/src/conversion_impls.rs:863-875 | crates/hyperswitch_interfaces/src/conversion_impls.rs:906-918 | crates/hyperswitch_interfaces/src/conversion_impls.rs:959-978 | crates/hyperswitch_interfaces/src/conversion_impls.rs:1086-1098 | crates/hyperswitch_interfaces/src/conversion_impls.rs:1125-1168 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (8 members, 50+ identical tokens) crates/analytics/src/active_payments/accumulator.rs:27— crates/analytics/src/active_payments/accumulator.rs:27-33 | crates/analytics/src/auth_events/accumulator.rs:43-49 | crates/analytics/src/auth_events/accumulator.rs:59-65 | crates/analytics/src/frm/accumulator.rs:34-40 | crates/analytics/src/payment_intents/accumulator.rs:75-81 | crates/analytics/src/payments/accumulator.rs:329-335 | crates/analytics/src/refunds/accumulator.rs:165-171 | crates/analytics/src/sdk_events/accumulator.rs:41-47 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/adyen.rs:574— crates/hyperswitch_connectors/src/connectors/adyen.rs:574-592 | crates/hyperswitch_connectors/src/connectors/adyen.rs:946-964 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:438-462 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:620-644 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:989-1011 | crates/hyperswitch_connectors/src/connectors/paypal.rs:1933-1948 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:283-298 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:736-751 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/archipel.rs:271— crates/hyperswitch_connectors/src/connectors/archipel.rs:271-285 | crates/hyperswitch_connectors/src/connectors/archipel.rs:382-396 | crates/hyperswitch_connectors/src/connectors/archipel.rs:473-487 | crates/hyperswitch_connectors/src/connectors/archipel.rs:578-592 | crates/hyperswitch_connectors/src/connectors/archipel.rs:677-691 | crates/hyperswitch_connectors/src/connectors/archipel.rs:782-796 | crates/hyperswitch_connectors/src/connectors/archipel.rs:873-887 | crates/hyperswitch_connectors/src/connectors/archipel.rs:995-1009 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:966— crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:966-982 | crates/hyperswitch_connectors/src/connectors/braintree.rs:1280-1296 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1687-1703 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:210-226 | crates/hyperswitch_connectors/src/connectors/nmi.rs:466-482 | crates/hyperswitch_connectors/src/connectors/payme.rs:464-480 | crates/hyperswitch_connectors/src/connectors/powertranz.rs:333-349 | crates/hyperswitch_connectors/src/connectors/redsys.rs:495-511 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/billwerk.rs:224— crates/hyperswitch_connectors/src/connectors/billwerk.rs:224-236 | crates/hyperswitch_connectors/src/connectors/finix.rs:219-231 | crates/hyperswitch_connectors/src/connectors/gocardless.rs:305-317 | crates/hyperswitch_connectors/src/connectors/mollie.rs:199-211 | crates/hyperswitch_connectors/src/connectors/silverflow.rs:111-123 | crates/hyperswitch_connectors/src/connectors/square.rs:241-253 | crates/hyperswitch_connectors/src/connectors/stax.rs:300-312 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:113-125 — 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 (40 lines × 2) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4695— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4695-4734 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4775-4814 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (40 lines × 2) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:819— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:819-858 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:947-986 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (40 lines × 2) crates/hyperswitch_domain_models/src/business_profile.rs:760— crates/hyperswitch_domain_models/src/business_profile.rs:760-799 | crates/hyperswitch_domain_models/src/business_profile.rs:890-929 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (40 lines × 2) crates/router/src/core/refunds_v2.rs:897— crates/router/src/core/refunds_v2.rs:897-936 | crates/router/src/core/refunds_v2.rs:995-1034 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (40 lines × 2) crates/router/src/core/webhooks/incoming.rs:3487— crates/router/src/core/webhooks/incoming.rs:3487-3526 | crates/router/src/core/webhooks/incoming_v2.rs:761-800 — before extracting anything, compare `crates/router/src/core/webhooks/incoming.rs` and `crates/router/src/core/webhooks/incoming_v2.rs` as WHOLE FILES: this scan already matched 5 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 (37 lines × 2) crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:58— crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:58-94 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs:57-93 — before extracting anything, compare `crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs` and `crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (37 lines × 2) crates/diesel_models/src/query/customers.rs:229— crates/diesel_models/src/query/customers.rs:229-265 | crates/diesel_models/src/query/customers.rs:277-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (37 lines × 2) crates/kgraph_utils/src/mca.rs:612— crates/kgraph_utils/src/mca.rs:612-648 | crates/kgraph_utils/src/mca.rs:673-709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (37 lines × 2) crates/router/src/core/payments/helpers.rs:6265— crates/router/src/core/payments/helpers.rs:6265-6301 | crates/router/src/core/payments/helpers.rs:6414-6450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (37 lines × 2) crates/storage_impl/src/payouts/payout_attempt.rs:718— crates/storage_impl/src/payouts/payout_attempt.rs:718-754 | crates/storage_impl/src/payouts/payout_attempt.rs:797-833 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–22 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:1553— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:1553-1574 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:1601-1621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–22 lines × 2) crates/hyperswitch_connectors/src/connectors/xendit.rs:751— crates/hyperswitch_connectors/src/connectors/xendit.rs:751-772 | crates/hyperswitch_connectors/src/connectors/xendit.rs:847-867 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–22 lines × 2) crates/injector/src/injector.rs:516— crates/injector/src/injector.rs:516-536 | crates/router/src/core/proxy/utils.rs:373-394 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (21–22 lines × 2) crates/router/src/core/debit_routing.rs:326— crates/router/src/core/debit_routing.rs:326-347 | crates/router/src/core/debit_routing.rs:591-611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–22 lines × 2) crates/storage_impl/src/customers.rs:1549— crates/storage_impl/src/customers.rs:1549-1569 | crates/storage_impl/src/customers.rs:1798-1819 — both copies are in the same file, so extract the block into 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 × 3) crates/diesel_models/src/payment_attempt.rs:2515— crates/diesel_models/src/payment_attempt.rs:2515-2536 | crates/diesel_models/src/payouts.rs:187-207 | crates/hyperswitch_domain_models/src/payouts/payouts.rs:234-254 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (21 lines × 3) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1819— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1819-1839 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1941-1961 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2067-2087 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21 lines × 3) crates/hyperswitch_connectors/src/connectors/nordea.rs:330— crates/hyperswitch_connectors/src/connectors/nordea.rs:330-350 | crates/hyperswitch_connectors/src/connectors/nordea.rs:505-525 | crates/hyperswitch_connectors/src/connectors/nordea.rs:670-690 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21 lines × 3) crates/router/src/core/payments.rs:2287— crates/router/src/core/payments.rs:2287-2307 | crates/router/src/core/payments.rs:2372-2392 | crates/router/src/core/payments/session_operation.rs:145-165 — before extracting anything, compare `crates/router/src/core/payments.rs` and `crates/router/src/core/payments/session_operation.rs` as WHOLE FILES: this scan already matched 3 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 (21 lines × 3) crates/router/src/core/payments/transformers.rs:555— crates/router/src/core/payments/transformers.rs:555-575 | crates/router/src/core/payments/transformers.rs:1157-1177 | crates/router/src/core/payments/transformers.rs:1903-1923 — all 3 copies are in the same file, so extract the block into one function there and call 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 (19 lines × 4) crates/analytics/src/sqlx.rs:352— crates/analytics/src/sqlx.rs:352-371 | crates/analytics/src/sqlx.rs:525-544 | crates/analytics/src/sqlx.rs:1023-1041 | crates/analytics/src/sqlx.rs:1222-1240 — 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 (19 lines × 4) crates/hyperswitch_connectors/src/connectors/klarna.rs:639— crates/hyperswitch_connectors/src/connectors/klarna.rs:639-657 | crates/hyperswitch_connectors/src/connectors/klarna.rs:781-799 | crates/hyperswitch_connectors/src/connectors/klarna.rs:930-948 | crates/hyperswitch_connectors/src/connectors/klarna.rs:1072-1090 — 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 (19 lines × 4) crates/hyperswitch_domain_models/src/business_profile.rs:302— crates/hyperswitch_domain_models/src/business_profile.rs:302-320 | crates/hyperswitch_domain_models/src/business_profile.rs:450-468 | crates/hyperswitch_domain_models/src/business_profile.rs:772-790 | crates/hyperswitch_domain_models/src/business_profile.rs:902-920 — 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 (19 lines × 4) crates/router/src/core/admin.rs:2103— crates/router/src/core/admin.rs:2103-2121 | crates/router/src/core/admin.rs:2281-2299 | crates/router/src/core/admin.rs:2426-2444 | crates/router/src/core/admin.rs:2626-2644 — 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 (19 lines × 4) crates/hyperswitch_connectors/src/connectors/dwolla.rs:96— crates/hyperswitch_connectors/src/connectors/dwolla.rs:96-120 | crates/hyperswitch_connectors/src/connectors/facilitapay.rs:110-128 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:840-858 | crates/hyperswitch_connectors/src/connectors/volt.rs:104-133 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/dwolla.rs` and `crates/hyperswitch_connectors/src/connectors/facilitapay.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–19 lines × 2) crates/hyperswitch_connectors/src/connectors/paydotcom.rs:291— crates/hyperswitch_connectors/src/connectors/paydotcom.rs:291-309 | crates/hyperswitch_connectors/src/connectors/paydotcom.rs:320-336 — both copies are in the same file, so extract the block into 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–19 lines × 2) crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs:281— crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs:281-299 | crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs:321-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 (17–19 lines × 2) crates/router/src/core/payments.rs:3612— crates/router/src/core/payments.rs:3612-3630 | crates/router/src/core/payments.rs:7810-7826 — both copies are in the same file, so extract the block into 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–19 lines × 2) crates/router/src/core/payments/operations/payment_approve.rs:58— crates/router/src/core/payments/operations/payment_approve.rs:58-74 | crates/router/src/core/payments/operations/payment_start.rs:60-78 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_approve.rs` and `crates/router/src/core/payments/operations/payment_start.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–19 lines × 2) crates/router/src/core/payments/tokenization.rs:494— crates/router/src/core/payments/tokenization.rs:494-512 | crates/router/src/core/payments/tokenization.rs:2377-2393 — both copies are in the same file, so extract the block into 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 × 6) crates/diesel_models/src/payment_attempt.rs:3232— crates/diesel_models/src/payment_attempt.rs:3232-3246 | crates/diesel_models/src/payment_attempt.rs:3410-3424 | crates/diesel_models/src/payment_attempt.rs:3507-3521 | crates/diesel_models/src/payment_attempt.rs:3819-3833 | crates/diesel_models/src/payment_attempt.rs:4412-4426 | crates/diesel_models/src/payment_attempt.rs:4630-4644 — 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 × 6) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:50— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:50-64 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:59-73 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3275-3289 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager/transformers.rs:77-91 | crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:736-750 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1605-1619 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (15 lines × 6) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:257— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:257-271 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:254-268 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:384-398 | crates/router/src/core/payments/operations/payment_get.rs:206-220 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:235-249 | crates/router/src/core/webhooks/incoming_v2.rs:665-679 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/payment_confirm_intent.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 6) crates/router/src/routes/disputes.rs:55— crates/router/src/routes/disputes.rs:55-69 | crates/router/src/routes/disputes.rs:92-106 | crates/router/src/routes/disputes.rs:314-328 | crates/router/src/routes/disputes.rs:401-415 | crates/router/src/routes/disputes.rs:621-635 | crates/router/src/routes/disputes.rs:747-761 — 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 × 6) crates/storage_impl/src/business_profile.rs:792— crates/storage_impl/src/business_profile.rs:792-806 | crates/storage_impl/src/business_profile.rs:859-873 | crates/storage_impl/src/business_profile.rs:926-940 | crates/storage_impl/src/business_profile.rs:993-1007 | crates/storage_impl/src/business_profile.rs:1129-1143 | crates/storage_impl/src/business_profile.rs:1197-1211 — 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 lines × 6) crates/diesel_models/src/payment_attempt.rs:2618— crates/diesel_models/src/payment_attempt.rs:2618-2631 | crates/diesel_models/src/payment_attempt.rs:2834-2847 | crates/diesel_models/src/payment_attempt.rs:3090-3103 | crates/diesel_models/src/payment_attempt.rs:3174-3187 | crates/diesel_models/src/payment_attempt.rs:3258-3271 | crates/diesel_models/src/payment_attempt.rs:3571-3584 — 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 lines × 6) crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:325— crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:325-338 | crates/hyperswitch_connectors/src/connectors/dummyconnector/transformers.rs:313-326 | crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs:326-339 | crates/hyperswitch_connectors/src/connectors/payjustnow/transformers.rs:247-260 | crates/hyperswitch_connectors/src/connectors/payjustnowinstore/transformers.rs:155-168 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:1029-1042 — `crates/hyperswitch_connectors/src/connectors/boku/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/zen/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 61 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 (14 lines × 6) crates/hyperswitch_connectors/src/connectors/citigate/transformers.rs:125— crates/hyperswitch_connectors/src/connectors/citigate/transformers.rs:125-138 | crates/hyperswitch_connectors/src/connectors/d24/transformers.rs:152-165 | crates/hyperswitch_connectors/src/connectors/interpayments/transformers.rs:122-135 | crates/hyperswitch_connectors/src/connectors/payconex/transformers.rs:125-138 | crates/hyperswitch_connectors/src/connectors/paynearme/transformers.rs:127-140 | crates/hyperswitch_connectors/src/connectors/worldpayraft/transformers.rs:126-139 — `crates/hyperswitch_connectors/src/connectors/citigate/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/interpayments/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 36 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 (14 lines × 6) crates/hyperswitch_connectors/src/connectors/cybersource.rs:536— crates/hyperswitch_connectors/src/connectors/cybersource.rs:536-549 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1319-1332 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1474-1487 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1624-1637 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1782-1795 | crates/hyperswitch_connectors/src/connectors/paypal.rs:433-446 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersource.rs` and `crates/hyperswitch_connectors/src/connectors/paypal.rs` as WHOLE FILES: this scan already matched 13 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 (14 lines × 6) crates/router/src/core/fraud_check/flows/fulfillment_flow.rs:75— crates/router/src/core/fraud_check/flows/fulfillment_flow.rs:75-88 | crates/router/src/core/utils.rs:1332-1345 | crates/router/src/core/utils.rs:1451-1464 | crates/router/src/core/utils.rs:1568-1581 | crates/router/src/core/utils.rs:1768-1781 | crates/router/src/core/utils.rs:2026-2039 — before extracting anything, compare `crates/router/src/core/fraud_check/flows/fulfillment_flow.rs` and `crates/router/src/core/utils.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 4) crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs:388— crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs:388-401 | crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs:294-307 | crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs:349-362 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:683-696 — 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 (14 lines × 4) crates/router/src/core/fraud_check/operation/fraud_check_post.rs:425— crates/router/src/core/fraud_check/operation/fraud_check_post.rs:425-438 | crates/router/src/core/fraud_check/operation/fraud_check_post.rs:470-483 | crates/router/src/core/fraud_check/operation/fraud_check_pre.rs:285-298 | crates/router/src/core/fraud_check/operation/fraud_check_pre.rs:333-346 — before extracting anything, compare `crates/router/src/core/fraud_check/operation/fraud_check_post.rs` and `crates/router/src/core/fraud_check/operation/fraud_check_pre.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 4) crates/router/src/core/payment_methods/network_tokenization.rs:169— crates/router/src/core/payment_methods/network_tokenization.rs:169-182 | crates/router/src/core/payment_methods/network_tokenization.rs:341-354 | crates/router/src/core/payment_methods/network_tokenization.rs:536-549 | crates/router/src/core/payment_methods/network_tokenization.rs:597-610 — 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 (14 lines × 4) crates/router/src/core/unified_authentication_service.rs:1046— crates/router/src/core/unified_authentication_service.rs:1046-1059 | crates/router/src/core/unified_authentication_service.rs:1350-1363 | crates/router/src/core/unified_authentication_service.rs:1684-1697 | crates/router/src/core/unified_authentication_service.rs:2065-2078 — 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 (14 lines × 4) crates/router/src/core/user_role.rs:219— crates/router/src/core/user_role.rs:219-232 | crates/router/src/core/user_role.rs:303-316 | crates/router/src/core/user_role.rs:574-587 | crates/router/src/core/user_role.rs:649-662 — 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 × 4) crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:1048— crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:1048-1061 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:1120-1133 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:1763-1775 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:1840-1853 — 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 × 4) crates/router/src/core/payments/operations/payment_post_session_tokens.rs:136— crates/router/src/core/payments/operations/payment_post_session_tokens.rs:136-149 | crates/router/src/core/payments/operations/payment_session.rs:183-196 | crates/router/src/core/payments/operations/payment_update_metadata.rs:147-159 | crates/router/src/core/payments/operations/tax_calculation.rs:152-165 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_post_session_tokens.rs` and `crates/router/src/core/payments/operations/payment_session.rs` as WHOLE FILES: this scan already matched 12 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–14 lines × 4) crates/router/src/db/capture.rs:61— crates/router/src/db/capture.rs:61-74 | crates/router/src/db/dispute.rs:310-323 | crates/router/src/db/refund.rs:651-663 | crates/router/src/db/reverse_lookup.rs:97-109 — before extracting anything, compare `crates/router/src/db/dispute.rs` and `crates/router/src/db/refund.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 4) crates/router/src/routes/authentication.rs:99— crates/router/src/routes/authentication.rs:99-112 | crates/router/src/routes/authentication.rs:144-157 | crates/router/src/routes/authentication.rs:224-236 | crates/router/src/routes/authentication.rs:297-310 — 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 × 4) crates/storage_impl/src/lib.rs:322— crates/storage_impl/src/lib.rs:322-335 | crates/storage_impl/src/lib.rs:353-366 | crates/storage_impl/src/mock_db.rs:157-169 | crates/storage_impl/src/mock_db.rs:184-196 — 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–14 lines × 2) crates/hyperswitch_connectors/src/connectors/checkout.rs:180— crates/hyperswitch_connectors/src/connectors/checkout.rs:180-193 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:180-189 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/checkout.rs` and `crates/hyperswitch_connectors/src/connectors/trustpay.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 156 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 2) crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:818— crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:818-831 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:969-978 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–14 lines × 2) crates/router/src/core/payment_methods/cards.rs:2055— crates/router/src/core/payment_methods/cards.rs:2055-2064 | crates/router/src/core/payments/tokenization.rs:924-937 — before extracting anything, compare `crates/router/src/core/payment_methods/cards.rs` and `crates/router/src/core/payments/tokenization.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10–14 lines × 2) crates/router/src/core/revenue_recovery.rs:1614— crates/router/src/core/revenue_recovery.rs:1614-1627 | crates/router/src/core/revenue_recovery.rs:1690-1699 — both copies are in the same file, so extract the block into 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–14 lines × 2) crates/router/src/workflows/outgoing_webhook_retry.rs:51— crates/router/src/workflows/outgoing_webhook_retry.rs:51-64 | crates/router/src/workflows/outgoing_webhook_retry.rs:310-319 — both copies are in the same file, so extract the block into 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 × 5) crates/hyperswitch_connectors/src/connectors/blackhawknetwork/transformers.rs:256— crates/hyperswitch_connectors/src/connectors/blackhawknetwork/transformers.rs:256-268 | crates/hyperswitch_connectors/src/connectors/celero/transformers.rs:695-707 | crates/hyperswitch_connectors/src/connectors/celero/transformers.rs:774-786 | crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs:228-240 | crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs:245-257 — 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.
Duplicated block (13 lines × 5) crates/hyperswitch_connectors/src/connectors/santander.rs:322— crates/hyperswitch_connectors/src/connectors/santander.rs:322-334 | crates/hyperswitch_connectors/src/connectors/santander.rs:1195-1207 | crates/hyperswitch_connectors/src/connectors/santander.rs:1501-1513 | crates/hyperswitch_connectors/src/connectors/santander.rs:1769-1781 | crates/hyperswitch_connectors/src/connectors/santander.rs:1899-1911 — 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 (13 lines × 5) crates/router/src/core/payments/flows/authorize_flow.rs:1887— crates/router/src/core/payments/flows/authorize_flow.rs:1887-1899 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:861-873 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:1012-1024 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:1128-1140 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:1266-1278 — before extracting anything, compare `crates/router/src/core/payments/flows/authorize_flow.rs` and `crates/router/src/core/payments/flows/complete_authorize_flow.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:179— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:179-191 | crates/router/src/core/payments/operations/payment_attempt_record.rs:127-139 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:167-179 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:305-317 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:158-170 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/payment_attempt_record.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 5) crates/common_types/src/domain.rs:32— crates/common_types/src/domain.rs:32-224 | crates/common_types/src/refunds.rs:32-52 | crates/common_types/src/three_ds_decision_rule_engine.rs:32-58 | crates/diesel_models/src/enums.rs:116-128 | crates/diesel_models/src/types.rs:71-475 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (11 lines × 6) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:296— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:296-306 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1100-1110 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:401-411 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2736-2746 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:566-576 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:804-814 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 47 separate duplicated blocks between them, totalling at least 513 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 (11 lines × 6) crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1547— crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1547-1558 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1571-1582 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:2447-2458 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:2471-2482 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:748-758 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:775-785 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 291 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/payments/transformers.rs:149— crates/router/src/core/payments/transformers.rs:149-159 | crates/router/src/core/payments/transformers.rs:879-889 | crates/router/src/core/payments/transformers.rs:2050-2060 | crates/router/src/core/payments/transformers.rs:2387-2397 | crates/router/src/core/payments/transformers.rs:3788-3798 | crates/router/src/core/payments/transformers.rs:8423-8433 — 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 (11 lines × 6) crates/hyperswitch_interfaces/src/unified_connector_service.rs:29— crates/hyperswitch_interfaces/src/unified_connector_service.rs:29-39 | crates/router/src/core/unified_connector_service.rs:3340-3350 | crates/router/src/core/unified_connector_service.rs:3355-3365 | crates/router/src/core/unified_connector_service.rs:3406-3416 | crates/router/src/core/unified_connector_service.rs:3421-3431 | crates/router/src/core/unified_connector_service.rs:3615-3625 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 6) crates/hyperswitch_connectors/src/connectors/authipay.rs:301— crates/hyperswitch_connectors/src/connectors/authipay.rs:301-311 | crates/hyperswitch_connectors/src/connectors/authipay.rs:383-393 | crates/hyperswitch_connectors/src/connectors/authipay.rs:474-484 | crates/hyperswitch_connectors/src/connectors/authipay.rs:564-574 | crates/hyperswitch_connectors/src/connectors/authipay.rs:654-664 | crates/hyperswitch_connectors/src/connectors/authipay.rs:736-746 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–11 lines × 3) crates/diesel_models/src/query/blocklist.rs:721— crates/diesel_models/src/query/blocklist.rs:721-731 | crates/diesel_models/src/query/blocklist.rs:761-770 | crates/diesel_models/src/query/blocklist.rs:796-806 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–11 lines × 3) crates/hyperswitch_connectors/src/connectors/airwallex.rs:1100— crates/hyperswitch_connectors/src/connectors/airwallex.rs:1100-1110 | crates/hyperswitch_connectors/src/connectors/calida.rs:637-646 | crates/hyperswitch_connectors/src/connectors/gocardless.rs:728-737 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/airwallex.rs` and `crates/hyperswitch_connectors/src/connectors/calida.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 3) crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs:369— crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs:369-378 | crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs:390-400 | crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs:476-486 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–11 lines × 3) crates/router/src/core/payments.rs:5702— crates/router/src/core/payments.rs:5702-5712 | crates/router/src/core/payments/operations/payment_confirm.rs:1348-1358 | crates/router/src/core/webhooks/incoming.rs:2107-2116 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10–11 lines × 3) crates/router/src/services/authentication.rs:1856— crates/router/src/services/authentication.rs:1856-1865 | crates/router/src/services/authentication.rs:2384-2394 | crates/router/src/services/authentication.rs:2625-2634 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–10 lines × 3) crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:433— crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:433-441 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:513-521 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:946-955 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–10 lines × 3) crates/router/src/core/payment_methods/cards.rs:3950— crates/router/src/core/payment_methods/cards.rs:3950-3958 | crates/router/src/core/payment_methods/cards.rs:4015-4024 | crates/router/src/core/payment_methods/cards.rs:4087-4096 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–10 lines × 3) crates/router/src/core/payments.rs:5354— crates/router/src/core/payments.rs:5354-5362 | crates/router/src/core/payments.rs:5499-5507 | crates/router/src/core/payments.rs:6049-6058 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–10 lines × 3) crates/router/src/core/payments.rs:13632— crates/router/src/core/payments.rs:13632-13641 | crates/router/src/core/payouts/helpers.rs:1153-1161 | crates/router/src/core/payouts/helpers.rs:1205-1213 — 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 (9–10 lines × 3) crates/router/src/core/payments/transformers.rs:6031— crates/router/src/core/payments/transformers.rs:6031-6039 | crates/router/src/core/payments/transformers.rs:6174-6183 | crates/router/src/core/payments/transformers.rs:7498-7506 — all 3 copies are in the same file, so extract the block into one function there and call 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) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2450— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2450-2457 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:184-191 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:732-740 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:366-373 | crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs:160-167 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/boku/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 18 separate duplicated blocks between them, totalling at least 159 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 5) crates/hyperswitch_connectors/src/utils.rs:2968— crates/hyperswitch_connectors/src/utils.rs:2968-2975 | crates/router/src/connector/utils.rs:869-876 | crates/router/src/connector/utils.rs:1135-1142 | crates/router/src/connector/utils.rs:1199-1206 | crates/router/src/connector/utils.rs:1225-1232 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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 × 5) crates/router/src/core/user.rs:302— crates/router/src/core/user.rs:302-309 | crates/router/src/core/user.rs:1632-1639 | crates/router/src/core/user.rs:2205-2213 | crates/router/src/core/user.rs:2323-2330 | crates/router/src/core/user_role.rs:513-520 — before extracting anything, compare `crates/router/src/core/user.rs` and `crates/router/src/core/user_role.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 5) crates/router/src/types/storage/dispute.rs:121— crates/router/src/types/storage/dispute.rs:121-128 | crates/router/src/types/storage/dispute.rs:189-196 | crates/router/src/types/storage/refund.rs:178-185 | crates/router/src/types/storage/refund.rs:263-270 | crates/router/src/types/storage/refund.rs:417-424 — before extracting anything, compare `crates/router/src/types/storage/dispute.rs` and `crates/router/src/types/storage/refund.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 5) crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers.rs:23— crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers.rs:23-30 | crates/hyperswitch_connectors/src/connectors/dummyconnector/transformers.rs:242-249 | crates/hyperswitch_connectors/src/connectors/sanlam_payshield/transformers.rs:39-46 | crates/hyperswitch_connectors/src/connectors/signifyd/transformers/auth.rs:11-18 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout/transformers.rs:86-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (6 lines × 4) crates/diesel_models/src/query/user/sample_data.rs:30— crates/diesel_models/src/query/user/sample_data.rs:30-35 | crates/diesel_models/src/query/user/sample_data.rs:46-51 | crates/diesel_models/src/query/user/sample_data.rs:61-66 | crates/diesel_models/src/query/user/sample_data.rs:76-81 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 4) crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:300— crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:300-305 | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:411-416 | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:489-494 | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:572-577 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 4) crates/router/src/core/files.rs:47— crates/router/src/core/files.rs:47-52 | crates/router/src/core/refunds.rs:1775-1780 | crates/router/src/core/refunds_v2.rs:1264-1269 | crates/router/src/core/routing.rs:579-584 — before extracting anything, compare `crates/router/src/core/refunds.rs` and `crates/router/src/core/refunds_v2.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/payment_methods/cards.rs:284— crates/router/src/core/payment_methods/cards.rs:284-289 | crates/router/src/core/payment_methods/transformers.rs:492-497 | crates/router/src/core/payment_methods/transformers.rs:518-523 | crates/router/src/core/payments/tokenization.rs:1635-1640 — before extracting anything, compare `crates/router/src/core/payment_methods/cards.rs` and `crates/router/src/core/payments/tokenization.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) crates/router/src/core/relay.rs:164— crates/router/src/core/relay.rs:164-169 | crates/router/src/core/relay.rs:296-301 | crates/router/src/core/relay.rs:432-438 | crates/router/src/core/relay.rs:568-573 — 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.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×5
Untrusted text written into markup unescaped REDACTED:973— `arrowDownImage.innerHTML` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped REDACTED:1114— `arrowUpImage.innerHTML` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped REDACTED:1151— `arrowDownImage.innerHTML` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js:18— `translations.notAllowed` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js:20— `translations.notAllowed` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
RouterStore::get_filtered_payment_intents_attempt_for_platform (cyclomatic 27) crates/storage_impl/src/payments/payment_intent.rs:1008— RouterStore::get_filtered_payment_intents_attempt_for_platform 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.
RouterStore::get_filtered_payment_intents_attempt (cyclomatic 26) crates/storage_impl/src/payments/payment_intent.rs:1349— RouterStore::get_filtered_payment_intents_attempt has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
RouterStore::get_filtered_payment_intents_attempt (cyclomatic 25) crates/storage_impl/src/payments/payment_intent.rs:1570— RouterStore::get_filtered_payment_intents_attempt has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
RouterStore::get_payment_intents_attempt_count_for_platform (cyclomatic 20) crates/storage_impl/src/payments/payment_intent.rs:1170— RouterStore::get_payment_intents_attempt_count_for_platform 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.
PaymentConfirm::call_unified_authentication_service_if_eligible (cognitive 41) crates/router/src/core/payments/operations/payment_confirm.rs:1957— PaymentConfirm::call_unified_authentication_service_if_eligible has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 5 (15 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PaymentConfirm::create_payment_method (cognitive 28) crates/router/src/core/payments/operations/payment_confirm.rs:1172— PaymentConfirm::create_payment_method has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 5 (18 pts), if/else 4 (8 pts), boolean chains 2 (nesting depth added 17). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PaymentConfirm::get_trackers (cognitive 22) crates/router/src/core/payments/operations/payment_confirm.rs:78— PaymentConfirm::get_trackers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, match/switch 6 (7 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.
PaymentConfirm::fetch_payment_method (cognitive 22) crates/router/src/core/payments/operations/payment_confirm.rs:1335— PaymentConfirm::fetch_payment_method has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 6 (16 pts), if/else 4 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
hyperswitch_connectors::connectors::adyen::transformers::get_adyen_webhook_event (cognitive 31) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:5669— hyperswitch_connectors::connectors::adyen::transformers::get_adyen_webhook_event has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 7 (13 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
hyperswitch_connectors::connectors::nexixpay::transformers::get_validated_address_details_generic (cognitive 29) crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:108— hyperswitch_connectors::connectors::nexixpay::transformers::get_validated_address_details_generic has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (27 pts), match/switch 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.
hyperswitch_connectors::connectors::stripe::transformers::create_stripe_line_items_data (cognitive 18) crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:2110— hyperswitch_connectors::connectors::stripe::transformers::create_stripe_line_items_data has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), 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.
hyperswitch_connectors::connectors::nuvei::transformers::get_payment_status (cognitive 17) crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2147— hyperswitch_connectors::connectors::nuvei::transformers::get_payment_status has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 7 (15 pts), boolean chains 1, if/else 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
payment_link::css_generator::generate_dynamic_css (cognitive 18) crates/payment_link/src/css_generator.rs:275— payment_link::css_generator::generate_dynamic_css has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
payment_link::css_generator::sanitize_color (cognitive 17) crates/payment_link/src/css_generator.rs:57— payment_link::css_generator::sanitize_color has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
payment_link::wasm::validate_payment_link_config_impl (cognitive 17) crates/payment_link/src/wasm.rs:91— payment_link::wasm::validate_payment_link_config_impl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5 (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.
payment_link::js_generator::convert_custom_message_keys_to_camel (cognitive 16) crates/payment_link/src/js_generator.rs:51— payment_link::js_generator::convert_custom_message_keys_to_camel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (14 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (14 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:210— crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:210-222 | crates/hyperswitch_connectors/src/connectors/datatrans.rs:234-246 | crates/hyperswitch_connectors/src/connectors/finix.rs:412-424 | crates/hyperswitch_connectors/src/connectors/gocardless.rs:395-412 | crates/hyperswitch_connectors/src/connectors/mollie.rs:361-373 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:318-330 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:294-306 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:284-296 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:264-276 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:344-356 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:262-274 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:245-257 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:322-334 | crates/hyperswitch_connectors/src/connectors/zift.rs:111-123 — These 14 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 14 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 14 times.
Members sharing a duplicated core (14 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:1015— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:1015-1024 | crates/hyperswitch_connectors/src/connectors/checkout.rs:916-925 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:2078-2087 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:593-602 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:955-964 | crates/hyperswitch_connectors/src/connectors/globepay.rs:507-516 | crates/hyperswitch_connectors/src/connectors/nexinets.rs:659-668 | crates/hyperswitch_connectors/src/connectors/noon.rs:793-802 | crates/hyperswitch_connectors/src/connectors/opayo.rs:532-541 | crates/hyperswitch_connectors/src/connectors/payu.rs:745-754 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:900-909 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:1151-1160 | crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs:624-633 | crates/hyperswitch_connectors/src/connectors/zen.rs:520-529 — These 14 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 14 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 14 times.
Members sharing a duplicated core (14 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/fiserv.rs:392— crates/hyperswitch_connectors/src/connectors/fiserv.rs:392-435 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:502-538 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:640-677 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:753-784 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:853-897 | crates/hyperswitch_connectors/src/connectors/stripe.rs:726-752 | crates/hyperswitch_connectors/src/connectors/stripe.rs:913-973 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1131-1157 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1930-1957 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2093-2120 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:916-954 | crates/hyperswitch_connectors/src/connectors/xendit.rs:301-331 | crates/hyperswitch_connectors/src/connectors/xendit.rs:745-772 | crates/hyperswitch_connectors/src/connectors/xendit.rs:840-867 — These 14 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 14 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 14 times.
Members sharing a duplicated core (14 members, 50+ identical tokens) crates/router/src/core/payments/operations/payment_response.rs:720— crates/router/src/core/payments/operations/payment_response.rs:720-747 | crates/router/src/core/payments/operations/payment_response.rs:1335-1352 | crates/router/src/core/payments/operations/payment_response.rs:1501-1520 | crates/router/src/core/payments/operations/payment_response.rs:1827-1846 | crates/router/src/core/payments/operations/payment_response.rs:1875-1894 | crates/router/src/core/payments/operations/payment_response.rs:1917-1936 | crates/router/src/core/payments/operations/payment_response.rs:1965-1984 | crates/router/src/core/payments/operations/payment_response.rs:2013-2032 | crates/router/src/core/payments/operations/payment_response.rs:2061-2080 | crates/router/src/core/payments/operations/payment_response.rs:2105-2124 | crates/router/src/core/payments/operations/payment_response.rs:2147-2166 | crates/router/src/core/payments/operations/payment_response.rs:2194-2218 | crates/router/src/core/payments/operations/payment_response.rs:2437-2454 | crates/router/src/core/payments/operations/payment_response.rs:4721-4738 — These 14 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 14 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 14 times.
Duplicated block (43 lines × 2) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1137— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1137-1179 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:1243-1285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (43 lines × 2) crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:602— crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:602-644 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:682-724 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (43 lines × 2) crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs:376— crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs:376-418 | crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs:662-704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (43 lines × 2) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:524— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:524-566 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:406-448 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/proxy_payments_intent.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 289 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (35 lines × 2) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2369— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2369-2403 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3370-3404 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (35 lines × 2) crates/router/src/core/admin.rs:4219— crates/router/src/core/admin.rs:4219-4253 | crates/router/src/core/admin.rs:4454-4488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (35 lines × 2) crates/router/src/core/user_role/role.rs:148— crates/router/src/core/user_role/role.rs:148-182 | crates/router/src/core/user_role/role.rs:281-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (35 lines × 2) crates/router/src/services/authentication.rs:5674— crates/router/src/services/authentication.rs:5674-5708 | crates/router/src/services/authentication.rs:5793-5827 — both copies are in the same file, so extract the block into 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–28 lines × 2) crates/router/src/core/payment_methods/utils.rs:758— crates/router/src/core/payment_methods/utils.rs:758-784 | crates/router/src/core/payment_methods/utils.rs:788-815 — both copies are in the same file, so extract the block into 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–28 lines × 2) crates/router/src/db/dispute.rs:148— crates/router/src/db/dispute.rs:148-175 | crates/router/src/db/dispute.rs:508-534 — both copies are in the same file, so extract the block into 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–28 lines × 2) crates/router/src/services/authentication.rs:3109— crates/router/src/services/authentication.rs:3109-3135 | crates/router/src/services/authentication.rs:3471-3498 — both copies are in the same file, so extract the block into 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–28 lines × 2) crates/router/src/workflows/attach_payout_account_workflow.rs:28— crates/router/src/workflows/attach_payout_account_workflow.rs:28-55 | crates/router/src/workflows/payout_sync.rs:46-72 — 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 (25–26 lines × 2) crates/hyperswitch_connectors/src/connectors/absa_sanlam/transformers.rs:107— crates/hyperswitch_connectors/src/connectors/absa_sanlam/transformers.rs:107-132 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:2327-2351 — 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 (25–26 lines × 2) crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:1364— crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:1364-1388 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:1909-1934 — both copies are in the same file, so extract the block into 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–26 lines × 2) crates/router/src/core/payments/flows/authorize_flow.rs:1405— crates/router/src/core/payments/flows/authorize_flow.rs:1405-1429 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:1348-1373 — before extracting anything, compare `crates/router/src/core/payments/flows/authorize_flow.rs` and `crates/router/src/core/payments/flows/complete_authorize_flow.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–26 lines × 2) crates/router/src/core/payments/operations/payment_complete_authorize.rs:289— crates/router/src/core/payments/operations/payment_complete_authorize.rs:289-314 | crates/router/src/core/payments/operations/payment_confirm.rs:492-516 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_complete_authorize.rs` and `crates/router/src/core/payments/operations/payment_confirm.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (24–25 lines × 2) crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs:163— crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs:163-186 | crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:96-120 — `crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 104 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 (24–25 lines × 2) crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1523— crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1523-1547 | crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1667-1690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24–25 lines × 2) crates/router/src/core/payments/transformers.rs:5653— crates/router/src/core/payments/transformers.rs:5653-5676 | crates/router/src/core/payments/transformers.rs:7311-7335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24–25 lines × 2) crates/router/src/core/webhooks/outgoing.rs:1218— crates/router/src/core/webhooks/outgoing.rs:1218-1242 | crates/router/src/core/webhooks/outgoing.rs:1316-1339 — both copies are in the same file, so extract the block into 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 × 3) crates/hyperswitch_domain_models/src/type_encryption.rs:119— crates/hyperswitch_domain_models/src/type_encryption.rs:119-142 | crates/hyperswitch_domain_models/src/type_encryption.rs:358-381 | crates/hyperswitch_domain_models/src/type_encryption.rs:831-854 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (24 lines × 3) crates/hyperswitch_domain_models/src/type_encryption.rs:228— crates/hyperswitch_domain_models/src/type_encryption.rs:228-251 | crates/hyperswitch_domain_models/src/type_encryption.rs:466-489 | crates/hyperswitch_domain_models/src/type_encryption.rs:934-957 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (24 lines × 3) crates/router/src/core/payouts.rs:2350— crates/router/src/core/payouts.rs:2350-2373 | crates/router/src/core/payouts.rs:2602-2625 | crates/router/src/core/payouts.rs:3177-3200 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (24 lines × 3) crates/router/src/db/refund.rs:618— crates/router/src/db/refund.rs:618-641 | crates/router/src/db/refund.rs:1084-1107 | crates/router/src/db/refund.rs:1167-1190 — all 3 copies are in the same file, so extract the block into one function there and call 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 (23–24 lines × 2) crates/analytics/src/payments/metrics/debit_routing.rs:43— crates/analytics/src/payments/metrics/debit_routing.rs:43-66 | crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs:44-66 — before extracting anything, compare `crates/analytics/src/payments/metrics/debit_routing.rs` and `crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 167 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (23–24 lines × 2) crates/router/src/core/payment_methods/vault.rs:2762— crates/router/src/core/payment_methods/vault.rs:2762-2785 | crates/router/src/core/payment_methods/vault.rs:3454-3476 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/operations/payment_confirm.rs:3270— crates/router/src/core/payments/operations/payment_confirm.rs:3270-3292 | crates/router/src/core/payments/operations/payment_update.rs:1022-1045 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_update.rs` 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.
Duplicated block (23–24 lines × 2) crates/router/src/core/superposition_sdk_config.rs:294— crates/router/src/core/superposition_sdk_config.rs:294-316 | crates/router/src/core/superposition_sdk_config.rs:402-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22–23 lines × 2) crates/router/src/core/disputes.rs:260— crates/router/src/core/disputes.rs:260-282 | crates/router/src/core/refunds.rs:2212-2233 — before extracting anything, compare `crates/router/src/core/disputes.rs` and `crates/router/src/core/refunds.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–23 lines × 2) crates/router/src/core/routing/helpers.rs:2193— crates/router/src/core/routing/helpers.rs:2193-2215 | crates/router/src/core/routing/helpers.rs:2329-2350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22–23 lines × 2) crates/router/src/services/authentication.rs:1811— crates/router/src/services/authentication.rs:1811-1833 | crates/router/src/services/authentication.rs:2339-2360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22–23 lines × 2) crates/router/src/types/api/payment_methods.rs:85— crates/router/src/types/api/payment_methods.rs:85-106 | crates/router/src/types/api/payment_methods.rs:116-138 — both copies are in the same file, so extract the block into 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 × 5) crates/diesel_models/src/payment_attempt.rs:2546— crates/diesel_models/src/payment_attempt.rs:2546-2564 | crates/diesel_models/src/payment_attempt.rs:2774-2792 | crates/diesel_models/src/payment_attempt.rs:3397-3415 | crates/diesel_models/src/payment_attempt.rs:3766-3784 | crates/diesel_models/src/payment_attempt.rs:3860-3878 — 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 (19 lines × 5) REDACTED:903— REDACTED:903-921 | REDACTED:966-984 | REDACTED:1228-1246 | REDACTED:1692-1710 | REDACTED:1943-1961 — 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 (19 lines × 5) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2754— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2754-2772 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3474-3492 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:5593-5611 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager/transformers.rs:294-312 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:2474-2492 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (19 lines × 5) crates/router/src/services/authentication.rs:632— crates/router/src/services/authentication.rs:632-650 | crates/router/src/services/authentication.rs:737-755 | crates/router/src/services/authentication.rs:1984-2002 | crates/router/src/services/authentication.rs:2135-2153 | crates/router/src/services/authentication.rs:3060-3078 — 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 (14–17 lines × 2) crates/analytics/src/connector_events/events.rs:50— crates/analytics/src/connector_events/events.rs:50-66 | crates/analytics/src/outgoing_webhook_event/events.rs:50-63 — 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–17 lines × 2) crates/hyperswitch_domain_models/src/type_encryption.rs:732— crates/hyperswitch_domain_models/src/type_encryption.rs:732-748 | crates/hyperswitch_domain_models/src/type_encryption.rs:799-812 — both copies are in the same file, so extract the block into 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–17 lines × 2) crates/router/src/core/fraud_check/operation/fraud_check_post.rs:487— crates/router/src/core/fraud_check/operation/fraud_check_post.rs:487-500 | crates/router/src/core/fraud_check/operation/fraud_check_pre.rs:302-318 — before extracting anything, compare `crates/router/src/core/fraud_check/operation/fraud_check_post.rs` and `crates/router/src/core/fraud_check/operation/fraud_check_pre.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–17 lines × 2) crates/router/src/core/payment_methods/cards.rs:5459— crates/router/src/core/payment_methods/cards.rs:5459-5475 | crates/router/src/core/superposition_sdk_config.rs:105-118 — before extracting anything, compare `crates/router/src/core/payment_methods/cards.rs` and `crates/router/src/core/superposition_sdk_config.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 7) crates/hyperswitch_connectors/src/connectors/facilitapay.rs:195— crates/hyperswitch_connectors/src/connectors/facilitapay.rs:195-210 | crates/hyperswitch_connectors/src/connectors/finix.rs:132-147 | crates/hyperswitch_connectors/src/connectors/gocardless.rs:214-229 | crates/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs:299-314 | crates/hyperswitch_connectors/src/connectors/mollie.rs:280-295 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:371-386 | crates/hyperswitch_connectors/src/connectors/stax.rs:212-227 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/facilitapay.rs` and `crates/hyperswitch_connectors/src/connectors/finix.rs` as WHOLE FILES: this scan already matched 6 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 × 7) crates/storage_impl/src/business_profile.rs:1805— crates/storage_impl/src/business_profile.rs:1805-1820 | crates/storage_impl/src/business_profile.rs:1865-1880 | crates/storage_impl/src/business_profile.rs:2105-2120 | crates/storage_impl/src/business_profile.rs:2165-2180 | crates/storage_impl/src/business_profile.rs:2225-2240 | crates/storage_impl/src/business_profile.rs:2286-2301 | crates/storage_impl/src/business_profile.rs:2347-2362 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 7) crates/storage_impl/src/business_profile.rs:1848— crates/storage_impl/src/business_profile.rs:1848-1863 | crates/storage_impl/src/business_profile.rs:1908-1923 | crates/storage_impl/src/business_profile.rs:1968-1983 | crates/storage_impl/src/business_profile.rs:2028-2043 | crates/storage_impl/src/business_profile.rs:2088-2103 | crates/storage_impl/src/business_profile.rs:2148-2163 | crates/storage_impl/src/business_profile.rs:2208-2223 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 7) crates/storage_impl/src/business_profile.rs:1845— crates/storage_impl/src/business_profile.rs:1845-1860 | crates/storage_impl/src/business_profile.rs:1905-1920 | crates/storage_impl/src/business_profile.rs:1965-1980 | crates/storage_impl/src/business_profile.rs:2025-2040 | crates/storage_impl/src/business_profile.rs:2085-2100 | crates/storage_impl/src/business_profile.rs:2145-2160 | crates/storage_impl/src/business_profile.rs:2387-2402 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 7) crates/router/src/compatibility/stripe/payment_intents.rs:59— crates/router/src/compatibility/stripe/payment_intents.rs:59-73 | crates/router/src/compatibility/stripe/payment_intents.rs:140-154 | crates/router/src/compatibility/stripe/payment_intents.rs:230-244 | crates/router/src/compatibility/stripe/payment_intents.rs:316-330 | crates/router/src/compatibility/stripe/payment_intents.rs:411-425 | crates/router/src/compatibility/stripe/payment_intents.rs:488-502 | crates/router/src/compatibility/stripe/payment_intents.rs:573-587 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 7) crates/router/src/core/payments/operations/payment_cancel.rs:160— crates/router/src/core/payments/operations/payment_cancel.rs:160-174 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:142-156 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:133-147 | crates/router/src/core/payments/operations/payment_reject.rs:153-167 | crates/router/src/core/payments/operations/payment_session.rs:174-188 | crates/router/src/core/payments/operations/payment_start.rs:176-190 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:148-162 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 7) crates/router/src/services/authentication.rs:4246— crates/router/src/services/authentication.rs:4246-4260 | crates/router/src/services/authentication.rs:4472-4486 | crates/router/src/services/authentication.rs:4567-4581 | crates/router/src/services/authentication.rs:4739-4753 | crates/router/src/services/authentication.rs:4809-4823 | crates/router/src/services/authentication.rs:4902-4916 | crates/router/src/services/authentication.rs:5105-5119 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 7) crates/hyperswitch_interfaces/src/conversion_impls.rs:303— crates/hyperswitch_interfaces/src/conversion_impls.rs:303-317 | crates/hyperswitch_interfaces/src/conversion_impls.rs:396-410 | crates/hyperswitch_interfaces/src/conversion_impls.rs:466-480 | crates/hyperswitch_interfaces/src/conversion_impls.rs:533-548 | crates/hyperswitch_interfaces/src/conversion_impls.rs:592-606 | crates/hyperswitch_interfaces/src/conversion_impls.rs:785-799 | crates/hyperswitch_interfaces/src/conversion_impls.rs:1201-1215 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 8) crates/diesel_models/src/payment_attempt.rs:1249— crates/diesel_models/src/payment_attempt.rs:1249-1261 | crates/diesel_models/src/payment_attempt.rs:1302-1314 | crates/diesel_models/src/payment_attempt.rs:1351-1363 | crates/diesel_models/src/payment_attempt.rs:1398-1410 | crates/diesel_models/src/payment_attempt.rs:1490-1502 | crates/diesel_models/src/payment_attempt.rs:3844-3856 | crates/diesel_models/src/payment_attempt.rs:4109-4121 | crates/diesel_models/src/payment_attempt.rs:4379-4391 — 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 (13 lines × 8) REDACTED:1622— REDACTED:1622-1634 | REDACTED:1686-1698 | REDACTED:1745-1757 | REDACTED:1809-1821 | REDACTED:1871-1883 | REDACTED:1937-1949 | REDACTED:2003-2015 | REDACTED:2065-2077 — 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 (13 lines × 8) crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:393— crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:393-405 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:197-209 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:135-147 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:77-89 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:184-196 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:452-464 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:131-143 | crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs:176-188 — `crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/boku/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 88 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 8) crates/router/src/db/address.rs:108— crates/router/src/db/address.rs:108-120 | crates/router/src/db/address.rs:160-172 | crates/router/src/db/address.rs:191-203 | crates/router/src/db/address.rs:221-233 | crates/router/src/db/address.rs:249-261 | crates/router/src/db/address.rs:334-346 | crates/router/src/db/address.rs:421-433 | crates/router/src/db/address.rs:647-659 — 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 (12 lines × 5) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:126— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:126-137 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:120-131 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:145-156 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:123-134 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:127-138 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 5) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:242— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:242-253 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:265-276 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:211-222 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:273-284 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:178-189 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 5) crates/router/src/core/payment_methods.rs:5617— crates/router/src/core/payment_methods.rs:5617-5628 | crates/router/src/core/payment_methods.rs:5776-5787 | crates/router/src/core/payment_methods/vault.rs:2775-2786 | crates/router/src/core/payment_methods/vault.rs:3323-3334 | crates/router/src/core/payment_methods/vault.rs:3466-3477 — before extracting anything, compare `crates/router/src/core/payment_methods.rs` and `crates/router/src/core/payment_methods/vault.rs` as WHOLE FILES: this scan already matched 6 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 (12 lines × 5) crates/router/src/routes/payment_methods.rs:298— crates/router/src/routes/payment_methods.rs:298-309 | crates/router/src/routes/payment_methods.rs:350-361 | crates/router/src/routes/payment_methods.rs:401-412 | crates/router/src/routes/payment_methods.rs:979-990 | crates/router/src/routes/payment_methods.rs:1771-1782 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 7) crates/analytics/src/sqlx.rs:608— crates/analytics/src/sqlx.rs:608-618 | crates/analytics/src/sqlx.rs:655-665 | crates/analytics/src/sqlx.rs:770-780 | crates/analytics/src/sqlx.rs:906-916 | crates/analytics/src/sqlx.rs:1130-1140 | crates/analytics/src/sqlx.rs:1337-1347 | crates/analytics/src/sqlx.rs:1447-1457 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 7) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1482— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1482-1492 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1547-1557 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:104-114 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2986-2996 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3067-3077 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:850-860 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:142-152 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 136 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 (11 lines × 7) crates/hyperswitch_connectors/src/connectors/cybersource.rs:504— crates/hyperswitch_connectors/src/connectors/cybersource.rs:504-514 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1039-1049 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1287-1297 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1442-1452 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1592-1602 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1750-1760 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1914-1924 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 7) crates/router/src/core/payouts.rs:1991— crates/router/src/core/payouts.rs:1991-2001 | crates/router/src/core/payouts.rs:2205-2215 | crates/router/src/core/payouts.rs:2456-2466 | crates/router/src/core/payouts.rs:2682-2692 | crates/router/src/core/payouts.rs:2964-2974 | crates/router/src/core/payouts.rs:3106-3116 | crates/router/src/core/payouts.rs:3315-3325 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–11 lines × 2) crates/hyperswitch_connectors/src/connectors/helcim.rs:276— crates/hyperswitch_connectors/src/connectors/helcim.rs:276-284 | crates/hyperswitch_connectors/src/connectors/helcim.rs:365-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–11 lines × 2) crates/hyperswitch_connectors/src/connectors/riskified.rs:478— crates/hyperswitch_connectors/src/connectors/riskified.rs:478-488 | crates/hyperswitch_connectors/src/connectors/signifyd.rs:555-563 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/riskified.rs` and `crates/hyperswitch_connectors/src/connectors/signifyd.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–11 lines × 2) crates/router/src/core/payment_methods/transformers.rs:346— crates/router/src/core/payment_methods/transformers.rs:346-356 | crates/router/src/core/payment_methods/transformers.rs:392-400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–11 lines × 2) crates/router/src/core/payments/helpers.rs:8039— crates/router/src/core/payments/helpers.rs:8039-8047 | crates/router/src/core/payments/helpers.rs:8158-8168 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/aci.rs:473— crates/hyperswitch_connectors/src/connectors/aci.rs:473-482 | crates/hyperswitch_connectors/src/connectors/aci.rs:574-583 | crates/hyperswitch_connectors/src/connectors/adyen.rs:884-893 | crates/hyperswitch_connectors/src/connectors/adyen.rs:989-998 | crates/hyperswitch_connectors/src/connectors/bambora.rs:96-105 | crates/hyperswitch_connectors/src/connectors/checkout.rs:98-107 | crates/hyperswitch_connectors/src/connectors/square.rs:88-97 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/aci.rs` and `crates/hyperswitch_connectors/src/connectors/adyen.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/adyen.rs:551— crates/hyperswitch_connectors/src/connectors/adyen.rs:551-560 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:331-340 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:361-370 | crates/hyperswitch_connectors/src/connectors/checkout.rs:411-420 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:448-457 | crates/hyperswitch_connectors/src/connectors/paypal.rs:948-957 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:406-415 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 7) crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:148— crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:148-157 | crates/hyperswitch_connectors/src/connectors/braintree.rs:201-210 | crates/hyperswitch_connectors/src/connectors/mifinity.rs:197-207 | crates/hyperswitch_connectors/src/connectors/payme.rs:159-168 | crates/hyperswitch_connectors/src/connectors/rapyd.rs:146-155 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:155-164 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:212-221 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bamboraapac.rs` and `crates/hyperswitch_connectors/src/connectors/braintree.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 (10 lines × 7) crates/hyperswitch_connectors/src/connectors/cybersource.rs:545— crates/hyperswitch_connectors/src/connectors/cybersource.rs:545-554 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1071-1080 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1328-1337 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1483-1492 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1633-1642 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1791-1800 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1946-1955 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 8) crates/analytics/src/sqlx.rs:247— crates/analytics/src/sqlx.rs:247-252 | crates/analytics/src/sqlx.rs:598-603 | crates/analytics/src/sqlx.rs:645-650 | crates/analytics/src/sqlx.rs:760-765 | crates/analytics/src/sqlx.rs:888-893 | crates/analytics/src/sqlx.rs:1107-1112 | crates/analytics/src/sqlx.rs:1318-1323 | crates/analytics/src/sqlx.rs:1437-1442 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 8) crates/analytics/src/sqlx.rs:581— crates/analytics/src/sqlx.rs:581-586 | crates/analytics/src/sqlx.rs:708-713 | crates/analytics/src/sqlx.rs:839-844 | crates/analytics/src/sqlx.rs:976-981 | crates/analytics/src/sqlx.rs:1060-1065 | crates/analytics/src/sqlx.rs:1167-1172 | crates/analytics/src/sqlx.rs:1264-1269 | crates/analytics/src/sqlx.rs:1310-1315 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 8) crates/router/src/types/storage/dispute.rs:83— crates/router/src/types/storage/dispute.rs:83-89 | crates/router/src/types/storage/dispute.rs:154-159 | crates/router/src/types/storage/dispute.rs:222-227 | crates/router/src/types/storage/refund.rs:134-140 | crates/router/src/types/storage/refund.rs:219-225 | crates/router/src/types/storage/refund.rs:302-308 | crates/router/src/types/storage/refund.rs:537-543 | crates/router/src/types/storage/refund.rs:606-612 — before extracting anything, compare `crates/router/src/types/storage/dispute.rs` and `crates/router/src/types/storage/refund.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 8) crates/router/src/db/api_keys.rs:163— crates/router/src/db/api_keys.rs:163-168 | crates/router/src/db/mandate.rs:194-199 | crates/router/src/db/mandate.rs:425-430 | crates/router/src/db/mandate.rs:454-459 | crates/router/src/db/role.rs:138-143 | crates/router/src/db/user.rs:134-140 | crates/router/src/db/user.rs:180-186 | crates/router/src/db/user/theme.rs:98-103 — there are 8 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 8 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 5) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3027— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3027-3032 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3253-3258 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3401-3406 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3798-3803 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:6915-6920 — 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) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:166— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:166-171 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:177-182 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:346-351 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:178-183 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:312-317 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 5) crates/router/src/core/user.rs:302— crates/router/src/core/user.rs:302-307 | crates/router/src/core/user.rs:1526-1531 | crates/router/src/core/user.rs:1632-1637 | crates/router/src/core/user.rs:2323-2328 | crates/router/src/core/user_role.rs:513-518 — before extracting anything, compare `crates/router/src/core/user.rs` and `crates/router/src/core/user_role.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 5) crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:1153— crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:1153-1158 | crates/hyperswitch_connectors/src/connectors/checkout.rs:178-183 | crates/hyperswitch_connectors/src/connectors/paypal.rs:178-183 | crates/hyperswitch_connectors/src/connectors/paypal.rs:377-384 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:178-183 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs` and `crates/hyperswitch_connectors/src/connectors/checkout.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Weak hash algorithm crates/common_utils/src/crypto.rs:525— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/hyperswitch_connectors/src/connectors/braintree.rs:1061— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs:360— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs:961— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Skipped test: toggle-success-based-dynamic-routing cypress-tests/cypress/e2e/spec/Routing/00005-DynamicRouting.cy.js:141— Skipped — switched off by xit
Skipped test: toggle-elimination-dynamic-routing cypress-tests/cypress/e2e/spec/Routing/00005-DynamicRouting.cy.js:159— Skipped — switched off by xit
Skipped test: should return 200 with keys array from JWKS endpoint (skipped: server returns 500 OI_05 — malformed OIDC signing key config, known defect) cypress-tests/cypress/e2e/spec/Misc/00003-OidcRouteMismatch.cy.js:29— Skipped — switched off by it.skip
analytics::payment_intents::core::get_metrics (cognitive 45) crates/analytics/src/payment_intents/core.rs:69— analytics::payment_intents::core::get_metrics has cognitive complexity 45 (threshold 15). Drivers by points: if/else 26 (32 pts), match/switch 4 (8 pts), loops 3 (5 pts) (nesting depth added 12). 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.
analytics::payments::core::get_metrics (cognitive 45) crates/analytics/src/payments/core.rs:49— analytics::payments::core::get_metrics has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (27 pts), match/switch 3 (10 pts), loops 4 (8 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.
analytics::refunds::core::get_metrics (cognitive 37) crates/analytics/src/refunds/core.rs:48— analytics::refunds::core::get_metrics has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (18 pts), match/switch 4 (11 pts), loops 4 (8 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RouterData::try_from (cognitive 27) crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:2019— RouterData::try_from has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 4 (6 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RouterData::try_from (cognitive 19) crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:1375— RouterData::try_from has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 4 (7 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RouterData::get_attempt_status_for_db_update (cognitive 16) crates/router/src/connector/utils.rs:153— RouterData::get_attempt_status_for_db_update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 4). 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.
Near-duplicate member pair (66 shared lines) crates/router/src/core/user_role.rs:160— crates/router/src/core/user_role.rs:160-383 | crates/router/src/core/user_role.rs:527-786 — These two members are variants of one another: 66 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 (66 shared lines) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:1975— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:1975-2165 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2965-3180 — These two members are variants of one another: 66 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 (66 shared lines) crates/router/src/core/payment_methods/transformers.rs:1478— crates/router/src/core/payment_methods/transformers.rs:1478-1596 | crates/router/src/core/payment_methods/transformers.rs:1602-1720 — These two members are variants of one another: 66 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 (44 shared lines) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:462— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:462-588 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:307-503 — These two members are variants of one another: 44 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 (44 shared lines) crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:105— crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:105-234 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:307-503 — These two members are variants of one another: 44 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 (44 shared lines) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1010— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1010-1181 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:783-869 — These two members are variants of one another: 44 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (41 shared lines) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1010— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1010-1181 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:307-503 — These two members are variants of one another: 41 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (41 shared lines) crates/api_models/src/payment_methods.rs:2840— crates/api_models/src/payment_methods.rs:2840-2914 | crates/api_models/src/payment_methods.rs:2958-3032 — These two members are variants of one another: 41 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (41 shared lines) crates/router/src/compatibility/stripe/setup_intents.rs:182— crates/router/src/compatibility/stripe/setup_intents.rs:182-258 | crates/router/src/compatibility/stripe/setup_intents.rs:268-345 — These two members are variants of one another: 41 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (9 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/aci.rs:203— crates/hyperswitch_connectors/src/connectors/aci.rs:203-211 | crates/hyperswitch_connectors/src/connectors/adyen.rs:620-628 | crates/hyperswitch_connectors/src/connectors/adyen.rs:1527-1535 | crates/hyperswitch_connectors/src/connectors/chargebee.rs:301-309 | crates/hyperswitch_connectors/src/connectors/powertranz.rs:106-114 | crates/hyperswitch_connectors/src/connectors/recurly.rs:390-398 | crates/hyperswitch_connectors/src/connectors/recurly.rs:476-484 | crates/hyperswitch_connectors/src/connectors/recurly.rs:568-576 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:115-123 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
Members sharing a duplicated core (9 members, 50+ identical tokens) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:178— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:178-309 | crates/router/src/core/payments/operations/payment_attempt_record.rs:126-237 | crates/router/src/core/payments/operations/payment_capture_v2.rs:154-212 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:166-291 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:304-421 | crates/router/src/core/payments/operations/payment_get.rs:165-256 | crates/router/src/core/payments/operations/payment_session_intent.rs:129-158 | crates/router/src/core/payments/operations/payment_update_intent.rs:149-332 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:157-280 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
Members sharing a duplicated core (9 members, 50+ identical tokens) crates/router/src/routes/superposition_proxy.rs:23— crates/router/src/routes/superposition_proxy.rs:23-60 | crates/router/src/routes/superposition_proxy.rs:67-104 | crates/router/src/routes/superposition_proxy.rs:111-148 | crates/router/src/routes/superposition_proxy.rs:155-192 | crates/router/src/routes/superposition_proxy.rs:199-236 | crates/router/src/routes/superposition_proxy.rs:243-280 | crates/router/src/routes/superposition_proxy.rs:287-324 | crates/router/src/routes/superposition_proxy.rs:332-372 | crates/router/src/routes/superposition_proxy.rs:379-416 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
Duplicated block (51 lines × 2) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1571— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1571-1621 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2499-2549 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (51 lines × 2) crates/router/src/core/payments/operations/payment_approve.rs:185— crates/router/src/core/payments/operations/payment_approve.rs:185-235 | crates/router/src/core/payments/operations/payment_reject.rs:181-231 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_approve.rs` and `crates/router/src/core/payments/operations/payment_reject.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/types/api/connector_mapping.rs:112— crates/router/src/types/api/connector_mapping.rs:112-162 | crates/router/src/types/api/feature_matrix.rs:25-75 — before extracting anything, compare `crates/router/src/types/api/connector_mapping.rs` and `crates/router/src/types/api/feature_matrix.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 401 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (48 lines × 2) crates/analytics/src/payments/metrics/retries_count.rs:48— crates/analytics/src/payments/metrics/retries_count.rs:48-95 | crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs:48-95 — before extracting anything, compare `crates/analytics/src/payments/metrics/retries_count.rs` and `crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 148 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 (48 lines × 2) crates/router/src/core/payment_methods.rs:1474— crates/router/src/core/payment_methods.rs:1474-1521 | crates/router/src/core/payment_methods.rs:1523-1570 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (48 lines × 2) crates/router/src/db/refund.rs:1734— crates/router/src/db/refund.rs:1734-1781 | crates/router/src/db/refund.rs:2065-2112 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments.rs:9371— crates/router/src/core/payments.rs:9371-9415 | crates/router/src/core/payments/vault_session.rs:452-496 — 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 (45 lines × 2) crates/router/src/services/api.rs:1003— crates/router/src/services/api.rs:1003-1047 | crates/router/src/services/api.rs:1167-1211 — both copies are in the same file, so extract the block into 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) crates/router/src/workflows/network_tokenization.rs:85— crates/router/src/workflows/network_tokenization.rs:85-129 | crates/router/src/workflows/network_tokenization.rs:195-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 (42 lines × 2) crates/analytics/src/search.rs:62— crates/analytics/src/search.rs:62-103 | crates/analytics/src/search.rs:256-297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (42 lines × 2) crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs:420— crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs:420-461 | crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs:706-747 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (42 lines × 2) crates/router/src/core/user/theme.rs:132— crates/router/src/core/user/theme.rs:132-173 | crates/router/src/core/user/theme.rs:270-311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (39 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1082— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1082-1120 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1152-1190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (39 lines × 2) crates/hyperswitch_connectors/src/connectors/paypal.rs:557— crates/hyperswitch_connectors/src/connectors/paypal.rs:557-595 | crates/hyperswitch_connectors/src/connectors/paypal.rs:692-730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (39 lines × 2) crates/router/src/core/payments/transformers.rs:3219— crates/router/src/core/payments/transformers.rs:3219-3257 | crates/router/src/core/payments/transformers.rs:3376-3414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (33 lines × 2) crates/router/src/core/payments/filters.rs:91— crates/router/src/core/payments/filters.rs:91-123 | crates/router/src/core/payments/filters.rs:221-253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (33 lines × 2) crates/router/src/routes/app.rs:2932— crates/router/src/routes/app.rs:2932-2964 | crates/router/src/routes/app.rs:2981-3013 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (33 lines × 2) crates/router/src/services/kafka/payment_attempt.rs:327— crates/router/src/services/kafka/payment_attempt.rs:327-359 | crates/router/src/services/kafka/payment_attempt_event.rs:329-361 — before extracting anything, compare `crates/router/src/services/kafka/payment_attempt.rs` and `crates/router/src/services/kafka/payment_attempt_event.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 230 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–31 lines × 2) crates/router/src/core/payment_methods/transformers.rs:2162— crates/router/src/core/payment_methods/transformers.rs:2162-2192 | crates/router/src/core/payment_methods/transformers.rs:2493-2520 — both copies are in the same file, so extract the block into 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–31 lines × 2) crates/router/src/core/refunds_v2.rs:160— crates/router/src/core/refunds_v2.rs:160-187 | crates/router/src/core/refunds_v2.rs:283-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28–31 lines × 2) crates/router/src/db/refund.rs:174— crates/router/src/db/refund.rs:174-204 | crates/router/src/db/refund.rs:578-605 — both copies are in the same file, so extract the block into 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–29 lines × 2) crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:101— crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:101-129 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:104-131 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs` and `crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs` as WHOLE FILES: this scan already matched 7 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. 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 (28–29 lines × 2) crates/analytics/src/refunds/metrics/refund_processed_amount.rs:71— crates/analytics/src/refunds/metrics/refund_processed_amount.rs:71-98 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs:78-106 — before extracting anything, compare `crates/analytics/src/refunds/metrics/refund_processed_amount.rs` and `crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (28–29 lines × 2) crates/router/src/core/customers.rs:308— crates/router/src/core/customers.rs:308-335 | crates/router/src/core/customers.rs:1576-1604 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26–27 lines × 2) crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:303— crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:303-329 | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:1790-1815 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26–27 lines × 2) crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs:2594— crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs:2594-2620 | crates/hyperswitch_interfaces/src/unified_connector_service/transformers.rs:2741-2766 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26–27 lines × 2) crates/router/src/core/payments.rs:5228— crates/router/src/core/payments.rs:5228-5253 | crates/router/src/core/payments.rs:5422-5448 — both copies are in the same file, so extract the block into 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 × 3) crates/analytics/src/sqlx.rs:352— crates/analytics/src/sqlx.rs:352-375 | crates/analytics/src/sqlx.rs:525-548 | crates/analytics/src/sqlx.rs:1023-1045 — all 3 copies are in the same file, so extract the block into one function there and call 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 (23–24 lines × 3) crates/analytics/src/sqlx.rs:735— crates/analytics/src/sqlx.rs:735-757 | crates/analytics/src/sqlx.rs:862-885 | crates/analytics/src/sqlx.rs:1003-1025 — all 3 copies are in the same file, so extract the block into one function there and call 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 (23–24 lines × 3) crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:4333— crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:4333-4356 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:4373-4395 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:4449-4471 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (22–24 lines × 2) crates/hyperswitch_connectors/src/connectors/stripe.rs:284— crates/hyperswitch_connectors/src/connectors/stripe.rs:284-307 | crates/hyperswitch_connectors/src/connectors/stripe.rs:461-482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22–24 lines × 2) crates/router/src/core/payments/helpers.rs:3708— crates/router/src/core/payments/helpers.rs:3708-3731 | crates/router/src/core/payments/helpers.rs:9178-9199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22–24 lines × 2) crates/router/src/core/payments/operations/payment_capture_v2.rs:265— crates/router/src/core/payments/operations/payment_capture_v2.rs:265-286 | crates/router/src/core/payments/operations/payment_get.rs:313-336 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_capture_v2.rs` and `crates/router/src/core/payments/operations/payment_get.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (22 lines × 3) crates/analytics/src/sqlx.rs:771— crates/analytics/src/sqlx.rs:771-792 | crates/analytics/src/sqlx.rs:907-928 | crates/analytics/src/sqlx.rs:1131-1152 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (22 lines × 3) crates/router/src/services/authentication.rs:671— crates/router/src/services/authentication.rs:671-692 | crates/router/src/services/authentication.rs:779-800 | crates/router/src/services/authentication.rs:3093-3114 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (22 lines × 3) crates/storage_impl/src/authentication.rs:120— crates/storage_impl/src/authentication.rs:120-141 | crates/storage_impl/src/authentication.rs:171-192 | crates/storage_impl/src/authentication.rs:236-257 — all 3 copies are in the same file, so extract the block into one function there and call 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 × 5) crates/analytics/src/sqlx.rs:681— crates/analytics/src/sqlx.rs:681-700 | crates/analytics/src/sqlx.rs:812-831 | crates/analytics/src/sqlx.rs:949-968 | crates/analytics/src/sqlx.rs:1065-1084 | crates/analytics/src/sqlx.rs:1172-1191 — 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 (20 lines × 5) crates/diesel_models/src/payment_attempt.rs:3098— crates/diesel_models/src/payment_attempt.rs:3098-3117 | crates/diesel_models/src/payment_attempt.rs:3138-3157 | crates/diesel_models/src/payment_attempt.rs:3515-3534 | crates/diesel_models/src/payment_attempt.rs:4420-4439 | crates/diesel_models/src/payment_attempt.rs:4492-4511 — 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 (20 lines × 5) crates/router/src/core/relay/utils.rs:40— crates/router/src/core/relay/utils.rs:40-59 | crates/router/src/core/relay/utils.rs:185-204 | crates/router/src/core/relay/utils.rs:324-343 | crates/router/src/core/relay/utils.rs:458-477 | crates/router/src/core/relay/utils.rs:590-609 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (19–20 lines × 3) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3462— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3462-3480 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3545-3564 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3764-3782 — all 3 copies are in the same file, so extract the block into one function there and call 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 (19–20 lines × 3) crates/router/src/core/payments/operations/payment_approve.rs:189— crates/router/src/core/payments/operations/payment_approve.rs:189-207 | crates/router/src/core/payments/operations/payment_confirm_external_vault_proxy.rs:480-499 | crates/router/src/core/payments/operations/payment_reject.rs:185-203 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_approve.rs` and `crates/router/src/core/payments/operations/payment_reject.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/routing.rs:2739— crates/router/src/core/routing.rs:2739-2757 | crates/router/src/core/routing.rs:2843-2862 | crates/router/src/core/routing.rs:3117-3135 — all 3 copies are in the same file, so extract the block into one function there and call 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 × 6) REDACTED:899— REDACTED:899-916 | REDACTED:962-979 | REDACTED:1093-1110 | REDACTED:1224-1241 | REDACTED:1688-1705 | REDACTED:1939-1956 — 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 (18 lines × 6) crates/storage_impl/src/business_profile.rs:1807— crates/storage_impl/src/business_profile.rs:1807-1824 | crates/storage_impl/src/business_profile.rs:2107-2124 | crates/storage_impl/src/business_profile.rs:2167-2184 | crates/storage_impl/src/business_profile.rs:2227-2244 | crates/storage_impl/src/business_profile.rs:2288-2305 | crates/storage_impl/src/business_profile.rs:2349-2366 — 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 (18 lines × 6) crates/storage_impl/src/business_profile.rs:1841— crates/storage_impl/src/business_profile.rs:1841-1858 | crates/storage_impl/src/business_profile.rs:1901-1918 | crates/storage_impl/src/business_profile.rs:1961-1978 | crates/storage_impl/src/business_profile.rs:2021-2038 | crates/storage_impl/src/business_profile.rs:2081-2098 | crates/storage_impl/src/business_profile.rs:2383-2400 — 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 (17–18 lines × 3) crates/hyperswitch_connectors/src/connectors/worldpay.rs:289— crates/hyperswitch_connectors/src/connectors/worldpay.rs:289-306 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:791-808 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:914-930 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17–18 lines × 3) crates/router/src/core/payments.rs:4194— crates/router/src/core/payments.rs:4194-4210 | crates/router/src/core/payments.rs:4287-4303 | crates/router/src/core/payments.rs:4751-4768 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17–18 lines × 3) crates/router/src/routes/customers.rs:37— crates/router/src/routes/customers.rs:37-54 | crates/router/src/routes/customers.rs:449-466 | crates/router/src/routes/customers.rs:485-501 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 5) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:255— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:255-271 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:278-294 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:224-240 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:286-302 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:191-207 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 5) crates/router/src/db/events.rs:1194— crates/router/src/db/events.rs:1194-1210 | crates/router/src/db/events.rs:1231-1247 | crates/router/src/db/events.rs:1412-1428 | crates/router/src/db/events.rs:1451-1467 | crates/router/src/db/events.rs:1498-1514 — 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 (17 lines × 5) crates/router/src/core/refunds.rs:2825— crates/router/src/core/refunds.rs:2825-2841 | crates/router/src/core/refunds.rs:2866-2882 | crates/router/src/core/refunds_v2.rs:1516-1532 | crates/router/src/core/refunds_v2.rs:1555-1571 | crates/router/src/core/revenue_recovery.rs:650-666 — before extracting anything, compare `crates/router/src/core/refunds.rs` and `crates/router/src/core/refunds_v2.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 4) crates/diesel_models/src/payment_method.rs:1100— crates/diesel_models/src/payment_method.rs:1100-1116 | crates/diesel_models/src/payment_method.rs:1151-1167 | crates/diesel_models/src/payment_method.rs:1179-1195 | crates/diesel_models/src/payment_method.rs:1205-1221 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 4) crates/router/src/core/payments.rs:1287— crates/router/src/core/payments.rs:1287-1303 | crates/router/src/core/payments.rs:1532-1548 | crates/router/src/core/payments.rs:1964-1980 | crates/router/src/core/payments.rs:3505-3521 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 4) crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:1193— crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:1193-1209 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:1324-1340 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:1408-1424 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:1458-1474 — 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 (16–17 lines × 3) crates/hyperswitch_connectors/src/connectors/stripe.rs:649— crates/hyperswitch_connectors/src/connectors/stripe.rs:649-665 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1505-1521 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1671-1686 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16–17 lines × 3) crates/hyperswitch_domain_models/src/router_data.rs:1366— crates/hyperswitch_domain_models/src/router_data.rs:1366-1381 | crates/hyperswitch_domain_models/src/router_data.rs:1695-1710 | crates/hyperswitch_domain_models/src/router_data.rs:2034-2050 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16–17 lines × 3) crates/router/src/core/user.rs:111— crates/router/src/core/user.rs:111-127 | crates/router/src/core/user.rs:341-356 | crates/router/src/core/user.rs:397-413 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 9) crates/analytics/src/payments/metrics/connector_success_rate.rs:90— crates/analytics/src/payments/metrics/connector_success_rate.rs:90-105 | crates/analytics/src/payments/metrics/payment_count.rs:81-96 | crates/analytics/src/payments/metrics/retries_count.rs:85-100 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:91-106 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:82-97 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:92-107 | crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs:85-100 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:85-100 | crates/analytics/src/payments/metrics/success_rate.rs:84-99 — before extracting anything, compare `crates/analytics/src/payments/metrics/connector_success_rate.rs` and `crates/analytics/src/payments/metrics/payment_count.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 125 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 9) crates/diesel_models/src/payment_attempt.rs:2550— crates/diesel_models/src/payment_attempt.rs:2550-2565 | crates/diesel_models/src/payment_attempt.rs:2778-2793 | crates/diesel_models/src/payment_attempt.rs:2921-2936 | crates/diesel_models/src/payment_attempt.rs:3401-3416 | crates/diesel_models/src/payment_attempt.rs:3770-3785 | crates/diesel_models/src/payment_attempt.rs:3864-3879 | crates/diesel_models/src/payment_attempt.rs:3945-3960 | crates/diesel_models/src/payment_attempt.rs:4128-4143 | crates/diesel_models/src/payment_attempt.rs:4400-4415 — 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.
Duplicated block (16 lines × 9) crates/router/src/core/payments/operations/payment_cancel.rs:204— crates/router/src/core/payments/operations/payment_cancel.rs:204-219 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:186-201 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:177-192 | crates/router/src/core/payments/operations/payment_capture.rs:259-274 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:171-186 | crates/router/src/core/payments/operations/payment_recurrence.rs:378-393 | crates/router/src/core/payments/operations/payment_start.rs:220-235 | crates/router/src/core/payments/operations/payment_update_metadata.rs:177-192 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:192-207 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 6) crates/diesel_models/src/payment_attempt.rs:3099— crates/diesel_models/src/payment_attempt.rs:3099-3114 | crates/diesel_models/src/payment_attempt.rs:3139-3154 | crates/diesel_models/src/payment_attempt.rs:3516-3531 | crates/diesel_models/src/payment_attempt.rs:3725-3740 | crates/diesel_models/src/payment_attempt.rs:4421-4436 | crates/diesel_models/src/payment_attempt.rs:4493-4508 — 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 (16 lines × 6) crates/hyperswitch_connectors/src/connectors/archipel.rs:249— crates/hyperswitch_connectors/src/connectors/archipel.rs:249-264 | crates/hyperswitch_connectors/src/connectors/archipel.rs:360-375 | crates/hyperswitch_connectors/src/connectors/archipel.rs:556-571 | crates/hyperswitch_connectors/src/connectors/archipel.rs:655-670 | crates/hyperswitch_connectors/src/connectors/archipel.rs:760-775 | crates/hyperswitch_connectors/src/connectors/archipel.rs:973-988 — 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 (16 lines × 6) crates/router/src/core/payments/flows/authorize_flow.rs:1682— crates/router/src/core/payments/flows/authorize_flow.rs:1682-1697 | crates/router/src/core/payments/flows/authorize_flow.rs:1830-1845 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:800-815 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:962-977 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:1070-1085 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:1216-1231 — before extracting anything, compare `crates/router/src/core/payments/flows/authorize_flow.rs` and `crates/router/src/core/payments/flows/complete_authorize_flow.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 4) crates/hyperswitch_domain_models/src/router_data.rs:1335— crates/hyperswitch_domain_models/src/router_data.rs:1335-1349 | crates/hyperswitch_domain_models/src/router_data.rs:2002-2017 | crates/hyperswitch_domain_models/src/router_data.rs:2301-2315 | crates/hyperswitch_domain_models/src/router_data.rs:2741-2756 — 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–16 lines × 4) crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:122— crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:122-137 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:96-110 | crates/router/src/core/payments/operations/payment_update_metadata.rs:94-108 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:137-152 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs` and `crates/router/src/core/payments/operations/payment_post_session_tokens.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 4) crates/storage_impl/src/lib.rs:389— crates/storage_impl/src/lib.rs:389-404 | crates/storage_impl/src/lib.rs:427-442 | crates/storage_impl/src/mock_db.rs:255-269 | crates/storage_impl/src/mock_db.rs:291-305 — 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 (15 lines × 21) crates/diesel_models/src/payment_attempt.rs:2552— crates/diesel_models/src/payment_attempt.rs:2552-2566 | crates/diesel_models/src/payment_attempt.rs:2620-2634 | crates/diesel_models/src/payment_attempt.rs:2780-2794 | crates/diesel_models/src/payment_attempt.rs:2836-2850 | crates/diesel_models/src/payment_attempt.rs:2923-2937 | crates/diesel_models/src/payment_attempt.rs:3011-3025 | crates/diesel_models/src/payment_attempt.rs:3176-3190 | crates/diesel_models/src/payment_attempt.rs:3260-3274 | crates/diesel_models/src/payment_attempt.rs:3403-3417 | crates/diesel_models/src/payment_attempt.rs:3504-3518 | crates/diesel_models/src/payment_attempt.rs:3573-3587 | crates/diesel_models/src/payment_attempt.rs:3672-3686 | crates/diesel_models/src/payment_attempt.rs:3772-3786 | crates/diesel_models/src/payment_attempt.rs:3866-3880 | crates/diesel_models/src/payment_attempt.rs:3947-3961 | crates/diesel_models/src/payment_attempt.rs:4032-4046 | crates/diesel_models/src/payment_attempt.rs:4130-4144 | crates/diesel_models/src/payment_attempt.rs:4304-4318 | crates/diesel_models/src/payment_attempt.rs:4402-4416 | crates/diesel_models/src/payment_attempt.rs:4574-4588 | crates/diesel_models/src/payment_attempt.rs:4658-4672 — 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.
Duplicated block (15 lines × 21) crates/diesel_models/src/payment_attempt.rs:2553— crates/diesel_models/src/payment_attempt.rs:2553-2567 | crates/diesel_models/src/payment_attempt.rs:2621-2635 | crates/diesel_models/src/payment_attempt.rs:2837-2851 | crates/diesel_models/src/payment_attempt.rs:2924-2938 | crates/diesel_models/src/payment_attempt.rs:3012-3026 | crates/diesel_models/src/payment_attempt.rs:3177-3191 | crates/diesel_models/src/payment_attempt.rs:3261-3275 | crates/diesel_models/src/payment_attempt.rs:3404-3418 | crates/diesel_models/src/payment_attempt.rs:3505-3519 | crates/diesel_models/src/payment_attempt.rs:3574-3588 | crates/diesel_models/src/payment_attempt.rs:3673-3687 | crates/diesel_models/src/payment_attempt.rs:3773-3787 | crates/diesel_models/src/payment_attempt.rs:3867-3881 | crates/diesel_models/src/payment_attempt.rs:3948-3962 | crates/diesel_models/src/payment_attempt.rs:4033-4047 | crates/diesel_models/src/payment_attempt.rs:4131-4145 | crates/diesel_models/src/payment_attempt.rs:4210-4224 | crates/diesel_models/src/payment_attempt.rs:4305-4319 | crates/diesel_models/src/payment_attempt.rs:4403-4417 | crates/diesel_models/src/payment_attempt.rs:4575-4589 | crates/diesel_models/src/payment_attempt.rs:4659-4673 — 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.
Duplicated block (15 lines × 21) crates/diesel_models/src/payment_attempt.rs:2567— crates/diesel_models/src/payment_attempt.rs:2567-2581 | crates/diesel_models/src/payment_attempt.rs:2650-2664 | crates/diesel_models/src/payment_attempt.rs:2865-2879 | crates/diesel_models/src/payment_attempt.rs:2951-2965 | crates/diesel_models/src/payment_attempt.rs:3037-3051 | crates/diesel_models/src/payment_attempt.rs:3123-3137 | crates/diesel_models/src/payment_attempt.rs:3207-3221 | crates/diesel_models/src/payment_attempt.rs:3290-3304 | crates/diesel_models/src/payment_attempt.rs:3524-3538 | crates/diesel_models/src/payment_attempt.rs:3603-3617 | crates/diesel_models/src/payment_attempt.rs:3696-3710 | crates/diesel_models/src/payment_attempt.rs:3795-3809 | crates/diesel_models/src/payment_attempt.rs:3891-3905 | crates/diesel_models/src/payment_attempt.rs:3976-3990 | crates/diesel_models/src/payment_attempt.rs:4061-4075 | crates/diesel_models/src/payment_attempt.rs:4157-4171 | crates/diesel_models/src/payment_attempt.rs:4240-4254 | crates/diesel_models/src/payment_attempt.rs:4328-4342 | crates/diesel_models/src/payment_attempt.rs:4510-4524 | crates/diesel_models/src/payment_attempt.rs:4601-4615 | crates/diesel_models/src/payment_attempt.rs:4682-4696 — 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.
Duplicated block (11–14 lines × 2) crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs:288— crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs:288-301 | crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs:406-416 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/paypal.rs:177— crates/hyperswitch_connectors/src/connectors/paypal.rs:177-187 | crates/hyperswitch_connectors/src/connectors/paypal.rs:376-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 (11–14 lines × 2) crates/router/src/services/authentication.rs:6631— crates/router/src/services/authentication.rs:6631-6644 | crates/router/src/services/authentication.rs:6693-6703 — both copies are in the same file, so extract the block into 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 × 4) crates/router/src/core/payments.rs:235— crates/router/src/core/payments.rs:235-246 | crates/router/src/core/payments.rs:2296-2308 | crates/router/src/core/payments.rs:2381-2393 | crates/router/src/core/payments/session_operation.rs:154-166 — before extracting anything, compare `crates/router/src/core/payments.rs` and `crates/router/src/core/payments/session_operation.rs` as WHOLE FILES: this scan already matched 3 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 (12–13 lines × 4) crates/storage_impl/src/customers.rs:1562— crates/storage_impl/src/customers.rs:1562-1573 | crates/storage_impl/src/customers.rs:1811-1823 | crates/storage_impl/src/customers.rs:1829-1841 | crates/storage_impl/src/customers.rs:1847-1859 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 4) crates/storage_impl/src/merchant_connector_account.rs:435— crates/storage_impl/src/merchant_connector_account.rs:435-447 | crates/storage_impl/src/merchant_connector_account.rs:491-503 | crates/storage_impl/src/merchant_connector_account.rs:564-576 | crates/storage_impl/src/merchant_connector_account.rs:617-628 — 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–13 lines × 3) crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:2239— crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:2239-2251 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:1012-1022 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:1146-1156 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11–13 lines × 3) crates/router/src/core/refunds.rs:229— crates/router/src/core/refunds.rs:229-239 | crates/router/src/core/refunds.rs:576-588 | crates/router/src/core/refunds.rs:1271-1283 — all 3 copies are in the same file, so extract the block into one function there and call 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–13 lines × 3) crates/router/src/services/authentication.rs:1118— crates/router/src/services/authentication.rs:1118-1130 | crates/router/src/services/authentication.rs:2925-2935 | crates/router/src/services/authentication.rs:2991-3001 — all 3 copies are in the same file, so extract the block into one function there and call 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 × 8) crates/analytics/src/sdk_events/metrics/average_payment_time.rs:114— crates/analytics/src/sdk_events/metrics/average_payment_time.rs:114-125 | crates/analytics/src/sdk_events/metrics/load_time.rs:114-125 | crates/analytics/src/sdk_events/metrics/payment_attempts.rs:109-120 | crates/analytics/src/sdk_events/metrics/payment_data_filled_count.rs:109-120 | crates/analytics/src/sdk_events/metrics/payment_method_selected_count.rs:109-120 | crates/analytics/src/sdk_events/metrics/payment_methods_call_count.rs:117-128 | crates/analytics/src/sdk_events/metrics/sdk_initiated_count.rs:109-120 | crates/analytics/src/sdk_events/metrics/sdk_rendered_count.rs:109-120 — before extracting anything, compare `crates/analytics/src/sdk_events/metrics/average_payment_time.rs` and `crates/analytics/src/sdk_events/metrics/load_time.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 8) crates/hyperswitch_connectors/src/connectors/billwerk.rs:225— crates/hyperswitch_connectors/src/connectors/billwerk.rs:225-236 | crates/hyperswitch_connectors/src/connectors/finix.rs:220-231 | crates/hyperswitch_connectors/src/connectors/gocardless.rs:306-317 | crates/hyperswitch_connectors/src/connectors/mollie.rs:200-211 | crates/hyperswitch_connectors/src/connectors/silverflow.rs:112-123 | crates/hyperswitch_connectors/src/connectors/square.rs:242-253 | crates/hyperswitch_connectors/src/connectors/stax.rs:301-312 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:114-125 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/billwerk.rs` and `crates/hyperswitch_connectors/src/connectors/finix.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 8) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:182— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:182-193 | crates/router/src/core/payments/operations/payment_attempt_record.rs:130-141 | crates/router/src/core/payments/operations/payment_capture_v2.rs:157-168 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:170-183 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:308-321 | crates/router/src/core/payments/operations/payment_get.rs:168-179 | crates/router/src/core/payments/operations/payment_session_intent.rs:131-144 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:161-172 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/payment_attempt_record.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 6) crates/analytics/src/refunds/metrics/refund_count.rs:85— crates/analytics/src/refunds/metrics/refund_count.rs:85-96 | crates/analytics/src/refunds/metrics/refund_success_rate.rs:83-94 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:86-97 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:151-162 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs:143-154 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs:83-94 — before extracting anything, compare `crates/analytics/src/refunds/metrics/refund_count.rs` and `crates/analytics/src/refunds/metrics/refund_success_rate.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 6) crates/analytics/src/refunds/metrics/refund_success_count.rs:115— crates/analytics/src/refunds/metrics/refund_success_count.rs:115-126 | crates/analytics/src/refunds/metrics/refund_success_rate.rs:110-121 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:178-189 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs:170-181 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs:115-126 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs:110-121 — before extracting anything, compare `crates/analytics/src/refunds/metrics/refund_success_count.rs` and `crates/analytics/src/refunds/metrics/refund_success_rate.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/payouts.rs:1992— crates/router/src/core/payouts.rs:1992-2003 | crates/router/src/core/payouts.rs:2206-2217 | crates/router/src/core/payouts.rs:2457-2468 | crates/router/src/core/payouts.rs:2965-2976 | crates/router/src/core/payouts.rs:3107-3118 | crates/router/src/core/payouts.rs:3316-3327 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–12 lines × 3) crates/router/src/core/fraud_check/flows/record_return.rs:58— crates/router/src/core/fraud_check/flows/record_return.rs:58-67 | crates/router/src/core/fraud_check/flows/sale_flow.rs:55-66 | crates/router/src/core/fraud_check/flows/transaction_flow.rs:63-72 — before extracting anything, compare `crates/router/src/core/fraud_check/flows/record_return.rs` and `crates/router/src/core/fraud_check/flows/sale_flow.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–12 lines × 3) crates/router/src/core/payment_methods.rs:7624— crates/router/src/core/payment_methods.rs:7624-7633 | crates/router/src/core/payment_methods.rs:7755-7766 | crates/router/src/core/split_payments.rs:521-530 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10–12 lines × 3) crates/router/src/core/payments/operations/payment_post_session_tokens.rs:88— crates/router/src/core/payments/operations/payment_post_session_tokens.rs:88-97 | crates/router/src/core/payments/operations/payment_update_metadata.rs:86-95 | crates/router/src/core/payments/operations/tax_calculation.rs:105-116 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_post_session_tokens.rs` and `crates/router/src/core/payments/operations/payment_update_metadata.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 219 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–12 lines × 2) crates/router/src/bin/scheduler.rs:470— crates/router/src/bin/scheduler.rs:470-479 | crates/scheduler/src/consumer/workflows.rs:32-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10–12 lines × 2) crates/router/src/core/payments/operations/payment_response.rs:2674— crates/router/src/core/payments/operations/payment_response.rs:2674-2685 | crates/router/src/core/payments/operations/payment_response.rs:3090-3099 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–12 lines × 2) crates/router/src/core/payments/operations/payment_response.rs:2727— crates/router/src/core/payments/operations/payment_response.rs:2727-2738 | crates/router/src/core/refunds.rs:701-710 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 10) crates/hyperswitch_connectors/src/connectors/aci.rs:611— crates/hyperswitch_connectors/src/connectors/aci.rs:611-620 | crates/hyperswitch_connectors/src/connectors/adyen.rs:1031-1040 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:690-699 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:823-832 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1044-1053 | crates/hyperswitch_connectors/src/connectors/braintree.rs:778-787 | crates/hyperswitch_connectors/src/connectors/checkout.rs:753-762 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:497-506 | crates/hyperswitch_connectors/src/connectors/noon.rs:561-570 | crates/hyperswitch_connectors/src/connectors/powertranz.rs:524-533 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/aci.rs` and `crates/hyperswitch_connectors/src/connectors/adyen.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2452— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2452-2461 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:379-388 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:121-130 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:61-70 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:168-177 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:399-408 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:659-668 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:735-744 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:368-377 | crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs:661-670 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 123 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 10) crates/hyperswitch_interfaces/src/conversion_impls.rs:261— crates/hyperswitch_interfaces/src/conversion_impls.rs:261-270 | crates/hyperswitch_interfaces/src/conversion_impls.rs:372-381 | crates/hyperswitch_interfaces/src/conversion_impls.rs:444-453 | crates/hyperswitch_interfaces/src/conversion_impls.rs:574-583 | crates/hyperswitch_interfaces/src/conversion_impls.rs:667-676 | crates/hyperswitch_interfaces/src/conversion_impls.rs:866-875 | crates/hyperswitch_interfaces/src/conversion_impls.rs:909-918 | crates/hyperswitch_interfaces/src/conversion_impls.rs:969-978 | crates/hyperswitch_interfaces/src/conversion_impls.rs:1089-1098 | crates/hyperswitch_interfaces/src/conversion_impls.rs:1159-1168 — 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 (9–10 lines × 5) crates/hyperswitch_connectors/src/connectors/adyen.rs:807— crates/hyperswitch_connectors/src/connectors/adyen.rs:807-815 | crates/hyperswitch_connectors/src/connectors/braintree.rs:544-553 | crates/hyperswitch_connectors/src/connectors/payme.rs:657-666 | crates/hyperswitch_connectors/src/connectors/plaid.rs:301-310 | crates/hyperswitch_connectors/src/connectors/tsys.rs:260-269 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/braintree.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 5) crates/hyperswitch_connectors/src/connectors/paybox.rs:320— crates/hyperswitch_connectors/src/connectors/paybox.rs:320-328 | crates/hyperswitch_connectors/src/connectors/paybox.rs:401-410 | crates/hyperswitch_connectors/src/connectors/paybox.rs:482-490 | crates/hyperswitch_connectors/src/connectors/paybox.rs:556-564 | crates/hyperswitch_connectors/src/connectors/paybox.rs:664-672 — 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 (9–10 lines × 5) crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1270— crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1270-1279 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:118-126 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:210-219 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1326-1335 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:498-506 — `crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/square/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 12 separate duplicated blocks between them, totalling at least 101 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8–10 lines × 3) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2348— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2348-2355 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3349-3356 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:2425-2434 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8–10 lines × 3) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:203— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:203-210 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2950-2959 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3031-3040 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–10 lines × 3) crates/hyperswitch_connectors/src/connectors/paypal.rs:2103— crates/hyperswitch_connectors/src/connectors/paypal.rs:2103-2110 | crates/hyperswitch_connectors/src/connectors/payu.rs:229-238 | crates/hyperswitch_connectors/src/connectors/tsys.rs:444-453 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/paypal.rs` and `crates/hyperswitch_connectors/src/connectors/payu.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 4) crates/hyperswitch_constraint_graph/src/graph.rs:247— crates/hyperswitch_constraint_graph/src/graph.rs:247-255 | crates/hyperswitch_constraint_graph/src/graph.rs:314-322 | crates/hyperswitch_constraint_graph/src/graph.rs:355-363 | crates/hyperswitch_constraint_graph/src/graph.rs:374-381 — 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–9 lines × 4) crates/router/src/core/payments.rs:5540— crates/router/src/core/payments.rs:5540-5547 | crates/router/src/core/payments/operations/payment_attempt_record.rs:92-100 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:60-67 | crates/router/src/core/payments/operations/payment_update_intent.rs:66-73 — before extracting anything, compare `crates/router/src/core/payments.rs` and `crates/router/src/core/payments/operations/payment_update_intent.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 4) crates/router/src/db/events.rs:1366— crates/router/src/db/events.rs:1366-1373 | crates/router/src/db/events.rs:1437-1444 | crates/router/src/db/events.rs:1477-1485 | crates/router/src/db/events.rs:1597-1604 — 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–9 lines × 3) crates/analytics/src/payment_intents/accumulator.rs:167— crates/analytics/src/payment_intents/accumulator.rs:167-174 | crates/analytics/src/payment_intents/accumulator.rs:297-304 | crates/analytics/src/payments/accumulator.rs:282-290 — `crates/analytics/src/payment_intents/accumulator.rs` and `crates/analytics/src/payments/accumulator.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 96 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8–9 lines × 3) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:818— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:818-825 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:946-953 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3820-3828 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 527 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8–9 lines × 3) crates/router/src/core/user.rs:1523— crates/router/src/core/user.rs:1523-1531 | crates/router/src/core/user.rs:1629-1637 | crates/router/src/core/user_role.rs:511-518 — before extracting anything, compare `crates/router/src/core/user.rs` and `crates/router/src/core/user_role.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 7) crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:211— crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:211-218 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:441-448 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1273-1280 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:120-127 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:213-220 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1329-1336 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:500-507 — `crates/hyperswitch_connectors/src/connectors/payme/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 64 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 7) crates/hyperswitch_connectors/src/connectors/gigadat.rs:376— crates/hyperswitch_connectors/src/connectors/gigadat.rs:376-383 | crates/hyperswitch_connectors/src/connectors/gigadat.rs:576-583 | crates/hyperswitch_connectors/src/connectors/loonio.rs:371-378 | crates/hyperswitch_connectors/src/connectors/loonio.rs:554-561 | crates/hyperswitch_connectors/src/connectors/loonio.rs:640-647 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:495-503 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:524-532 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/gigadat.rs` and `crates/hyperswitch_connectors/src/connectors/loonio.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:208— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:208-215 | crates/router/src/core/payments/operations/payment_attempt_record.rs:166-173 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:198-205 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:336-343 | crates/router/src/core/payments/operations/payment_create_intent.rs:137-144 | crates/router/src/core/payments/operations/payment_update_intent.rs:217-224 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:187-194 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/payment_attempt_record.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 5) crates/router/src/routes/blocklist.rs:227— crates/router/src/routes/blocklist.rs:227-233 | crates/router/src/routes/blocklist.rs:283-289 | crates/router/src/routes/blocklist.rs:518-524 | crates/router/src/routes/blocklist.rs:569-575 | crates/router/src/routes/blocklist.rs:622-628 — 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) crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs:65— crates/hyperswitch_connectors/src/connectors/gigadat/transformers.rs:65-71 | crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs:63-69 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:49-55 | crates/hyperswitch_connectors/src/connectors/nordea/transformers.rs:87-93 | crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs:97-103 — `crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 5) crates/diesel_models/src/query/user/sample_data.rs:94— crates/diesel_models/src/query/user/sample_data.rs:94-100 | crates/diesel_models/src/query/user/sample_data.rs:121-127 | crates/diesel_models/src/query/user/sample_data.rs:146-152 | crates/diesel_models/src/query/user/sample_data.rs:172-178 | crates/diesel_models/src/query/user/sample_data.rs:198-204 — 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 × 6) crates/diesel_models/src/query/blocklist.rs:119— crates/diesel_models/src/query/blocklist.rs:119-124 | crates/diesel_models/src/query/blocklist.rs:149-154 | crates/diesel_models/src/query/blocklist.rs:305-310 | crates/diesel_models/src/query/blocklist.rs:339-344 | crates/diesel_models/src/query/blocklist.rs:816-821 | crates/diesel_models/src/query/blocklist.rs:839-844 — 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 (6 lines × 6) crates/router/src/db/events.rs:987— crates/router/src/db/events.rs:987-992 | crates/router/src/db/events.rs:1159-1165 | crates/router/src/db/events.rs:1340-1345 | crates/router/src/db/events.rs:1377-1383 | crates/router/src/db/events.rs:1571-1577 | crates/router/src/db/events.rs:1609-1615 — 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 (6 lines × 6) crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:1153— crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:1153-1158 | crates/hyperswitch_connectors/src/connectors/bluesnap.rs:153-159 | crates/hyperswitch_connectors/src/connectors/checkout.rs:178-183 | crates/hyperswitch_connectors/src/connectors/paypal.rs:178-183 | crates/hyperswitch_connectors/src/connectors/paypal.rs:377-382 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:177-183 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs` and `crates/hyperswitch_connectors/src/connectors/bluesnap.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/analytics/src/payment_intents/accumulator.rs:95— crates/analytics/src/payment_intents/accumulator.rs:95-99 | crates/analytics/src/payment_intents/accumulator.rs:201-205 | crates/analytics/src/payment_intents/accumulator.rs:217-221 | crates/analytics/src/payments/accumulator.rs:356-360 | crates/analytics/src/payments/accumulator.rs:372-376 | crates/analytics/src/payments/accumulator.rs:412-416 | crates/analytics/src/refunds/accumulator.rs:185-189 — `crates/analytics/src/payment_intents/accumulator.rs` and `crates/analytics/src/payments/accumulator.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 96 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 (5 lines × 7) crates/diesel_models/src/query/generics.rs:268— crates/diesel_models/src/query/generics.rs:268-272 | crates/diesel_models/src/query/generics.rs:346-350 | crates/diesel_models/src/query/generics.rs:392-396 | crates/diesel_models/src/query/generics.rs:481-485 | crates/diesel_models/src/query/generics.rs:528-532 | crates/diesel_models/src/query/generics.rs:575-579 | crates/diesel_models/src/query/generics.rs:619-623 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 7) crates/router/src/types/storage/dispute.rs:119— crates/router/src/types/storage/dispute.rs:119-123 | crates/router/src/types/storage/dispute.rs:187-191 | crates/router/src/types/storage/dispute.rs:250-254 | crates/router/src/types/storage/payment_link.rs:75-79 | crates/router/src/types/storage/refund.rs:176-180 | crates/router/src/types/storage/refund.rs:261-265 | crates/router/src/types/storage/refund.rs:415-419 — before extracting anything, compare `crates/router/src/types/storage/dispute.rs` and `crates/router/src/types/storage/refund.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) crates/hyperswitch_connectors/src/utils.rs:1363— crates/hyperswitch_connectors/src/utils.rs:1363-1367 | crates/hyperswitch_connectors/src/utils.rs:1470-1474 | crates/router/src/connector/utils.rs:1506-1510 | crates/router/src/connector/utils.rs:1579-1583 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) crates/hyperswitch_connectors/src/utils.rs:1686— crates/hyperswitch_connectors/src/utils.rs:1686-1690 | crates/hyperswitch_connectors/src/utils.rs:1795-1799 | crates/hyperswitch_connectors/src/utils.rs:7468-7472 | crates/router/src/connector/utils.rs:1431-1435 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:159— crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:159-163 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:318-322 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:380-384 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:284-288 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersource.rs` and `crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
external_services::http_client::send_request (cyclomatic 25) crates/external_services/src/http_client.rs:110— external_services::http_client::send_request has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
external_services::grpc_client::unified_connector_service::build_grpc_headers_internal (cyclomatic 17) crates/external_services/src/grpc_client/unified_connector_service.rs:1688— external_services::grpc_client::unified_connector_service::build_grpc_headers_internal 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.
RouterData::get_payment_attempt_update (cyclomatic 18) crates/hyperswitch_domain_models/src/router_data.rs:1224— RouterData::get_payment_attempt_update has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (RouterData::get_payment_attempt_update) 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.
RouterData::get_payment_attempt_update (cyclomatic 18) crates/hyperswitch_domain_models/src/router_data.rs:2190— RouterData::get_payment_attempt_update has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (RouterData::get_payment_attempt_update) 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.
PaymentConfirm::get_trackers (cyclomatic 17) crates/router/src/core/payments/operations/payment_confirm.rs:78— PaymentConfirm::get_trackers 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.
PaymentConfirm::call_unified_authentication_service_if_eligible (cyclomatic 16) crates/router/src/core/payments/operations/payment_confirm.rs:1957— PaymentConfirm::call_unified_authentication_service_if_eligible 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.
Refund::filter_by_constraints (cyclomatic 16) crates/router/src/types/storage/refund.rs:90— Refund::filter_by_constraints 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 shape REPEATS in the file: one other method here (Refund::get_refunds_count) 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.
Refund::get_refunds_count (cyclomatic 16) crates/router/src/types/storage/refund.rs:493— Refund::get_refunds_count 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 shape REPEATS in the file: one other method here (Refund::filter_by_constraints) 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.
PaymentResponse::save_pm_and_mandate (cognitive 39) crates/router/src/core/payments/operations/payment_response.rs:766— PaymentResponse::save_pm_and_mandate has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (28 pts), match/switch 2 (6 pts), boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PaymentResponse::update_tracker (cognitive 33) crates/router/src/core/payments/operations/payment_response.rs:5332— PaymentResponse::update_tracker has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (29 pts), match/switch 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.
PaymentsDistributionAccumulator::add_metrics_bucket (cognitive 32) crates/analytics/src/payments/accumulator.rs:224— PaymentsDistributionAccumulator::add_metrics_bucket has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
PaymentsDistributionAccumulator::add_metrics_bucket (cognitive 23) crates/analytics/src/payment_intents/accumulator.rs:254— PaymentsDistributionAccumulator::add_metrics_bucket has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 3 (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.
PaymentCreate::get_trackers (cognitive 21) crates/router/src/core/payments/operations/payment_create.rs:74— PaymentCreate::get_trackers has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, match/switch 6 (8 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PaymentCreate::fetch_payment_method (cognitive 16) crates/router/src/core/payments/operations/payment_create.rs:926— PaymentCreate::fetch_payment_method has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Santander::get_webhook_event_type (cognitive 20) crates/hyperswitch_connectors/src/connectors/santander.rs:2203— Santander::get_webhook_event_type has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 4 (8 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Santander::get_url (cognitive 18) crates/hyperswitch_connectors/src/connectors/santander.rs:1334— Santander::get_url has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 3, boolean chains 2 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ProcessingInformation::try_from (cognitive 19) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:936— ProcessingInformation::try_from has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 5 (6 pts), boolean chains 2 (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.
ProcessingInformation::try_from (cognitive 16) crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:594— ProcessingInformation::try_from has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 3, boolean chains 2 (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.
BackwardCompatWorkflowBuilder::backfill_legacy_locker_card (cognitive 18) crates/router/src/workflows/payment_method_modular_backward_compat.rs:338— BackwardCompatWorkflowBuilder::backfill_legacy_locker_card has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 2 (3 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BackwardCompatWorkflowBuilder::backfill_legacy_locker_card (cognitive 17) crates/router/src/workflows/payment_method_modular_backward_compat.rs:583— BackwardCompatWorkflowBuilder::backfill_legacy_locker_card has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 2 (3 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Refund::filter_by_constraints (cognitive 16) crates/router/src/types/storage/refund.rs:90— Refund::filter_by_constraints has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), 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. This shape REPEATS in the file: one other method here (Refund::get_refunds_count) 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.
Refund::get_refunds_count (cognitive 16) crates/router/src/types/storage/refund.rs:493— Refund::get_refunds_count has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), 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. This shape REPEATS in the file: one other method here (Refund::filter_by_constraints) 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.
Change coupling clique: REDACTED, REDACTED, payment_intent_event.rs crates/hyperswitch_domain_models/src/payments/payment_intent.rs— 3 files — `crates/hyperswitch_domain_models/src/payments/payment_intent.rs`, `crates/router/src/services/kafka/payment_intent.rs`, `crates/router/src/services/kafka/payment_intent_event.rs` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
Change coupling clique: aci.rs, checkout.rs, stripe.rs crates/hyperswitch_connectors/src/connectors/aci.rs— 3 files — `crates/hyperswitch_connectors/src/connectors/aci.rs`, `crates/hyperswitch_connectors/src/connectors/checkout.rs`, `crates/hyperswitch_connectors/src/connectors/stripe.rs` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D4 · Code Duplication· Near-duplicate member family (7 members, 50 shared lines) · ×2
Near-duplicate member family (7 members, 50 shared lines) crates/router/src/core/payments/operations/payment_cancel.rs:54— crates/router/src/core/payments/operations/payment_cancel.rs:54-238 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:58-220 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:52-211 | crates/router/src/core/payments/operations/payment_capture.rs:59-293 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:59-204 | crates/router/src/core/payments/operations/payment_update_metadata.rs:54-210 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:58-226 — These 7 members are variants of one another: a block of 50 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Near-duplicate member family (7 members, 50 shared lines) crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:58— crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:58-220 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:52-211 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:59-204 | crates/router/src/core/payments/operations/payment_start.rs:54-254 | crates/router/src/core/payments/operations/payment_update_metadata.rs:54-210 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:58-226 | crates/router/src/core/payments/operations/tax_calculation.rs:64-220 — These 7 members are variants of one another: a block of 50 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 27 shared lines) · ×2
Near-duplicate member family (6 members, 27 shared lines) crates/analytics/src/refunds/metrics/refund_count.rs:39— crates/analytics/src/refunds/metrics/refund_count.rs:39-120 | crates/analytics/src/refunds/metrics/refund_success_rate.rs:41-121 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:39-121 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:43-189 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs:42-181 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs:41-121 — These 6 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 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.
Near-duplicate member family (6 members, 27 shared lines) crates/analytics/src/refunds/metrics/refund_success_count.rs:43— crates/analytics/src/refunds/metrics/refund_success_count.rs:43-126 | crates/analytics/src/refunds/metrics/refund_success_rate.rs:41-121 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:43-189 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs:42-181 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs:43-126 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs:41-121 — These 6 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 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 (4 members, 32 shared lines) · ×2
Near-duplicate member family (4 members, 32 shared lines) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:817— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:817-936 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:945-1040 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1455-1513 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1520-1578 — These 4 members are variants of one another: a block of 32 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, 32 shared lines) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2947— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2947-3017 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3026-3098 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3819-3959 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3968-4074 — These 4 members are variants of one another: a block of 32 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 (74 shared lines) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1010— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1010-1181 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2586-2816 — 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 (74 shared lines) crates/router/src/core/routing/helpers.rs:2178— crates/router/src/core/routing/helpers.rs:2178-2291 | crates/router/src/core/routing/helpers.rs:2303-2419 — 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) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1894— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1894-2060 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1223-1404 — 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 (67 shared lines) crates/router/src/core/admin.rs:1765— crates/router/src/core/admin.rs:1765-1846 | crates/router/src/core/admin.rs:1850-1937 — 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 (57 shared lines) crates/router/src/core/payments/transformers.rs:5500— crates/router/src/core/payments/transformers.rs:5500-5766 | crates/router/src/core/payments/transformers.rs:7244-7428 — These two members are variants of one another: 57 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (57 shared lines) crates/router/src/core/webhooks/outgoing.rs:1044— crates/router/src/core/webhooks/outgoing.rs:1044-1107 | crates/router/src/core/webhooks/outgoing_v2.rs:371-436 — These two members are variants of one another: 57 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (54 shared lines) crates/router/src/core/payments/filters.rs:30— crates/router/src/core/payments/filters.rs:30-158 | crates/router/src/core/payments/filters.rs:204-287 — 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) crates/router/src/core/payments/routing.rs:2933— crates/router/src/core/payments/routing.rs:2933-3066 | crates/router/src/core/payments/routing.rs:3077-3296 — 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 (52 shared lines) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1894— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1894-2060 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2586-2816 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (52 shared lines) crates/router/src/core/user.rs:864— crates/router/src/core/user.rs:864-1081 | crates/router/src/core/user.rs:1091-1254 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (51 shared lines) crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:264— crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:264-453 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:106-186 — These two members are variants of one another: 51 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (51 shared lines) crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:106— crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:106-186 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:105-234 — These two members are variants of one another: 51 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (47 shared lines) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:290— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:290-360 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1010-1181 — These two members are variants of one another: 47 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 (47 shared lines) crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:106— crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:106-186 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:54-132 — These two members are variants of one another: 47 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 (46 shared lines) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:290— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:290-360 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:307-503 — These two members are variants of one another: 46 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 (46 shared lines) crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:264— crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:264-453 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:54-132 — These two members are variants of one another: 46 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (43 shared lines) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:462— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:462-588 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:290-360 — These two members are variants of one another: 43 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (43 shared lines) crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:783— crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:783-869 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:307-503 — These two members are variants of one another: 43 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (38 shared lines) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:462— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:462-588 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1010-1181 — 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 (38 shared lines) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:290— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:290-360 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:264-453 — 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 (37 shared lines) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:462— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:462-588 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1894-2060 — These two members are variants of one another: 37 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 (37 shared lines) crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:758— crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:758-847 | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:1241-1313 — These two members are variants of one another: 37 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 (18 corresponding lines) · ×2
Edited copy of a member (18 corresponding lines) crates/analytics/src/query.rs:173— crates/analytics/src/query.rs:173-194 | crates/analytics/src/query.rs:199-221 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/router/src/core/webhooks/incoming.rs:2340— crates/router/src/core/webhooks/incoming.rs:2340-2393 | crates/router/src/utils.rs:291-322 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (23 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (23 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/affirm.rs:570— crates/hyperswitch_connectors/src/connectors/affirm.rs:570-582 | crates/hyperswitch_connectors/src/connectors/airwallex.rs:893-905 | crates/hyperswitch_connectors/src/connectors/authipay.rs:543-555 | crates/hyperswitch_connectors/src/connectors/breadpay.rs:587-599 | crates/hyperswitch_connectors/src/connectors/deutschebank.rs:782-794 | crates/hyperswitch_connectors/src/connectors/finix.rs:778-790 | crates/hyperswitch_connectors/src/connectors/fiservemea.rs:566-578 | crates/hyperswitch_connectors/src/connectors/forte.rs:498-510 | crates/hyperswitch_connectors/src/connectors/getnet.rs:505-517 | crates/hyperswitch_connectors/src/connectors/helcim.rs:601-613 | crates/hyperswitch_connectors/src/connectors/jpmorgan.rs:611-623 | crates/hyperswitch_connectors/src/connectors/klarna.rs:1248-1260 | crates/hyperswitch_connectors/src/connectors/moneris.rs:602-614 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:982-994 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:792-804 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:877-889 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:717-729 | crates/hyperswitch_connectors/src/connectors/placetopay.rs:453-465 | crates/hyperswitch_connectors/src/connectors/silverflow.rs:577-589 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:676-688 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:548-560 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:674-686 | crates/hyperswitch_connectors/src/connectors/zift.rs:555-567 — These 23 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 23 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 23 times.
Members sharing a duplicated core (23 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/affirm.rs:733— crates/hyperswitch_connectors/src/connectors/affirm.rs:733-742 | crates/hyperswitch_connectors/src/connectors/airwallex.rs:1042-1051 | crates/hyperswitch_connectors/src/connectors/authipay.rs:718-727 | crates/hyperswitch_connectors/src/connectors/bambora.rs:779-788 | crates/hyperswitch_connectors/src/connectors/bluesnap.rs:1063-1072 | crates/hyperswitch_connectors/src/connectors/coingate.rs:491-500 | crates/hyperswitch_connectors/src/connectors/deutschebank.rs:946-955 | crates/hyperswitch_connectors/src/connectors/dlocal.rs:651-660 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:827-836 | crates/hyperswitch_connectors/src/connectors/facilitapay.rs:771-780 | crates/hyperswitch_connectors/src/connectors/forte.rs:668-677 | crates/hyperswitch_connectors/src/connectors/helcim.rs:775-784 | crates/hyperswitch_connectors/src/connectors/iatapay.rs:630-639 | crates/hyperswitch_connectors/src/connectors/mollie.rs:796-805 | crates/hyperswitch_connectors/src/connectors/multisafepay.rs:485-494 | crates/hyperswitch_connectors/src/connectors/payload.rs:1003-1012 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:899-908 | crates/hyperswitch_connectors/src/connectors/shift4.rs:783-792 | crates/hyperswitch_connectors/src/connectors/square.rs:785-794 | crates/hyperswitch_connectors/src/connectors/stax.rs:822-831 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:1096-1105 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:929-938 | crates/hyperswitch_connectors/src/connectors/xendit.rs:824-833 — These 23 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 23 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 23 times.
D4 · Code Duplication· Members sharing a duplicated core (22 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (22 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/aci.rs:422— crates/hyperswitch_connectors/src/connectors/aci.rs:422-431 | crates/hyperswitch_connectors/src/connectors/bambora.rs:406-415 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:606-615 | crates/hyperswitch_connectors/src/connectors/bitpay.rs:312-321 | crates/hyperswitch_connectors/src/connectors/checkout.rs:571-580 | crates/hyperswitch_connectors/src/connectors/cryptopay.rs:369-378 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1121-1130 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:353-362 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:592-601 | crates/hyperswitch_connectors/src/connectors/globepay.rs:326-335 | crates/hyperswitch_connectors/src/connectors/gocardless.rs:568-577 | crates/hyperswitch_connectors/src/connectors/nexinets.rs:329-338 | crates/hyperswitch_connectors/src/connectors/noon.rs:396-405 | crates/hyperswitch_connectors/src/connectors/opayo.rs:302-311 | crates/hyperswitch_connectors/src/connectors/payu.rs:398-407 | crates/hyperswitch_connectors/src/connectors/stripe.rs:894-903 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:457-466 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:746-755 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:292-301 | crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs:279-288 | crates/hyperswitch_connectors/src/connectors/xendit.rs:485-494 | crates/hyperswitch_connectors/src/connectors/zen.rs:335-344 — These 22 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 22 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 22 times.
Members sharing a duplicated core (22 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/citigate/transformers.rs:53— crates/hyperswitch_connectors/src/connectors/citigate/transformers.rs:53-61 | crates/hyperswitch_connectors/src/connectors/elavon_pg/transformers.rs:53-61 | crates/hyperswitch_connectors/src/connectors/envoy/transformers.rs:68-76 | crates/hyperswitch_connectors/src/connectors/etisalat/transformers.rs:53-61 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub/transformers.rs:55-63 | crates/hyperswitch_connectors/src/connectors/givepayments/transformers.rs:55-63 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex/transformers.rs:55-63 | crates/hyperswitch_connectors/src/connectors/hyperpg/transformers.rs:53-61 | crates/hyperswitch_connectors/src/connectors/hyperwallet/transformers.rs:53-61 | crates/hyperswitch_connectors/src/connectors/ilixium/transformers.rs:53-61 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions/transformers.rs:55-63 | crates/hyperswitch_connectors/src/connectors/interpayments/transformers.rs:55-63 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital/transformers.rs:55-63 | crates/hyperswitch_connectors/src/connectors/katapult/transformers.rs:53-61 | crates/hyperswitch_connectors/src/connectors/mpgs/transformers.rs:51-59 | crates/hyperswitch_connectors/src/connectors/payconex/transformers.rs:53-61 | crates/hyperswitch_connectors/src/connectors/paynearme/transformers.rs:53-61 | crates/hyperswitch_connectors/src/connectors/paytm/transformers.rs:51-59 | crates/hyperswitch_connectors/src/connectors/phonepe/transformers.rs:53-61 | crates/hyperswitch_connectors/src/connectors/sift/transformers.rs:51-59 | crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs:188-196 | crates/hyperswitch_connectors/src/connectors/worldpayraft/transformers.rs:54-62 — These 22 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 22 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 22 times.
D4 · Code Duplication· Members sharing a duplicated core (11 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (11 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/adyen.rs:1706— crates/hyperswitch_connectors/src/connectors/adyen.rs:1706-1716 | crates/hyperswitch_connectors/src/connectors/adyenplatform.rs:242-252 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1533-1543 | crates/hyperswitch_connectors/src/connectors/ebanx.rs:276-286 | crates/hyperswitch_connectors/src/connectors/gotyme_sanlam.rs:230-240 | crates/hyperswitch_connectors/src/connectors/loonio.rs:710-720 | crates/hyperswitch_connectors/src/connectors/payone.rs:329-338 | crates/hyperswitch_connectors/src/connectors/paypal.rs:781-791 | crates/hyperswitch_connectors/src/connectors/stripe.rs:3289-3299 | crates/hyperswitch_connectors/src/connectors/trustly.rs:637-647 | crates/hyperswitch_connectors/src/connectors/wise.rs:710-720 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
Members sharing a duplicated core (11 members, 50+ identical tokens) crates/router/src/analytics.rs:621— crates/router/src/analytics.rs:621-666 | crates/router/src/analytics.rs:852-897 | crates/router/src/analytics.rs:1008-1053 | crates/router/src/analytics.rs:1323-1358 | crates/router/src/analytics.rs:1419-1447 | crates/router/src/analytics.rs:1488-1516 | crates/router/src/analytics.rs:1619-1647 | crates/router/src/analytics.rs:2854-2882 | crates/router/src/analytics.rs:2973-3008 | crates/router/src/analytics.rs:3071-3100 | crates/router/src/analytics.rs:3142-3171 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
Duplicated block (69 lines × 2) crates/router/src/types/api/connector_mapping.rs:460— crates/router/src/types/api/connector_mapping.rs:460-528 | crates/router/src/types/api/feature_matrix.rs:385-453 — before extracting anything, compare `crates/router/src/types/api/connector_mapping.rs` and `crates/router/src/types/api/feature_matrix.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 401 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (69 lines × 2) crates/router/src/types/transformers.rs:1673— crates/router/src/types/transformers.rs:1673-1741 | crates/router/src/types/transformers.rs:1764-1832 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (61 lines × 2) crates/kgraph_utils/src/mca.rs:931— crates/kgraph_utils/src/mca.rs:931-991 | crates/kgraph_utils/src/mca.rs:1002-1062 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (61 lines × 2) crates/router/src/types/transformers.rs:1028— crates/router/src/types/transformers.rs:1028-1088 | crates/router/src/types/transformers.rs:1103-1163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (57 lines × 2) crates/router/src/core/payment_methods.rs:5609— crates/router/src/core/payment_methods.rs:5609-5665 | crates/router/src/core/payment_methods.rs:5768-5824 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (57 lines × 2) crates/router/src/core/user_role.rs:223— crates/router/src/core/user_role.rs:223-279 | crates/router/src/core/user_role.rs:307-363 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (52 lines × 2) crates/hyperswitch_domain_models/src/router_data.rs:1230— crates/hyperswitch_domain_models/src/router_data.rs:1230-1281 | crates/hyperswitch_domain_models/src/router_data.rs:2196-2247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (52 lines × 2) crates/router/src/services/api.rs:950— crates/router/src/services/api.rs:950-1001 | crates/router/src/services/api.rs:1114-1165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (50 lines × 2) crates/router/src/core/payment_methods/network_tokenization.rs:131— crates/router/src/core/payment_methods/network_tokenization.rs:131-180 | crates/router/src/core/payment_methods/network_tokenization.rs:303-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.
Duplicated block (50 lines × 2) crates/router/src/core/refunds_v2.rs:191— crates/router/src/core/refunds_v2.rs:191-240 | crates/router/src/core/refunds_v2.rs:315-364 — both copies are in the same file, so extract the block into 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) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2950— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2950-2995 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3031-3076 — both copies are in the same file, so extract the block into 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) crates/router/src/core/payments/transformers.rs:2446— crates/router/src/core/payments/transformers.rs:2446-2491 | crates/router/src/core/payments/transformers.rs:8450-8495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (43–44 lines × 2) crates/router/src/core/payments.rs:10332— crates/router/src/core/payments.rs:10332-10374 | crates/router/src/core/payments.rs:10380-10423 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (43–44 lines × 2) crates/router/src/core/unified_connector_service.rs:4556— crates/router/src/core/unified_connector_service.rs:4556-4598 | crates/router/src/core/unified_connector_service.rs:4653-4696 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (36 lines × 2) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:167— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:167-202 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:178-213 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (36 lines × 2) crates/router/src/core/webhooks/outgoing.rs:1072— crates/router/src/core/webhooks/outgoing.rs:1072-1107 | crates/router/src/core/webhooks/outgoing_v2.rs:401-436 — before extracting anything, compare `crates/router/src/core/webhooks/outgoing.rs` and `crates/router/src/core/webhooks/outgoing_v2.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (34–35 lines × 2) crates/router/src/core/payment_methods/utils.rs:368— crates/router/src/core/payment_methods/utils.rs:368-401 | crates/router/src/core/payment_methods/utils.rs:420-454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (34–35 lines × 2) crates/router/src/types/transformers.rs:1184— crates/router/src/types/transformers.rs:1184-1217 | crates/router/src/types/transformers.rs:1371-1405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (33–34 lines × 2) crates/router/src/core/payments/operations.rs:738— crates/router/src/core/payments/operations.rs:738-770 | crates/router/src/core/payments/operations/payment_complete_authorize.rs:538-571 — 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 (33–34 lines × 2) crates/router/src/services/authentication.rs:3547— crates/router/src/services/authentication.rs:3547-3579 | crates/router/src/services/authentication.rs:3893-3926 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (32–33 lines × 2) crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:372— crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:372-404 | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:1856-1887 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (32–33 lines × 2) crates/router/src/routes/profiles.rs:21— crates/router/src/routes/profiles.rs:21-52 | crates/router/src/routes/profiles.rs:234-266 — both copies are in the same file, so extract the block into 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–32 lines × 2) crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:1764— crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:1764-1795 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:1945-1974 — both copies are in the same file, so extract the block into 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–32 lines × 2) crates/router/src/types/storage/refund.rs:105— crates/router/src/types/storage/refund.rs:105-134 | crates/router/src/types/storage/refund.rs:506-537 — both copies are in the same file, so extract the block into 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–32 lines × 2) crates/router/src/core/payment_methods.rs:6125— crates/router/src/core/payment_methods.rs:6125-6156 | crates/router/src/core/payment_methods.rs:6184-6214 — both copies are in the same file, so extract the block into 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–32 lines × 2) crates/router/src/core/payments/operations/payment_session.rs:344— crates/router/src/core/payments/operations/payment_session.rs:344-374 | crates/router/src/core/payments/operations/payment_status.rs:84-115 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_session.rs` and `crates/router/src/core/payments/operations/payment_status.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 lines × 3) crates/hyperswitch_connectors/src/connectors/cybersource.rs:288— crates/hyperswitch_connectors/src/connectors/cybersource.rs:288-317 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:350-379 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:254-283 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersource.rs` and `crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (30 lines × 3) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:549— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:549-578 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:848-877 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:431-460 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/payment_confirm_intent.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (29 lines × 3) crates/hyperswitch_domain_models/src/lib.rs:1168— crates/hyperswitch_domain_models/src/lib.rs:1168-1196 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:2274-2302 | crates/storage_impl/src/payments/payment_attempt.rs:2431-2459 — before extracting anything, compare `crates/hyperswitch_domain_models/src/lib.rs` and `crates/hyperswitch_domain_models/src/payments/payment_intent.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (29 lines × 3) crates/router/src/core/payouts.rs:1998— crates/router/src/core/payouts.rs:1998-2026 | crates/router/src/core/payouts.rs:3113-3141 | crates/router/src/core/payouts.rs:3322-3350 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (28 lines × 3) crates/hyperswitch_connectors/src/connectors/cybersource.rs:116— crates/hyperswitch_connectors/src/connectors/cybersource.rs:116-143 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:94-121 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:98-125 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersource.rs` and `crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (28 lines × 3) crates/hyperswitch_domain_models/src/payments/payment_intent.rs:840— crates/hyperswitch_domain_models/src/payments/payment_intent.rs:840-868 | crates/storage_impl/src/business_profile.rs:633-660 | crates/storage_impl/src/business_profile.rs:1715-1742 — 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 (25–28 lines × 2) crates/router/src/core/payments/helpers.rs:747— crates/router/src/core/payments/helpers.rs:747-774 | crates/router/src/core/payments/helpers.rs:791-815 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25–28 lines × 2) crates/router/src/core/refunds.rs:534— crates/router/src/core/refunds.rs:534-558 | crates/router/src/core/refunds.rs:1226-1253 — both copies are in the same file, so extract the block into 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 × 3) crates/router/src/core/payments/operations/payment_cancel.rs:138— crates/router/src/core/payments/operations/payment_cancel.rs:138-164 | crates/router/src/core/payments/operations/payment_capture.rs:193-219 | crates/router/src/core/payments/operations/payment_session.rs:152-178 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_capture.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 236 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 3) crates/router/src/core/utils.rs:1482— crates/router/src/core/utils.rs:1482-1508 | crates/router/src/core/utils.rs:1802-1828 | crates/router/src/core/utils.rs:2060-2086 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (26 lines × 4) crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:89— crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:89-114 | crates/analytics/src/payments/metrics/debit_routing.rs:77-102 | crates/analytics/src/payments/metrics/payment_processed_amount.rs:71-96 | crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs:77-102 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs` and `crates/analytics/src/payments/metrics/debit_routing.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 96 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 (26 lines × 4) crates/router/src/core/payments/operations/payment_response.rs:1094— crates/router/src/core/payments/operations/payment_response.rs:1094-1119 | crates/router/src/core/payments/operations/payment_response.rs:1431-1456 | crates/router/src/core/payments/operations/payment_response.rs:2368-2393 | crates/router/src/core/payments/operations/payment_response.rs:2536-2561 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (26 lines × 3) crates/analytics/src/api_event/core.rs:118— crates/analytics/src/api_event/core.rs:118-143 | crates/analytics/src/disputes/core.rs:54-79 | crates/analytics/src/frm/core.rs:47-72 — `crates/analytics/src/api_event/core.rs` and `crates/analytics/src/disputes/core.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 43 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 (26 lines × 3) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:266— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:266-291 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:289-314 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:202-227 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 5) crates/analytics/src/lib.rs:130— crates/analytics/src/lib.rs:130-151 | crates/analytics/src/lib.rs:345-366 | crates/analytics/src/lib.rs:466-487 | crates/analytics/src/lib.rs:676-697 | crates/analytics/src/lib.rs:776-797 — 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 (22 lines × 5) crates/analytics/src/sqlx.rs:712— crates/analytics/src/sqlx.rs:712-733 | crates/analytics/src/sqlx.rs:843-864 | crates/analytics/src/sqlx.rs:980-1001 | crates/analytics/src/sqlx.rs:1083-1104 | crates/analytics/src/sqlx.rs:1190-1211 — 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 (21–22 lines × 4) crates/analytics/src/refunds/metrics/refund_processed_amount.rs:83— crates/analytics/src/refunds/metrics/refund_processed_amount.rs:83-104 | crates/analytics/src/refunds/metrics/refund_success_count.rs:79-99 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs:91-112 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs:79-99 — before extracting anything, compare `crates/analytics/src/refunds/metrics/refund_processed_amount.rs` and `crates/analytics/src/refunds/metrics/refund_success_count.rs` as WHOLE FILES: this scan already matched 3 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 (21–22 lines × 4) crates/router/src/core/relay/utils.rs:117— crates/router/src/core/relay/utils.rs:117-138 | crates/router/src/core/relay/utils.rs:262-283 | crates/router/src/core/relay/utils.rs:391-411 | crates/router/src/core/relay/utils.rs:528-548 — 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 (21–22 lines × 3) crates/router/src/core/payments/transformers.rs:371— crates/router/src/core/payments/transformers.rs:371-392 | crates/router/src/core/payments/transformers.rs:673-693 | crates/router/src/core/payments/transformers.rs:1771-1792 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21–22 lines × 3) crates/router/src/core/payouts.rs:2133— crates/router/src/core/payouts.rs:2133-2154 | crates/router/src/core/payouts.rs:2822-2842 | crates/router/src/core/payouts.rs:3041-3061 — all 3 copies are in the same file, so extract the block into one function there and call 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–22 lines × 2) crates/router/src/core/payment_link.rs:111— crates/router/src/core/payment_link.rs:111-132 | crates/router/src/core/payment_link.rs:911-930 — both copies are in the same file, so extract the block into 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–22 lines × 2) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:498— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:498-519 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:380-399 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/proxy_payments_intent.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 289 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 8) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:743— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:743-763 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:871-891 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:966-986 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1092-1112 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1048-1068 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1923-1943 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:685-705 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:1010-1030 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 8) crates/storage_impl/src/business_profile.rs:808— crates/storage_impl/src/business_profile.rs:808-828 | crates/storage_impl/src/business_profile.rs:875-895 | crates/storage_impl/src/business_profile.rs:942-962 | crates/storage_impl/src/business_profile.rs:1010-1030 | crates/storage_impl/src/business_profile.rs:1078-1098 | crates/storage_impl/src/business_profile.rs:1145-1165 | crates/storage_impl/src/business_profile.rs:1213-1233 | crates/storage_impl/src/business_profile.rs:1281-1301 — 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 (21 lines × 4) crates/api_models/src/payments.rs:12692— crates/api_models/src/payments.rs:12692-12712 | crates/api_models/src/payments.rs:12721-12741 | crates/api_models/src/payments.rs:12931-12951 | crates/api_models/src/payments.rs:12960-12980 — 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 (21 lines × 4) crates/router/src/db/api_keys.rs:338— crates/router/src/db/api_keys.rs:338-358 | crates/router/src/db/events.rs:994-1014 | crates/router/src/db/events.rs:1167-1187 | crates/router/src/db/events.rs:1385-1405 — 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 (20–21 lines × 3) crates/hyperswitch_connectors/src/connectors/absa_sanlam/transformers.rs:119— crates/hyperswitch_connectors/src/connectors/absa_sanlam/transformers.rs:119-139 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:2339-2358 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:2470-2489 — 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–21 lines × 3) crates/router/src/routes/admin.rs:221— crates/router/src/routes/admin.rs:221-240 | crates/router/src/routes/profiles.rs:32-51 | crates/router/src/routes/profiles.rs:245-265 — before extracting anything, compare `crates/router/src/routes/admin.rs` and `crates/router/src/routes/profiles.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 8) crates/analytics/src/sdk_events/metrics/average_payment_time.rs:54— crates/analytics/src/sdk_events/metrics/average_payment_time.rs:54-73 | crates/analytics/src/sdk_events/metrics/load_time.rs:54-73 | crates/analytics/src/sdk_events/metrics/payment_attempts.rs:53-72 | crates/analytics/src/sdk_events/metrics/payment_data_filled_count.rs:53-72 | crates/analytics/src/sdk_events/metrics/payment_method_selected_count.rs:53-72 | crates/analytics/src/sdk_events/metrics/payment_methods_call_count.rs:53-72 | crates/analytics/src/sdk_events/metrics/sdk_initiated_count.rs:53-72 | crates/analytics/src/sdk_events/metrics/sdk_rendered_count.rs:53-72 — before extracting anything, compare `crates/analytics/src/sdk_events/metrics/average_payment_time.rs` and `crates/analytics/src/sdk_events/metrics/load_time.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 8) crates/router/src/routes/superposition_proxy.rs:41— crates/router/src/routes/superposition_proxy.rs:41-60 | crates/router/src/routes/superposition_proxy.rs:85-104 | crates/router/src/routes/superposition_proxy.rs:129-148 | crates/router/src/routes/superposition_proxy.rs:173-192 | crates/router/src/routes/superposition_proxy.rs:217-236 | crates/router/src/routes/superposition_proxy.rs:305-324 | crates/router/src/routes/superposition_proxy.rs:353-372 | crates/router/src/routes/superposition_proxy.rs:397-416 — 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 (20 lines × 4) crates/router/src/core/payments/transformers.rs:606— crates/router/src/core/payments/transformers.rs:606-625 | crates/router/src/core/payments/transformers.rs:1198-1217 | crates/router/src/core/payments/transformers.rs:1702-1721 | crates/router/src/core/payments/transformers.rs:1944-1963 — 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 (20 lines × 4) crates/router/src/routes/payments.rs:1141— crates/router/src/routes/payments.rs:1141-1160 | crates/router/src/routes/payments.rs:1459-1478 | crates/router/src/routes/payments.rs:1615-1634 | crates/router/src/routes/payments.rs:3270-3289 — 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–20 lines × 3) crates/analytics/src/api_event/metrics/api_count.rs:53— crates/analytics/src/api_event/metrics/api_count.rs:53-72 | crates/analytics/src/api_event/metrics/latency.rs:58-75 | crates/analytics/src/api_event/metrics/status_code_count.rs:59-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 all 3 call sites, so a change lands once.
Duplicated block (18–20 lines × 3) crates/router/src/core/payments/transformers.rs:3206— crates/router/src/core/payments/transformers.rs:3206-3225 | crates/router/src/core/payments/transformers.rs:3363-3382 | crates/router/src/core/payments/transformers.rs:3488-3505 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17–20 lines × 2) crates/router/src/core/payments/operations/payment_confirm.rs:3248— crates/router/src/core/payments/operations/payment_confirm.rs:3248-3264 | crates/router/src/core/payments/operations/payment_create.rs:1244-1263 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_create.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–20 lines × 2) crates/router/src/core/payments/operations/payment_response.rs:922— crates/router/src/core/payments/operations/payment_response.rs:922-941 | crates/router/src/core/payments/operations/payment_response.rs:2288-2304 — both copies are in the same file, so extract the block into 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 × 10) crates/router/src/core/payments/operations/payment_approve.rs:115— crates/router/src/core/payments/operations/payment_approve.rs:115-133 | crates/router/src/core/payments/operations/payment_cancel.rs:97-115 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:97-115 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:92-110 | crates/router/src/core/payments/operations/payment_capture.rs:159-177 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:116-134 | crates/router/src/core/payments/operations/payment_reject.rs:93-111 | crates/router/src/core/payments/operations/payment_session.rs:104-122 | crates/router/src/core/payments/operations/payment_start.rs:105-123 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:107-125 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_approve.rs` and `crates/router/src/core/payments/operations/payment_capture.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 10) crates/router/src/core/payments/operations/payment_approve.rs:125— crates/router/src/core/payments/operations/payment_approve.rs:125-143 | crates/router/src/core/payments/operations/payment_cancel.rs:107-125 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:107-125 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:102-120 | crates/router/src/core/payments/operations/payment_capture.rs:169-187 | crates/router/src/core/payments/operations/payment_complete_authorize.rs:262-280 | crates/router/src/core/payments/operations/payment_reject.rs:103-121 | crates/router/src/core/payments/operations/payment_session.rs:114-132 | crates/router/src/core/payments/operations/payment_start.rs:115-133 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:117-135 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_approve.rs` and `crates/router/src/core/payments/operations/payment_capture.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–19 lines × 3) crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:439— crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:439-457 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:621-639 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:990-1006 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17–19 lines × 3) crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:948— crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:948-966 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:1052-1068 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:1157-1173 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16–19 lines × 2) crates/hyperswitch_connectors/src/connectors/trustpay.rs:493— crates/hyperswitch_connectors/src/connectors/trustpay.rs:493-508 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:519-537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–19 lines × 2) crates/router/src/core/refunds.rs:1673— crates/router/src/core/refunds.rs:1673-1691 | crates/router/src/core/refunds_v2.rs:1175-1190 — before extracting anything, compare `crates/router/src/core/refunds.rs` and `crates/router/src/core/refunds_v2.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–18 lines × 4) crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:70— crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:70-86 | crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs:70-87 | crates/analytics/src/disputes/metrics/total_amount_disputed.rs:69-85 | crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs:69-86 — before extracting anything, compare `crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs` and `crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–18 lines × 4) crates/router/src/core/unified_authentication_service.rs:159— crates/router/src/core/unified_authentication_service.rs:159-176 | crates/router/src/core/unified_authentication_service.rs:197-214 | crates/router/src/core/unified_authentication_service.rs:270-286 | crates/router/src/core/unified_authentication_service.rs:384-401 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–18 lines × 3) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1925— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1925-1939 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2627-2644 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1255-1272 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 527 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 (15–18 lines × 3) crates/router/src/core/user.rs:86— crates/router/src/core/user.rs:86-103 | crates/router/src/core/user.rs:246-263 | crates/router/src/core/user.rs:376-390 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16–18 lines × 3) crates/router/src/core/payments.rs:14262— crates/router/src/core/payments.rs:14262-14278 | crates/router/src/core/payments.rs:14539-14554 | crates/router/src/core/payments.rs:14622-14639 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16–18 lines × 3) crates/router/src/core/webhooks/incoming.rs:1096— crates/router/src/core/webhooks/incoming.rs:1096-1111 | crates/router/src/core/webhooks/incoming.rs:2281-2298 | crates/router/src/core/webhooks/incoming.rs:3203-3218 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–18 lines × 2) crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs:81— crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs:81-98 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:56-70 — before extracting anything, compare `crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs` and `crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–18 lines × 2) crates/router/src/core/payment_methods/cards.rs:5474— crates/router/src/core/payment_methods/cards.rs:5474-5488 | crates/router/src/core/superposition_sdk_config.rs:42-59 — before extracting anything, compare `crates/router/src/core/payment_methods/cards.rs` and `crates/router/src/core/superposition_sdk_config.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16–18 lines × 2) crates/router/src/core/payments/access_token.rs:483— crates/router/src/core/payments/access_token.rs:483-500 | crates/router/src/core/payments/access_token.rs:578-593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–18 lines × 2) crates/router/src/routes/payments.rs:1686— crates/router/src/routes/payments.rs:1686-1701 | crates/router/src/routes/payments.rs:3323-3340 — both copies are in the same file, so extract the block into 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 × 14) REDACTED:911— REDACTED:911-926 | REDACTED:974-989 | REDACTED:1170-1185 | REDACTED:1236-1251 | REDACTED:1375-1390 | REDACTED:1441-1456 | REDACTED:1506-1521 | REDACTED:1571-1586 | REDACTED:1635-1650 | REDACTED:1700-1715 | REDACTED:1760-1775 | REDACTED:1823-1838 | REDACTED:1886-1901 | REDACTED:1951-1966 — 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 (16 lines × 14) crates/hyperswitch_connectors/src/connectors/stripe.rs:216— crates/hyperswitch_connectors/src/connectors/stripe.rs:216-231 | crates/hyperswitch_connectors/src/connectors/stripe.rs:430-445 | crates/hyperswitch_connectors/src/connectors/stripe.rs:620-635 | crates/hyperswitch_connectors/src/connectors/stripe.rs:811-826 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1032-1047 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1216-1231 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1394-1409 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1643-1658 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1816-1831 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2016-2031 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2179-2194 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2354-2369 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2486-2501 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2723-2738 — 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 (16 lines × 8) crates/diesel_models/src/payment_attempt.rs:3094— crates/diesel_models/src/payment_attempt.rs:3094-3109 | crates/diesel_models/src/payment_attempt.rs:3236-3251 | crates/diesel_models/src/payment_attempt.rs:3414-3429 | crates/diesel_models/src/payment_attempt.rs:3511-3526 | crates/diesel_models/src/payment_attempt.rs:3714-3729 | crates/diesel_models/src/payment_attempt.rs:3823-3838 | crates/diesel_models/src/payment_attempt.rs:4416-4431 | crates/diesel_models/src/payment_attempt.rs:4488-4503 — 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 (16 lines × 8) crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:967— crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:967-982 | crates/hyperswitch_connectors/src/connectors/braintree.rs:1281-1296 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1688-1703 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:211-226 | crates/hyperswitch_connectors/src/connectors/nmi.rs:467-482 | crates/hyperswitch_connectors/src/connectors/payme.rs:465-480 | crates/hyperswitch_connectors/src/connectors/powertranz.rs:334-349 | crates/hyperswitch_connectors/src/connectors/redsys.rs:496-511 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs` and `crates/hyperswitch_connectors/src/connectors/braintree.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 7) crates/router/src/core/payments/operations/payment_cancel.rs:57— crates/router/src/core/payments/operations/payment_cancel.rs:57-71 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:61-75 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:55-69 | crates/router/src/core/payments/operations/payment_confirm_external_vault_proxy.rs:194-209 | crates/router/src/core/payments/operations/payment_reject.rs:53-67 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:61-75 | crates/router/src/core/payments/operations/payments_incremental_authorization.rs:66-80 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 7) crates/storage_impl/src/business_profile.rs:755— crates/storage_impl/src/business_profile.rs:755-770 | crates/storage_impl/src/business_profile.rs:823-837 | crates/storage_impl/src/business_profile.rs:1025-1039 | crates/storage_impl/src/business_profile.rs:1093-1107 | crates/storage_impl/src/business_profile.rs:1160-1174 | crates/storage_impl/src/business_profile.rs:1228-1242 | crates/storage_impl/src/business_profile.rs:1296-1310 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14–16 lines × 5) crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:47— crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:47-60 | crates/analytics/src/payment_intents/metrics/payments_success_rate.rs:46-60 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:47-61 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs:46-61 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs:46-60 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs` and `crates/analytics/src/payment_intents/metrics/payments_success_rate.rs` as WHOLE FILES: this scan already matched 6 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.
Duplicated block (14–16 lines × 5) crates/hyperswitch_connectors/src/connectors/stripe.rs:956— crates/hyperswitch_connectors/src/connectors/stripe.rs:956-969 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1940-1955 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2103-2118 | crates/hyperswitch_connectors/src/connectors/xendit.rs:755-770 | crates/hyperswitch_connectors/src/connectors/xendit.rs:851-865 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/stripe.rs` and `crates/hyperswitch_connectors/src/connectors/xendit.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–16 lines × 2) crates/hyperswitch_connectors/src/connectors/stripe.rs:2822— crates/hyperswitch_connectors/src/connectors/stripe.rs:2822-2834 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2841-2856 — both copies are in the same file, so extract the block into 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–16 lines × 2) crates/router/src/core/admin.rs:3213— crates/router/src/core/admin.rs:3213-3225 | crates/router/src/core/merchant_connector_webhook_management.rs:590-605 — 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 × 16) REDACTED:928— REDACTED:928-942 | REDACTED:1123-1137 | REDACTED:1189-1203 | REDACTED:1255-1269 | REDACTED:1329-1343 | REDACTED:1394-1408 | REDACTED:1460-1474 | REDACTED:1525-1539 | REDACTED:1590-1604 | REDACTED:1654-1668 | REDACTED:1779-1793 | REDACTED:1842-1856 | REDACTED:1905-1919 | REDACTED:1970-1984 | REDACTED:2036-2050 | REDACTED:2097-2111 — 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.
Duplicated block (15 lines × 16) crates/hyperswitch_connectors/src/connectors/braintree.rs:106— crates/hyperswitch_connectors/src/connectors/braintree.rs:106-120 | crates/hyperswitch_connectors/src/connectors/coinbase.rs:90-104 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:97-113 | crates/hyperswitch_connectors/src/connectors/finix.rs:273-287 | crates/hyperswitch_connectors/src/connectors/getnet.rs:95-109 | crates/hyperswitch_connectors/src/connectors/gocardless.rs:96-110 | crates/hyperswitch_connectors/src/connectors/mifinity.rs:99-113 | crates/hyperswitch_connectors/src/connectors/opennode.rs:90-104 | crates/hyperswitch_connectors/src/connectors/shift4.rs:82-96 | crates/hyperswitch_connectors/src/connectors/shift4.rs:474-488 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:114-129 | crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs:60-74 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:983-1002 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1072-1091 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1153-1172 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1256-1275 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/braintree.rs` and `crates/hyperswitch_connectors/src/connectors/coinbase.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 8) crates/hyperswitch_domain_models/src/payments/payment_intent.rs:601— crates/hyperswitch_domain_models/src/payments/payment_intent.rs:601-615 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:654-668 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:705-719 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:756-770 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:810-824 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:961-975 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1009-1023 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1060-1074 — 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 (15 lines × 8) crates/hyperswitch_domain_models/src/payments/payment_intent.rs:601— crates/hyperswitch_domain_models/src/payments/payment_intent.rs:601-615 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:705-719 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:756-770 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:810-824 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:961-975 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1009-1023 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1060-1074 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1107-1121 — 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 (13–15 lines × 6) crates/analytics/src/payments/metrics/connector_success_rate.rs:44— crates/analytics/src/payments/metrics/connector_success_rate.rs:44-58 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:45-59 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs:44-56 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:43-56 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:42-56 | crates/analytics/src/payments/metrics/success_rate.rs:41-55 — before extracting anything, compare `crates/analytics/src/payments/metrics/connector_success_rate.rs` and `crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13–15 lines × 6) crates/router/src/db/dispute.rs:473— crates/router/src/db/dispute.rs:473-486 | crates/router/src/db/dispute.rs:548-561 | crates/router/src/db/mandate.rs:161-175 | crates/router/src/db/refund.rs:617-629 | crates/router/src/db/refund.rs:1082-1095 | crates/router/src/db/refund.rs:1165-1178 — before extracting anything, compare `crates/router/src/db/dispute.rs` and `crates/router/src/db/mandate.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 6) crates/hyperswitch_connectors/src/connectors/fiserv.rs:421— crates/hyperswitch_connectors/src/connectors/fiserv.rs:421-435 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:524-538 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:663-677 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:771-784 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:884-897 | crates/hyperswitch_connectors/src/connectors/xendit.rs:317-331 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/fiserv.rs` and `crates/hyperswitch_connectors/src/connectors/xendit.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 6) crates/router/src/services/authentication.rs:652— crates/router/src/services/authentication.rs:652-665 | crates/router/src/services/authentication.rs:1003-1017 | crates/router/src/services/authentication.rs:1088-1102 | crates/router/src/services/authentication.rs:2004-2017 | crates/router/src/services/authentication.rs:3080-3093 | crates/router/src/services/authentication.rs:5550-5563 — 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 (13–15 lines × 5) crates/analytics/src/frm/metrics/frm_blocked_rate.rs:71— crates/analytics/src/frm/metrics/frm_blocked_rate.rs:71-85 | crates/analytics/src/refunds/metrics/refund_success_count.rs:73-85 | crates/analytics/src/refunds/metrics/refund_success_rate.rs:74-86 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs:73-85 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs:74-86 — before extracting anything, compare `crates/analytics/src/frm/metrics/frm_blocked_rate.rs` and `crates/analytics/src/refunds/metrics/refund_success_count.rs` as WHOLE FILES: this scan already matched 5 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 (13–15 lines × 5) crates/router/src/core/payments/operations/payment_complete_authorize.rs:716— crates/router/src/core/payments/operations/payment_complete_authorize.rs:716-730 | crates/router/src/core/payments/operations/payment_confirm.rs:3285-3297 | crates/router/src/core/payments/operations/payment_create.rs:1322-1334 | crates/router/src/core/payments/operations/payment_recurrence.rs:701-713 | crates/router/src/core/payments/operations/payment_update.rs:1038-1050 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_complete_authorize.rs` and `crates/router/src/core/payments/operations/payment_confirm.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 5) crates/external_services/src/utils.rs:60— crates/external_services/src/utils.rs:60-73 | crates/payment_methods/src/configs/settings.rs:182-195 | crates/router/src/configs/settings.rs:1880-1893 | crates/router/src/configs/settings.rs:1931-1944 | crates/router/src/configs/settings.rs:1994-2008 — before extracting anything, compare `crates/external_services/src/utils.rs` and `crates/payment_methods/src/configs/settings.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 5) crates/router/src/core/payments.rs:3723— crates/router/src/core/payments.rs:3723-3736 | crates/router/src/core/payments.rs:6915-6929 | crates/router/src/core/payments.rs:7510-7524 | crates/router/src/core/payments.rs:7851-7865 | crates/router/src/core/payments.rs:8983-8997 — 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 (13–15 lines × 3) crates/router/src/core/payment_methods/cards.rs:7570— crates/router/src/core/payment_methods/cards.rs:7570-7584 | crates/router/src/core/payment_methods/cards.rs:7615-7627 | crates/router/src/core/payment_methods/cards.rs:7656-7670 — all 3 copies are in the same file, so extract the block into one function there and call 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–15 lines × 3) crates/subscriptions/src/core.rs:501— crates/subscriptions/src/core.rs:501-513 | crates/subscriptions/src/core.rs:549-563 | crates/subscriptions/src/core.rs:600-614 — all 3 copies are in the same file, so extract the block into one function there and call 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–15 lines × 2) crates/router/src/bin/scheduler.rs:243— crates/router/src/bin/scheduler.rs:243-257 | crates/router/src/routes/health.rs:52-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10–15 lines × 2) crates/router/src/core/payment_methods/cards.rs:2680— crates/router/src/core/payment_methods/cards.rs:2680-2689 | crates/router/src/core/payment_methods/tokenize/payment_method_executor.rs:146-160 — 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 × 13) crates/hyperswitch_connectors/src/connectors/adyen.rs:199— crates/hyperswitch_connectors/src/connectors/adyen.rs:199-212 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:273-286 | crates/hyperswitch_connectors/src/connectors/cashtocode.rs:172-185 | crates/hyperswitch_connectors/src/connectors/checkout.rs:209-222 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1062-1075 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1937-1950 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:242-255 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:177-190 | crates/hyperswitch_connectors/src/connectors/paypal.rs:226-239 | crates/hyperswitch_connectors/src/connectors/paypal.rs:587-600 | crates/hyperswitch_connectors/src/connectors/paypal.rs:722-735 | crates/hyperswitch_connectors/src/connectors/redsys.rs:148-161 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:393-406 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 13) crates/router/src/core/payments/operations/payment_cancel.rs:152— crates/router/src/core/payments/operations/payment_cancel.rs:152-165 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:134-147 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:125-138 | crates/router/src/core/payments/operations/payment_capture.rs:207-220 | crates/router/src/core/payments/operations/payment_complete_authorize.rs:325-338 | crates/router/src/core/payments/operations/payment_confirm_external_vault_proxy.rs:333-346 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:98-111 | crates/router/src/core/payments/operations/payment_session.rs:166-179 | crates/router/src/core/payments/operations/payment_start.rs:168-181 | crates/router/src/core/payments/operations/payment_update.rs:441-454 | crates/router/src/core/payments/operations/payment_update_metadata.rs:96-109 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:140-153 | crates/router/src/core/payments/operations/tax_calculation.rs:130-143 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 7) crates/router/src/routes/payments.rs:1211— crates/router/src/routes/payments.rs:1211-1224 | crates/router/src/routes/payments.rs:1532-1545 | crates/router/src/routes/payments.rs:1956-1968 | crates/router/src/routes/payments.rs:2113-2126 | crates/router/src/routes/payments.rs:4204-4217 | crates/router/src/routes/payments.rs:4488-4501 | crates/router/src/routes/payments.rs:4756-4769 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13–14 lines × 7) crates/storage_impl/src/payments/payment_attempt.rs:80— crates/storage_impl/src/payments/payment_attempt.rs:80-93 | crates/storage_impl/src/payments/payment_attempt.rs:148-161 | crates/storage_impl/src/payments/payment_attempt.rs:219-232 | crates/storage_impl/src/payments/payment_attempt.rs:255-267 | crates/storage_impl/src/payments/payment_attempt.rs:317-330 | crates/storage_impl/src/payments/payment_attempt.rs:386-399 | crates/storage_impl/src/payments/payment_attempt.rs:505-518 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13–14 lines × 5) crates/hyperswitch_connectors/src/connectors/nomupay.rs:708— crates/hyperswitch_connectors/src/connectors/nomupay.rs:708-721 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:205-217 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:768-780 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:1213-1225 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:1137-1149 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/nomupay.rs` and `crates/hyperswitch_connectors/src/connectors/truelayer.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 5) crates/router/src/core/payments/operations/payment_confirm.rs:1082— crates/router/src/core/payments/operations/payment_confirm.rs:1082-1095 | crates/router/src/core/payments/operations/payment_create.rs:779-792 | crates/router/src/core/payments/operations/payment_session.rs:351-363 | crates/router/src/core/payments/operations/payment_status.rs:91-103 | crates/router/src/core/payments/operations/payment_update.rs:610-623 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_create.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 228 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–14 lines × 4) crates/hyperswitch_connectors/src/connectors/airwallex.rs:105— crates/hyperswitch_connectors/src/connectors/airwallex.rs:105-118 | crates/hyperswitch_connectors/src/connectors/iatapay.rs:103-114 | crates/hyperswitch_connectors/src/connectors/payu.rs:84-96 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:97-109 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/airwallex.rs` and `crates/hyperswitch_connectors/src/connectors/iatapay.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–14 lines × 4) crates/router/src/core/user_role/role.rs:119— crates/router/src/core/user_role/role.rs:119-130 | crates/router/src/core/user_role/role.rs:252-263 | crates/router/src/core/user_role/role.rs:639-652 | crates/router/src/core/user_role/role.rs:816-829 — 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–14 lines × 3) crates/router/src/core/payment_methods/transformers.rs:1416— crates/router/src/core/payment_methods/transformers.rs:1416-1425 | crates/router/src/core/payment_methods/transformers.rs:2179-2192 | crates/router/src/core/payment_methods/transformers.rs:2509-2520 — all 3 copies are in the same file, so extract the block into one function there and call 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–14 lines × 3) crates/router/src/services/authentication.rs:1859— crates/router/src/services/authentication.rs:1859-1868 | crates/router/src/services/authentication.rs:2628-2638 | crates/router/src/services/authentication.rs:2724-2737 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 7) crates/hyperswitch_connectors/src/connectors/barclaycard.rs:471— crates/hyperswitch_connectors/src/connectors/barclaycard.rs:471-482 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:565-576 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:772-783 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:866-877 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:855-866 | crates/hyperswitch_connectors/src/connectors/redsys.rs:316-328 | crates/hyperswitch_connectors/src/connectors/redsys.rs:635-647 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 291 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 7) crates/router/src/core/payouts.rs:2009— crates/router/src/core/payouts.rs:2009-2021 | crates/router/src/core/payouts.rs:2223-2235 | crates/router/src/core/payouts.rs:2474-2485 | crates/router/src/core/payouts.rs:2700-2712 | crates/router/src/core/payouts.rs:2982-2994 | crates/router/src/core/payouts.rs:3124-3136 | crates/router/src/core/payouts.rs:3333-3345 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 6) crates/diesel_models/src/query/blocklist.rs:208— crates/diesel_models/src/query/blocklist.rs:208-220 | crates/diesel_models/src/query/blocklist.rs:257-269 | crates/diesel_models/src/query/blocklist.rs:409-421 | crates/diesel_models/src/query/blocklist.rs:657-669 | crates/diesel_models/src/query/blocklist.rs:1072-1084 | crates/diesel_models/src/query/blocklist.rs:1153-1165 — 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 (13 lines × 6) crates/hyperswitch_domain_models/src/router_data.rs:1337— crates/hyperswitch_domain_models/src/router_data.rs:1337-1349 | crates/hyperswitch_domain_models/src/router_data.rs:1666-1678 | crates/hyperswitch_domain_models/src/router_data.rs:2005-2017 | crates/hyperswitch_domain_models/src/router_data.rs:2303-2315 | crates/hyperswitch_domain_models/src/router_data.rs:2557-2569 | crates/hyperswitch_domain_models/src/router_data.rs:2744-2756 — 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 (11–13 lines × 2) crates/router/src/core/payments/operations/payment_create_intent.rs:137— crates/router/src/core/payments/operations/payment_create_intent.rs:137-149 | crates/router/src/core/payments/operations/payment_update_intent.rs:217-227 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_create_intent.rs` and `crates/router/src/core/payments/operations/payment_update_intent.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 (11–13 lines × 2) crates/router/src/services/kafka/deja_record_sink.rs:217— crates/router/src/services/kafka/deja_record_sink.rs:217-229 | crates/router/src/services/kafka/deja_record_sink.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 (12 lines × 12) crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:144— crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:144-155 | crates/analytics/src/auth_events/metrics/authentication_count.rs:131-142 | crates/analytics/src/auth_events/metrics/authentication_error_message.rs:149-160 | crates/analytics/src/auth_events/metrics/authentication_exemption_approved_count.rs:134-145 | crates/analytics/src/auth_events/metrics/authentication_exemption_requested_count.rs:135-146 | crates/analytics/src/auth_events/metrics/authentication_funnel.rs:141-152 | crates/analytics/src/auth_events/metrics/authentication_success_count.rs:135-146 | crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs:145-156 | crates/analytics/src/auth_events/metrics/challenge_flow_count.rs:137-148 | crates/analytics/src/auth_events/metrics/challenge_success_count.rs:142-153 | crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs:138-149 | crates/analytics/src/auth_events/metrics/frictionless_success_count.rs:142-153 — before extracting anything, compare `crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs` and `crates/analytics/src/auth_events/metrics/authentication_count.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 12) crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs:110— crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs:110-123 | crates/hyperswitch_connectors/src/connectors/etisalat.rs:126-150 | crates/hyperswitch_connectors/src/connectors/gotyme_sanlam.rs:131-144 | crates/hyperswitch_connectors/src/connectors/inespay.rs:127-140 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital.rs:145-164 | crates/hyperswitch_connectors/src/connectors/loonio.rs:135-148 | crates/hyperswitch_connectors/src/connectors/merchante.rs:129-150 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:150-163 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:133-144 | crates/hyperswitch_connectors/src/connectors/powertranz.rs:134-147 | crates/hyperswitch_connectors/src/connectors/recurly.rs:325-342 | crates/hyperswitch_connectors/src/connectors/stripebilling.rs:201-214 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs` and `crates/hyperswitch_connectors/src/connectors/etisalat.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 5) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:324— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:324-335 | crates/router/src/core/payments/operations/payment_capture_v2.rs:225-236 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:436-447 | crates/router/src/core/payments/operations/payment_get.rs:271-282 | crates/router/src/core/payments/operations/payment_session_intent.rs:241-251 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/payment_capture_v2.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 5) crates/router/src/db/events.rs:1052— crates/router/src/db/events.rs:1052-1062 | crates/router/src/db/events.rs:1088-1099 | crates/router/src/db/events.rs:1226-1237 | crates/router/src/db/events.rs:1447-1457 | crates/router/src/db/events.rs:1493-1504 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–12 lines × 4) crates/hyperswitch_connectors/src/connectors/fiserv.rs:402— crates/hyperswitch_connectors/src/connectors/fiserv.rs:402-413 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:508-517 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:646-655 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:865-876 — 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–12 lines × 4) crates/hyperswitch_domain_models/src/lib.rs:1120— crates/hyperswitch_domain_models/src/lib.rs:1120-1129 | crates/router/src/core/payments/transformers.rs:8024-8033 | crates/router/src/core/payments/transformers.rs:8102-8111 | crates/router/src/types/transformers.rs:2704-2715 — before extracting anything, compare `crates/hyperswitch_domain_models/src/lib.rs` and `crates/router/src/core/payments/transformers.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 4) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2465— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2465-2474 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2800-2810 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3193-3203 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3295-3305 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–11 lines × 4) crates/router/src/core/payments/operations/payment_post_session_tokens.rs:87— crates/router/src/core/payments/operations/payment_post_session_tokens.rs:87-96 | crates/router/src/core/payments/operations/payment_session.rs:88-98 | crates/router/src/core/payments/operations/payment_update_metadata.rs:85-94 | crates/router/src/core/payments/operations/tax_calculation.rs:104-114 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_post_session_tokens.rs` and `crates/router/src/core/payments/operations/payment_session.rs` as WHOLE FILES: this scan already matched 12 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 (9–11 lines × 3) crates/router/src/core/payment_methods/cards.rs:5208— crates/router/src/core/payment_methods/cards.rs:5208-5218 | crates/router/src/core/payment_methods/cards.rs:5222-5230 | crates/router/src/core/payment_methods/cards.rs:5236-5244 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–11 lines × 3) crates/router/src/db/events.rs:215— crates/router/src/db/events.rs:215-224 | crates/router/src/db/relay.rs:50-58 | crates/storage_impl/src/tokenization.rs:53-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10 lines × 9) crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:949— crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:949-958 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:537-546 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2470-2479 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:202-211 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:587-596 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:189-198 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:386-395 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:457-466 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:136-145 — `crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 9) crates/router/src/routes/superposition_proxy.rs:32— crates/router/src/routes/superposition_proxy.rs:32-41 | crates/router/src/routes/superposition_proxy.rs:76-85 | crates/router/src/routes/superposition_proxy.rs:120-129 | crates/router/src/routes/superposition_proxy.rs:164-173 | crates/router/src/routes/superposition_proxy.rs:208-217 | crates/router/src/routes/superposition_proxy.rs:252-261 | crates/router/src/routes/superposition_proxy.rs:296-305 | crates/router/src/routes/superposition_proxy.rs:344-353 | crates/router/src/routes/superposition_proxy.rs:388-397 — 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.
Duplicated block (8–10 lines × 4) crates/diesel_models/src/query/customers.rs:170— crates/diesel_models/src/query/customers.rs:170-177 | crates/diesel_models/src/query/customers.rs:200-207 | crates/diesel_models/src/query/customers.rs:235-244 | crates/diesel_models/src/query/customers.rs:283-292 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–10 lines × 4) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1047— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1047-1056 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1926-1933 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2629-2637 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1257-1265 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9–10 lines × 4) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2914— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2914-2923 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2939-2947 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3413-3422 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3438-3446 — 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–10 lines × 4) crates/router/src/core/admin.rs:3100— crates/router/src/core/admin.rs:3100-3108 | crates/router/src/core/admin.rs:3206-3214 | crates/router/src/core/admin.rs:3357-3366 | crates/router/src/core/admin.rs:3453-3462 — 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 × 30) crates/hyperswitch_connectors/src/connectors/aci.rs:528— crates/hyperswitch_connectors/src/connectors/aci.rs:528-536 | crates/hyperswitch_connectors/src/connectors/adyen.rs:931-939 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:605-613 | crates/hyperswitch_connectors/src/connectors/bambora.rs:241-249 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:492-500 | crates/hyperswitch_connectors/src/connectors/bitpay.rs:236-244 | crates/hyperswitch_connectors/src/connectors/braintree.rs:609-617 | crates/hyperswitch_connectors/src/connectors/cashtocode.rs:278-286 | crates/hyperswitch_connectors/src/connectors/checkout.rs:680-688 | crates/hyperswitch_connectors/src/connectors/cryptopay.rs:273-281 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:274-282 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:791-799 | crates/hyperswitch_connectors/src/connectors/globepay.rs:254-262 | crates/hyperswitch_connectors/src/connectors/nexinets.rs:250-258 | crates/hyperswitch_connectors/src/connectors/noon.rs:325-333 | crates/hyperswitch_connectors/src/connectors/opayo.rs:236-244 | crates/hyperswitch_connectors/src/connectors/payme.rs:572-580 | crates/hyperswitch_connectors/src/connectors/payu.rs:582-590 | crates/hyperswitch_connectors/src/connectors/plaid.rs:225-233 | crates/hyperswitch_connectors/src/connectors/powertranz.rs:251-259 | crates/hyperswitch_connectors/src/connectors/square.rs:414-422 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1116-1124 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:715-723 | crates/hyperswitch_connectors/src/connectors/tsys.rs:181-189 | crates/hyperswitch_connectors/src/connectors/volt.rs:372-380 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:229-237 | crates/hyperswitch_connectors/src/connectors/worldline.rs:506-514 | crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs:469-477 | crates/hyperswitch_connectors/src/connectors/xendit.rs:286-294 | crates/hyperswitch_connectors/src/connectors/zen.rs:265-273 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/aci.rs` and `crates/hyperswitch_connectors/src/connectors/adyen.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 30) crates/hyperswitch_connectors/src/connectors/adyen.rs:204— crates/hyperswitch_connectors/src/connectors/adyen.rs:204-212 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:278-286 | crates/hyperswitch_connectors/src/connectors/cashtocode.rs:177-185 | crates/hyperswitch_connectors/src/connectors/checkout.rs:214-222 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:541-549 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1067-1075 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1324-1332 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1479-1487 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1629-1637 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1787-1795 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1942-1950 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:182-190 | crates/hyperswitch_connectors/src/connectors/paypal.rs:592-600 | crates/hyperswitch_connectors/src/connectors/paypal.rs:727-735 | crates/hyperswitch_connectors/src/connectors/redsys.rs:153-161 | crates/hyperswitch_connectors/src/connectors/stripe.rs:218-226 | crates/hyperswitch_connectors/src/connectors/stripe.rs:432-440 | crates/hyperswitch_connectors/src/connectors/stripe.rs:622-630 | crates/hyperswitch_connectors/src/connectors/stripe.rs:813-821 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1034-1042 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1218-1226 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1396-1404 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1645-1653 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1818-1826 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2018-2026 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2181-2189 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2356-2364 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2488-2496 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2725-2733 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:398-406 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 16) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2454— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2454-2462 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:299-307 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1103-1111 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:381-389 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:123-131 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:404-412 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2739-2747 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:569-577 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:63-71 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:170-178 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:401-409 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:661-669 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:737-745 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:807-815 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:370-378 | crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs:663-671 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 18 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 16) crates/router/src/routes/payments.rs:3680— crates/router/src/routes/payments.rs:3680-3688 | crates/router/src/routes/payments.rs:3719-3727 | crates/router/src/routes/payments.rs:3746-3754 | crates/router/src/routes/payments.rs:3763-3771 | crates/router/src/routes/payments.rs:3780-3788 | crates/router/src/routes/payments.rs:3819-3827 | crates/router/src/routes/payments.rs:3836-3844 | crates/router/src/routes/payments.rs:3853-3861 | crates/router/src/routes/payments.rs:3870-3878 | crates/router/src/routes/payments.rs:3904-3912 | crates/router/src/routes/payments.rs:3921-3929 | crates/router/src/routes/payments.rs:3978-3986 | crates/router/src/routes/payments.rs:3995-4003 | crates/router/src/routes/payments.rs:4012-4020 | crates/router/src/routes/payments.rs:4108-4116 | crates/router/src/routes/payouts.rs:783-791 — there are 16 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 16 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 14) crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:952— crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:952-960 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:540-548 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2473-2481 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:320-328 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1123-1131 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:205-213 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:424-432 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:590-598 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:828-836 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:389-397 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1293-1301 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:139-147 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:234-242 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1350-1358 — `crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 14) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:1016— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:1016-1024 | crates/hyperswitch_connectors/src/connectors/checkout.rs:917-925 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:2079-2087 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:594-602 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:956-964 | crates/hyperswitch_connectors/src/connectors/globepay.rs:508-516 | crates/hyperswitch_connectors/src/connectors/nexinets.rs:660-668 | crates/hyperswitch_connectors/src/connectors/noon.rs:794-802 | crates/hyperswitch_connectors/src/connectors/opayo.rs:533-541 | crates/hyperswitch_connectors/src/connectors/payu.rs:746-754 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:901-909 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:1152-1160 | crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs:625-633 | crates/hyperswitch_connectors/src/connectors/zen.rs:521-529 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/checkout.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 12) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:527— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:527-535 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:307-315 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1111-1119 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2001-2009 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:389-397 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:131-139 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:412-420 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2747-2755 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:577-585 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:815-823 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:127-135 | crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs:172-180 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 18 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 12) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:308— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:308-316 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1112-1120 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2002-2010 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:390-398 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:132-140 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:413-421 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2748-2756 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:816-824 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:128-136 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:222-230 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1338-1346 | crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs:173-181 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 10) crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:110— crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:110-118 | crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs:111-119 | crates/analytics/src/disputes/metrics/total_amount_disputed.rs:109-117 | crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs:110-118 | crates/analytics/src/payments/metrics/payment_count.rs:123-131 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:124-132 | crates/analytics/src/refunds/metrics/refund_count.rs:112-120 | crates/analytics/src/refunds/metrics/refund_processed_amount.rs:120-128 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:113-121 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs:128-136 — before extracting anything, compare `crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs` and `crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 10) crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:951— crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:951-959 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:539-547 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2472-2480 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2013-2021 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:204-212 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:589-597 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:191-199 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:388-396 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1292-1300 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:138-146 — `crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 8) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2450— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2450-2458 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:377-385 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:184-192 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:119-127 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:166-174 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:733-741 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:366-374 | crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs:659-667 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 123 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 8) crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:149— crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:149-157 | crates/hyperswitch_connectors/src/connectors/braintree.rs:202-210 | crates/hyperswitch_connectors/src/connectors/mifinity.rs:198-207 | crates/hyperswitch_connectors/src/connectors/noon.rs:199-207 | crates/hyperswitch_connectors/src/connectors/payme.rs:160-168 | crates/hyperswitch_connectors/src/connectors/rapyd.rs:147-155 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:156-164 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:213-221 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bamboraapac.rs` and `crates/hyperswitch_connectors/src/connectors/braintree.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 × 23) crates/hyperswitch_connectors/src/connectors/affirm.rs:575— crates/hyperswitch_connectors/src/connectors/affirm.rs:575-582 | crates/hyperswitch_connectors/src/connectors/airwallex.rs:898-905 | crates/hyperswitch_connectors/src/connectors/authipay.rs:548-555 | crates/hyperswitch_connectors/src/connectors/breadpay.rs:592-599 | crates/hyperswitch_connectors/src/connectors/deutschebank.rs:787-794 | crates/hyperswitch_connectors/src/connectors/finix.rs:783-790 | crates/hyperswitch_connectors/src/connectors/fiservemea.rs:571-578 | crates/hyperswitch_connectors/src/connectors/forte.rs:503-510 | crates/hyperswitch_connectors/src/connectors/getnet.rs:510-517 | crates/hyperswitch_connectors/src/connectors/helcim.rs:606-613 | crates/hyperswitch_connectors/src/connectors/jpmorgan.rs:616-623 | crates/hyperswitch_connectors/src/connectors/klarna.rs:1253-1260 | crates/hyperswitch_connectors/src/connectors/moneris.rs:607-614 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:987-994 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:797-804 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:882-889 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:722-729 | crates/hyperswitch_connectors/src/connectors/placetopay.rs:458-465 | crates/hyperswitch_connectors/src/connectors/silverflow.rs:582-589 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:681-688 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:553-560 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:679-686 | crates/hyperswitch_connectors/src/connectors/zift.rs:560-567 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/affirm.rs` and `crates/hyperswitch_connectors/src/connectors/airwallex.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 23) crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs:73— crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs:73-80 | crates/hyperswitch_connectors/src/connectors/calida/transformers.rs:164-171 | crates/hyperswitch_connectors/src/connectors/givepayments/transformers.rs:74-81 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:314-321 | crates/hyperswitch_connectors/src/connectors/hyperwallet/transformers.rs:72-79 | crates/hyperswitch_connectors/src/connectors/interpayments/transformers.rs:74-81 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/transformers.rs:86-93 | crates/hyperswitch_connectors/src/connectors/katapult/transformers.rs:72-79 | crates/hyperswitch_connectors/src/connectors/mpgs/transformers.rs:70-77 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1100-1107 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:113-120 | crates/hyperswitch_connectors/src/connectors/opennode/transformers.rs:67-74 | crates/hyperswitch_connectors/src/connectors/paydotcom.rs:78-85 | crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs:77-84 | crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs:53-60 | crates/hyperswitch_connectors/src/connectors/revolv3/transformers.rs:10-17 | crates/hyperswitch_connectors/src/connectors/sift/transformers.rs:70-77 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:159-166 | crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs:106-113 | crates/hyperswitch_connectors/src/connectors/taxjar/transformers.rs:125-132 | crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs:242-249 | crates/hyperswitch_connectors/src/connectors/thunes/transformers.rs:84-91 | crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs:770-777 — `crates/hyperswitch_connectors/src/connectors/givepayments/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/hyperwallet/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 44 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 17) crates/hyperswitch_connectors/src/connectors/elavon.rs:211— crates/hyperswitch_connectors/src/connectors/elavon.rs:211-218 | crates/hyperswitch_connectors/src/connectors/elavon.rs:288-295 | crates/hyperswitch_connectors/src/connectors/elavon.rs:374-381 | crates/hyperswitch_connectors/src/connectors/elavon.rs:470-477 | crates/hyperswitch_connectors/src/connectors/elavon.rs:546-553 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:267-274 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:365-372 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:611-618 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:696-703 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:787-794 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:881-888 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1048-1055 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1127-1134 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1437-1444 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:648-655 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:734-741 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:829-836 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/elavon.rs` and `crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 17) crates/hyperswitch_connectors/src/connectors/barclaycard.rs:236— crates/hyperswitch_connectors/src/connectors/barclaycard.rs:236-243 | crates/hyperswitch_connectors/src/connectors/celero.rs:123-130 | crates/hyperswitch_connectors/src/connectors/citigate.rs:124-131 | crates/hyperswitch_connectors/src/connectors/d24.rs:122-132 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs:122-129 | crates/hyperswitch_connectors/src/connectors/givepayments.rs:123-130 | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs:122-129 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:127-134 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs:176-183 | crates/hyperswitch_connectors/src/connectors/katapult.rs:125-132 | crates/hyperswitch_connectors/src/connectors/mpgs.rs:125-132 | crates/hyperswitch_connectors/src/connectors/opayo.rs:115-122 | crates/hyperswitch_connectors/src/connectors/payconex.rs:124-131 | crates/hyperswitch_connectors/src/connectors/paynearme.rs:125-132 | crates/hyperswitch_connectors/src/connectors/sift.rs:125-132 | crates/hyperswitch_connectors/src/connectors/thunes.rs:122-129 | crates/hyperswitch_connectors/src/connectors/tokenex.rs:134-141 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` and `crates/hyperswitch_connectors/src/connectors/celero.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 9) crates/hyperswitch_connectors/src/connectors/aci.rs:204— crates/hyperswitch_connectors/src/connectors/aci.rs:204-211 | crates/hyperswitch_connectors/src/connectors/adyen.rs:621-628 | crates/hyperswitch_connectors/src/connectors/adyen.rs:1528-1535 | crates/hyperswitch_connectors/src/connectors/chargebee.rs:302-309 | crates/hyperswitch_connectors/src/connectors/powertranz.rs:107-114 | crates/hyperswitch_connectors/src/connectors/recurly.rs:391-398 | crates/hyperswitch_connectors/src/connectors/recurly.rs:477-484 | crates/hyperswitch_connectors/src/connectors/recurly.rs:569-576 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:116-123 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/aci.rs` and `crates/hyperswitch_connectors/src/connectors/adyen.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 9) crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:150— crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:150-157 | crates/hyperswitch_connectors/src/connectors/braintree.rs:203-210 | crates/hyperswitch_connectors/src/connectors/mifinity.rs:199-207 | crates/hyperswitch_connectors/src/connectors/noon.rs:200-207 | crates/hyperswitch_connectors/src/connectors/payme.rs:161-168 | crates/hyperswitch_connectors/src/connectors/rapyd.rs:148-155 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:157-164 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:211-218 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:214-221 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bamboraapac.rs` and `crates/hyperswitch_connectors/src/connectors/braintree.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 × 19) crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:786— crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:786-792 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:944-950 | crates/hyperswitch_connectors/src/connectors/braintree.rs:872-878 | crates/hyperswitch_connectors/src/connectors/checkout.rs:849-855 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:524-530 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:885-891 | crates/hyperswitch_connectors/src/connectors/nexinets.rs:584-590 | crates/hyperswitch_connectors/src/connectors/noon.rs:724-730 | crates/hyperswitch_connectors/src/connectors/opayo.rs:468-474 | crates/hyperswitch_connectors/src/connectors/payme.rs:945-951 | crates/hyperswitch_connectors/src/connectors/payu.rs:676-682 | crates/hyperswitch_connectors/src/connectors/powertranz.rs:589-595 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1916-1922 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:819-825 | crates/hyperswitch_connectors/src/connectors/tsys.rs:514-520 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:454-460 | crates/hyperswitch_connectors/src/connectors/worldline.rs:590-596 | crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs:557-563 | crates/hyperswitch_connectors/src/connectors/zen.rs:451-457 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs` and `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 19) crates/hyperswitch_connectors/src/connectors/bambora.rs:144— crates/hyperswitch_connectors/src/connectors/bambora.rs:144-152 | crates/hyperswitch_connectors/src/connectors/coinbase.rs:139-147 | crates/hyperswitch_connectors/src/connectors/cryptopay.rs:186-194 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:140-148 | crates/hyperswitch_connectors/src/connectors/globepay.rs:147-155 | crates/hyperswitch_connectors/src/connectors/iatapay.rs:290-298 | crates/hyperswitch_connectors/src/connectors/itaubank.rs:291-299 | crates/hyperswitch_connectors/src/connectors/moneris.rs:276-282 | crates/hyperswitch_connectors/src/connectors/opayo.rs:130-138 | crates/hyperswitch_connectors/src/connectors/opennode.rs:142-150 | crates/hyperswitch_connectors/src/connectors/payu.rs:131-139 | crates/hyperswitch_connectors/src/connectors/payu.rs:338-346 | crates/hyperswitch_connectors/src/connectors/placetopay.rs:125-133 | crates/hyperswitch_connectors/src/connectors/prophetpay.rs:135-143 | crates/hyperswitch_connectors/src/connectors/shift4.rs:134-142 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:298-306 | crates/hyperswitch_connectors/src/connectors/vgs.rs:253-261 | crates/hyperswitch_connectors/src/connectors/volt.rs:291-299 | crates/hyperswitch_connectors/src/connectors/zen.rs:137-145 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bambora.rs` and `crates/hyperswitch_connectors/src/connectors/coinbase.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 6) crates/diesel_models/src/query/generics.rs:747— crates/diesel_models/src/query/generics.rs:747-753 | crates/diesel_models/src/query/generics.rs:796-802 | crates/diesel_models/src/query/generics.rs:945-951 | crates/diesel_models/src/query/generics.rs:982-988 | crates/diesel_models/src/query/generics.rs:1104-1110 | crates/diesel_models/src/query/generics.rs:1253-1259 — 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 (7 lines × 6) crates/router/src/types/storage/dispute.rs:121— crates/router/src/types/storage/dispute.rs:121-127 | crates/router/src/types/storage/dispute.rs:189-195 | crates/router/src/types/storage/payment_link.rs:77-83 | crates/router/src/types/storage/refund.rs:178-184 | crates/router/src/types/storage/refund.rs:263-269 | crates/router/src/types/storage/refund.rs:417-423 — before extracting anything, compare `crates/router/src/types/storage/dispute.rs` and `crates/router/src/types/storage/refund.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 3) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1594— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1594-1599 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1778-1783 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1821-1827 — all 3 copies are in the same file, so extract the block into one function there and call 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 × 3) crates/router/src/core/payment_methods/cards.rs:285— crates/router/src/core/payment_methods/cards.rs:285-290 | crates/router/src/core/payment_methods/transformers.rs:493-499 | crates/router/src/core/payments/tokenization.rs:1636-1641 — before extracting anything, compare `crates/router/src/core/payment_methods/cards.rs` and `crates/router/src/core/payments/tokenization.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 2) crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:789— crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:789-795 | crates/hyperswitch_connectors/src/connectors/prophetpay/transformers.rs:279-284 — 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–7 lines × 2) crates/router_derive/src/macros/schema.rs:14— crates/router_derive/src/macros/schema.rs:14-19 | crates/router_derive/src/macros/xss_validation.rs:126-132 — 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 × 10) crates/analytics/src/sqlx.rs:572— crates/analytics/src/sqlx.rs:572-577 | crates/analytics/src/sqlx.rs:680-685 | crates/analytics/src/sqlx.rs:811-816 | crates/analytics/src/sqlx.rs:948-953 | crates/analytics/src/sqlx.rs:1064-1069 | crates/analytics/src/sqlx.rs:1171-1176 | crates/analytics/src/sqlx.rs:1255-1260 | crates/analytics/src/sqlx.rs:1301-1306 | crates/analytics/src/sqlx.rs:1389-1394 | crates/analytics/src/sqlx.rs:1424-1429 — 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 lines × 10) crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:153— crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:153-158 | crates/hyperswitch_connectors/src/connectors/braintree.rs:206-211 | crates/hyperswitch_connectors/src/connectors/mifinity.rs:202-208 | crates/hyperswitch_connectors/src/connectors/noon.rs:203-208 | crates/hyperswitch_connectors/src/connectors/rapyd.rs:151-156 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:214-219 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:178-183 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1593-1598 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1635-1640 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:217-222 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bamboraapac.rs` and `crates/hyperswitch_connectors/src/connectors/braintree.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 (5 lines × 6) crates/router/src/core/payment_methods/cards.rs:284— crates/router/src/core/payment_methods/cards.rs:284-288 | crates/router/src/core/payment_methods/transformers.rs:492-496 | crates/router/src/core/payment_methods/transformers.rs:518-522 | crates/router/src/core/payment_methods/transformers.rs:609-613 | crates/router/src/core/payments/tokenization.rs:1538-1542 | crates/router/src/core/payments/tokenization.rs:1635-1639 — before extracting anything, compare `crates/router/src/core/payment_methods/cards.rs` and `crates/router/src/core/payments/tokenization.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 6) crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs:325— crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs:325-329 | crates/hyperswitch_connectors/src/connectors/coinbase.rs:408-412 | crates/hyperswitch_connectors/src/connectors/coingate.rs:548-552 | crates/hyperswitch_connectors/src/connectors/cryptopay.rs:452-456 | crates/hyperswitch_connectors/src/connectors/iatapay.rs:694-698 | crates/hyperswitch_connectors/src/connectors/paystack.rs:609-613 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs` and `crates/hyperswitch_connectors/src/connectors/coingate.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 7) crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:267— crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:267-273 | crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs:255-261 | crates/hyperswitch_connectors/src/connectors/coingate/transformers.rs:46-52 | crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:1127-1133 | crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs:78-84 | crates/hyperswitch_connectors/src/connectors/klarna/transformers.rs:67-73 | crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs:104-110 — `crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 31 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 (7 lines × 7) crates/router/src/core/payments/operations/payment_attempt_list.rs:152— crates/router/src/core/payments/operations/payment_attempt_list.rs:152-158 | crates/router/src/core/payments/operations/payment_attempt_record.rs:310-316 | crates/router/src/core/payments/operations/payment_cancel_v2.rs:113-119 | crates/router/src/core/payments/operations/payment_create_intent.rs:233-239 | crates/router/src/core/payments/operations/payment_get_intent.rs:154-160 | crates/router/src/core/payments/operations/payment_session_intent.rs:214-220 | crates/router/src/core/payments/operations/payment_update_intent.rs:442-448 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_attempt_record.rs` and `crates/router/src/core/payments/operations/payment_session_intent.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Complex function (anonymous) (cyclomatic 26, cognitive 10) cypress-tests/cypress/support/redirectionHandler.js:4988— (anonymous) has cyclomatic complexity 26 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 26, cognitive 10) cypress-tests/cypress/support/redirectionHandler.js:5344— (anonymous) has cyclomatic complexity 26 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (an accessibility check that can read your UI — no component framework was detected and your pages are rendered by server-side templates, which neither the JSX/Vue ESLint plugins nor the HTML-template linters can parse; run axe/pa11y over the rendered pages, or assert the accessibility invariants over that rendered HTML in the test suite you already have) and no axe/pa11y/Lighthouse in tests or CI. Start by running that check over your rendered pages in CI. What was searched, so you can tell an absence from a miss: the 8 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
ConnectorSpecificConfig::foreign_try_from (cyclomatic 220) crates/router/src/core/unified_connector_service/connector_config.rs:893— ConnectorSpecificConfig::foreign_try_from has cyclomatic complexity 220 (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.
PaymentMethodDataType::from (cyclomatic 135) crates/hyperswitch_connectors/src/utils.rs:6951— PaymentMethodDataType::from has cyclomatic complexity 135 (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: UnitedKingdomStatesAbbreviation::foreign_try_from (cyclomatic 249) 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.
ConnectorApiIntegrationPayload::get_transformed_response_payload (cyclomatic 55) crates/connector_configs/src/response_modifier.rs:7— ConnectorApiIntegrationPayload::get_transformed_response_payload has cyclomatic complexity 55 (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.
euclid::frontend::ast::lowering::lower_comparison_inner (cyclomatic 52) crates/euclid/src/frontend/ast/lowering.rs:155— euclid::frontend::ast::lowering::lower_comparison_inner has cyclomatic complexity 52 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
MultisafepayPaymentsRequest::try_from (cyclomatic 48) crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:386— MultisafepayPaymentsRequest::try_from has cyclomatic complexity 48 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PaymentsRequest::try_from (cyclomatic 47) crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:762— PaymentsRequest::try_from has cyclomatic complexity 47 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PaymentIntentRequest::try_from (cyclomatic 39) crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:2231— PaymentIntentRequest::try_from has cyclomatic complexity 39 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: StripeBankNames::try_from (cyclomatic 60) 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.
payment_link.initializeEventListeners (cyclomatic 34) REDACTED:326— payment_link.initializeEventListeners has cyclomatic complexity 34 (threshold 15). Of this number, 22 points are the body's own statements and 12 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AuthEventMetricRow::from_row (cyclomatic 30) crates/analytics/src/sqlx.rs:208— AuthEventMetricRow::from_row has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
smithy_core::types::resolve_type_and_generate_shapes (cyclomatic 30) crates/smithy-core/src/types.rs:150— smithy_core::types::resolve_type_and_generate_shapes has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
AuthEventFilterRow::from_row (cyclomatic 29) crates/analytics/src/sqlx.rs:393— AuthEventFilterRow::from_row has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PaymentMethodType::from (cyclomatic 29) crates/api_models/src/payouts.rs:1881— PaymentMethodType::from has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SmithyGenerator::generate_shape_definition (cyclomatic 28) crates/smithy-core/src/generator.rs:75— SmithyGenerator::generate_shape_definition has cyclomatic complexity 28 (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.
status.renderStatusDetails (cyclomatic 28) REDACTED:188— status.renderStatusDetails has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Context::from_input (cyclomatic 27) crates/euclid/src/backend/vir_interpreter/types.rs:53— Context::from_input 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.
HipayPaymentsRequest::try_from (cyclomatic 27) crates/hyperswitch_connectors/src/connectors/hipay/transformers.rs:151— HipayPaymentsRequest::try_from has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: hyperswitch_connectors::connectors::hipay::transformers::get_sync_status (cyclomatic 33) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
PaypalPaymentsRequest::try_from (cyclomatic 26) crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1089— PaypalPaymentsRequest::try_from has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: hyperswitch_connectors::connectors::paypal::transformers::get_paypal_error_message (cyclomatic 151) 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.
PaymentDistributionRow::from_row (cyclomatic 23) crates/analytics/src/sqlx.rs:802— PaymentDistributionRow::from_row has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
AuthEventFilters::set_filter_clause (cyclomatic 23) crates/analytics/src/auth_events/types.rs:27— AuthEventFilters::set_filter_clause 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.
AdyenPaymentMethod::try_from (cyclomatic 23) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:2433— AdyenPaymentMethod::try_from has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: AdyenTestBankNames::try_from (cyclomatic 27) 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.
BraintreePaymentsRequest::try_from (cyclomatic 23) crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:387— BraintreePaymentsRequest::try_from 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.
FraudCheckPost::update_tracker (cyclomatic 23) crates/router/src/core/fraud_check/operation/fraud_check_post.rs:410— FraudCheckPost::update_tracker has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
script.renderStatusDetails (cyclomatic 23) crates/router/src/core/generic_link/payout_link/status/script.js:48— script.renderStatusDetails has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PaymentMetricRow::from_row (cyclomatic 22) crates/analytics/src/sqlx.rs:671— PaymentMetricRow::from_row 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: AnalyticsCollection::to_sql (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
CybersourcePaymentsRequest::try_from (cyclomatic 22) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2584— CybersourcePaymentsRequest::try_from 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.
AuthipayPaymentsResponse::get_transaction_status (cyclomatic 21) REDACTED:283— AuthipayPaymentsResponse::get_transaction_status has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
NuveiPaymentsRequest::try_from (cyclomatic 21) crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:1135— NuveiPaymentsRequest::try_from has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PaymentResponse::save_pm_and_mandate (cyclomatic 21) crates/router/src/core/payments/operations/payment_response.rs:766— PaymentResponse::save_pm_and_mandate 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.
payment_link_initiator.initializeSDK (cyclomatic 21) crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:10— payment_link_initiator.initializeSDK 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.
PaymentFilterRow::from_row (cyclomatic 20) crates/analytics/src/sqlx.rs:939— PaymentFilterRow::from_row has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: AnalyticsCollection::to_sql (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
PaymentFilters::set_filter_clause (cyclomatic 20) crates/analytics/src/payments/types.rs:14— PaymentFilters::set_filter_clause 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.
NovalnetPaymentsRequest::try_from (cyclomatic 20) crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:224— NovalnetPaymentsRequest::try_from has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
hyperswitch_interfaces::api_client::execute_connector_processing_step (cyclomatic 20) crates/hyperswitch_interfaces/src/api_client.rs:139— hyperswitch_interfaces::api_client::execute_connector_processing_step has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
AdyenWebhookResponse::from (cyclomatic 19) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:5892— AdyenWebhookResponse::from has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: AdyenTestBankNames::try_from (cyclomatic 27) 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.
FinixWebhookBody::get_webhook_event_type (cyclomatic 19) crates/hyperswitch_connectors/src/connectors/finix/transformers.rs:786— FinixWebhookBody::get_webhook_event_type 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.
PaymentIntentMetricRow::from_row (cyclomatic 18) crates/analytics/src/sqlx.rs:1051— PaymentIntentMetricRow::from_row has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: AnalyticsCollection::to_sql (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
AirwallexPaymentsRequest::try_from (cyclomatic 18) crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:517— AirwallexPaymentsRequest::try_from has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: hyperswitch_connectors::connectors::airwallex::transformers::map_error_code_to_message (cyclomatic 137) 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.
k6-summary.summarizeMetrics (cyclomatic 18) loadtest/k6/helper/k6-summary.js:244— k6-summary.summarizeMetrics has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 259, getData, a function literal at line 303, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FiuuPaymentRequest::try_from (cyclomatic 17) crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:459— FiuuPaymentRequest::try_from has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: FPXTxnChannel::try_from (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.
PaymentCreate::get_trackers (cyclomatic 17) crates/router/src/core/payments/operations/payment_create.rs:74— PaymentCreate::get_trackers 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.
router_derive::macros::xss_validation::get_field_type (cyclomatic 17) crates/router_derive/src/macros/xss_validation.rs:17— router_derive::macros::xss_validation::get_field_type 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.
payment_link.appendMerchantDetails (cyclomatic 17) REDACTED:743— payment_link.appendMerchantDetails has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PaymentIntentFilterRow::from_row (cyclomatic 16) crates/analytics/src/sqlx.rs:1158— PaymentIntentFilterRow::from_row 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: AnalyticsCollection::to_sql (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
PaymentIntentFilters::set_filter_clause (cyclomatic 16) crates/analytics/src/payment_intents/types.rs:14— PaymentIntentFilters::set_filter_clause 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.
MolliePaymentsRequest::try_from (cyclomatic 16) crates/hyperswitch_connectors/src/connectors/mollie/transformers.rs:441— MolliePaymentsRequest::try_from 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.
SantanderSetupMandateRequest::try_from (cyclomatic 16) crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:2706— SantanderSetupMandateRequest::try_from 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.
Santander::get_webhook_event_type (cyclomatic 16) crates/hyperswitch_connectors/src/connectors/santander.rs:2203— Santander::get_webhook_event_type 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.
payment_link::wasm::validate_payment_link_config_impl (cyclomatic 16) crates/payment_link/src/wasm.rs:91— payment_link::wasm::validate_payment_link_config_impl 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.
MerchantAccountData::foreign_from (cyclomatic 16) crates/router/src/types.rs:985— MerchantAccountData::foreign_from 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.
payment_link.handleCartView (cyclomatic 16) REDACTED:1065— payment_link.handleCartView has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
k6-summary.strWidth (cyclomatic 16) loadtest/k6/helper/k6-summary.js:33— k6-summary.strWidth 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.
TodoComment repeated across 97 files crates/hyperswitch_connectors/src/connectors/affirm.rs:188— The identical TodoComment appears in 97 files (101 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 101 independent debts. Fix the systemic cause once rather than file-by-file. Text: "//TODO: implement sessions flow". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
TodoComment repeated across 20 files crates/hyperswitch_connectors/src/connectors/barclaycard.rs:343— The identical TodoComment appears in 20 files (20 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 20 independent debts. Fix the systemic cause once rather than file-by-file. Text: "//TODO: implement functions when support enabled". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
TodoComment repeated across 12 files crates/hyperswitch_connectors/src/connectors/breadpay.rs:121— The identical TodoComment appears in 12 files (12 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 12 independent debts. Fix the systemic cause once rather than file-by-file. Text: "// TODO! Check connector documentation, on which unit they are processing the currency.". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
TodoComment repeated across 51 files crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs:42— The identical TodoComment appears in 51 files (234 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 234 independent debts. Fix the systemic cause once rather than file-by-file. Text: "//TODO: Fill the struct with respective fields". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
TodoComment repeated across 33 files crates/hyperswitch_connectors/src/connectors/worldpayraft/transformers.rs:88— The identical TodoComment appears in 33 files (33 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 33 independent debts. Fix the systemic cause once rather than file-by-file. Text: "//TODO: Append the remaining status flags". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
TodoComment repeated across 35 files crates/hyperswitch_connectors/src/connectors/wellsfargopayout/transformers.rs:28— The identical TodoComment appears in 35 files (35 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 35 independent debts. Fix the systemic cause once rather than file-by-file. Text: "//Todo : use utils to convert the amount to the type of amount that a connector accepts". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
TodoComment repeated across 40 files crates/hyperswitch_connectors/src/connectors/wellsfargopayout/transformers.rs:188— The identical TodoComment appears in 40 files (40 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 40 independent debts. Fix the systemic cause once rather than file-by-file. Text: "//TODO: Review mapping". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
ConnectorApiIntegrationPayload::get_transformed_response_payload (cognitive 181) crates/connector_configs/src/response_modifier.rs:7— ConnectorApiIntegrationPayload::get_transformed_response_payload has cognitive complexity 181 (threshold 15). Drivers by points: loops 18 (93 pts), if/else 19 (79 pts), match/switch 2 (9 pts) (nesting depth added 142). 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.
ConnectorSpecificConfig::foreign_try_from (cognitive 120) crates/router/src/core/unified_connector_service/connector_config.rs:893— ConnectorSpecificConfig::foreign_try_from has cognitive complexity 120 (threshold 15). Drivers by points: match/switch 104 (120 pts) (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PaymentIntentRequest::try_from (cognitive 57) crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:2231— PaymentIntentRequest::try_from has cognitive complexity 57 (threshold 15). Drivers by points: match/switch 18 (33 pts), if/else 19 (20 pts), boolean chains 4 (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BraintreePaymentsRequest::try_from (cognitive 54) crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:387— BraintreePaymentsRequest::try_from has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (39 pts), match/switch 6 (14 pts), boolean chains 1 (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.
hyperswitch_interfaces::api_client::execute_connector_processing_step (cognitive 51) crates/hyperswitch_interfaces/src/api_client.rs:139— hyperswitch_interfaces::api_client::execute_connector_processing_step has cognitive complexity 51 (threshold 15). Drivers by points: match/switch 9 (29 pts), if/else 7 (22 pts) (nesting depth added 35). 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.
status.renderStatusDetails (cognitive 49) REDACTED:188— status.renderStatusDetails has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 2 (10 pts), ternaries 2 (8 pts), boolean chains 4, match/switch 1 (nesting depth added 29). Of this number, 26 points are the body's own statements and 23 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
initializeEventListeners (cognitive 49) REDACTED:326— initializeEventListeners has cognitive complexity 49 (threshold 15). Drivers by points: if/else 23 (34 pts), boolean chains 7, error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 15). Of this number, 29 points are the body's own statements and 20 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SmithyGenerator::generate_shape_definition (cognitive 47) crates/smithy-core/src/generator.rs:75— SmithyGenerator::generate_shape_definition has cognitive complexity 47 (threshold 15). Drivers by points: loops 14 (31 pts), if/else 6 (15 pts), match/switch 1 (nesting depth added 26). 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.
PaymentsRequest::try_from (cognitive 39) crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:762— PaymentsRequest::try_from has cognitive complexity 39 (threshold 15). Drivers by points: match/switch 14 (26 pts), if/else 12, boolean chains 1 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
CybersourcePaymentsRequest::try_from (cognitive 39) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2584— CybersourcePaymentsRequest::try_from has cognitive complexity 39 (threshold 15). Drivers by points: match/switch 9 (33 pts), if/else 2 (6 pts) (nesting depth added 28). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
router_derive::macros::xss_validation::get_field_type (cognitive 39) crates/router_derive/src/macros/xss_validation.rs:17— router_derive::macros::xss_validation::get_field_type has cognitive complexity 39 (threshold 15). Drivers by points: match/switch 10 (33 pts), if/else 5 (6 pts) (nesting depth added 24). 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.
scheduler::consumer::start_consumer (cognitive 39) crates/scheduler/src/consumer.rs:36— scheduler::consumer::start_consumer has cognitive complexity 39 (threshold 15). Drivers by points: match/switch 4 (18 pts), loops 4 (12 pts), if/else 2 (9 pts) (nesting depth added 29). 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.
IsSchemaFieldApplicableForValidation::from (cognitive 33) crates/router_derive/src/macros/schema/helpers.rs:173— IsSchemaFieldApplicableForValidation::from has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (31 pts), boolean chains 2 (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.
payment_link.handleCartView (cognitive 33) REDACTED:1065— payment_link.handleCartView has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 2 (nesting depth added 17). Most of this is not in the body itself: 13 of the 33 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1140, 1122, 1130, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
api_models::payments::payment_method_data_serde::deserialize (cognitive 32) crates/api_models/src/payments.rs:3333— api_models::payments::payment_method_data_serde::deserialize has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 3 (8 pts) (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
DashboardRequestPayload::create_connector_request (cognitive 32) crates/connector_configs/src/transformer.rs:109— DashboardRequestPayload::create_connector_request has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 2 (8 pts), match/switch 1 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Context::from_input (cognitive 30) crates/euclid/src/backend/vir_interpreter/types.rs:53— Context::from_input has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25 (28 pts), loops 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.
AuthEventMetricRow::from_row (cognitive 29) crates/analytics/src/sqlx.rs:208— AuthEventMetricRow::from_row has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 29. 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.
PaypalPaymentsRequest::try_from (cognitive 29) crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1089— PaypalPaymentsRequest::try_from has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 10 (20 pts), if/else 6 (9 pts) (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
payment_link.appendMerchantDetails (cognitive 29) REDACTED:743— payment_link.appendMerchantDetails has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 4, loops 1 (2 pts), error handling 1 (nesting depth added 12). Of this number, 22 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
k6-summary.summarizeMetrics (cognitive 29) loadtest/k6/helper/k6-summary.js:244— k6-summary.summarizeMetrics has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 5 (8 pts) (nesting depth added 11). Most of this is not in the body itself: 3 of the 29 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 259, getData, a function literal at line 303, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AuthEventFilterRow::from_row (cognitive 28) crates/analytics/src/sqlx.rs:393— AuthEventFilterRow::from_row has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 28. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SantanderPixQRPaymentRequest::try_from (cognitive 28) crates/hyperswitch_connectors/src/connectors/santander/transformers.rs:2289— SantanderPixQRPaymentRequest::try_from has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 3 (5 pts), loops 1 (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.
SessionRoutingStage::route (cognitive 27) crates/router/src/core/payments/routing.rs:940— SessionRoutingStage::route has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FraudCheckPost::update_tracker (cognitive 26) crates/router/src/core/fraud_check/operation/fraud_check_post.rs:410— FraudCheckPost::update_tracker has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 12 (25 pts), if/else 1 (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PSync::execute (cognitive 25) crates/router/src/core/payments/gateway/psync_gateway.rs:55— PSync::execute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 4 (7 pts) (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
NovalnetPaymentsRequest::try_from (cognitive 24) crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:224— NovalnetPaymentsRequest::try_from has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 9 (19 pts), if/else 3 (5 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
drainer::handler::drainer (cognitive 23) crates/drainer/src/handler.rs:204— drainer::handler::drainer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 4 (8 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.
PaymentMethodDataType::from (cognitive 23) crates/hyperswitch_connectors/src/utils.rs:6951— PaymentMethodDataType::from has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 12 (23 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PaymentDistributionRow::from_row (cognitive 22) crates/analytics/src/sqlx.rs:802— PaymentDistributionRow::from_row has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 22. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AuthEventFilters::set_filter_clause (cognitive 22) crates/analytics/src/auth_events/types.rs:27— AuthEventFilters::set_filter_clause has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Peachpayments::get_webhook_event_type (cognitive 22) crates/hyperswitch_connectors/src/connectors/peachpayments.rs:971— Peachpayments::get_webhook_event_type has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 2 (4 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FormattingLayer::common_serialize (cognitive 22) crates/router_env/src/logger/formatter.rs:209— FormattingLayer::common_serialize has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PaymentMetricRow::from_row (cognitive 21) crates/analytics/src/sqlx.rs:671— PaymentMetricRow::from_row has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 21. 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.
AdyenWebhookResponse::from (cognitive 21) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:5892— AdyenWebhookResponse::from has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (20 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Authorize::execute (cognitive 21) crates/router/src/core/payments/gateway/authorize_gateway.rs:55— Authorize::execute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (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.
PmCards::add_payment_method (cognitive 21) crates/router/src/core/payment_methods/cards.rs:1827— PmCards::add_payment_method has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 6 (10 pts), boolean chains 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
CustomerId::redact_customer_details_and_generate_response (cognitive 20) crates/router/src/core/customers.rs:981— CustomerId::redact_customer_details_and_generate_response has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), match/switch 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BankOfAmericaPaymentsRequest::try_from (cognitive 20) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1008— BankOfAmericaPaymentsRequest::try_from has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 6 (20 pts) (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FinixWebhookBody::get_webhook_event_type (cognitive 20) crates/hyperswitch_connectors/src/connectors/finix/transformers.rs:786— FinixWebhookBody::get_webhook_event_type has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 7 (17 pts), if/else 2 (3 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FiservPaymentsRequest::try_from (cognitive 20) crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:381— FiservPaymentsRequest::try_from has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 6 (19 pts), if/else 1 (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FiuuPaymentRequest::try_from (cognitive 20) crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:459— FiuuPaymentRequest::try_from has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 9 (20 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WellsfargoPaymentsRequest::try_from (cognitive 20) crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1221— WellsfargoPaymentsRequest::try_from has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 6 (20 pts) (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ConnectorTypeAndConnectorName::get_routable_connector (cognitive 20) crates/router/src/core/admin.rs:1676— ConnectorTypeAndConnectorName::get_routable_connector has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
payment_link_initiator.initializeSDK (cognitive 20) crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:10— payment_link_initiator.initializeSDK has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 9, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PaymentFilterRow::from_row (cognitive 19) crates/analytics/src/sqlx.rs:939— PaymentFilterRow::from_row has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 19. 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.
MerchantAccountCreate::create_domain_model_from_request (cognitive 19) crates/router/src/core/admin.rs:435— MerchantAccountCreate::create_domain_model_from_request has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 4 (7 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.
PaymentFilters::set_filter_clause (cognitive 19) crates/analytics/src/payments/types.rs:14— PaymentFilters::set_filter_clause 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.
RecordedIncomingFuture::poll (cognitive 19) crates/router_env/src/request_id.rs:397— RecordedIncomingFuture::poll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 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.
Aci::get_webhook_event_type (cognitive 18) crates/hyperswitch_connectors/src/connectors/aci.rs:928— Aci::get_webhook_event_type has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
HipayPaymentsRequest::try_from (cognitive 18) crates/hyperswitch_connectors/src/connectors/hipay/transformers.rs:151— HipayPaymentsRequest::try_from has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 5 (9 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
MultisafepayPaymentsRequest::try_from (cognitive 18) crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:386— MultisafepayPaymentsRequest::try_from has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 11 (16 pts), if/else 2 (nesting depth added 5). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PaymentIntentMetricRow::from_row (cognitive 17) crates/analytics/src/sqlx.rs:1051— PaymentIntentMetricRow::from_row has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 17. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Dispute::filter_by_constraints (cognitive 17) crates/router/src/types/storage/dispute.rs:43— Dispute::filter_by_constraints has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (17 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.
AirwallexPaymentsRequest::try_from (cognitive 17) crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs:517— AirwallexPaymentsRequest::try_from has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, match/switch 4 (8 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CybersourceZeroMandateRequest::try_from (cognitive 17) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:145— CybersourceZeroMandateRequest::try_from has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 4 (5 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LockAction::free_lock_action (cognitive 17) crates/router/src/core/api_locking.rs:176— LockAction::free_lock_action has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 3 (7 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FraudCheckPre::update_tracker (cognitive 17) crates/router/src/core/fraud_check/operation/fraud_check_pre.rs:271— FraudCheckPre::update_tracker has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 8 (17 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
smithy_core::types::resolve_type_and_generate_shapes (cognitive 17) crates/smithy-core/src/types.rs:150— smithy_core::types::resolve_type_and_generate_shapes has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (7 pts), match/switch 1 (nesting depth added 3). 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.
k6-summary.strWidth (cognitive 17) loadtest/k6/helper/k6-summary.js:33— k6-summary.strWidth has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PaymentsSuccessRateAccumulator::add_metrics_bucket (cognitive 16) crates/analytics/src/payment_intents/accumulator.rs:133— PaymentsSuccessRateAccumulator::add_metrics_bucket has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
external_services::grpc_client::unified_connector_service::build_grpc_headers_internal (cognitive 16) crates/external_services/src/grpc_client/unified_connector_service.rs:1688— external_services::grpc_client::unified_connector_service::build_grpc_headers_internal 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.
RedisConnectionWithContext::hscan (cognitive 16) crates/redis_interface/src/module/redis_rs/commands.rs:913— RedisConnectionWithContext::hscan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MigrationBatch::fetch_payment_methods (cognitive 16) crates/router/src/routes/payment_methods/migrate.rs:293— MigrationBatch::fetch_payment_methods has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (7 pts), loops 3 (5 pts), if/else 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.
payment_link.renderCart (cognitive 16) REDACTED:934— payment_link.renderCart has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2 (nesting depth added 7). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent 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: euclid_wasm crates/euclid_wasm/src/lib.rs:73— TooManyFunctions — 38 free functions. The bar is 30 free functions; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Near-duplicate member family (33 members, 29 shared lines) · ×1
Near-duplicate member family (33 members, 29 shared lines) crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:40— crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:40-155 | crates/analytics/src/auth_events/metrics/authentication_count.rs:39-142 | crates/analytics/src/auth_events/metrics/authentication_exemption_approved_count.rs:39-145 | crates/analytics/src/auth_events/metrics/authentication_exemption_requested_count.rs:39-146 | crates/analytics/src/auth_events/metrics/authentication_funnel.rs:42-152 | crates/analytics/src/auth_events/metrics/authentication_success_count.rs:40-146 | crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs:40-156 | crates/analytics/src/auth_events/metrics/challenge_flow_count.rs:40-148 | crates/analytics/src/auth_events/metrics/challenge_success_count.rs:40-153 | crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs:40-149 | crates/analytics/src/auth_events/metrics/frictionless_success_count.rs:40-153 | crates/analytics/src/frm/metrics/frm_triggered_attempts.rs:36-115 | crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:42-134 | crates/analytics/src/payment_intents/metrics/payments_success_rate.rs:42-138 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs:42-134 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs:48-144 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs:45-139 | crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs:48-144 | crates/analytics/src/payment_intents/metrics/total_smart_retries.rs:45-139 | crates/analytics/src/payments/metrics/avg_ticket_size.rs:40-148 | crates/analytics/src/payments/metrics/connector_success_rate.rs:42-143 | crates/analytics/src/payments/metrics/payment_count.rs:39-131 | crates/analytics/src/payments/metrics/payment_success_count.rs:40-141 | crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs:40-149 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:42-144 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:39-132 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs:40-142 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:39-138 | crates/analytics/src/payments/metrics/success_rate.rs:39-137 | crates/analytics/src/refunds/metrics/refund_count.rs:39-120 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:39-121 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:43-189 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs:42-181 — These 33 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 33 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 33 times.
D4 · Code Duplication· Near-duplicate member family (16 members, 18 shared lines) · ×1
Near-duplicate member family (16 members, 18 shared lines) crates/hyperswitch_connectors/src/connectors/cashtocode.rs:140— crates/hyperswitch_connectors/src/connectors/cashtocode.rs:140-190 | crates/hyperswitch_connectors/src/connectors/paypal.rs:553-605 | crates/hyperswitch_connectors/src/connectors/paypal.rs:688-740 | crates/hyperswitch_connectors/src/connectors/stripe.rs:377-445 | crates/hyperswitch_connectors/src/connectors/stripe.rs:567-635 | crates/hyperswitch_connectors/src/connectors/stripe.rs:758-826 | crates/hyperswitch_connectors/src/connectors/stripe.rs:979-1047 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1163-1231 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1341-1409 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1590-1658 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1763-1831 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1963-2031 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2126-2194 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2301-2369 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2433-2501 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2670-2738 — These 16 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 16 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 16 times.
D4 · Code Duplication· Near-duplicate member family (15 members, 33 shared lines) · ×1
Near-duplicate member family (15 members, 33 shared lines) crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:42— crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:42-134 | crates/analytics/src/payment_intents/metrics/payments_success_rate.rs:42-138 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs:42-134 | crates/analytics/src/payments/distribution/payment_error_message.rs:41-186 | crates/analytics/src/payments/metrics/avg_ticket_size.rs:40-148 | crates/analytics/src/payments/metrics/payment_count.rs:39-131 | crates/analytics/src/payments/metrics/payment_success_count.rs:40-141 | crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs:40-149 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:39-132 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs:40-142 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:39-138 | crates/analytics/src/payments/metrics/success_rate.rs:39-137 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs:40-168 | crates/analytics/src/refunds/metrics/refund_count.rs:39-120 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:39-121 — These 15 members are variants of one another: a block of 33 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 15 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 15 times.
D4 · Code Duplication· Near-duplicate member family (14 members, 21 shared lines) · ×1
Near-duplicate member family (14 members, 21 shared lines) crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:225— crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:225-291 | crates/hyperswitch_connectors/src/connectors/stripe.rs:377-445 | crates/hyperswitch_connectors/src/connectors/stripe.rs:567-635 | crates/hyperswitch_connectors/src/connectors/stripe.rs:758-826 | crates/hyperswitch_connectors/src/connectors/stripe.rs:979-1047 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1163-1231 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1341-1409 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1590-1658 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1763-1831 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1963-2031 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2126-2194 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2301-2369 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2433-2501 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2670-2738 — These 14 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 14 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 14 times.
D4 · Code Duplication· Near-duplicate member family (13 members, 26 shared lines) · ×1
Near-duplicate member family (13 members, 26 shared lines) crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:42— crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:42-134 | crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:43-162 | crates/analytics/src/payment_intents/metrics/payments_success_rate.rs:42-138 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs:42-134 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:43-164 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs:42-146 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs:42-147 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs:48-159 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs:48-144 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs:45-139 | crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs:48-151 | crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs:48-144 | crates/analytics/src/payment_intents/metrics/total_smart_retries.rs:45-139 — These 13 members are variants of one another: a block of 26 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 (12 members, 57 shared lines) · ×1
Near-duplicate member family (12 members, 57 shared lines) crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:40— crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:40-155 | crates/analytics/src/auth_events/metrics/authentication_count.rs:39-142 | crates/analytics/src/auth_events/metrics/authentication_error_message.rs:43-160 | crates/analytics/src/auth_events/metrics/authentication_exemption_approved_count.rs:39-145 | crates/analytics/src/auth_events/metrics/authentication_exemption_requested_count.rs:39-146 | crates/analytics/src/auth_events/metrics/authentication_funnel.rs:42-152 | crates/analytics/src/auth_events/metrics/authentication_success_count.rs:40-146 | crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs:40-156 | crates/analytics/src/auth_events/metrics/challenge_flow_count.rs:40-148 | crates/analytics/src/auth_events/metrics/challenge_success_count.rs:40-153 | crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs:40-149 | crates/analytics/src/auth_events/metrics/frictionless_success_count.rs:40-153 — These 12 members are variants of one another: a block of 57 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 12 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 12 times.
D4 · Code Duplication· Near-duplicate member family (11 members, 39 shared lines) · ×1
Near-duplicate member family (11 members, 39 shared lines) crates/analytics/src/payments/metrics/avg_ticket_size.rs:40— crates/analytics/src/payments/metrics/avg_ticket_size.rs:40-148 | crates/analytics/src/payments/metrics/debit_routing.rs:40-154 | crates/analytics/src/payments/metrics/payment_processed_amount.rs:40-148 | crates/analytics/src/payments/metrics/payment_success_count.rs:40-141 | crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs:40-149 | crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs:40-154 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs:40-166 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs:40-142 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:39-145 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:39-138 | crates/analytics/src/payments/metrics/success_rate.rs:39-137 — These 11 members are variants of one another: a block of 39 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
D4 · Code Duplication· Near-duplicate member family (11 members, 28 shared lines) · ×1
Near-duplicate member family (11 members, 28 shared lines) crates/analytics/src/payments/metrics/avg_ticket_size.rs:40— crates/analytics/src/payments/metrics/avg_ticket_size.rs:40-148 | crates/analytics/src/payments/metrics/connector_success_rate.rs:42-143 | crates/analytics/src/payments/metrics/payment_success_count.rs:40-141 | crates/analytics/src/payments/metrics/retries_count.rs:45-138 | crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs:40-149 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:42-144 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs:40-166 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs:40-142 | crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs:45-138 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:39-138 | crates/analytics/src/payments/metrics/success_rate.rs:39-137 — These 11 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 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
D4 · Code Duplication· Near-duplicate member family (10 members, 23 shared lines) · ×1
Near-duplicate member family (10 members, 23 shared lines) crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:41— crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:41-118 | crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs:41-119 | crates/analytics/src/disputes/metrics/total_amount_disputed.rs:41-117 | crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs:41-118 | crates/analytics/src/payments/metrics/payment_count.rs:39-131 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:39-132 | crates/analytics/src/refunds/metrics/refund_count.rs:39-120 | crates/analytics/src/refunds/metrics/refund_processed_amount.rs:42-128 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:39-121 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs:42-136 — These 10 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 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication· Near-duplicate member family (9 members, 33 shared lines) · ×1
Near-duplicate member family (9 members, 33 shared lines) crates/router/src/services/authentication.rs:4225— crates/router/src/services/authentication.rs:4225-4305 | crates/router/src/services/authentication.rs:4362-4441 | crates/router/src/services/authentication.rs:4549-4625 | crates/router/src/services/authentication.rs:4638-4711 | crates/router/src/services/authentication.rs:4787-4868 | crates/router/src/services/authentication.rs:4888-4966 | crates/router/src/services/authentication.rs:4979-5049 | crates/router/src/services/authentication.rs:5091-5163 | crates/router/src/services/authentication.rs:5176-5251 — These 9 members are variants of one another: a block of 33 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication· Near-duplicate member family (9 members, 30 shared lines) · ×1
Near-duplicate member family (9 members, 30 shared lines) crates/analytics/src/payments/metrics/connector_success_rate.rs:42— crates/analytics/src/payments/metrics/connector_success_rate.rs:42-143 | crates/analytics/src/payments/metrics/payment_count.rs:39-131 | crates/analytics/src/payments/metrics/retries_count.rs:45-138 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:42-144 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:39-132 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:39-145 | crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs:45-138 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:39-138 | crates/analytics/src/payments/metrics/success_rate.rs:39-137 — These 9 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 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication· Near-duplicate member family (8 members, 63 shared lines) · ×1
Near-duplicate member family (8 members, 63 shared lines) crates/analytics/src/sdk_events/metrics/average_payment_time.rs:40— crates/analytics/src/sdk_events/metrics/average_payment_time.rs:40-125 | crates/analytics/src/sdk_events/metrics/load_time.rs:40-125 | crates/analytics/src/sdk_events/metrics/payment_attempts.rs:40-120 | crates/analytics/src/sdk_events/metrics/payment_data_filled_count.rs:40-120 | crates/analytics/src/sdk_events/metrics/payment_method_selected_count.rs:40-120 | crates/analytics/src/sdk_events/metrics/payment_methods_call_count.rs:40-128 | crates/analytics/src/sdk_events/metrics/sdk_initiated_count.rs:40-120 | crates/analytics/src/sdk_events/metrics/sdk_rendered_count.rs:40-120 — These 8 members are variants of one another: a block of 63 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, 49 shared lines) · ×1
Near-duplicate member family (8 members, 49 shared lines) crates/router/src/core/payments/operations/payment_cancel.rs:54— crates/router/src/core/payments/operations/payment_cancel.rs:54-238 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:58-220 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:52-211 | crates/router/src/core/payments/operations/payment_capture.rs:59-293 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:59-204 | crates/router/src/core/payments/operations/payment_session.rs:54-252 | crates/router/src/core/payments/operations/payment_start.rs:54-254 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:58-226 — These 8 members are variants of one another: a block of 49 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, 38 shared lines) · ×1
Near-duplicate member family (8 members, 38 shared lines) crates/analytics/src/payments/metrics/connector_success_rate.rs:42— crates/analytics/src/payments/metrics/connector_success_rate.rs:42-143 | crates/analytics/src/payments/metrics/retries_count.rs:45-138 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:42-144 | crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs:43-209 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:39-145 | crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs:45-138 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:39-138 | crates/analytics/src/payments/metrics/success_rate.rs:39-137 — These 8 members are variants of one another: a block of 38 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) crates/analytics/src/sqlx.rs:563— crates/analytics/src/sqlx.rs:563-624 | crates/analytics/src/sqlx.rs:671-798 | crates/analytics/src/sqlx.rs:802-935 | crates/analytics/src/sqlx.rs:939-1047 | crates/analytics/src/sqlx.rs:1051-1154 | crates/analytics/src/sqlx.rs:1158-1242 | crates/analytics/src/sqlx.rs:1246-1288 | crates/analytics/src/sqlx.rs:1292-1353 — 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, 46 shared lines) · ×1
Near-duplicate member family (7 members, 46 shared lines) crates/router/src/core/payments/operations/payment_cancel.rs:54— crates/router/src/core/payments/operations/payment_cancel.rs:54-238 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:58-220 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:52-211 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:59-204 | crates/router/src/core/payments/operations/payment_start.rs:54-254 | crates/router/src/core/payments/operations/payment_update_metadata.rs:54-210 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:58-226 — These 7 members are variants of one another: a block of 46 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 44 shared lines) · ×1
Near-duplicate member family (7 members, 44 shared lines) crates/router/src/core/payments/operations/payment_cancel.rs:54— crates/router/src/core/payments/operations/payment_cancel.rs:54-238 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:58-220 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:52-211 | crates/router/src/core/payments/operations/payment_reject.rs:50-231 | crates/router/src/core/payments/operations/payment_session.rs:54-252 | crates/router/src/core/payments/operations/payment_start.rs:54-254 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:58-226 — These 7 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 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, 42 shared lines) · ×1
Near-duplicate member family (7 members, 42 shared lines) crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:58— crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:58-220 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:52-211 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:59-204 | crates/router/src/core/payments/operations/payment_update_metadata.rs:54-210 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:58-226 | crates/router/src/core/payments/operations/payments_incremental_authorization.rs:63-205 | crates/router/src/core/payments/operations/tax_calculation.rs:64-220 — These 7 members are variants of one another: a block of 42 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 40 shared lines) · ×1
Near-duplicate member family (7 members, 40 shared lines) crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:58— crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:58-220 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:52-211 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:59-204 | crates/router/src/core/payments/operations/payment_start.rs:54-254 | crates/router/src/core/payments/operations/payment_update_metadata.rs:54-210 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:58-226 | crates/router/src/core/payments/operations/payments_incremental_authorization.rs:63-205 — These 7 members are variants of one another: a block of 40 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 29 shared lines) · ×1
Near-duplicate member family (7 members, 29 shared lines) crates/router/src/services/authentication.rs:4225— crates/router/src/services/authentication.rs:4225-4305 | crates/router/src/services/authentication.rs:4549-4625 | crates/router/src/services/authentication.rs:4787-4868 | crates/router/src/services/authentication.rs:4888-4966 | crates/router/src/services/authentication.rs:5091-5163 | crates/router/src/services/authentication.rs:5176-5251 | crates/router/src/services/authentication.rs:5294-5364 — These 7 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 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, 25 shared lines) · ×1
Near-duplicate member family (7 members, 25 shared lines) crates/hyperswitch_connectors/src/connectors/cybersource.rs:490— crates/hyperswitch_connectors/src/connectors/cybersource.rs:490-554 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1025-1080 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1273-1337 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1428-1492 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1578-1642 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1736-1800 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1900-1955 — These 7 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 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) crates/router/src/core/payouts.rs:1772— crates/router/src/core/payouts.rs:1772-2052 | crates/router/src/core/payouts.rs:2113-2265 | crates/router/src/core/payouts.rs:2348-2513 | crates/router/src/core/payouts.rs:2663-2764 | crates/router/src/core/payouts.rs:2803-3014 | crates/router/src/core/payouts.rs:3022-3166 | crates/router/src/core/payouts.rs:3175-3375 — 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, 17 shared lines) · ×1
Near-duplicate member family (7 members, 17 shared lines) crates/analytics/src/sqlx.rs:208— crates/analytics/src/sqlx.rs:208-389 | crates/analytics/src/sqlx.rs:563-624 | crates/analytics/src/sqlx.rs:671-798 | crates/analytics/src/sqlx.rs:802-935 | crates/analytics/src/sqlx.rs:1051-1154 | crates/analytics/src/sqlx.rs:1292-1353 | crates/analytics/src/sqlx.rs:1415-1460 — These 7 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 52 shared lines) · ×1
Near-duplicate member family (6 members, 52 shared lines) crates/router/src/core/payments/operations/payment_cancel.rs:54— crates/router/src/core/payments/operations/payment_cancel.rs:54-238 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:58-220 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:52-211 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:59-204 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:58-226 | crates/router/src/core/payments/operations/tax_calculation.rs:64-220 — These 6 members are variants of one another: a block of 52 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, 40 shared lines) · ×1
Near-duplicate member family (6 members, 40 shared lines) crates/analytics/src/payments/metrics/connector_success_rate.rs:42— crates/analytics/src/payments/metrics/connector_success_rate.rs:42-143 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:42-144 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs:40-166 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:39-145 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:39-138 | crates/analytics/src/payments/metrics/success_rate.rs:39-137 — These 6 members are variants of one another: a block of 40 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 35 shared lines) · ×1
Near-duplicate member family (6 members, 35 shared lines) crates/router/src/core/payouts.rs:1772— crates/router/src/core/payouts.rs:1772-2052 | crates/router/src/core/payouts.rs:2113-2265 | crates/router/src/core/payouts.rs:2348-2513 | crates/router/src/core/payouts.rs:2663-2764 | crates/router/src/core/payouts.rs:3022-3166 | crates/router/src/core/payouts.rs:3175-3375 — These 6 members are variants of one another: a block of 35 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, 29 shared lines) · ×1
Near-duplicate member family (6 members, 29 shared lines) crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:43— crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:43-164 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs:42-146 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs:42-147 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs:48-159 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs:40-166 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:39-145 — These 6 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 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, 64 shared lines) · ×1
Near-duplicate member family (5 members, 64 shared lines) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:226— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:226-316 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:249-339 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:180-322 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:255-384 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:162-288 — These 5 members are variants of one another: a block of 64 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 39 shared lines) · ×1
Near-duplicate member family (5 members, 39 shared lines) crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:43— crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:43-162 | crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs:48-151 | crates/analytics/src/payments/metrics/debit_routing.rs:40-154 | crates/analytics/src/payments/metrics/payment_processed_amount.rs:40-148 | crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs:40-154 — These 5 members are variants of one another: a block of 39 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 33 shared lines) · ×1
Near-duplicate member family (5 members, 33 shared lines) crates/analytics/src/frm/metrics/frm_blocked_rate.rs:38— crates/analytics/src/frm/metrics/frm_blocked_rate.rs:38-116 | crates/analytics/src/refunds/metrics/refund_success_count.rs:43-126 | crates/analytics/src/refunds/metrics/refund_success_rate.rs:41-121 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs:43-126 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs:41-121 — These 5 members are variants of one another: a block of 33 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 26 shared lines) · ×1
Near-duplicate member family (5 members, 26 shared lines) crates/hyperswitch_connectors/src/connectors/cashtocode.rs:140— crates/hyperswitch_connectors/src/connectors/cashtocode.rs:140-190 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:145-195 | crates/hyperswitch_connectors/src/connectors/paypal.rs:553-605 | crates/hyperswitch_connectors/src/connectors/paypal.rs:688-740 | crates/hyperswitch_connectors/src/connectors/stripe.rs:171-231 — These 5 members are variants of one another: a block of 26 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 22 shared lines) · ×1
Near-duplicate member family (5 members, 22 shared lines) crates/router/src/core/payment_methods/network_tokenization.rs:128— crates/router/src/core/payment_methods/network_tokenization.rs:128-221 | crates/router/src/core/payment_methods/network_tokenization.rs:300-394 | crates/router/src/core/payment_methods/network_tokenization.rs:857-917 | crates/router/src/core/payment_methods/network_tokenization.rs:925-979 | crates/router/src/core/payment_methods/network_tokenization.rs:1085-1146 — These 5 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 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 16 shared lines) · ×1
Near-duplicate member family (5 members, 16 shared lines) crates/diesel_models/src/query/user/sample_data.rs:89— crates/diesel_models/src/query/user/sample_data.rs:89-110 | crates/diesel_models/src/query/user/sample_data.rs:116-137 | crates/diesel_models/src/query/user/sample_data.rs:141-162 | crates/diesel_models/src/query/user/sample_data.rs:167-188 | crates/diesel_models/src/query/user/sample_data.rs:193-214 — These 5 members are variants of one another: a block of 16 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 14 shared lines) · ×1
Near-duplicate member family (5 members, 14 shared lines) crates/router/src/core/payments/transformers.rs:133— crates/router/src/core/payments/transformers.rs:133-254 | crates/router/src/core/payments/transformers.rs:824-1059 | crates/router/src/core/payments/transformers.rs:2003-2328 | crates/router/src/core/payments/transformers.rs:2348-2559 | crates/router/src/core/payments/transformers.rs:8384-8559 — These 5 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 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, 50 shared lines) · ×1
Near-duplicate member family (4 members, 50 shared lines) crates/analytics/src/sqlx.rs:208— crates/analytics/src/sqlx.rs:208-389 | crates/analytics/src/sqlx.rs:393-559 | crates/analytics/src/sqlx.rs:939-1047 | crates/analytics/src/sqlx.rs:1158-1242 — These 4 members are variants of one another: a block of 50 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 47 shared lines) · ×1
Near-duplicate member family (4 members, 47 shared lines) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:817— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:817-936 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:945-1040 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3819-3959 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3968-4074 — These 4 members are variants of one another: a block of 47 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, 41 shared lines) · ×1
Near-duplicate member family (4 members, 41 shared lines) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1455— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1455-1513 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1520-1578 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2947-3017 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3026-3098 — These 4 members are variants of one another: a block of 41 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, 39 shared lines) · ×1
Near-duplicate member family (4 members, 39 shared lines) crates/router/src/core/payments/operations/payment_post_session_tokens.rs:59— crates/router/src/core/payments/operations/payment_post_session_tokens.rs:59-204 | crates/router/src/core/payments/operations/payment_session.rs:54-252 | crates/router/src/core/payments/operations/payment_update_metadata.rs:54-210 | crates/router/src/core/payments/operations/tax_calculation.rs:64-220 — These 4 members are variants of one another: a block of 39 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, 36 shared lines) · ×1
Near-duplicate member family (4 members, 36 shared lines) crates/analytics/src/refunds/metrics/refund_processed_amount.rs:42— crates/analytics/src/refunds/metrics/refund_processed_amount.rs:42-128 | crates/analytics/src/refunds/metrics/refund_success_count.rs:43-126 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs:42-136 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs:43-126 — These 4 members are variants of one another: a block of 36 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 34 shared lines) · ×1
Near-duplicate member family (4 members, 34 shared lines) crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs:42— crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs:42-146 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs:42-147 | crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs:43-209 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:39-145 — These 4 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 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, 31 shared lines) · ×1
Near-duplicate member family (4 members, 31 shared lines) crates/router/src/core/fraud_check/flows/checkout_flow.rs:60— crates/router/src/core/fraud_check/flows/checkout_flow.rs:60-213 | crates/router/src/core/fraud_check/flows/record_return.rs:57-156 | crates/router/src/core/fraud_check/flows/sale_flow.rs:54-208 | crates/router/src/core/fraud_check/flows/transaction_flow.rs:62-175 — These 4 members are variants of one another: a block of 31 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 30 shared lines) · ×1
Near-duplicate member family (4 members, 30 shared lines) crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:576— crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:576-627 | crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:653-704 | crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:730-781 | crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:807-858 — These 4 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 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, 24 shared lines) · ×1
Near-duplicate member family (4 members, 24 shared lines) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2044— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2044-2075 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3046-3077 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3229-3263 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1562-1593 — These 4 members are variants of one another: a block of 24 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 23 shared lines) · ×1
Near-duplicate member family (4 members, 23 shared lines) crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:148— crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:148-239 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:95-163 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:55-103 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:701-753 — These 4 members are variants of one another: a block of 23 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 21 shared lines) · ×1
Near-duplicate member family (4 members, 21 shared lines) crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:148— crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:148-239 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:95-163 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:701-753 | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:67-123 — These 4 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 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, 19 shared lines) · ×1
Near-duplicate member family (4 members, 19 shared lines) crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:241— crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:241-275 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:428-488 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:65-149 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:245-309 — These 4 members are variants of one another: a block of 19 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 10 shared lines) · ×1
Near-duplicate member family (4 members, 10 shared lines) crates/router/src/core/payments/transformers.rs:353— crates/router/src/core/payments/transformers.rs:353-642 | crates/router/src/core/payments/transformers.rs:655-811 | crates/router/src/core/payments/transformers.rs:1073-1234 | crates/router/src/core/payments/transformers.rs:1752-1980 — These 4 members are variants of one another: a block of 10 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, 68 shared lines) · ×1
Near-duplicate member family (3 members, 68 shared lines) crates/analytics/src/payments/distribution/payment_error_message.rs:41— crates/analytics/src/payments/distribution/payment_error_message.rs:41-186 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs:41-176 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs:40-168 — These 3 members are variants of one another: a block of 68 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, 38 shared lines) · ×1
Near-duplicate member family (3 members, 38 shared lines) crates/hyperswitch_domain_models/src/disputes.rs:31— crates/hyperswitch_domain_models/src/disputes.rs:31-90 | crates/hyperswitch_domain_models/src/disputes.rs:106-161 | crates/hyperswitch_domain_models/src/refunds.rs:51-103 — These 3 members are variants of one another: a block of 38 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) crates/router/src/core/routing.rs:2703— crates/router/src/core/routing.rs:2703-2796 | crates/router/src/core/routing.rs:2804-2902 | crates/router/src/core/routing.rs:3070-3172 — 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, 28 shared lines) · ×1
Near-duplicate member family (3 members, 28 shared lines) crates/router/src/services/authentication.rs:953— crates/router/src/services/authentication.rs:953-1044 | crates/router/src/services/authentication.rs:1057-1147 | crates/router/src/services/authentication.rs:1191-1287 — These 3 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 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, 24 shared lines) · ×1
Near-duplicate member family (3 members, 24 shared lines) crates/hyperswitch_connectors/src/connectors/deutschebank.rs:421— crates/hyperswitch_connectors/src/connectors/deutschebank.rs:421-459 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:516-560 | crates/hyperswitch_connectors/src/connectors/santander.rs:2902-2950 — These 3 members are variants of one another: a block of 24 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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, 17 shared lines) · ×1
Near-duplicate member family (3 members, 17 shared lines) crates/hyperswitch_connectors/src/connectors/checkout.rs:142— crates/hyperswitch_connectors/src/connectors/checkout.rs:142-227 | crates/hyperswitch_connectors/src/connectors/paypal.rs:156-244 | crates/hyperswitch_connectors/src/connectors/paypal.rs:357-451 — These 3 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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 (401 shared lines) crates/router/src/types/api/connector_mapping.rs:105— crates/router/src/types/api/connector_mapping.rs:105-578 | crates/router/src/types/api/feature_matrix.rs:18-513 — These two members are variants of one another: 401 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 (195 shared lines) crates/router/src/core/unified_connector_service.rs:3998— crates/router/src/core/unified_connector_service.rs:3998-4205 | crates/router/src/core/unified_connector_service.rs:4238-4448 — These two members are variants of one another: 195 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 (160 shared lines) crates/router/src/services/kafka/payment_attempt.rs:232— crates/router/src/services/kafka/payment_attempt.rs:232-394 | crates/router/src/services/kafka/payment_attempt_event.rs:234-396 — These two members are variants of one another: 160 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 (126 shared lines) crates/router/src/core/refunds.rs:489— crates/router/src/core/refunds.rs:489-828 | crates/router/src/core/refunds.rs:1192-1480 — These two members are variants of one another: 126 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 (114 shared lines) crates/router/src/core/payments/operations/payment_approve.rs:52— crates/router/src/core/payments/operations/payment_approve.rs:52-235 | crates/router/src/core/payments/operations/payment_reject.rs:50-231 — These two members are variants of one another: 114 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (110 shared lines) crates/router/src/core/payments/transformers.rs:3130— crates/router/src/core/payments/transformers.rs:3130-3259 | crates/router/src/core/payments/transformers.rs:3275-3416 — These two members are variants of one another: 110 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (103 shared lines) crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs:353— crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs:353-470 | crates/hyperswitch_connectors/src/connectors/signifyd/transformers/api.rs:639-756 — These two members are variants of one another: 103 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 (100 shared lines) crates/router/src/core/payment_link.rs:101— crates/router/src/core/payment_link.rs:101-359 | crates/router/src/core/payment_link.rs:889-1064 — These two members are variants of one another: 100 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (89 shared lines) crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:226— crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:226-601 | crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs:1727-1934 — These two members are variants of one another: 89 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (86 shared lines) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2586— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2586-2816 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1223-1404 — 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 (84 shared lines) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1010— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1010-1181 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1223-1404 — These two members are variants of one another: 84 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 (69 shared lines) crates/api_models/src/payouts.rs:1402— crates/api_models/src/payouts.rs:1402-1540 | crates/api_models/src/payouts.rs:1544-1709 — These two members are variants of one another: 69 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 (63 shared lines) crates/router/src/services/authentication.rs:5628— crates/router/src/services/authentication.rs:5628-5725 | crates/router/src/services/authentication.rs:5738-5844 — These two members are variants of one another: 63 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (56 shared lines) crates/router/src/services/authentication.rs:3533— crates/router/src/services/authentication.rs:3533-3679 | crates/router/src/services/authentication.rs:3871-3986 — These two members are variants of one another: 56 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (55 shared lines) crates/router/src/core/user.rs:3438— crates/router/src/core/user.rs:3438-3580 | crates/router/src/core/user.rs:3781-3907 — These two members are variants of one another: 55 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (53 shared lines) crates/router/src/core/payments.rs:14536— crates/router/src/core/payments.rs:14536-14608 | crates/router/src/core/payments.rs:14617-14765 — These two members are variants of one another: 53 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (50 shared lines) crates/router/src/core/revenue_recovery/types.rs:812— crates/router/src/core/revenue_recovery/types.rs:812-986 | crates/router/src/core/revenue_recovery/types.rs:1134-1291 — These two members are variants of one another: 50 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 (49 shared lines) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4441— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4441-4510 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1979-2047 — These two members are variants of one another: 49 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) crates/router/src/workflows/outgoing_webhook_retry.rs:50— crates/router/src/workflows/outgoing_webhook_retry.rs:50-302 | crates/router/src/workflows/outgoing_webhook_retry.rs:309-426 — 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 (42 shared lines) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1010— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1010-1181 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1894-2060 — These two members are variants of one another: 42 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (39 shared lines) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2192— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2192-2269 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4138-4197 — These two members are variants of one another: 39 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (33 shared lines) crates/router/src/types/transformers.rs:571— crates/router/src/types/transformers.rs:571-614 | crates/router/src/types/transformers.rs:618-661 — These two members are variants of one another: 33 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) crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2524— crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2524-2578 | crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:2592-2641 — 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 (26 shared lines) crates/router/src/core/payment_link/validator.rs:16— crates/router/src/core/payment_link/validator.rs:16-109 | crates/router/src/core/payouts/validator.rs:530-628 — 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.
Near-duplicate member pair (25 shared lines) crates/api_models/src/payments.rs:3900— crates/api_models/src/payments.rs:3900-3939 | crates/hyperswitch_domain_models/src/payment_method_data.rs:3940-3978 — These two members are variants of one another: 25 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (100 corresponding lines) · ×1
Edited copy of a member (100 corresponding lines) crates/router/src/db/refund.rs:1732— crates/router/src/db/refund.rs:1732-1837 | crates/router/src/db/refund.rs:2063-2168 — These two members are one piece of code written twice and then edited apart: 100 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (90 corresponding lines) · ×1
Edited copy of a member (90 corresponding lines) crates/router/src/db/refund.rs:1847— crates/router/src/db/refund.rs:1847-1942 | crates/router/src/db/refund.rs:2176-2271 — These two members are one piece of code written twice and then edited apart: 90 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (79 corresponding lines) · ×1
Edited copy of a member (79 corresponding lines) crates/analytics/src/disputes/metrics/dispute_status_metric.rs:41— crates/analytics/src/disputes/metrics/dispute_status_metric.rs:41-120 | crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs:41-120 — These two members are one piece of code written twice and then edited apart: 79 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (76 corresponding lines) · ×1
Edited copy of a member (76 corresponding lines) crates/router/src/db/dispute.rs:976— crates/router/src/db/dispute.rs:976-1061 | crates/router/src/db/dispute.rs:1068-1148 — These two members are one piece of code written twice and then edited apart: 76 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (88 corresponding lines) · ×1
Edited copy of a member (88 corresponding lines) crates/router/src/core/payments/operations/payment_create.rs:836— crates/router/src/core/payments/operations/payment_create.rs:836-923 | crates/router/src/core/payments/operations/payment_update.rs:690-777 — These two members are one piece of code written twice and then edited apart: 88 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (86 corresponding lines) · ×1
Edited copy of a member (86 corresponding lines) crates/router/src/compatibility/stripe/payment_intents/types.rs:874— crates/router/src/compatibility/stripe/payment_intents/types.rs:874-959 | crates/router/src/compatibility/stripe/setup_intents/types.rs:424-509 — These two members are one piece of code written twice and then edited apart: 86 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (101 corresponding lines) · ×1
Edited copy of a member (101 corresponding lines) crates/analytics/src/lib.rs:232— crates/analytics/src/lib.rs:232-332 | crates/analytics/src/lib.rs:564-664 — These two members are one piece of code written twice and then edited apart: 101 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (52 corresponding lines) · ×1
Edited copy of a member (52 corresponding lines) crates/router/src/core/user_role.rs:389— crates/router/src/core/user_role.rs:389-443 | crates/router/src/core/user_role.rs:449-520 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (53 corresponding lines) · ×1
Edited copy of a member (53 corresponding lines) crates/analytics/src/clickhouse.rs:591— crates/analytics/src/clickhouse.rs:591-643 | crates/analytics/src/sqlx.rs:1593-1645 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) crates/router/src/core/payments/helpers.rs:8037— crates/router/src/core/payments/helpers.rs:8037-8054 | crates/router/src/core/payments/helpers.rs:8155-8177 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×1
Edited copy of a member (32 corresponding lines) crates/router/src/core/payment_methods.rs:5193— crates/router/src/core/payment_methods.rs:5193-5254 | crates/router/src/core/payment_methods/vault.rs:2847-2905 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×1
Edited copy of a member (15 corresponding lines) crates/analytics/src/sqlx.rs:628— crates/analytics/src/sqlx.rs:628-667 | crates/analytics/src/sqlx.rs:1357-1377 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×1
Edited copy of a member (16 corresponding lines) crates/analytics/src/payment_intents/accumulator.rs:158— crates/analytics/src/payment_intents/accumulator.rs:158-184 | crates/analytics/src/payment_intents/accumulator.rs:288-307 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) crates/router/src/routes/routing.rs:867— crates/router/src/routes/routing.rs:867-909 | crates/router/src/routes/routing.rs:959-1000 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (88 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (88 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/affirm.rs:239— crates/hyperswitch_connectors/src/connectors/affirm.rs:239-255 | crates/hyperswitch_connectors/src/connectors/airwallex.rs:522-538 | crates/hyperswitch_connectors/src/connectors/amazonpay.rs:429-445 | crates/hyperswitch_connectors/src/connectors/authipay.rs:276-292 | crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:300-316 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:692-708 | crates/hyperswitch_connectors/src/connectors/billwerk.rs:320-336 | crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs:395-411 | crates/hyperswitch_connectors/src/connectors/bluesnap.rs:746-762 | crates/hyperswitch_connectors/src/connectors/boku.rs:254-270 | crates/hyperswitch_connectors/src/connectors/breadpay.rs:234-250 | crates/hyperswitch_connectors/src/connectors/calida.rs:229-245 | crates/hyperswitch_connectors/src/connectors/celero.rs:245-261 | crates/hyperswitch_connectors/src/connectors/checkbook.rs:219-235 | crates/hyperswitch_connectors/src/connectors/citigate.rs:227-243 | crates/hyperswitch_connectors/src/connectors/coingate.rs:221-237 | crates/hyperswitch_connectors/src/connectors/custombilling.rs:212-228 | crates/hyperswitch_connectors/src/connectors/d24.rs:223-239 | crates/hyperswitch_connectors/src/connectors/datatrans.rs:330-346 | crates/hyperswitch_connectors/src/connectors/deutschebank.rs:398-414 | crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs:268-284 | crates/hyperswitch_connectors/src/connectors/dlocal.rs:251-267 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:535-551 | crates/hyperswitch_connectors/src/connectors/elavon.rs:185-201 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:255-271 | crates/hyperswitch_connectors/src/connectors/envoy.rs:330-346 | crates/hyperswitch_connectors/src/connectors/etisalat.rs:246-262 | crates/hyperswitch_connectors/src/connectors/facilitapay.rs:390-406 | crates/hyperswitch_connectors/src/connectors/finix.rs:508-524 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs:234-250 | crates/hyperswitch_connectors/src/connectors/fiservemea.rs:314-330 | crates/hyperswitch_connectors/src/connectors/flexiti.rs:345-361 | crates/hyperswitch_connectors/src/connectors/forte.rs:248-264 | crates/hyperswitch_connectors/src/connectors/getnet.rs:257-273 | crates/hyperswitch_connectors/src/connectors/gigadat.rs:261-277 | crates/hyperswitch_connectors/src/connectors/givepayments.rs:227-243 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:247-263 | crates/hyperswitch_connectors/src/connectors/gocardless.rs:487-503 | crates/hyperswitch_connectors/src/connectors/helcim.rs:341-357 | crates/hyperswitch_connectors/src/connectors/hyperpg.rs:217-233 | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs:226-242 | crates/hyperswitch_connectors/src/connectors/iatapay.rs:368-384 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:227-243 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions.rs:246-262 | crates/hyperswitch_connectors/src/connectors/inespay.rs:235-251 | crates/hyperswitch_connectors/src/connectors/jpmorgan.rs:364-380 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital.rs:267-283 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs:281-297 | crates/hyperswitch_connectors/src/connectors/katapult.rs:228-244 | crates/hyperswitch_connectors/src/connectors/klarna.rs:1171-1187 | crates/hyperswitch_connectors/src/connectors/loonio.rs:247-263 | crates/hyperswitch_connectors/src/connectors/merchante.rs:246-262 | crates/hyperswitch_connectors/src/connectors/mifinity.rs:277-293 | crates/hyperswitch_connectors/src/connectors/mollie.rs:443-459 | crates/hyperswitch_connectors/src/connectors/moneris.rs:353-369 | crates/hyperswitch_connectors/src/connectors/mpgs.rs:225-241 | crates/hyperswitch_connectors/src/connectors/multisafepay.rs:303-319 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:677-693 | crates/hyperswitch_connectors/src/connectors/nordea.rs:909-925 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:381-397 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:879-895 | crates/hyperswitch_connectors/src/connectors/payconex.rs:227-243 | crates/hyperswitch_connectors/src/connectors/payjustnowinstore.rs:267-283 | crates/hyperswitch_connectors/src/connectors/payload.rs:498-514 | crates/hyperswitch_connectors/src/connectors/paynearme.rs:228-244 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:493-509 | crates/hyperswitch_connectors/src/connectors/paystack.rs:219-235 | crates/hyperswitch_connectors/src/connectors/paytm.rs:217-233 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:377-393 | crates/hyperswitch_connectors/src/connectors/phonepe.rs:217-233 | crates/hyperswitch_connectors/src/connectors/placetopay.rs:210-226 | crates/hyperswitch_connectors/src/connectors/prophetpay.rs:228-244 | crates/hyperswitch_connectors/src/connectors/razorpay.rs:356-372 | crates/hyperswitch_connectors/src/connectors/sift.rs:225-241 | crates/hyperswitch_connectors/src/connectors/silverflow.rs:331-347 | crates/hyperswitch_connectors/src/connectors/stax.rs:408-424 | crates/hyperswitch_connectors/src/connectors/stripebilling.rs:305-321 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:432-448 | crates/hyperswitch_connectors/src/connectors/thunes.rs:214-230 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:371-387 | crates/hyperswitch_connectors/src/connectors/trustly.rs:229-245 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:303-319 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:760-776 | crates/hyperswitch_connectors/src/connectors/worldpayraft.rs:227-243 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:339-355 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:426-442 | crates/hyperswitch_connectors/src/connectors/zift.rs:317-333 | crates/hyperswitch_connectors/src/connectors/zsl.rs:185-201 — These 88 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 88 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 88 times.
D4 · Code Duplication· Members sharing a duplicated core (86 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (86 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/affirm.rs:661— crates/hyperswitch_connectors/src/connectors/affirm.rs:661-674 | crates/hyperswitch_connectors/src/connectors/airwallex.rs:966-979 | crates/hyperswitch_connectors/src/connectors/amazonpay.rs:608-621 | crates/hyperswitch_connectors/src/connectors/authipay.rs:632-645 | crates/hyperswitch_connectors/src/connectors/bambora.rs:701-714 | crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:572-585 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1161-1174 | crates/hyperswitch_connectors/src/connectors/billwerk.rs:668-681 | crates/hyperswitch_connectors/src/connectors/bluesnap.rs:972-985 | crates/hyperswitch_connectors/src/connectors/boku.rs:515-528 | crates/hyperswitch_connectors/src/connectors/breadpay.rs:670-683 | crates/hyperswitch_connectors/src/connectors/calida.rs:511-524 | crates/hyperswitch_connectors/src/connectors/celero.rs:583-596 | crates/hyperswitch_connectors/src/connectors/checkbook.rs:448-461 | crates/hyperswitch_connectors/src/connectors/citigate.rs:460-473 | crates/hyperswitch_connectors/src/connectors/coingate.rs:415-428 | crates/hyperswitch_connectors/src/connectors/custombilling.rs:447-460 | crates/hyperswitch_connectors/src/connectors/datatrans.rs:666-679 | crates/hyperswitch_connectors/src/connectors/deutschebank.rs:873-886 | crates/hyperswitch_connectors/src/connectors/dlocal.rs:573-586 | crates/hyperswitch_connectors/src/connectors/elavon.rs:447-460 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:488-501 | crates/hyperswitch_connectors/src/connectors/envoy.rs:563-576 | crates/hyperswitch_connectors/src/connectors/etisalat.rs:479-492 | crates/hyperswitch_connectors/src/connectors/finix.rs:869-882 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:733-746 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs:471-484 | crates/hyperswitch_connectors/src/connectors/fiservemea.rs:654-667 | crates/hyperswitch_connectors/src/connectors/flexiti.rs:589-602 | crates/hyperswitch_connectors/src/connectors/forte.rs:590-603 | crates/hyperswitch_connectors/src/connectors/getnet.rs:592-605 | crates/hyperswitch_connectors/src/connectors/gigadat.rs:539-552 | crates/hyperswitch_connectors/src/connectors/givepayments.rs:462-475 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:485-498 | crates/hyperswitch_connectors/src/connectors/gocardless.rs:656-669 | crates/hyperswitch_connectors/src/connectors/helcim.rs:687-700 | crates/hyperswitch_connectors/src/connectors/hipay.rs:622-635 | crates/hyperswitch_connectors/src/connectors/hyperpg.rs:450-463 | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs:460-473 | crates/hyperswitch_connectors/src/connectors/iatapay.rs:552-565 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:460-473 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions.rs:489-502 | crates/hyperswitch_connectors/src/connectors/inespay.rs:478-491 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital.rs:502-515 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs:519-532 | crates/hyperswitch_connectors/src/connectors/katapult.rs:461-474 | crates/hyperswitch_connectors/src/connectors/klarna.rs:1341-1354 | crates/hyperswitch_connectors/src/connectors/loonio.rs:517-530 | crates/hyperswitch_connectors/src/connectors/merchante.rs:479-492 | crates/hyperswitch_connectors/src/connectors/mollie.rs:715-728 | crates/hyperswitch_connectors/src/connectors/moneris.rs:678-691 | crates/hyperswitch_connectors/src/connectors/mpgs.rs:458-471 | crates/hyperswitch_connectors/src/connectors/multisafepay.rs:407-420 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:1080-1093 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:635-648 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:1140-1153 | crates/hyperswitch_connectors/src/connectors/payconex.rs:460-473 | crates/hyperswitch_connectors/src/connectors/payjustnowinstore.rs:452-465 | crates/hyperswitch_connectors/src/connectors/payload.rs:931-944 | crates/hyperswitch_connectors/src/connectors/paynearme.rs:461-474 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:967-980 | crates/hyperswitch_connectors/src/connectors/paystack.rs:462-475 | crates/hyperswitch_connectors/src/connectors/paytm.rs:450-463 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:829-842 | crates/hyperswitch_connectors/src/connectors/phonepe.rs:450-463 | crates/hyperswitch_connectors/src/connectors/placetopay.rs:532-545 | crates/hyperswitch_connectors/src/connectors/prophetpay.rs:580-593 | crates/hyperswitch_connectors/src/connectors/razorpay.rs:590-603 | crates/hyperswitch_connectors/src/connectors/shift4.rs:706-719 | crates/hyperswitch_connectors/src/connectors/sift.rs:458-471 | crates/hyperswitch_connectors/src/connectors/silverflow.rs:664-677 | crates/hyperswitch_connectors/src/connectors/square.rs:711-724 | crates/hyperswitch_connectors/src/connectors/stax.rs:747-760 | crates/hyperswitch_connectors/src/connectors/stripebilling.rs:540-553 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:760-773 | crates/hyperswitch_connectors/src/connectors/thunes.rs:447-460 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:604-617 | crates/hyperswitch_connectors/src/connectors/trustly.rs:397-410 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:634-647 | crates/hyperswitch_connectors/src/connectors/volt.rs:617-630 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:998-1011 | crates/hyperswitch_connectors/src/connectors/worldpayraft.rs:462-475 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:858-871 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:806-819 | crates/hyperswitch_connectors/src/connectors/xendit.rs:725-738 | crates/hyperswitch_connectors/src/connectors/zift.rs:637-650 — These 86 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 86 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 86 times.
D4 · Code Duplication· Members sharing a duplicated core (75 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (75 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/affirm.rs:489— crates/hyperswitch_connectors/src/connectors/affirm.rs:489-503 | crates/hyperswitch_connectors/src/connectors/airwallex.rs:780-794 | crates/hyperswitch_connectors/src/connectors/authipay.rs:451-465 | crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:477-491 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:913-927 | crates/hyperswitch_connectors/src/connectors/billwerk.rs:497-511 | crates/hyperswitch_connectors/src/connectors/boku.rs:420-434 | crates/hyperswitch_connectors/src/connectors/breadpay.rs:502-516 | crates/hyperswitch_connectors/src/connectors/calida.rs:423-437 | crates/hyperswitch_connectors/src/connectors/celero.rs:419-433 | crates/hyperswitch_connectors/src/connectors/citigate.rs:372-386 | crates/hyperswitch_connectors/src/connectors/custombilling.rs:357-371 | crates/hyperswitch_connectors/src/connectors/datatrans.rs:492-506 | crates/hyperswitch_connectors/src/connectors/deutschebank.rs:698-712 | crates/hyperswitch_connectors/src/connectors/dlocal.rs:415-429 | crates/hyperswitch_connectors/src/connectors/elavon.rs:350-364 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:400-414 | crates/hyperswitch_connectors/src/connectors/envoy.rs:475-489 | crates/hyperswitch_connectors/src/connectors/etisalat.rs:391-405 | crates/hyperswitch_connectors/src/connectors/facilitapay.rs:548-562 | crates/hyperswitch_connectors/src/connectors/finix.rs:691-705 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs:381-395 | crates/hyperswitch_connectors/src/connectors/fiservemea.rs:483-497 | crates/hyperswitch_connectors/src/connectors/flexiti.rs:501-515 | crates/hyperswitch_connectors/src/connectors/forte.rs:412-426 | crates/hyperswitch_connectors/src/connectors/getnet.rs:424-438 | crates/hyperswitch_connectors/src/connectors/gigadat.rs:434-448 | crates/hyperswitch_connectors/src/connectors/givepayments.rs:372-386 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:394-408 | crates/hyperswitch_connectors/src/connectors/helcim.rs:520-534 | crates/hyperswitch_connectors/src/connectors/hipay.rs:469-483 | crates/hyperswitch_connectors/src/connectors/hyperpg.rs:362-376 | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs:371-385 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:372-386 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions.rs:399-413 | crates/hyperswitch_connectors/src/connectors/inespay.rs:390-404 | crates/hyperswitch_connectors/src/connectors/jpmorgan.rs:456-470 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital.rs:412-426 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs:428-442 | crates/hyperswitch_connectors/src/connectors/katapult.rs:373-387 | crates/hyperswitch_connectors/src/connectors/loonio.rs:429-443 | crates/hyperswitch_connectors/src/connectors/merchante.rs:391-405 | crates/hyperswitch_connectors/src/connectors/mifinity.rs:437-451 | crates/hyperswitch_connectors/src/connectors/mollie.rs:608-622 | crates/hyperswitch_connectors/src/connectors/moneris.rs:519-533 | crates/hyperswitch_connectors/src/connectors/mpgs.rs:370-384 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:873-887 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:548-562 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:793-807 | crates/hyperswitch_connectors/src/connectors/payconex.rs:372-386 | crates/hyperswitch_connectors/src/connectors/payjustnow.rs:429-443 | crates/hyperswitch_connectors/src/connectors/payload.rs:667-681 | crates/hyperswitch_connectors/src/connectors/paynearme.rs:373-387 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:783-797 | crates/hyperswitch_connectors/src/connectors/paystack.rs:374-388 | crates/hyperswitch_connectors/src/connectors/paytm.rs:362-376 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:549-563 | crates/hyperswitch_connectors/src/connectors/phonepe.rs:362-376 | crates/hyperswitch_connectors/src/connectors/placetopay.rs:372-386 | crates/hyperswitch_connectors/src/connectors/razorpay.rs:510-524 | crates/hyperswitch_connectors/src/connectors/santander.rs:1648-1662 | crates/hyperswitch_connectors/src/connectors/sift.rs:370-384 | crates/hyperswitch_connectors/src/connectors/silverflow.rs:493-507 | crates/hyperswitch_connectors/src/connectors/stax.rs:577-591 | crates/hyperswitch_connectors/src/connectors/stripebilling.rs:450-464 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:597-611 | crates/hyperswitch_connectors/src/connectors/thunes.rs:359-373 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:516-530 | crates/hyperswitch_connectors/src/connectors/trustly.rs:310-324 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:469-483 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:631-645 | crates/hyperswitch_connectors/src/connectors/worldpayraft.rs:372-386 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:587-601 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:624-638 | crates/hyperswitch_connectors/src/connectors/zift.rs:478-492 — These 75 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 75 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 75 times.
D4 · Code Duplication· Members sharing a duplicated core (74 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (74 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/affirm.rs:403— crates/hyperswitch_connectors/src/connectors/affirm.rs:403-412 | crates/hyperswitch_connectors/src/connectors/airwallex.rs:606-615 | crates/hyperswitch_connectors/src/connectors/amazonpay.rs:508-517 | crates/hyperswitch_connectors/src/connectors/authipay.rs:365-374 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:828-837 | crates/hyperswitch_connectors/src/connectors/billwerk.rs:404-413 | crates/hyperswitch_connectors/src/connectors/bluesnap.rs:456-465 | crates/hyperswitch_connectors/src/connectors/breadpay.rs:422-431 | crates/hyperswitch_connectors/src/connectors/calida.rs:327-336 | crates/hyperswitch_connectors/src/connectors/checkbook.rs:300-309 | crates/hyperswitch_connectors/src/connectors/citigate.rs:299-308 | crates/hyperswitch_connectors/src/connectors/coingate.rs:303-312 | crates/hyperswitch_connectors/src/connectors/custombilling.rs:284-293 | crates/hyperswitch_connectors/src/connectors/d24.rs:295-304 | crates/hyperswitch_connectors/src/connectors/datatrans.rs:408-417 | crates/hyperswitch_connectors/src/connectors/deutschebank.rs:611-620 | crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs:345-354 | crates/hyperswitch_connectors/src/connectors/dlocal.rs:333-342 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:648-657 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:327-336 | crates/hyperswitch_connectors/src/connectors/envoy.rs:402-411 | crates/hyperswitch_connectors/src/connectors/etisalat.rs:318-327 | crates/hyperswitch_connectors/src/connectors/facilitapay.rs:473-482 | crates/hyperswitch_connectors/src/connectors/finix.rs:597-606 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs:306-315 | crates/hyperswitch_connectors/src/connectors/fiservemea.rs:398-407 | crates/hyperswitch_connectors/src/connectors/flexiti.rs:428-437 | crates/hyperswitch_connectors/src/connectors/forte.rs:331-340 | crates/hyperswitch_connectors/src/connectors/getnet.rs:342-351 | crates/hyperswitch_connectors/src/connectors/gigadat.rs:343-352 | crates/hyperswitch_connectors/src/connectors/givepayments.rs:299-308 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:319-328 | crates/hyperswitch_connectors/src/connectors/helcim.rs:432-441 | crates/hyperswitch_connectors/src/connectors/hipay.rs:387-396 | crates/hyperswitch_connectors/src/connectors/hyperpg.rs:289-298 | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs:298-307 | crates/hyperswitch_connectors/src/connectors/iatapay.rs:448-457 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:299-308 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions.rs:318-327 | crates/hyperswitch_connectors/src/connectors/inespay.rs:317-326 | crates/hyperswitch_connectors/src/connectors/jpmorgan.rs:530-539 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital.rs:339-348 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs:353-362 | crates/hyperswitch_connectors/src/connectors/katapult.rs:300-309 | crates/hyperswitch_connectors/src/connectors/klarna.rs:460-469 | crates/hyperswitch_connectors/src/connectors/loonio.rs:323-332 | crates/hyperswitch_connectors/src/connectors/merchante.rs:318-327 | crates/hyperswitch_connectors/src/connectors/mifinity.rs:363-372 | crates/hyperswitch_connectors/src/connectors/mollie.rs:525-534 | crates/hyperswitch_connectors/src/connectors/moneris.rs:433-442 | crates/hyperswitch_connectors/src/connectors/mpgs.rs:297-306 | crates/hyperswitch_connectors/src/connectors/multisafepay.rs:203-212 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:754-763 | crates/hyperswitch_connectors/src/connectors/payconex.rs:299-308 | crates/hyperswitch_connectors/src/connectors/payjustnowinstore.rs:348-357 | crates/hyperswitch_connectors/src/connectors/payload.rs:580-589 | crates/hyperswitch_connectors/src/connectors/paynearme.rs:300-309 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:697-706 | crates/hyperswitch_connectors/src/connectors/paystack.rs:301-310 | crates/hyperswitch_connectors/src/connectors/paytm.rs:289-298 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:458-467 | crates/hyperswitch_connectors/src/connectors/phonepe.rs:289-298 | crates/hyperswitch_connectors/src/connectors/shift4.rs:339-348 | crates/hyperswitch_connectors/src/connectors/sift.rs:297-306 | crates/hyperswitch_connectors/src/connectors/silverflow.rs:414-423 | crates/hyperswitch_connectors/src/connectors/square.rs:488-497 | crates/hyperswitch_connectors/src/connectors/stax.rs:491-500 | crates/hyperswitch_connectors/src/connectors/stripebilling.rs:377-386 | crates/hyperswitch_connectors/src/connectors/thunes.rs:286-295 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:443-452 | crates/hyperswitch_connectors/src/connectors/volt.rs:446-455 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:476-485 | crates/hyperswitch_connectors/src/connectors/worldpayraft.rs:299-308 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:416-425 — These 74 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 74 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 74 times.
D4 · Code Duplication· Members sharing a duplicated core (64 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (64 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs:78— crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs:78-86 | crates/hyperswitch_connectors/src/connectors/affirm.rs:99-107 | crates/hyperswitch_connectors/src/connectors/archipel.rs:103-111 | crates/hyperswitch_connectors/src/connectors/billwerk.rs:96-104 | crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs:179-187 | crates/hyperswitch_connectors/src/connectors/breadpay.rs:103-111 | crates/hyperswitch_connectors/src/connectors/calida.rs:95-103 | crates/hyperswitch_connectors/src/connectors/celero.rs:91-99 | crates/hyperswitch_connectors/src/connectors/checkbook.rs:92-100 | crates/hyperswitch_connectors/src/connectors/citigate.rs:90-98 | crates/hyperswitch_connectors/src/connectors/coingate.rs:94-102 | crates/hyperswitch_connectors/src/connectors/ctp_mastercard.rs:59-67 | crates/hyperswitch_connectors/src/connectors/custombilling.rs:84-92 | crates/hyperswitch_connectors/src/connectors/d24.rs:88-96 | crates/hyperswitch_connectors/src/connectors/datatrans.rs:102-110 | crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs:96-104 | crates/hyperswitch_connectors/src/connectors/elavon.rs:105-113 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:115-123 | crates/hyperswitch_connectors/src/connectors/envoy.rs:203-211 | crates/hyperswitch_connectors/src/connectors/etisalat.rs:91-99 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs:90-98 | crates/hyperswitch_connectors/src/connectors/gigadat.rs:117-125 | crates/hyperswitch_connectors/src/connectors/givepayments.rs:91-99 | crates/hyperswitch_connectors/src/connectors/globalpayments_heartland.rs:86-94 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:102-110 | crates/hyperswitch_connectors/src/connectors/gotyme_sanlam.rs:99-107 | crates/hyperswitch_connectors/src/connectors/hyperpg.rs:89-97 | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs:90-98 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:95-103 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions.rs:91-99 | crates/hyperswitch_connectors/src/connectors/inespay.rs:95-103 | crates/hyperswitch_connectors/src/connectors/interpayments.rs:74-82 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital.rs:113-121 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs:141-149 | crates/hyperswitch_connectors/src/connectors/katapult.rs:90-98 | crates/hyperswitch_connectors/src/connectors/loonio.rs:103-111 | crates/hyperswitch_connectors/src/connectors/merchante.rs:91-99 | crates/hyperswitch_connectors/src/connectors/mpgs.rs:90-98 | crates/hyperswitch_connectors/src/connectors/netcetera.rs:92-100 | crates/hyperswitch_connectors/src/connectors/nexinets.rs:96-104 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:118-126 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:98-106 | crates/hyperswitch_connectors/src/connectors/payconex.rs:90-98 | crates/hyperswitch_connectors/src/connectors/paynearme.rs:91-99 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:211-219 | crates/hyperswitch_connectors/src/connectors/paystack.rs:91-99 | crates/hyperswitch_connectors/src/connectors/paytm.rs:89-97 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:100-108 | crates/hyperswitch_connectors/src/connectors/phonepe.rs:89-97 | crates/hyperswitch_connectors/src/connectors/placetopay.rs:91-99 | crates/hyperswitch_connectors/src/connectors/plaid.rs:94-102 | crates/hyperswitch_connectors/src/connectors/prophetpay.rs:84-92 | crates/hyperswitch_connectors/src/connectors/saferpay.rs:83-91 | crates/hyperswitch_connectors/src/connectors/sift.rs:90-98 | crates/hyperswitch_connectors/src/connectors/signifyd.rs:106-115 | crates/hyperswitch_connectors/src/connectors/stripebilling.rs:169-177 | crates/hyperswitch_connectors/src/connectors/taxjar.rs:89-97 | crates/hyperswitch_connectors/src/connectors/thunes.rs:87-95 | crates/hyperswitch_connectors/src/connectors/trustly.rs:101-109 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:93-121 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:167-175 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:89-97 | crates/hyperswitch_connectors/src/connectors/worldpayraft.rs:91-99 | crates/hyperswitch_connectors/src/connectors/xendit.rs:104-112 — These 64 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 64 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 64 times.
D4 · Code Duplication· Members sharing a duplicated core (57 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (57 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/amazonpay.rs:684— crates/hyperswitch_connectors/src/connectors/amazonpay.rs:684-696 | crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:657-669 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1237-1249 | crates/hyperswitch_connectors/src/connectors/billwerk.rs:749-761 | crates/hyperswitch_connectors/src/connectors/boku.rs:600-612 | crates/hyperswitch_connectors/src/connectors/breadpay.rs:738-750 | crates/hyperswitch_connectors/src/connectors/celero.rs:665-677 | crates/hyperswitch_connectors/src/connectors/checkbook.rs:507-519 | crates/hyperswitch_connectors/src/connectors/citigate.rs:529-541 | crates/hyperswitch_connectors/src/connectors/custombilling.rs:516-528 | crates/hyperswitch_connectors/src/connectors/datatrans.rs:738-750 | crates/hyperswitch_connectors/src/connectors/elavon.rs:525-537 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:557-569 | crates/hyperswitch_connectors/src/connectors/envoy.rs:632-644 | crates/hyperswitch_connectors/src/connectors/etisalat.rs:548-560 | crates/hyperswitch_connectors/src/connectors/finix.rs:948-960 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs:540-552 | crates/hyperswitch_connectors/src/connectors/fiservemea.rs:731-743 | crates/hyperswitch_connectors/src/connectors/flexiti.rs:658-670 | crates/hyperswitch_connectors/src/connectors/getnet.rs:669-681 | crates/hyperswitch_connectors/src/connectors/givepayments.rs:531-543 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:554-566 | crates/hyperswitch_connectors/src/connectors/hipay.rs:692-704 | crates/hyperswitch_connectors/src/connectors/hyperpg.rs:519-531 | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs:529-541 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:529-541 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions.rs:558-570 | crates/hyperswitch_connectors/src/connectors/inespay.rs:557-569 | crates/hyperswitch_connectors/src/connectors/jpmorgan.rs:763-775 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital.rs:571-583 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs:588-600 | crates/hyperswitch_connectors/src/connectors/katapult.rs:530-542 | crates/hyperswitch_connectors/src/connectors/loonio.rs:604-616 | crates/hyperswitch_connectors/src/connectors/merchante.rs:548-560 | crates/hyperswitch_connectors/src/connectors/moneris.rs:748-760 | crates/hyperswitch_connectors/src/connectors/mpgs.rs:527-539 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:1154-1166 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:714-726 | crates/hyperswitch_connectors/src/connectors/payconex.rs:529-541 | crates/hyperswitch_connectors/src/connectors/paynearme.rs:530-542 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:1041-1053 | crates/hyperswitch_connectors/src/connectors/paystack.rs:541-553 | crates/hyperswitch_connectors/src/connectors/paytm.rs:519-531 | crates/hyperswitch_connectors/src/connectors/phonepe.rs:519-531 | crates/hyperswitch_connectors/src/connectors/placetopay.rs:612-624 | crates/hyperswitch_connectors/src/connectors/prophetpay.rs:664-676 | crates/hyperswitch_connectors/src/connectors/razorpay.rs:668-680 | crates/hyperswitch_connectors/src/connectors/sift.rs:527-539 | crates/hyperswitch_connectors/src/connectors/silverflow.rs:742-754 | crates/hyperswitch_connectors/src/connectors/stripebilling.rs:609-621 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:838-850 | crates/hyperswitch_connectors/src/connectors/thunes.rs:516-528 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:673-685 | crates/hyperswitch_connectors/src/connectors/trustly.rs:465-477 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:712-724 | crates/hyperswitch_connectors/src/connectors/worldpayraft.rs:531-543 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:895-907 — These 57 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 57 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 57 times.
D4 · Code Duplication· Members sharing a duplicated core (30 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (30 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/aci.rs:524— crates/hyperswitch_connectors/src/connectors/aci.rs:524-536 | crates/hyperswitch_connectors/src/connectors/adyen.rs:927-939 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:601-613 | crates/hyperswitch_connectors/src/connectors/bambora.rs:237-249 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:488-500 | crates/hyperswitch_connectors/src/connectors/bitpay.rs:232-244 | crates/hyperswitch_connectors/src/connectors/braintree.rs:605-617 | crates/hyperswitch_connectors/src/connectors/cashtocode.rs:274-286 | crates/hyperswitch_connectors/src/connectors/checkout.rs:676-688 | crates/hyperswitch_connectors/src/connectors/cryptopay.rs:269-281 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:270-282 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:787-799 | crates/hyperswitch_connectors/src/connectors/globepay.rs:250-262 | crates/hyperswitch_connectors/src/connectors/nexinets.rs:246-258 | crates/hyperswitch_connectors/src/connectors/noon.rs:321-333 | crates/hyperswitch_connectors/src/connectors/opayo.rs:232-244 | crates/hyperswitch_connectors/src/connectors/payme.rs:568-580 | crates/hyperswitch_connectors/src/connectors/payu.rs:578-590 | crates/hyperswitch_connectors/src/connectors/plaid.rs:221-233 | crates/hyperswitch_connectors/src/connectors/powertranz.rs:247-259 | crates/hyperswitch_connectors/src/connectors/square.rs:410-422 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1112-1124 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:711-723 | crates/hyperswitch_connectors/src/connectors/tsys.rs:177-189 | crates/hyperswitch_connectors/src/connectors/volt.rs:368-380 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:225-237 | crates/hyperswitch_connectors/src/connectors/worldline.rs:502-514 | crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs:465-477 | crates/hyperswitch_connectors/src/connectors/xendit.rs:282-294 | crates/hyperswitch_connectors/src/connectors/zen.rs:261-273 — These 30 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 30 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 30 times.
D4 · Code Duplication· Members sharing a duplicated core (20 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (20 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/aci.rs:336— crates/hyperswitch_connectors/src/connectors/aci.rs:336-348 | crates/hyperswitch_connectors/src/connectors/adyen.rs:665-677 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:419-431 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:692-704 | crates/hyperswitch_connectors/src/connectors/braintree.rs:465-477 | crates/hyperswitch_connectors/src/connectors/checkout.rs:494-506 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:979-991 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:694-706 | crates/hyperswitch_connectors/src/connectors/nexinets.rs:412-424 | crates/hyperswitch_connectors/src/connectors/noon.rs:480-492 | crates/hyperswitch_connectors/src/connectors/opayo.rs:377-389 | crates/hyperswitch_connectors/src/connectors/payme.rs:748-760 | crates/hyperswitch_connectors/src/connectors/payu.rs:480-492 | crates/hyperswitch_connectors/src/connectors/powertranz.rs:427-439 | crates/hyperswitch_connectors/src/connectors/stripe.rs:703-715 | crates/hyperswitch_connectors/src/connectors/tsys.rs:345-357 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:633-645 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:364-376 | crates/hyperswitch_connectors/src/connectors/worldline.rs:399-411 | crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs:359-371 — These 20 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 20 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 20 times.
D4 · Code Duplication· Members sharing a duplicated core (19 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (19 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:783— crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:783-792 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:941-950 | crates/hyperswitch_connectors/src/connectors/braintree.rs:869-878 | crates/hyperswitch_connectors/src/connectors/checkout.rs:846-855 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:521-530 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:882-891 | crates/hyperswitch_connectors/src/connectors/nexinets.rs:581-590 | crates/hyperswitch_connectors/src/connectors/noon.rs:721-730 | crates/hyperswitch_connectors/src/connectors/opayo.rs:465-474 | crates/hyperswitch_connectors/src/connectors/payme.rs:942-951 | crates/hyperswitch_connectors/src/connectors/payu.rs:673-682 | crates/hyperswitch_connectors/src/connectors/powertranz.rs:586-595 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1913-1922 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:816-825 | crates/hyperswitch_connectors/src/connectors/tsys.rs:511-520 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:451-460 | crates/hyperswitch_connectors/src/connectors/worldline.rs:587-596 | crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs:554-563 | crates/hyperswitch_connectors/src/connectors/zen.rs:448-457 — These 19 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 19 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 19 times.
D4 · Code Duplication· Members sharing a duplicated core (18 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (18 members, 50+ identical tokens) crates/router/src/core/fraud_check/flows/fulfillment_flow.rs:40— crates/router/src/core/fraud_check/flows/fulfillment_flow.rs:40-151 | crates/router/src/core/mandate/utils.rs:24-104 | crates/router/src/core/relay/utils.rs:25-163 | crates/router/src/core/relay/utils.rs:170-308 | crates/router/src/core/relay/utils.rs:315-436 | crates/router/src/core/relay/utils.rs:443-573 | crates/router/src/core/utils.rs:252-451 | crates/router/src/core/utils.rs:464-637 | crates/router/src/core/utils.rs:673-863 | crates/router/src/core/utils.rs:1298-1405 | crates/router/src/core/utils.rs:1416-1520 | crates/router/src/core/utils.rs:1534-1641 | crates/router/src/core/utils.rs:1732-1840 | crates/router/src/core/utils.rs:1858-1980 | crates/router/src/core/utils.rs:1990-2098 | crates/router/src/core/utils.rs:2107-2206 | crates/router/src/core/webhooks/utils.rs:78-157 | crates/router/src/types/api/verify_connector.rs:93-161 — These 18 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 18 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 18 times.
D4 · Code Duplication· Members sharing a duplicated core (12 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (12 members, 50+ identical tokens) crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:127— crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:127-163 | crates/hyperswitch_connectors/src/connectors/braintree.rs:155-216 | crates/hyperswitch_connectors/src/connectors/mifinity.rs:150-214 | crates/hyperswitch_connectors/src/connectors/noon.rs:163-213 | crates/hyperswitch_connectors/src/connectors/payme.rs:137-174 | crates/hyperswitch_connectors/src/connectors/rapyd.rs:131-161 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:133-170 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:158-224 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:160-188 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1571-1603 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1608-1645 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:170-227 — These 12 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 12 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 12 times.
Duplicated block (345 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:3721— crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:3721-4065 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:4096-4440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (145 lines × 2) crates/router/src/services/kafka/payment_intent.rs:199— crates/router/src/services/kafka/payment_intent.rs:199-343 | crates/router/src/services/kafka/payment_intent_event.rs:213-357 — before extracting anything, compare `crates/router/src/services/kafka/payment_intent.rs` and `crates/router/src/services/kafka/payment_intent_event.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 185 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (139–140 lines × 2) crates/router/src/core/unified_connector_service.rs:4033— crates/router/src/core/unified_connector_service.rs:4033-4172 | crates/router/src/core/unified_connector_service.rs:4278-4416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (119 lines × 2) crates/analytics/src/sqlx.rs:265— crates/analytics/src/sqlx.rs:265-383 | crates/analytics/src/sqlx.rs:438-556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (118 lines × 2) crates/kgraph_utils/src/mca.rs:280— crates/kgraph_utils/src/mca.rs:280-397 | crates/kgraph_utils/src/mca.rs:466-583 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (93 lines × 2) crates/router/src/services/kafka/payment_attempt.rs:233— crates/router/src/services/kafka/payment_attempt.rs:233-325 | crates/router/src/services/kafka/payment_attempt_event.rs:235-327 — before extracting anything, compare `crates/router/src/services/kafka/payment_attempt.rs` and `crates/router/src/services/kafka/payment_attempt_event.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 230 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (89 lines × 2) crates/router/src/types/api/connector_mapping.rs:192— crates/router/src/types/api/connector_mapping.rs:192-280 | crates/router/src/types/api/feature_matrix.rs:104-192 — before extracting anything, compare `crates/router/src/types/api/connector_mapping.rs` and `crates/router/src/types/api/feature_matrix.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 401 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (83 lines × 2) crates/diesel_models/src/payout_attempt.rs:209— crates/diesel_models/src/payout_attempt.rs:209-291 | crates/hyperswitch_domain_models/src/payouts/payout_attempt.rs:253-335 — 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 (80 lines × 2) crates/router/src/services/kafka/refund.rs:132— crates/router/src/services/kafka/refund.rs:132-211 | crates/router/src/services/kafka/refund_event.rs:134-213 — before extracting anything, compare `crates/router/src/services/kafka/refund.rs` and `crates/router/src/services/kafka/refund_event.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 161 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (79 lines × 2) crates/analytics/src/search.rs:105— crates/analytics/src/search.rs:105-183 | crates/analytics/src/search.rs:302-380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (76 lines × 2) crates/hyperswitch_connectors/src/utils.rs:3596— crates/hyperswitch_connectors/src/utils.rs:3596-3671 | crates/router/src/connector/utils.rs:1940-2015 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/connector/utils.rs` as WHOLE FILES: this scan already matched 73 separate duplicated blocks between them, totalling at least 713 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 (74 lines × 2) crates/router/src/core/user.rs:1396— crates/router/src/core/user.rs:1396-1469 | crates/router/src/core/user.rs:1549-1622 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (73 lines × 2) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4685— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4685-4757 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4823-4895 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (72 lines × 2) crates/router/src/core/payments.rs:299— crates/router/src/core/payments.rs:299-370 | crates/router/src/core/payments.rs:410-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (70 lines × 2) crates/router/src/core/utils.rs:2625— crates/router/src/core/utils.rs:2625-2694 | crates/router/src/core/utils.rs:2708-2777 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (64 lines × 2) crates/diesel_models/src/payouts.rs:185— crates/diesel_models/src/payouts.rs:185-248 | crates/hyperswitch_domain_models/src/payouts/payouts.rs:232-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 (62–63 lines × 2) crates/router/src/core/split_payments.rs:298— crates/router/src/core/split_payments.rs:298-360 | crates/router/src/core/split_payments.rs:390-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (62 lines × 3) crates/router/src/core/payments/operations/payment_create.rs:837— crates/router/src/core/payments/operations/payment_create.rs:837-898 | crates/router/src/core/payments/operations/payment_update.rs:691-752 | crates/router/src/core/payments/operations/tax_calculation.rs:255-316 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_create.rs` and `crates/router/src/core/payments/operations/payment_update.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 181 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (62 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2824— crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:2824-2885 | crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs:3319-3380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (61–62 lines × 2) crates/router/src/core/admin.rs:2392— crates/router/src/core/admin.rs:2392-2453 | crates/router/src/core/admin.rs:2593-2653 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (59 lines × 5) crates/hyperswitch_connectors/src/connectors/cybersource.rs:491— crates/hyperswitch_connectors/src/connectors/cybersource.rs:491-549 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1274-1332 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1429-1487 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1579-1637 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1737-1795 — 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 (53–56 lines × 2) crates/router/src/core/payments/helpers.rs:4481— crates/router/src/core/payments/helpers.rs:4481-4536 | crates/router/src/core/payments/helpers.rs:4547-4599 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (55 lines × 2) crates/router/src/core/unified_connector_service.rs:3063— crates/router/src/core/unified_connector_service.rs:3063-3117 | crates/router/src/core/unified_connector_service.rs:3178-3232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (54 lines × 2) crates/router/src/types/api/connector_mapping.rs:288— crates/router/src/types/api/connector_mapping.rs:288-341 | crates/router/src/types/api/feature_matrix.rs:200-253 — before extracting anything, compare `crates/router/src/types/api/connector_mapping.rs` and `crates/router/src/types/api/feature_matrix.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 401 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) crates/hyperswitch_domain_models/src/router_data.rs:1308— crates/hyperswitch_domain_models/src/router_data.rs:1308-1360 | crates/hyperswitch_domain_models/src/router_data.rs:2274-2326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (50–52 lines × 4) crates/router/src/services/authentication.rs:4383— crates/router/src/services/authentication.rs:4383-4434 | crates/router/src/services/authentication.rs:4655-4704 | crates/router/src/services/authentication.rs:4992-5042 | crates/router/src/services/authentication.rs:5193-5244 — 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 (50–51 lines × 2) crates/router/src/core/payments/operations/payment_response.rs:1366— crates/router/src/core/payments/operations/payment_response.rs:1366-1416 | crates/router/src/core/payments/operations/payment_response.rs:2468-2517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (49 lines × 2) crates/router/src/core/webhooks/incoming_v2.rs:703— crates/router/src/core/webhooks/incoming_v2.rs:703-751 | crates/router/src/core/webhooks/utils.rs:171-219 — 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 (46–48 lines × 2) crates/router/src/core/payments.rs:5321— crates/router/src/core/payments.rs:5321-5368 | crates/router/src/core/payments.rs:5468-5513 — both copies are in the same file, so extract the block into 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–46 lines × 2) crates/router/src/utils.rs:862— crates/router/src/utils.rs:862-907 | crates/router/src/utils.rs:1003-1047 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (44–45 lines × 2) crates/storage_impl/src/authentication.rs:437— crates/storage_impl/src/authentication.rs:437-481 | crates/storage_impl/src/authentication.rs:538-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38–44 lines × 3) crates/hyperswitch_domain_models/src/disputes.rs:34— crates/hyperswitch_domain_models/src/disputes.rs:34-77 | crates/hyperswitch_domain_models/src/disputes.rs:110-147 | crates/hyperswitch_domain_models/src/refunds.rs:53-91 — 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 (42–44 lines × 2) crates/diesel_models/src/refund.rs:461— crates/diesel_models/src/refund.rs:461-504 | crates/diesel_models/src/refund.rs:587-628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (44 lines × 2) crates/router/src/core/payments/transformers.rs:535— crates/router/src/core/payments/transformers.rs:535-578 | crates/router/src/core/payments/transformers.rs:1883-1926 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (39–43 lines × 2) crates/router/src/core/payments.rs:3365— crates/router/src/core/payments.rs:3365-3403 | crates/router/src/core/payments.rs:3415-3457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (42–43 lines × 2) crates/router/src/core/payments/tokenization.rs:575— crates/router/src/core/payments/tokenization.rs:575-616 | crates/router/src/core/payments/tokenization.rs:701-743 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (42 lines × 5) crates/hyperswitch_domain_models/src/router_data.rs:1278— crates/hyperswitch_domain_models/src/router_data.rs:1278-1319 | crates/hyperswitch_domain_models/src/router_data.rs:1614-1655 | crates/hyperswitch_domain_models/src/router_data.rs:1945-1986 | crates/hyperswitch_domain_models/src/router_data.rs:2244-2285 | crates/hyperswitch_domain_models/src/router_data.rs:2505-2546 — 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 (42 lines × 4) crates/hyperswitch_connectors/src/connectors/klarna.rs:591— crates/hyperswitch_connectors/src/connectors/klarna.rs:591-632 | crates/hyperswitch_connectors/src/connectors/klarna.rs:732-773 | crates/hyperswitch_connectors/src/connectors/klarna.rs:882-923 | crates/hyperswitch_connectors/src/connectors/klarna.rs:1023-1064 — 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 (36–42 lines × 2) crates/router/src/core/payment_methods/migration.rs:244— crates/router/src/core/payment_methods/migration.rs:244-285 | crates/router/src/core/payment_methods/migration.rs:342-377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (41 lines × 4) crates/router/src/core/utils.rs:1418— crates/router/src/core/utils.rs:1418-1458 | crates/router/src/core/utils.rs:1535-1575 | crates/router/src/core/utils.rs:1735-1775 | crates/router/src/core/utils.rs:1993-2033 — 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 (41 lines × 3) crates/router/src/types/transformers.rs:1229— crates/router/src/types/transformers.rs:1229-1269 | crates/router/src/types/transformers.rs:1286-1326 | crates/router/src/types/transformers.rs:1420-1460 — all 3 copies are in the same file, so extract the block into one function there and call 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 (39–41 lines × 2) crates/router/src/core/payments/flows/complete_authorize_flow.rs:381— crates/router/src/core/payments/flows/complete_authorize_flow.rs:381-421 | crates/router/src/core/payments/flows/complete_authorize_flow.rs:471-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (40–41 lines × 2) crates/router/src/core/unified_connector_service.rs:3021— crates/router/src/core/unified_connector_service.rs:3021-3061 | crates/router/src/core/unified_connector_service.rs:3138-3177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (40 lines × 3) crates/hyperswitch_connectors/src/connectors/cybersource.rs:347— crates/hyperswitch_connectors/src/connectors/cybersource.rs:347-386 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:179-218 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:313-352 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cybersource.rs` and `crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (39–40 lines × 2) crates/router/src/core/payment_link.rs:134— crates/router/src/core/payment_link.rs:134-172 | crates/router/src/core/payment_link.rs:933-972 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38–39 lines × 2) crates/router/src/core/fraud_check/operation/fraud_check_post.rs:125— crates/router/src/core/fraud_check/operation/fraud_check_post.rs:125-162 | crates/router/src/core/fraud_check/operation/fraud_check_pre.rs:113-151 — before extracting anything, compare `crates/router/src/core/fraud_check/operation/fraud_check_post.rs` and `crates/router/src/core/fraud_check/operation/fraud_check_pre.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (38 lines × 3) crates/storage_impl/src/kv_router_store.rs:277— crates/storage_impl/src/kv_router_store.rs:277-314 | crates/storage_impl/src/kv_router_store.rs:356-393 | crates/storage_impl/src/kv_router_store.rs:425-462 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (37–38 lines × 2) crates/router/src/core/user_role/role.rs:597— crates/router/src/core/user_role/role.rs:597-633 | crates/router/src/core/user_role/role.rs:774-811 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (35–37 lines × 7) crates/router/src/services/authentication.rs:4262— crates/router/src/services/authentication.rs:4262-4298 | crates/router/src/services/authentication.rs:4583-4618 | crates/router/src/services/authentication.rs:4825-4860 | crates/router/src/services/authentication.rs:4923-4959 | crates/router/src/services/authentication.rs:5121-5156 | crates/router/src/services/authentication.rs:5323-5357 | crates/router/src/services/authentication.rs:5566-5601 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (37 lines × 3) crates/router/src/core/payments.rs:1286— crates/router/src/core/payments.rs:1286-1322 | crates/router/src/core/payments.rs:1531-1567 | crates/router/src/core/payments.rs:1963-1999 — all 3 copies are in the same file, so extract the block into one function there and call 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–36 lines × 2) crates/router/src/workflows/dispute_list.rs:44— crates/router/src/workflows/dispute_list.rs:44-79 | crates/router/src/workflows/process_dispute.rs:41-75 — before extracting anything, compare `crates/router/src/workflows/dispute_list.rs` and `crates/router/src/workflows/process_dispute.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (35 lines × 3) crates/analytics/src/payments/distribution/payment_error_message.rs:106— crates/analytics/src/payments/distribution/payment_error_message.rs:106-140 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs:107-141 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs:99-133 — before extracting anything, compare `crates/analytics/src/payments/distribution/payment_error_message.rs` and `crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 115 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 (30–35 lines × 2) crates/hyperswitch_connectors/src/connectors/santander.rs:290— crates/hyperswitch_connectors/src/connectors/santander.rs:290-319 | crates/hyperswitch_connectors/src/connectors/santander.rs:1731-1765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (33–35 lines × 2) crates/hyperswitch_connectors/src/utils.rs:7809— crates/hyperswitch_connectors/src/utils.rs:7809-7841 | crates/router/src/types.rs:1487-1521 — before extracting anything, compare `crates/hyperswitch_connectors/src/utils.rs` and `crates/router/src/types.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (34 lines × 13) crates/hyperswitch_connectors/src/connectors/stripe.rs:378— crates/hyperswitch_connectors/src/connectors/stripe.rs:378-411 | crates/hyperswitch_connectors/src/connectors/stripe.rs:568-601 | crates/hyperswitch_connectors/src/connectors/stripe.rs:759-792 | crates/hyperswitch_connectors/src/connectors/stripe.rs:980-1013 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1164-1197 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1342-1375 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1591-1624 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1764-1797 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1964-1997 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2127-2160 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2302-2335 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2434-2467 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2671-2704 — 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 (34 lines × 3) crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1068— crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1068-1101 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1138-1171 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:688-721 — `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 46 separate duplicated blocks between them, totalling at least 601 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 (31–34 lines × 2) crates/router/src/services/authentication.rs:3191— crates/router/src/services/authentication.rs:3191-3224 | crates/router/src/services/authentication.rs:3933-3963 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (33 lines × 3) crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1748— crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1748-1780 | crates/router/src/utils/user/dashboard_metadata.rs:475-507 | crates/router/src/utils/user/dashboard_metadata.rs:543-575 — before extracting anything, compare `crates/hyperswitch_domain_models/src/payments/payment_intent.rs` and `crates/router/src/utils/user/dashboard_metadata.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 94 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 (31–33 lines × 2) crates/router/src/core/payments/operations/payment_confirm.rs:1705— crates/router/src/core/payments/operations/payment_confirm.rs:1705-1737 | crates/router/src/core/payments/operations/payment_confirm_external_vault_proxy.rs:1089-1119 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_confirm.rs` and `crates/router/src/core/payments/operations/payment_confirm_external_vault_proxy.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (30–33 lines × 2) crates/router/src/db/refund.rs:339— crates/router/src/db/refund.rs:339-371 | crates/router/src/db/refund.rs:1121-1150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (32 lines × 6) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:612— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:612-643 | crates/router/src/core/payments/operations/payment_response.rs:4323-4354 | crates/router/src/core/payments/operations/payment_response.rs:4394-4425 | crates/router/src/core/payments/operations/payment_response.rs:4869-4900 | crates/router/src/core/payments/operations/payment_response.rs:4942-4973 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:494-525 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/proxy_payments_intent.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 289 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (30–31 lines × 5) crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1746— crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1746-1775 | crates/router/src/services/kafka/refund.rs:140-170 | crates/router/src/services/kafka/refund_event.rs:142-172 | crates/router/src/utils/user/dashboard_metadata.rs:473-502 | crates/router/src/utils/user/dashboard_metadata.rs:541-570 — before extracting anything, compare `crates/hyperswitch_domain_models/src/payments/payment_intent.rs` and `crates/router/src/utils/user/dashboard_metadata.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 94 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 (31 lines × 4) crates/router/src/core/fraud_check/flows/checkout_flow.rs:183— crates/router/src/core/fraud_check/flows/checkout_flow.rs:183-213 | crates/router/src/core/fraud_check/flows/record_return.rs:126-156 | crates/router/src/core/fraud_check/flows/sale_flow.rs:178-208 | crates/router/src/core/fraud_check/flows/transaction_flow.rs:145-175 — before extracting anything, compare `crates/router/src/core/fraud_check/flows/checkout_flow.rs` and `crates/router/src/core/fraud_check/flows/sale_flow.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (29–31 lines × 3) crates/router/src/core/payment_methods/cards.rs:807— crates/router/src/core/payment_methods/cards.rs:807-837 | crates/router/src/core/payment_methods/cards.rs:915-945 | crates/router/src/core/payment_methods/cards.rs:1024-1052 — all 3 copies are in the same file, so extract the block into one function there and call 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 (30–31 lines × 2) crates/analytics/src/sqlx.rs:209— crates/analytics/src/sqlx.rs:209-238 | crates/analytics/src/sqlx.rs:394-424 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29–31 lines × 2) crates/router/src/core/payments.rs:2279— crates/router/src/core/payments.rs:2279-2309 | crates/router/src/core/payments.rs:2366-2394 — both copies are in the same file, so extract the block into 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 × 4) crates/hyperswitch_domain_models/src/lib.rs:1010— crates/hyperswitch_domain_models/src/lib.rs:1010-1039 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:1751-1780 | crates/router/src/utils/user/dashboard_metadata.rs:478-507 | crates/router/src/utils/user/dashboard_metadata.rs:546-575 — before extracting anything, compare `crates/hyperswitch_domain_models/src/lib.rs` and `crates/hyperswitch_domain_models/src/payments/payment_intent.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (28–30 lines × 2) crates/router/src/core/refunds_v2.rs:866— crates/router/src/core/refunds_v2.rs:866-893 | crates/router/src/core/refunds_v2.rs:964-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 (27–30 lines × 2) crates/router/src/db/refund.rs:299— crates/router/src/db/refund.rs:299-328 | crates/router/src/db/refund.rs:1041-1067 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29 lines × 8) crates/analytics/src/sdk_events/metrics/average_payment_time.rs:81— crates/analytics/src/sdk_events/metrics/average_payment_time.rs:81-109 | crates/analytics/src/sdk_events/metrics/load_time.rs:81-109 | crates/analytics/src/sdk_events/metrics/payment_attempts.rs:76-104 | crates/analytics/src/sdk_events/metrics/payment_data_filled_count.rs:76-104 | crates/analytics/src/sdk_events/metrics/payment_method_selected_count.rs:76-104 | crates/analytics/src/sdk_events/metrics/payment_methods_call_count.rs:84-112 | crates/analytics/src/sdk_events/metrics/sdk_initiated_count.rs:76-104 | crates/analytics/src/sdk_events/metrics/sdk_rendered_count.rs:76-104 — before extracting anything, compare `crates/analytics/src/sdk_events/metrics/average_payment_time.rs` and `crates/analytics/src/sdk_events/metrics/load_time.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (29 lines × 5) crates/hyperswitch_domain_models/src/lib.rs:1166— crates/hyperswitch_domain_models/src/lib.rs:1166-1194 | crates/hyperswitch_domain_models/src/payments/payment_intent.rs:2242-2270 | crates/hyperswitch_interfaces/src/conversion_impls.rs:278-306 | crates/hyperswitch_interfaces/src/conversion_impls.rs:1176-1204 | crates/storage_impl/src/payments/payment_attempt.rs:2401-2429 — before extracting anything, compare `crates/hyperswitch_domain_models/src/lib.rs` and `crates/hyperswitch_domain_models/src/payments/payment_intent.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (27–29 lines × 2) crates/router/src/core/payment_methods/utils.rs:636— crates/router/src/core/payment_methods/utils.rs:636-662 | crates/router/src/core/payment_methods/utils.rs:664-692 — both copies are in the same file, so extract the block into 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–28 lines × 5) crates/router/src/services/api.rs:953— crates/router/src/services/api.rs:953-980 | crates/router/src/services/api.rs:1005-1032 | crates/router/src/services/api.rs:1117-1144 | crates/router/src/services/api.rs:1169-1196 | crates/router/src/services/api.rs:1213-1239 — 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 (27 lines × 4) crates/hyperswitch_domain_models/src/payment_method_data.rs:603— crates/hyperswitch_domain_models/src/payment_method_data.rs:603-629 | crates/hyperswitch_domain_models/src/payment_method_data.rs:693-719 | crates/hyperswitch_domain_models/src/payment_method_data.rs:797-823 | crates/hyperswitch_domain_models/src/payment_method_data.rs:903-929 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (26–27 lines × 3) crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:90— crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:90-115 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs:92-117 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs:87-113 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs` and `crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs` 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.
Duplicated block (23–27 lines × 3) crates/router/src/core/disputes.rs:366— crates/router/src/core/disputes.rs:366-388 | crates/router/src/core/payments/filters.rs:55-81 | crates/router/src/core/refunds.rs:1991-2013 — before extracting anything, compare `crates/router/src/core/disputes.rs` and `crates/router/src/core/refunds.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–27 lines × 3) crates/router/src/types/storage/dispute.rs:83— crates/router/src/types/storage/dispute.rs:83-109 | crates/router/src/types/storage/dispute.rs:154-177 | crates/router/src/types/storage/dispute.rs:222-245 — all 3 copies are in the same file, so extract the block into one function there and call 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 (23–27 lines × 2) crates/router/src/core/user/theme.rs:205— crates/router/src/core/user/theme.rs:205-231 | crates/router/src/core/user/theme.rs:399-421 — both copies are in the same file, so extract the block into 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 × 5) crates/api_models/src/cards_info.rs:368— crates/api_models/src/cards_info.rs:368-393 | crates/router/src/core/cards_info.rs:358-383 | crates/router/src/types/transformers.rs:902-927 | crates/router/src/types/transformers.rs:2870-2895 | crates/router/src/types/transformers.rs:2917-2942 — 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.
Duplicated block (25–26 lines × 3) crates/diesel_models/src/authentication.rs:533— crates/diesel_models/src/authentication.rs:533-557 | crates/diesel_models/src/payment_attempt.rs:2508-2533 | crates/diesel_models/src/payment_attempt.rs:2724-2748 — 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 (25 lines × 6) crates/analytics/src/sdk_events/metrics/payment_attempts.rs:41— crates/analytics/src/sdk_events/metrics/payment_attempts.rs:41-65 | crates/analytics/src/sdk_events/metrics/payment_data_filled_count.rs:41-65 | crates/analytics/src/sdk_events/metrics/payment_method_selected_count.rs:41-65 | crates/analytics/src/sdk_events/metrics/payment_methods_call_count.rs:41-65 | crates/analytics/src/sdk_events/metrics/sdk_initiated_count.rs:41-65 | crates/analytics/src/sdk_events/metrics/sdk_rendered_count.rs:41-65 — before extracting anything, compare `crates/analytics/src/sdk_events/metrics/payment_attempts.rs` and `crates/analytics/src/sdk_events/metrics/payment_data_filled_count.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 lines × 5) crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:89— crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:89-113 | crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs:85-109 | crates/analytics/src/payments/metrics/debit_routing.rs:77-101 | crates/analytics/src/payments/metrics/payment_processed_amount.rs:71-95 | crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs:77-101 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs` and `crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 4) crates/router/src/core/relay.rs:234— crates/router/src/core/relay.rs:234-258 | crates/router/src/core/relay.rs:369-393 | crates/router/src/core/relay.rs:506-530 | crates/router/src/core/relay.rs:640-664 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (25 lines × 3) crates/router/src/core/payment_methods/access_token.rs:159— crates/router/src/core/payment_methods/access_token.rs:159-183 | crates/router/src/core/payments/access_token.rs:492-516 | crates/router/src/core/payouts/access_token.rs:185-209 — `crates/router/src/core/payment_methods/access_token.rs` and `crates/router/src/core/payouts/access_token.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 120 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 (23–25 lines × 2) crates/router/src/core/payment_methods/cards.rs:1300— crates/router/src/core/payment_methods/cards.rs:1300-1322 | crates/router/src/core/payment_methods/cards.rs:1390-1414 — both copies are in the same file, so extract the block into 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 × 11) crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:81— crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:81-104 | crates/analytics/src/auth_events/metrics/authentication_count.rs:68-91 | crates/analytics/src/auth_events/metrics/authentication_exemption_approved_count.rs:71-94 | crates/analytics/src/auth_events/metrics/authentication_exemption_requested_count.rs:72-95 | crates/analytics/src/auth_events/metrics/authentication_funnel.rs:78-101 | crates/analytics/src/auth_events/metrics/authentication_success_count.rs:72-95 | crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs:82-105 | crates/analytics/src/auth_events/metrics/challenge_flow_count.rs:75-97 | crates/analytics/src/auth_events/metrics/challenge_success_count.rs:79-102 | crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs:75-98 | crates/analytics/src/auth_events/metrics/frictionless_success_count.rs:79-102 — before extracting anything, compare `crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs` and `crates/analytics/src/auth_events/metrics/authentication_count.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (23–24 lines × 7) crates/router/src/core/fraud_check/flows/fulfillment_flow.rs:129— crates/router/src/core/fraud_check/flows/fulfillment_flow.rs:129-151 | crates/router/src/core/utils.rs:840-863 | crates/router/src/core/utils.rs:1383-1405 | crates/router/src/core/utils.rs:1498-1520 | crates/router/src/core/utils.rs:1818-1840 | crates/router/src/core/utils.rs:1958-1980 | crates/router/src/core/utils.rs:2076-2098 — before extracting anything, compare `crates/router/src/core/fraud_check/flows/fulfillment_flow.rs` and `crates/router/src/core/utils.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 99 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 (24 lines × 5) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:276— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:276-299 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:299-322 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:246-269 | crates/hyperswitch_connectors/src/connectors/cybersourcedecisionmanager.rs:308-331 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:212-235 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–24 lines × 5) crates/storage_impl/src/merchant_account.rs:947— crates/storage_impl/src/merchant_account.rs:947-969 | crates/storage_impl/src/merchant_account.rs:980-1003 | crates/storage_impl/src/merchant_account.rs:1013-1036 | crates/storage_impl/src/merchant_account.rs:1045-1068 | crates/storage_impl/src/merchant_account.rs:1081-1104 — 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 (24 lines × 4) crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs:77— crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs:77-100 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs:71-94 | crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs:73-96 | crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs:71-94 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs` and `crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19–24 lines × 3) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2373— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:2373-2396 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:3374-3397 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:2443-2461 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 48 separate duplicated blocks between them, totalling at least 647 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 (21–24 lines × 2) crates/router/src/db/reverse_lookup.rs:125— crates/router/src/db/reverse_lookup.rs:125-148 | crates/storage_impl/src/lookup.rs:99-119 — 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 (23 lines × 12) REDACTED:1239— REDACTED:1239-1261 | REDACTED:1378-1400 | REDACTED:1444-1466 | REDACTED:1509-1531 | REDACTED:1574-1596 | REDACTED:1638-1660 | REDACTED:1703-1725 | REDACTED:1763-1785 | REDACTED:1826-1848 | REDACTED:1889-1911 | REDACTED:1954-1976 | REDACTED:2081-2103 — 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.
Duplicated block (21–23 lines × 11) crates/router/src/services/authentication.rs:4272— crates/router/src/services/authentication.rs:4272-4293 | crates/router/src/services/authentication.rs:4408-4429 | crates/router/src/services/authentication.rs:4593-4614 | crates/router/src/services/authentication.rs:4679-4700 | crates/router/src/services/authentication.rs:4835-4856 | crates/router/src/services/authentication.rs:4933-4955 | crates/router/src/services/authentication.rs:5017-5038 | crates/router/src/services/authentication.rs:5131-5152 | crates/router/src/services/authentication.rs:5219-5240 | crates/router/src/services/authentication.rs:5333-5353 | crates/router/src/services/authentication.rs:5576-5597 — all 11 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (22–23 lines × 8) crates/analytics/src/payments/metrics/avg_ticket_size.rs:88— crates/analytics/src/payments/metrics/avg_ticket_size.rs:88-110 | crates/analytics/src/payments/metrics/debit_routing.rs:94-116 | crates/analytics/src/payments/metrics/payment_processed_amount.rs:88-110 | crates/analytics/src/payments/metrics/payment_success_count.rs:82-103 | crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs:89-111 | crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs:94-116 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs:106-128 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs:83-104 — before extracting anything, compare `crates/analytics/src/payments/metrics/avg_ticket_size.rs` and `crates/analytics/src/payments/metrics/debit_routing.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–23 lines × 4) crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs:85— crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs:85-104 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs:84-105 | crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs:124-146 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:80-99 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs` and `crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–23 lines × 4) crates/router/src/core/relay/utils.rs:71— crates/router/src/core/relay/utils.rs:71-92 | crates/router/src/core/relay/utils.rs:216-237 | crates/router/src/core/relay/utils.rs:357-379 | crates/router/src/core/relay/utils.rs:489-510 — 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 (21–23 lines × 2) crates/router/src/core/revenue_recovery/types.rs:934— crates/router/src/core/revenue_recovery/types.rs:934-954 | crates/router/src/core/revenue_recovery/types.rs:1233-1255 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–22 lines × 9) crates/router/src/core/payments/operations/payment_cancel.rs:217— crates/router/src/core/payments/operations/payment_cancel.rs:217-238 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:199-220 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:190-211 | crates/router/src/core/payments/operations/payment_capture.rs:272-293 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:184-204 | crates/router/src/core/payments/operations/payment_update_metadata.rs:190-210 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:205-226 | crates/router/src/core/payments/operations/payments_incremental_authorization.rs:184-205 | crates/router/src/core/payments/operations/tax_calculation.rs:200-220 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 6) crates/router/src/types/storage/refund.rs:135— crates/router/src/types/storage/refund.rs:135-156 | crates/router/src/types/storage/refund.rs:220-241 | crates/router/src/types/storage/refund.rs:303-324 | crates/router/src/types/storage/refund.rs:374-395 | crates/router/src/types/storage/refund.rs:538-559 | crates/router/src/types/storage/refund.rs:607-628 — 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 (20–22 lines × 5) crates/router/src/services/authentication.rs:4413— crates/router/src/services/authentication.rs:4413-4434 | crates/router/src/services/authentication.rs:4684-4704 | crates/router/src/services/authentication.rs:5022-5042 | crates/router/src/services/authentication.rs:5224-5244 | crates/router/src/services/authentication.rs:5416-5435 — 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 (22 lines × 4) crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:606— crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:606-627 | crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:683-704 | crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:760-781 | crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs:837-858 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17–22 lines × 3) crates/hyperswitch_domain_models/src/router_data.rs:1727— crates/hyperswitch_domain_models/src/router_data.rs:1727-1745 | crates/hyperswitch_domain_models/src/router_data.rs:2350-2366 | crates/hyperswitch_domain_models/src/router_data.rs:2607-2628 — all 3 copies are in the same file, so extract the block into one function there and call 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 (19–22 lines × 3) crates/router/src/core/payment_methods/access_token.rs:70— crates/router/src/core/payment_methods/access_token.rs:70-88 | crates/router/src/core/payments/access_token.rs:212-232 | crates/router/src/core/payouts/access_token.rs:90-111 — `crates/router/src/core/payment_methods/access_token.rs` and `crates/router/src/core/payouts/access_token.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 120 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 (21 lines × 20) crates/diesel_models/src/payment_attempt.rs:2657— crates/diesel_models/src/payment_attempt.rs:2657-2677 | crates/diesel_models/src/payment_attempt.rs:2872-2892 | crates/diesel_models/src/payment_attempt.rs:2958-2978 | crates/diesel_models/src/payment_attempt.rs:3044-3064 | crates/diesel_models/src/payment_attempt.rs:3214-3234 | crates/diesel_models/src/payment_attempt.rs:3297-3317 | crates/diesel_models/src/payment_attempt.rs:3531-3551 | crates/diesel_models/src/payment_attempt.rs:3610-3630 | crates/diesel_models/src/payment_attempt.rs:3703-3723 | crates/diesel_models/src/payment_attempt.rs:3802-3822 | crates/diesel_models/src/payment_attempt.rs:3898-3918 | crates/diesel_models/src/payment_attempt.rs:3983-4003 | crates/diesel_models/src/payment_attempt.rs:4068-4088 | crates/diesel_models/src/payment_attempt.rs:4164-4184 | crates/diesel_models/src/payment_attempt.rs:4247-4267 | crates/diesel_models/src/payment_attempt.rs:4335-4355 | crates/diesel_models/src/payment_attempt.rs:4433-4453 | crates/diesel_models/src/payment_attempt.rs:4517-4537 | crates/diesel_models/src/payment_attempt.rs:4608-4628 | crates/diesel_models/src/payment_attempt.rs:4689-4709 — 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.
Duplicated block (21 lines × 11) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:417— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:417-437 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:546-566 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:768-788 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1385-1405 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:522-542 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1305-1325 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1460-1480 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1610-1630 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1768-1788 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:461-481 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:884-904 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 9) crates/router/src/core/payments/operations/payment_cancel.rs:209— crates/router/src/core/payments/operations/payment_cancel.rs:209-229 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:191-211 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:182-202 | crates/router/src/core/payments/operations/payment_capture.rs:264-284 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:176-195 | crates/router/src/core/payments/operations/payment_start.rs:225-245 | crates/router/src/core/payments/operations/payment_update_metadata.rs:182-201 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:197-217 | crates/router/src/core/payments/operations/payments_incremental_authorization.rs:176-196 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–21 lines × 4) crates/hyperswitch_domain_models/src/router_data.rs:1390— crates/hyperswitch_domain_models/src/router_data.rs:1390-1409 | crates/hyperswitch_domain_models/src/router_data.rs:1432-1452 | crates/hyperswitch_domain_models/src/router_data.rs:1848-1867 | crates/hyperswitch_domain_models/src/router_data.rs:1891-1908 — 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 (19–21 lines × 4) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:184— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:184-202 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:172-192 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:310-330 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:163-181 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/payment_confirm_intent.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 173 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–21 lines × 3) crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:444— crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:444-464 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:541-558 | crates/hyperswitch_domain_models/src/payments/payment_attempt.rs:610-627 — all 3 copies are in the same file, so extract the block into one function there and call 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–21 lines × 2) crates/router/src/core/webhooks/incoming.rs:1091— crates/router/src/core/webhooks/incoming.rs:1091-1111 | crates/router/src/core/webhooks/incoming.rs:3201-3218 — both copies are in the same file, so extract the block into 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–21 lines × 2) crates/router_env/src/request_id.rs:1029— crates/router_env/src/request_id.rs:1029-1042 | crates/router_env/src/request_id.rs:1161-1181 — both copies are in the same file, so extract the block into 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 × 21) crates/diesel_models/src/payment_attempt.rs:2651— crates/diesel_models/src/payment_attempt.rs:2651-2670 | crates/diesel_models/src/payment_attempt.rs:2866-2885 | crates/diesel_models/src/payment_attempt.rs:2952-2971 | crates/diesel_models/src/payment_attempt.rs:3038-3057 | crates/diesel_models/src/payment_attempt.rs:3124-3143 | crates/diesel_models/src/payment_attempt.rs:3208-3227 | crates/diesel_models/src/payment_attempt.rs:3291-3310 | crates/diesel_models/src/payment_attempt.rs:3525-3544 | crates/diesel_models/src/payment_attempt.rs:3604-3623 | crates/diesel_models/src/payment_attempt.rs:3697-3716 | crates/diesel_models/src/payment_attempt.rs:3796-3815 | crates/diesel_models/src/payment_attempt.rs:3892-3911 | crates/diesel_models/src/payment_attempt.rs:3977-3996 | crates/diesel_models/src/payment_attempt.rs:4062-4081 | crates/diesel_models/src/payment_attempt.rs:4158-4177 | crates/diesel_models/src/payment_attempt.rs:4241-4260 | crates/diesel_models/src/payment_attempt.rs:4329-4348 | crates/diesel_models/src/payment_attempt.rs:4427-4446 | crates/diesel_models/src/payment_attempt.rs:4511-4530 | crates/diesel_models/src/payment_attempt.rs:4602-4621 | crates/diesel_models/src/payment_attempt.rs:4683-4702 — 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.
Duplicated block (20 lines × 7) crates/router/src/core/payouts.rs:1919— crates/router/src/core/payouts.rs:1919-1938 | crates/router/src/core/payouts.rs:1961-1980 | crates/router/src/core/payouts.rs:2028-2047 | crates/router/src/core/payouts.rs:3077-3096 | crates/router/src/core/payouts.rs:3142-3161 | crates/router/src/core/payouts.rs:3260-3279 | crates/router/src/core/payouts.rs:3351-3370 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (20 lines × 6) crates/diesel_models/src/payment_method.rs:539— crates/diesel_models/src/payment_method.rs:539-558 | crates/diesel_models/src/payment_method.rs:572-591 | crates/diesel_models/src/payment_method.rs:672-691 | crates/diesel_models/src/payment_method.rs:755-774 | crates/diesel_models/src/payment_method.rs:788-807 | crates/diesel_models/src/payment_method.rs:869-888 — 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 (18–20 lines × 6) crates/router/src/services/authentication.rs:643— crates/router/src/services/authentication.rs:643-660 | crates/router/src/services/authentication.rs:748-767 | crates/router/src/services/authentication.rs:994-1011 | crates/router/src/services/authentication.rs:1079-1096 | crates/router/src/services/authentication.rs:1995-2012 | crates/router/src/services/authentication.rs:3071-3088 — 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 (18–20 lines × 4) crates/hyperswitch_connectors/src/connectors/adyen.rs:1938— crates/hyperswitch_connectors/src/connectors/adyen.rs:1938-1957 | crates/hyperswitch_connectors/src/connectors/rapyd.rs:806-823 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:1309-1326 | crates/hyperswitch_interfaces/src/webhooks.rs:289-308 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/rapyd.rs` as WHOLE FILES: this scan already matched 6 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–20 lines × 2) crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:2212— crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:2212-2225 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs:2355-2374 — both copies are in the same file, so extract the block into 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–19 lines × 41) crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:48— crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:48-66 | crates/analytics/src/auth_events/metrics/authentication_count.rs:45-63 | crates/analytics/src/auth_events/metrics/authentication_exemption_approved_count.rs:45-63 | crates/analytics/src/auth_events/metrics/authentication_exemption_requested_count.rs:45-63 | crates/analytics/src/auth_events/metrics/authentication_funnel.rs:48-66 | crates/analytics/src/auth_events/metrics/authentication_success_count.rs:46-64 | crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs:46-64 | crates/analytics/src/auth_events/metrics/challenge_flow_count.rs:46-64 | crates/analytics/src/auth_events/metrics/challenge_success_count.rs:46-64 | crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs:46-64 | crates/analytics/src/auth_events/metrics/frictionless_success_count.rs:46-64 | crates/analytics/src/disputes/metrics/dispute_status_metric.rs:50-66 | crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs:50-66 | crates/analytics/src/frm/metrics/frm_blocked_rate.rs:48-64 | crates/analytics/src/frm/metrics/frm_triggered_attempts.rs:43-59 | crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:50-66 | crates/analytics/src/payment_intents/metrics/payments_success_rate.rs:53-70 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs:50-66 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs:55-71 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs:52-68 | crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs:55-71 | crates/analytics/src/payment_intents/metrics/total_smart_retries.rs:52-68 | crates/analytics/src/payments/distribution/payment_error_message.rs:52-68 | crates/analytics/src/payments/metrics/avg_ticket_size.rs:53-69 | crates/analytics/src/payments/metrics/connector_success_rate.rs:52-68 | crates/analytics/src/payments/metrics/payment_count.rs:46-62 | crates/analytics/src/payments/metrics/payment_success_count.rs:47-63 | crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs:54-70 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:53-69 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:47-63 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs:48-64 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:50-66 | crates/analytics/src/payments/metrics/success_rate.rs:49-65 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs:53-69 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs:52-68 | crates/analytics/src/refunds/metrics/refund_count.rs:46-62 | crates/analytics/src/refunds/metrics/refund_success_count.rs:50-66 | crates/analytics/src/refunds/metrics/refund_success_rate.rs:51-67 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:47-63 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs:50-66 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs:51-67 — before extracting anything, compare `crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs` and `crates/analytics/src/auth_events/metrics/authentication_count.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–19 lines × 11) crates/router/src/core/mandate/utils.rs:83— crates/router/src/core/mandate/utils.rs:83-100 | crates/router/src/core/relay/utils.rs:142-159 | crates/router/src/core/relay/utils.rs:287-304 | crates/router/src/core/relay/utils.rs:415-432 | crates/router/src/core/relay/utils.rs:552-569 | crates/router/src/core/utils.rs:430-447 | crates/router/src/core/utils.rs:616-633 | crates/router/src/core/utils.rs:1621-1638 | crates/router/src/core/utils.rs:2186-2203 | crates/router/src/core/webhooks/utils.rs:137-154 | crates/router/src/types/api/verify_connector.rs:142-160 — before extracting anything, compare `crates/router/src/core/mandate/utils.rs` and `crates/router/src/core/utils.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 11) crates/router/src/core/payments/operations/payment_response.rs:729— crates/router/src/core/payments/operations/payment_response.rs:729-747 | crates/router/src/core/payments/operations/payment_response.rs:1502-1520 | crates/router/src/core/payments/operations/payment_response.rs:1828-1846 | crates/router/src/core/payments/operations/payment_response.rs:1876-1894 | crates/router/src/core/payments/operations/payment_response.rs:1918-1936 | crates/router/src/core/payments/operations/payment_response.rs:1966-1984 | crates/router/src/core/payments/operations/payment_response.rs:2014-2032 | crates/router/src/core/payments/operations/payment_response.rs:2062-2080 | crates/router/src/core/payments/operations/payment_response.rs:2106-2124 | crates/router/src/core/payments/operations/payment_response.rs:2148-2166 | crates/router/src/core/payments/operations/payment_response.rs:2200-2218 — all 11 copies are in the same file, so extract the block into one function there and call 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 (19 lines × 8) crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:171— crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:171-189 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:162-180 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:156-174 | crates/router/src/core/payments/operations/payment_start.rs:205-223 | crates/router/src/core/payments/operations/payment_update_metadata.rs:162-180 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:177-195 | crates/router/src/core/payments/operations/payments_incremental_authorization.rs:151-169 | crates/router/src/core/payments/operations/tax_calculation.rs:172-190 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 309 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–19 lines × 5) crates/router/src/core/payments/operations/payment_cancel.rs:134— crates/router/src/core/payments/operations/payment_cancel.rs:134-152 | crates/router/src/core/payments/operations/payment_capture.rs:189-207 | crates/router/src/core/payments/operations/payment_create.rs:515-531 | crates/router/src/core/payments/operations/payment_session.rs:148-166 | crates/router/src/core/payments/operations/payment_update.rs:415-431 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_capture.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 236 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–19 lines × 5) crates/router/src/routes/admin.rs:223— crates/router/src/routes/admin.rs:223-240 | crates/router/src/routes/profiles.rs:34-51 | crates/router/src/routes/profiles.rs:79-97 | crates/router/src/routes/profiles.rs:248-265 | crates/router/src/routes/profiles.rs:314-332 — before extracting anything, compare `crates/router/src/routes/admin.rs` and `crates/router/src/routes/profiles.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–19 lines × 4) crates/router/src/core/payouts.rs:2244— crates/router/src/core/payouts.rs:2244-2261 | crates/router/src/core/payouts.rs:2429-2447 | crates/router/src/core/payouts.rs:2492-2509 | crates/router/src/core/payouts.rs:2736-2754 — 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–19 lines × 2) crates/redis_interface/src/module/fred.rs:378— crates/redis_interface/src/module/fred.rs:378-396 | crates/redis_interface/src/module/redis_rs.rs:537-547 — 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–18 lines × 33) crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:86— crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:86-100 | crates/analytics/src/auth_events/metrics/authentication_count.rs:73-87 | crates/analytics/src/auth_events/metrics/authentication_exemption_approved_count.rs:76-90 | crates/analytics/src/auth_events/metrics/authentication_exemption_requested_count.rs:77-91 | crates/analytics/src/auth_events/metrics/authentication_funnel.rs:83-97 | crates/analytics/src/auth_events/metrics/authentication_success_count.rs:77-91 | crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs:87-101 | crates/analytics/src/auth_events/metrics/challenge_flow_count.rs:80-93 | crates/analytics/src/auth_events/metrics/challenge_success_count.rs:84-98 | crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs:80-94 | crates/analytics/src/auth_events/metrics/frictionless_success_count.rs:84-98 | crates/analytics/src/frm/metrics/frm_triggered_attempts.rs:71-87 | crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:76-92 | crates/analytics/src/payment_intents/metrics/payments_success_rate.rs:80-96 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs:76-92 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs:87-102 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs:81-97 | crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs:87-102 | crates/analytics/src/payment_intents/metrics/total_smart_retries.rs:81-97 | crates/analytics/src/payments/metrics/avg_ticket_size.rs:79-95 | crates/analytics/src/payments/metrics/connector_success_rate.rs:81-97 | crates/analytics/src/payments/metrics/payment_count.rs:72-88 | crates/analytics/src/payments/metrics/payment_success_count.rs:73-89 | crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs:80-96 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:82-98 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:73-89 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs:74-90 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:76-92 | crates/analytics/src/payments/metrics/success_rate.rs:75-91 | crates/analytics/src/refunds/metrics/refund_count.rs:72-88 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:73-89 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:120-137 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs:112-129 — before extracting anything, compare `crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs` and `crates/analytics/src/auth_events/metrics/authentication_count.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 8) REDACTED:1486— REDACTED:1486-1503 | REDACTED:1551-1568 | REDACTED:1615-1632 | REDACTED:1679-1696 | REDACTED:1738-1755 | REDACTED:1802-1819 | REDACTED:1930-1947 | REDACTED:2058-2075 — 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 (15–18 lines × 6) crates/router/src/core/admin.rs:451— crates/router/src/core/admin.rs:451-465 | crates/router/src/core/admin.rs:1185-1199 | crates/router/src/core/admin.rs:3577-3591 | crates/router/src/core/admin.rs:3817-3831 | crates/router/src/core/admin.rs:4176-4193 | crates/router/src/core/admin.rs:4436-4450 — 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 (17–18 lines × 6) crates/router/src/routes/payment_methods.rs:152— crates/router/src/routes/payment_methods.rs:152-168 | crates/router/src/routes/payment_methods.rs:291-308 | crates/router/src/routes/payment_methods.rs:343-360 | crates/router/src/routes/payment_methods.rs:394-411 | crates/router/src/routes/payment_methods.rs:1765-1781 | crates/router/src/routes/payment_methods.rs:2164-2181 — 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 (17–18 lines × 5) crates/router/src/routes/customers.rs:253— crates/router/src/routes/customers.rs:253-269 | crates/router/src/routes/customers.rs:323-339 | crates/router/src/routes/payment_methods.rs:1033-1050 | crates/router/src/routes/payment_methods.rs:1076-1093 | crates/router/src/routes/payment_methods.rs:1112-1129 — 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 (14–18 lines × 4) crates/router/src/db/refund.rs:1747— crates/router/src/db/refund.rs:1747-1764 | crates/router/src/db/refund.rs:1854-1867 | crates/router/src/db/refund.rs:2078-2095 | crates/router/src/db/refund.rs:2183-2196 — 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–18 lines × 2) crates/router/src/core/webhooks/incoming.rs:3197— crates/router/src/core/webhooks/incoming.rs:3197-3208 | crates/router/src/core/webhooks/incoming_v2.rs:545-562 — before extracting anything, compare `crates/router/src/core/webhooks/incoming.rs` and `crates/router/src/core/webhooks/incoming_v2.rs` as WHOLE FILES: this scan already matched 5 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 (14–17 lines × 53) crates/analytics/src/auth_events/metrics/authentication_count.rs:52— crates/analytics/src/auth_events/metrics/authentication_count.rs:52-67 | crates/analytics/src/disputes/metrics/dispute_status_metric.rs:56-69 | crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs:56-69 | crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:55-68 | crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs:55-68 | crates/analytics/src/disputes/metrics/total_amount_disputed.rs:54-67 | crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs:54-67 | crates/analytics/src/frm/metrics/frm_blocked_rate.rs:54-69 | crates/analytics/src/frm/metrics/frm_triggered_attempts.rs:49-64 | crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:56-69 | crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:71-85 | crates/analytics/src/payment_intents/metrics/payments_success_rate.rs:60-73 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs:56-69 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:71-84 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs:65-78 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs:64-77 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs:67-80 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs:61-74 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs:58-71 | crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs:63-76 | crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs:61-74 | crates/analytics/src/payment_intents/metrics/total_smart_retries.rs:58-71 | crates/analytics/src/payments/distribution/payment_error_message.rs:58-71 | crates/analytics/src/payments/metrics/avg_ticket_size.rs:59-72 | crates/analytics/src/payments/metrics/connector_success_rate.rs:58-71 | crates/analytics/src/payments/metrics/debit_routing.rs:60-73 | crates/analytics/src/payments/metrics/payment_count.rs:52-65 | crates/analytics/src/payments/metrics/payment_processed_amount.rs:54-67 | crates/analytics/src/payments/metrics/payment_success_count.rs:53-66 | crates/analytics/src/payments/metrics/retries_count.rs:60-74 | crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs:60-73 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:59-72 | crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs:60-73 | crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs:87-103 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:53-66 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs:68-81 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs:54-67 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:60-73 | crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs:60-74 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:56-69 | crates/analytics/src/payments/metrics/success_rate.rs:55-68 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs:59-72 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs:58-71 | crates/analytics/src/refunds/metrics/refund_count.rs:52-65 | crates/analytics/src/refunds/metrics/refund_processed_amount.rs:56-69 | crates/analytics/src/refunds/metrics/refund_success_count.rs:56-69 | crates/analytics/src/refunds/metrics/refund_success_rate.rs:57-70 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:53-66 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:83-99 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs:63-76 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs:82-98 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs:56-69 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs:57-70 — before extracting anything, compare `crates/analytics/src/auth_events/metrics/authentication_count.rs` and `crates/analytics/src/disputes/metrics/dispute_status_metric.rs` as WHOLE FILES: this scan already matched 4 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. 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 (17 lines × 13) REDACTED:1248— REDACTED:1248-1264 | REDACTED:1387-1403 | REDACTED:1453-1469 | REDACTED:1518-1534 | REDACTED:1583-1599 | REDACTED:1647-1663 | REDACTED:1712-1728 | REDACTED:1772-1788 | REDACTED:1835-1851 | REDACTED:1898-1914 | REDACTED:1963-1979 | REDACTED:2029-2045 | REDACTED:2090-2106 — 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 (17 lines × 11) crates/router/src/analytics.rs:650— crates/router/src/analytics.rs:650-666 | crates/router/src/analytics.rs:881-897 | crates/router/src/analytics.rs:1037-1053 | crates/router/src/analytics.rs:1342-1358 | crates/router/src/analytics.rs:1431-1447 | crates/router/src/analytics.rs:1500-1516 | crates/router/src/analytics.rs:1631-1647 | crates/router/src/analytics.rs:2866-2882 | crates/router/src/analytics.rs:2992-3008 | crates/router/src/analytics.rs:3084-3100 | crates/router/src/analytics.rs:3155-3171 — all 11 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 9) crates/router/src/core/payments/operations/payment_cancel.rs:200— crates/router/src/core/payments/operations/payment_cancel.rs:200-216 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:182-198 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:173-189 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:167-183 | crates/router/src/core/payments/operations/payment_recurrence.rs:374-390 | crates/router/src/core/payments/operations/payment_session.rs:214-230 | crates/router/src/core/payments/operations/payment_start.rs:216-232 | crates/router/src/core/payments/operations/payment_update_metadata.rs:173-189 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:188-204 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 8) crates/router/src/core/fraud_check/flows/fulfillment_flow.rs:121— crates/router/src/core/fraud_check/flows/fulfillment_flow.rs:121-137 | crates/router/src/core/relay/utils.rs:280-296 | crates/router/src/core/relay/utils.rs:408-424 | crates/router/src/core/relay/utils.rs:545-561 | crates/router/src/core/utils.rs:1614-1630 | crates/router/src/core/utils.rs:2179-2195 | crates/router/src/core/webhooks/utils.rs:130-146 | crates/router/src/types/api/verify_connector.rs:135-151 — before extracting anything, compare `crates/router/src/core/fraud_check/flows/fulfillment_flow.rs` and `crates/router/src/core/utils.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15–17 lines × 7) crates/hyperswitch_connectors/src/connectors/cashtocode.rs:141— crates/hyperswitch_connectors/src/connectors/cashtocode.rs:141-155 | crates/hyperswitch_connectors/src/connectors/fiuu.rs:242-256 | crates/hyperswitch_connectors/src/connectors/nmi.rs:125-139 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:146-160 | crates/hyperswitch_connectors/src/connectors/paypal.rs:554-570 | crates/hyperswitch_connectors/src/connectors/paypal.rs:689-705 | crates/hyperswitch_connectors/src/connectors/stripe.rs:174-188 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/cashtocode.rs` and `crates/hyperswitch_connectors/src/connectors/fiuu.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 7) crates/storage_impl/src/business_profile.rs:1811— crates/storage_impl/src/business_profile.rs:1811-1827 | crates/storage_impl/src/business_profile.rs:2052-2068 | crates/storage_impl/src/business_profile.rs:2111-2127 | crates/storage_impl/src/business_profile.rs:2171-2187 | crates/storage_impl/src/business_profile.rs:2231-2247 | crates/storage_impl/src/business_profile.rs:2292-2308 | crates/storage_impl/src/business_profile.rs:2353-2369 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–17 lines × 6) crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:88— crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:88-103 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs:82-96 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs:81-96 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs:89-105 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs:85-99 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:77-91 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs` and `crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 6) crates/router/src/core/payments/operations/payment_cancel.rs:55— crates/router/src/core/payments/operations/payment_cancel.rs:55-71 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:59-75 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:53-69 | crates/router/src/core/payments/operations/payment_reject.rs:51-67 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:59-75 | crates/router/src/core/payments/operations/payments_incremental_authorization.rs:64-80 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–17 lines × 5) crates/hyperswitch_domain_models/src/router_data.rs:1469— crates/hyperswitch_domain_models/src/router_data.rs:1469-1483 | crates/hyperswitch_domain_models/src/router_data.rs:1718-1733 | crates/hyperswitch_domain_models/src/router_data.rs:2060-2075 | crates/hyperswitch_domain_models/src/router_data.rs:2343-2355 | crates/hyperswitch_domain_models/src/router_data.rs:2597-2613 — 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 (16–17 lines × 5) crates/hyperswitch_domain_models/src/type_encryption.rs:165— crates/hyperswitch_domain_models/src/type_encryption.rs:165-181 | crates/hyperswitch_domain_models/src/type_encryption.rs:274-289 | crates/hyperswitch_domain_models/src/type_encryption.rs:512-527 | crates/hyperswitch_domain_models/src/type_encryption.rs:877-892 | crates/hyperswitch_domain_models/src/type_encryption.rs:980-995 — 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 (15–17 lines × 3) crates/router/src/core/revenue_recovery/types.rs:201— crates/router/src/core/revenue_recovery/types.rs:201-217 | crates/router/src/core/revenue_recovery/types.rs:639-654 | crates/router/src/core/revenue_recovery/types.rs:683-697 — all 3 copies are in the same file, so extract the block into one function there and call 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–17 lines × 2) crates/router/src/core/routing.rs:1989— crates/router/src/core/routing.rs:1989-2005 | crates/router/src/core/routing.rs:2050-2061 — both copies are in the same file, so extract the block into 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 × 15) REDACTED:1121— REDACTED:1121-1136 | REDACTED:1187-1202 | REDACTED:1253-1268 | REDACTED:1327-1342 | REDACTED:1392-1407 | REDACTED:1458-1473 | REDACTED:1523-1538 | REDACTED:1588-1603 | REDACTED:1652-1667 | REDACTED:1777-1792 | REDACTED:1840-1855 | REDACTED:1903-1918 | REDACTED:1968-1983 | REDACTED:2034-2049 | REDACTED:2095-2110 — 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.
Duplicated block (16 lines × 12) crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:93— crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:93-108 | crates/analytics/src/auth_events/metrics/authentication_count.rs:80-95 | crates/analytics/src/auth_events/metrics/authentication_error_message.rs:98-113 | crates/analytics/src/auth_events/metrics/authentication_exemption_approved_count.rs:83-98 | crates/analytics/src/auth_events/metrics/authentication_exemption_requested_count.rs:84-99 | crates/analytics/src/auth_events/metrics/authentication_funnel.rs:90-105 | crates/analytics/src/auth_events/metrics/authentication_success_count.rs:84-99 | crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs:94-109 | crates/analytics/src/auth_events/metrics/challenge_flow_count.rs:86-101 | crates/analytics/src/auth_events/metrics/challenge_success_count.rs:91-106 | crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs:87-102 | crates/analytics/src/auth_events/metrics/frictionless_success_count.rs:91-106 — before extracting anything, compare `crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs` and `crates/analytics/src/auth_events/metrics/authentication_count.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 11) crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:85— crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:85-100 | crates/analytics/src/payment_intents/metrics/payments_success_rate.rs:89-104 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs:85-100 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs:97-112 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs:98-113 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs:110-125 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs:95-110 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs:90-105 | crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs:102-117 | crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs:95-110 | crates/analytics/src/payment_intents/metrics/total_smart_retries.rs:90-105 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/payment_intent_count.rs` and `crates/analytics/src/payment_intents/metrics/payments_success_rate.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 10) crates/hyperswitch_connectors/src/connectors/affirm.rs:325— crates/hyperswitch_connectors/src/connectors/affirm.rs:325-340 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1324-1339 | crates/hyperswitch_connectors/src/connectors/bluesnap.rs:877-892 | crates/hyperswitch_connectors/src/connectors/deutschebank.rs:532-547 | crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs:426-441 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:586-601 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:448-463 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:614-629 | crates/hyperswitch_connectors/src/connectors/prophetpay.rs:328-343 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:1024-1039 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/affirm.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 10) crates/router/src/core/payments/operations/payment_cancel.rs:215— crates/router/src/core/payments/operations/payment_cancel.rs:215-230 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:197-212 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:188-203 | crates/router/src/core/payments/operations/payment_capture.rs:270-285 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:182-196 | crates/router/src/core/payments/operations/payment_start.rs:231-246 | crates/router/src/core/payments/operations/payment_update_metadata.rs:188-202 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:203-218 | crates/router/src/core/payments/operations/payments_incremental_authorization.rs:182-197 | crates/router/src/core/payments/operations/tax_calculation.rs:198-212 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 9) crates/analytics/src/auth_events/metrics/authentication_error_message.rs:54— crates/analytics/src/auth_events/metrics/authentication_error_message.rs:54-68 | crates/analytics/src/auth_events/metrics/authentication_exemption_approved_count.rs:52-66 | crates/analytics/src/auth_events/metrics/authentication_exemption_requested_count.rs:52-66 | crates/analytics/src/auth_events/metrics/authentication_success_count.rs:53-67 | crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs:53-68 | crates/analytics/src/auth_events/metrics/challenge_flow_count.rs:53-68 | crates/analytics/src/auth_events/metrics/challenge_success_count.rs:53-67 | crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs:53-68 | crates/analytics/src/auth_events/metrics/frictionless_success_count.rs:53-68 — before extracting anything, compare `crates/analytics/src/auth_events/metrics/authentication_error_message.rs` and `crates/analytics/src/auth_events/metrics/authentication_exemption_approved_count.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 5) crates/hyperswitch_connectors/src/connectors/gigadat.rs:374— crates/hyperswitch_connectors/src/connectors/gigadat.rs:374-389 | crates/hyperswitch_connectors/src/connectors/gigadat.rs:574-589 | crates/hyperswitch_connectors/src/connectors/loonio.rs:369-384 | crates/hyperswitch_connectors/src/connectors/loonio.rs:552-567 | crates/hyperswitch_connectors/src/connectors/loonio.rs:638-653 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/gigadat.rs` and `crates/hyperswitch_connectors/src/connectors/loonio.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 123 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 5) crates/router/src/core/refunds.rs:2634— crates/router/src/core/refunds.rs:2634-2649 | crates/router/src/workflows/dispute_list.rs:193-207 | crates/router/src/workflows/payment_sync.rs:304-318 | crates/router/src/workflows/post_capture_void_sync.rs:191-206 | crates/router/src/workflows/process_dispute.rs:204-219 — before extracting anything, compare `crates/router/src/core/refunds.rs` and `crates/router/src/workflows/process_dispute.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 3) crates/router/src/db/refund.rs:601— crates/router/src/db/refund.rs:601-615 | crates/router/src/db/refund.rs:1063-1078 | crates/router/src/db/refund.rs:1146-1160 — all 3 copies are in the same file, so extract the block into one function there and call 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–16 lines × 2) crates/router/src/core/payments/operations/payment_create.rs:1117— crates/router/src/core/payments/operations/payment_create.rs:1117-1126 | crates/router/src/core/payments/operations/payment_update.rs:1139-1154 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_create.rs` and `crates/router/src/core/payments/operations/payment_update.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 181 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–16 lines × 2) crates/router/src/core/payments/tokenization.rs:532— crates/router/src/core/payments/tokenization.rs:532-545 | crates/router/src/core/payments/tokenization.rs:945-960 — both copies are in the same file, so extract the block into 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–16 lines × 2) crates/router/src/core/refunds.rs:2412— crates/router/src/core/refunds.rs:2412-2427 | crates/router/src/core/refunds_v2.rs:1400-1408 — before extracting anything, compare `crates/router/src/core/refunds.rs` and `crates/router/src/core/refunds_v2.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 19) crates/diesel_models/src/payment_attempt.rs:2682— crates/diesel_models/src/payment_attempt.rs:2682-2696 | crates/diesel_models/src/payment_attempt.rs:2897-2911 | crates/diesel_models/src/payment_attempt.rs:2983-2997 | crates/diesel_models/src/payment_attempt.rs:3069-3083 | crates/diesel_models/src/payment_attempt.rs:3154-3168 | crates/diesel_models/src/payment_attempt.rs:3322-3336 | crates/diesel_models/src/payment_attempt.rs:3635-3649 | crates/diesel_models/src/payment_attempt.rs:4008-4022 | crates/diesel_models/src/payment_attempt.rs:4093-4107 | crates/diesel_models/src/payment_attempt.rs:4272-4286 | crates/diesel_models/src/payment_attempt.rs:4360-4374 | crates/diesel_models/src/payment_attempt.rs:4542-4556 | crates/storage_impl/src/business_profile.rs:1849-1863 | crates/storage_impl/src/business_profile.rs:1909-1923 | crates/storage_impl/src/business_profile.rs:1969-1983 | crates/storage_impl/src/business_profile.rs:2029-2043 | crates/storage_impl/src/business_profile.rs:2089-2103 | crates/storage_impl/src/business_profile.rs:2149-2163 | crates/storage_impl/src/business_profile.rs:2209-2223 — there are 19 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 19 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (14–15 lines × 12) crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:77— crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:77-91 | crates/analytics/src/auth_events/metrics/authentication_count.rs:64-78 | crates/analytics/src/auth_events/metrics/authentication_error_message.rs:77-91 | crates/analytics/src/auth_events/metrics/authentication_exemption_approved_count.rs:68-81 | crates/analytics/src/auth_events/metrics/authentication_exemption_requested_count.rs:68-82 | crates/analytics/src/auth_events/metrics/authentication_funnel.rs:74-88 | crates/analytics/src/auth_events/metrics/authentication_success_count.rs:69-82 | crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs:78-92 | crates/analytics/src/auth_events/metrics/challenge_flow_count.rs:71-85 | crates/analytics/src/auth_events/metrics/challenge_success_count.rs:75-89 | crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs:71-85 | crates/analytics/src/auth_events/metrics/frictionless_success_count.rs:76-89 — before extracting anything, compare `crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs` and `crates/analytics/src/auth_events/metrics/authentication_count.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 12) crates/router/src/core/payments/operations/payment_cancel.rs:153— crates/router/src/core/payments/operations/payment_cancel.rs:153-167 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:135-149 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:126-140 | crates/router/src/core/payments/operations/payment_capture.rs:208-222 | crates/router/src/core/payments/operations/payment_complete_authorize.rs:326-340 | crates/router/src/core/payments/operations/payment_confirm_external_vault_proxy.rs:334-348 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:99-113 | crates/router/src/core/payments/operations/payment_session.rs:167-181 | crates/router/src/core/payments/operations/payment_start.rs:169-183 | crates/router/src/core/payments/operations/payment_update_metadata.rs:97-111 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:141-155 | crates/router/src/core/payments/operations/tax_calculation.rs:131-145 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 9) crates/diesel_models/src/payment_attempt.rs:3094— crates/diesel_models/src/payment_attempt.rs:3094-3108 | crates/diesel_models/src/payment_attempt.rs:3236-3250 | crates/diesel_models/src/payment_attempt.rs:3414-3428 | crates/diesel_models/src/payment_attempt.rs:3511-3525 | crates/diesel_models/src/payment_attempt.rs:3714-3728 | crates/diesel_models/src/payment_attempt.rs:3823-3837 | crates/diesel_models/src/payment_attempt.rs:4416-4430 | crates/diesel_models/src/payment_attempt.rs:4488-4502 | crates/storage_impl/src/business_profile.rs:1818-1832 — there are 9 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 9 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (14–15 lines × 4) crates/router/src/core/payouts.rs:2175— crates/router/src/core/payouts.rs:2175-2188 | crates/router/src/core/payouts.rs:2303-2316 | crates/router/src/core/payouts.rs:2426-2439 | crates/router/src/core/payouts.rs:2732-2746 — 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) crates/hyperswitch_connectors/src/connectors/redsys.rs:234— crates/hyperswitch_connectors/src/connectors/redsys.rs:234-237 | crates/hyperswitch_connectors/src/connectors/redsys.rs:317-331 | crates/hyperswitch_connectors/src/connectors/redsys.rs:411-414 | crates/hyperswitch_connectors/src/connectors/redsys.rs:636-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 (12–15 lines × 2) crates/router/src/core/admin.rs:1647— crates/router/src/core/admin.rs:1647-1658 | crates/router/src/core/admin.rs:2967-2981 — both copies are in the same file, so extract the block into 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 × 36) crates/hyperswitch_connectors/src/connectors/boku.rs:163— crates/hyperswitch_connectors/src/connectors/boku.rs:163-176 | crates/hyperswitch_connectors/src/connectors/checkbook.rs:151-164 | crates/hyperswitch_connectors/src/connectors/citigate.rs:146-159 | crates/hyperswitch_connectors/src/connectors/custombilling.rs:136-149 | crates/hyperswitch_connectors/src/connectors/d24.rs:147-160 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:174-187 | crates/hyperswitch_connectors/src/connectors/envoy.rs:252-265 | crates/hyperswitch_connectors/src/connectors/etisalat.rs:165-178 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs:144-157 | crates/hyperswitch_connectors/src/connectors/getnet.rs:158-171 | crates/hyperswitch_connectors/src/connectors/givepayments.rs:145-158 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:156-169 | crates/hyperswitch_connectors/src/connectors/hyperpg.rs:139-152 | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs:144-157 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:149-162 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions.rs:155-168 | crates/hyperswitch_connectors/src/connectors/interpayments.rs:127-140 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital.rs:179-192 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs:198-211 | crates/hyperswitch_connectors/src/connectors/katapult.rs:147-160 | crates/hyperswitch_connectors/src/connectors/merchante.rs:165-178 | crates/hyperswitch_connectors/src/connectors/mpgs.rs:147-160 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:170-183 | crates/hyperswitch_connectors/src/connectors/opayo.rs:137-150 | crates/hyperswitch_connectors/src/connectors/paybox.rs:154-167 | crates/hyperswitch_connectors/src/connectors/payconex.rs:146-159 | crates/hyperswitch_connectors/src/connectors/paynearme.rs:147-160 | crates/hyperswitch_connectors/src/connectors/paytm.rs:139-152 | crates/hyperswitch_connectors/src/connectors/phonepe.rs:139-152 | crates/hyperswitch_connectors/src/connectors/recurly.rs:357-370 | crates/hyperswitch_connectors/src/connectors/sift.rs:147-160 | crates/hyperswitch_connectors/src/connectors/stripebilling.rs:229-242 | crates/hyperswitch_connectors/src/connectors/thunes.rs:144-157 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:221-234 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:146-159 | crates/hyperswitch_connectors/src/connectors/worldpayraft.rs:145-158 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/boku.rs` and `crates/hyperswitch_connectors/src/connectors/checkbook.rs` as WHOLE FILES: this scan already matched 6 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 (14 lines × 22) crates/diesel_models/src/payment_attempt.rs:2568— crates/diesel_models/src/payment_attempt.rs:2568-2581 | crates/diesel_models/src/payment_attempt.rs:2651-2664 | crates/diesel_models/src/payment_attempt.rs:2782-2795 | crates/diesel_models/src/payment_attempt.rs:2866-2879 | crates/diesel_models/src/payment_attempt.rs:2952-2965 | crates/diesel_models/src/payment_attempt.rs:3038-3051 | crates/diesel_models/src/payment_attempt.rs:3124-3137 | crates/diesel_models/src/payment_attempt.rs:3208-3221 | crates/diesel_models/src/payment_attempt.rs:3291-3304 | crates/diesel_models/src/payment_attempt.rs:3525-3538 | crates/diesel_models/src/payment_attempt.rs:3604-3617 | crates/diesel_models/src/payment_attempt.rs:3697-3710 | crates/diesel_models/src/payment_attempt.rs:3796-3809 | crates/diesel_models/src/payment_attempt.rs:3892-3905 | crates/diesel_models/src/payment_attempt.rs:3977-3990 | crates/diesel_models/src/payment_attempt.rs:4062-4075 | crates/diesel_models/src/payment_attempt.rs:4158-4171 | crates/diesel_models/src/payment_attempt.rs:4241-4254 | crates/diesel_models/src/payment_attempt.rs:4329-4342 | crates/diesel_models/src/payment_attempt.rs:4511-4524 | crates/diesel_models/src/payment_attempt.rs:4602-4615 | crates/diesel_models/src/payment_attempt.rs:4683-4696 — all 22 copies are in the same file, so extract the block into one function there and call 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 × 16) crates/router/src/core/fraud_check/flows/fulfillment_flow.rs:127— crates/router/src/core/fraud_check/flows/fulfillment_flow.rs:127-140 | crates/router/src/core/mandate/utils.rs:82-95 | crates/router/src/core/relay/utils.rs:141-154 | crates/router/src/core/relay/utils.rs:286-299 | crates/router/src/core/relay/utils.rs:414-427 | crates/router/src/core/relay/utils.rs:551-564 | crates/router/src/core/utils.rs:615-628 | crates/router/src/core/utils.rs:838-851 | crates/router/src/core/utils.rs:1381-1394 | crates/router/src/core/utils.rs:1496-1509 | crates/router/src/core/utils.rs:1620-1633 | crates/router/src/core/utils.rs:1816-1829 | crates/router/src/core/utils.rs:2074-2087 | crates/router/src/core/utils.rs:2185-2198 | crates/router/src/core/webhooks/utils.rs:136-149 | crates/router/src/types/api/verify_connector.rs:141-154 — before extracting anything, compare `crates/router/src/core/fraud_check/flows/fulfillment_flow.rs` and `crates/router/src/core/utils.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 10) crates/router/src/core/payments/operations/payment_cancel.rs:204— crates/router/src/core/payments/operations/payment_cancel.rs:204-217 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:186-199 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:177-190 | crates/router/src/core/payments/operations/payment_capture.rs:259-272 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:171-184 | crates/router/src/core/payments/operations/payment_recurrence.rs:378-391 | crates/router/src/core/payments/operations/payment_session.rs:218-231 | crates/router/src/core/payments/operations/payment_start.rs:220-233 | crates/router/src/core/payments/operations/payment_update_metadata.rs:177-190 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:192-205 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 8) crates/storage_impl/src/business_profile.rs:1850— crates/storage_impl/src/business_profile.rs:1850-1863 | crates/storage_impl/src/business_profile.rs:1910-1923 | crates/storage_impl/src/business_profile.rs:1970-1983 | crates/storage_impl/src/business_profile.rs:2030-2043 | crates/storage_impl/src/business_profile.rs:2090-2103 | crates/storage_impl/src/business_profile.rs:2150-2163 | crates/storage_impl/src/business_profile.rs:2210-2223 | crates/storage_impl/src/business_profile.rs:2270-2283 — 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 (14 lines × 7) crates/router/src/core/unified_connector_service.rs:3653— crates/router/src/core/unified_connector_service.rs:3653-3666 | crates/router/src/core/unified_connector_service.rs:3683-3696 | crates/router/src/core/unified_connector_service.rs:3743-3756 | crates/router/src/core/unified_connector_service.rs:3773-3786 | crates/router/src/core/unified_connector_service.rs:3803-3816 | crates/router/src/core/unified_connector_service.rs:3833-3846 | crates/router/src/core/unified_connector_service.rs:3863-3876 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–14 lines × 6) crates/hyperswitch_domain_models/src/router_data.rs:1725— crates/hyperswitch_domain_models/src/router_data.rs:1725-1735 | crates/hyperswitch_domain_models/src/router_data.rs:2067-2077 | crates/hyperswitch_domain_models/src/router_data.rs:2349-2357 | crates/hyperswitch_domain_models/src/router_data.rs:2382-2390 | crates/hyperswitch_domain_models/src/router_data.rs:2605-2618 | crates/hyperswitch_domain_models/src/router_data.rs:2647-2658 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–14 lines × 4) crates/router/src/core/payment_methods.rs:5619— crates/router/src/core/payment_methods.rs:5619-5632 | crates/router/src/core/payment_methods.rs:5778-5791 | crates/router/src/core/payment_methods/vault.rs:2777-2790 | crates/router/src/core/payment_methods/vault.rs:3468-3477 — before extracting anything, compare `crates/router/src/core/payment_methods.rs` and `crates/router/src/core/payment_methods/vault.rs` as WHOLE FILES: this scan already matched 6 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 (11–14 lines × 3) crates/hyperswitch_connectors/src/connectors/payme.rs:366— crates/hyperswitch_connectors/src/connectors/payme.rs:366-379 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:453-463 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:1050-1060 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/payme.rs` and `crates/hyperswitch_connectors/src/connectors/worldpayxml.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–14 lines × 3) crates/hyperswitch_constraint_graph/src/graph.rs:228— crates/hyperswitch_constraint_graph/src/graph.rs:228-240 | crates/hyperswitch_constraint_graph/src/graph.rs:290-303 | crates/hyperswitch_constraint_graph/src/graph.rs: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.
Duplicated block (8–14 lines × 2) crates/router/src/core/payments/access_token.rs:37— crates/router/src/core/payments/access_token.rs:37-44 | crates/router/src/core/payments/access_token.rs:137-150 — both copies are in the same file, so extract the block into 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 × 51) crates/analytics/src/api_event/metrics/latency.rs:55— crates/analytics/src/api_event/metrics/latency.rs:55-68 | crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:52-66 | crates/analytics/src/auth_events/metrics/authentication_count.rs:49-63 | crates/analytics/src/auth_events/metrics/authentication_exemption_approved_count.rs:49-63 | crates/analytics/src/auth_events/metrics/authentication_exemption_requested_count.rs:49-63 | crates/analytics/src/auth_events/metrics/authentication_funnel.rs:52-66 | crates/analytics/src/auth_events/metrics/authentication_success_count.rs:50-64 | crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs:50-64 | crates/analytics/src/auth_events/metrics/challenge_flow_count.rs:50-64 | crates/analytics/src/auth_events/metrics/challenge_success_count.rs:50-64 | crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs:50-64 | crates/analytics/src/auth_events/metrics/frictionless_success_count.rs:50-64 | crates/analytics/src/disputes/metrics/dispute_status_metric.rs:54-66 | crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs:54-66 | crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:53-65 | crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs:53-65 | crates/analytics/src/disputes/metrics/total_amount_disputed.rs:52-64 | crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs:52-64 | crates/analytics/src/frm/metrics/frm_blocked_rate.rs:52-64 | crates/analytics/src/frm/metrics/frm_triggered_attempts.rs:47-59 | crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:54-66 | crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:68-82 | crates/analytics/src/payment_intents/metrics/payments_success_rate.rs:57-70 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs:54-66 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:69-81 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs:59-71 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs:56-68 | crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs:59-71 | crates/analytics/src/payment_intents/metrics/total_smart_retries.rs:56-68 | crates/analytics/src/payments/distribution/payment_error_message.rs:56-68 | crates/analytics/src/payments/metrics/avg_ticket_size.rs:57-69 | crates/analytics/src/payments/metrics/connector_success_rate.rs:56-68 | crates/analytics/src/payments/metrics/payment_count.rs:50-62 | crates/analytics/src/payments/metrics/payment_success_count.rs:51-63 | crates/analytics/src/payments/metrics/retries_count.rs:58-70 | crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs:58-70 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:57-69 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:51-63 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs:66-78 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs:52-64 | crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs:58-70 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:54-66 | crates/analytics/src/payments/metrics/success_rate.rs:53-65 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs:57-69 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs:56-68 | crates/analytics/src/refunds/metrics/refund_count.rs:50-62 | crates/analytics/src/refunds/metrics/refund_success_count.rs:54-66 | crates/analytics/src/refunds/metrics/refund_success_rate.rs:55-67 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:51-63 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs:54-66 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs:55-67 — before extracting anything, compare `crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs` and `crates/analytics/src/auth_events/metrics/authentication_count.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 39) crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs:471— crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs:471-484 | crates/hyperswitch_connectors/src/connectors/breadpay/transformers.rs:201-214 | crates/hyperswitch_connectors/src/connectors/cashtocode/transformers.rs:304-317 | crates/hyperswitch_connectors/src/connectors/checkbook/transformers.rs:138-151 | crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs:117-130 | crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:684-696 | crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:939-951 | crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:1031-1043 | crates/hyperswitch_connectors/src/connectors/digitalvirgo/transformers.rs:223-236 | crates/hyperswitch_connectors/src/connectors/elavon_pg/transformers.rs:136-149 | crates/hyperswitch_connectors/src/connectors/envoy/transformers.rs:139-152 | crates/hyperswitch_connectors/src/connectors/etisalat/transformers.rs:131-144 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub/transformers.rs:134-147 | crates/hyperswitch_connectors/src/connectors/flexiti/transformers.rs:254-267 | crates/hyperswitch_connectors/src/connectors/givepayments/transformers.rs:122-135 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex/transformers.rs:145-158 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:307-319 | crates/hyperswitch_connectors/src/connectors/hyperwallet/transformers.rs:120-133 | crates/hyperswitch_connectors/src/connectors/ilixium/transformers.rs:136-149 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions/transformers.rs:129-142 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital/transformers.rs:144-157 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/transformers.rs:135-148 | crates/hyperswitch_connectors/src/connectors/katapult/transformers.rs:120-133 | crates/hyperswitch_connectors/src/connectors/merchante/transformers.rs:126-139 | crates/hyperswitch_connectors/src/connectors/mpgs/transformers.rs:118-131 | crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs:1474-1487 | crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs:1789-1802 | crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs:1860-1873 | crates/hyperswitch_connectors/src/connectors/paytm/transformers.rs:126-139 | crates/hyperswitch_connectors/src/connectors/phonepe/transformers.rs:128-141 | crates/hyperswitch_connectors/src/connectors/prophetpay/transformers.rs:458-470 | crates/hyperswitch_connectors/src/connectors/prophetpay/transformers.rs:514-526 | crates/hyperswitch_connectors/src/connectors/sift/transformers.rs:118-131 | crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs:154-167 | crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs:2024-2037 | crates/hyperswitch_connectors/src/connectors/thunes/transformers.rs:132-145 | crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs:238-251 | crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs:153-166 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout/transformers.rs:134-147 — `crates/hyperswitch_connectors/src/connectors/breadpay/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/flexiti/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 37 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 24) crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:71— crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:71-83 | crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:87-99 | crates/analytics/src/payment_intents/metrics/payments_success_rate.rs:75-87 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs:71-83 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:86-98 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs:80-92 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs:79-91 | crates/analytics/src/payments/distribution/payment_error_message.rs:73-85 | crates/analytics/src/payments/metrics/avg_ticket_size.rs:74-86 | crates/analytics/src/payments/metrics/debit_routing.rs:75-87 | crates/analytics/src/payments/metrics/payment_count.rs:67-79 | crates/analytics/src/payments/metrics/payment_processed_amount.rs:69-81 | crates/analytics/src/payments/metrics/payment_success_count.rs:68-80 | crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs:75-87 | crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs:75-87 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:68-80 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs:83-95 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs:69-81 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:75-87 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:71-83 | crates/analytics/src/payments/metrics/success_rate.rs:70-82 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs:73-85 | crates/analytics/src/refunds/metrics/refund_count.rs:67-79 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:68-80 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/payment_intent_count.rs` and `crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–13 lines × 11) crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:291— crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:291-297 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:408-420 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:503-515 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:606-618 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:696-708 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:788-800 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:877-889 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:1005-1017 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:1118-1130 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:1216-1228 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:1313-1325 — all 11 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 8) crates/diesel_models/src/payment_attempt.rs:1248— crates/diesel_models/src/payment_attempt.rs:1248-1259 | crates/diesel_models/src/payment_attempt.rs:1301-1312 | crates/diesel_models/src/payment_attempt.rs:1350-1361 | crates/diesel_models/src/payment_attempt.rs:1397-1408 | crates/diesel_models/src/payment_attempt.rs:1489-1500 | crates/diesel_models/src/payment_attempt.rs:3843-3855 | crates/diesel_models/src/payment_attempt.rs:4378-4390 | crates/storage_impl/src/payments/payment_attempt.rs:2942-2954 — there are 8 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 8 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11–13 lines × 8) crates/hyperswitch_connectors/src/connectors/nuvei.rs:307— crates/hyperswitch_connectors/src/connectors/nuvei.rs:307-318 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:387-397 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:470-480 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:556-566 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:815-827 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:903-915 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:1079-1089 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:1161-1172 — 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 (13 lines × 7) crates/router/src/core/payments/operations/payment_cancel.rs:186— crates/router/src/core/payments/operations/payment_cancel.rs:186-198 | crates/router/src/core/payments/operations/payment_cancel_post_capture.rs:168-180 | crates/router/src/core/payments/operations/payment_cancel_post_capture_sync.rs:159-171 | crates/router/src/core/payments/operations/payment_post_session_tokens.rs:153-165 | crates/router/src/core/payments/operations/payment_session.rs:200-212 | crates/router/src/core/payments/operations/payments_extend_authorization.rs:174-186 | crates/router/src/core/payments/operations/tax_calculation.rs:169-181 — before extracting anything, compare `crates/router/src/core/payments/operations/payment_cancel.rs` and `crates/router/src/core/payments/operations/payment_cancel_post_capture.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 324 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 6) crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs:82— crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs:82-93 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs:76-87 | crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs:78-89 | crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs:76-87 | crates/analytics/src/payments/metrics/retries_count.rs:71-83 | crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs:71-83 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs` and `crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–13 lines × 5) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:208— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:208-218 | crates/router/src/core/payments/operations/payment_attempt_record.rs:166-176 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:198-210 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:336-348 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:187-197 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/payment_attempt_record.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–13 lines × 4) crates/router/src/core/payments/transformers.rs:356— crates/router/src/core/payments/transformers.rs:356-368 | crates/router/src/core/payments/transformers.rs:658-670 | crates/router/src/core/payments/transformers.rs:1076-1085 | crates/router/src/core/payments/transformers.rs:1753-1763 — 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–13 lines × 2) crates/router/src/core/authentication.rs:695— crates/router/src/core/authentication.rs:695-703 | crates/router/src/core/authentication.rs:1078-1090 — both copies are in the same file, so extract the block into 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 × 66) crates/analytics/src/api_event/metrics/latency.rs:56— crates/analytics/src/api_event/metrics/latency.rs:56-69 | crates/analytics/src/api_event/metrics/status_code_count.rs:57-70 | crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs:53-67 | crates/analytics/src/auth_events/metrics/authentication_count.rs:50-64 | crates/analytics/src/auth_events/metrics/authentication_error_message.rs:52-66 | crates/analytics/src/auth_events/metrics/authentication_exemption_approved_count.rs:50-64 | crates/analytics/src/auth_events/metrics/authentication_exemption_requested_count.rs:50-64 | crates/analytics/src/auth_events/metrics/authentication_funnel.rs:53-67 | crates/analytics/src/auth_events/metrics/authentication_success_count.rs:51-65 | crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs:51-65 | crates/analytics/src/auth_events/metrics/challenge_flow_count.rs:51-65 | crates/analytics/src/auth_events/metrics/challenge_success_count.rs:51-65 | crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs:51-65 | crates/analytics/src/auth_events/metrics/frictionless_success_count.rs:51-65 | crates/analytics/src/disputes/metrics/dispute_status_metric.rs:55-67 | crates/analytics/src/disputes/metrics/sessionized_metrics/dispute_status_metric.rs:55-67 | crates/analytics/src/disputes/metrics/sessionized_metrics/total_amount_disputed.rs:54-66 | crates/analytics/src/disputes/metrics/sessionized_metrics/total_dispute_lost_amount.rs:54-66 | crates/analytics/src/disputes/metrics/total_amount_disputed.rs:53-65 | crates/analytics/src/disputes/metrics/total_dispute_lost_amount.rs:53-65 | crates/analytics/src/frm/metrics/frm_blocked_rate.rs:53-65 | crates/analytics/src/frm/metrics/frm_triggered_attempts.rs:48-60 | crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:55-67 | crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:69-83 | crates/analytics/src/payment_intents/metrics/payments_success_rate.rs:58-71 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs:55-67 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:70-82 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs:63-76 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs:62-75 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs:67-78 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs:60-72 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs:57-69 | crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs:63-74 | crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs:60-72 | crates/analytics/src/payment_intents/metrics/total_smart_retries.rs:57-69 | crates/analytics/src/payments/distribution/payment_error_message.rs:57-69 | crates/analytics/src/payments/metrics/avg_ticket_size.rs:58-70 | crates/analytics/src/payments/metrics/connector_success_rate.rs:57-69 | crates/analytics/src/payments/metrics/debit_routing.rs:60-71 | crates/analytics/src/payments/metrics/payment_count.rs:51-63 | crates/analytics/src/payments/metrics/payment_processed_amount.rs:54-65 | crates/analytics/src/payments/metrics/payment_success_count.rs:52-64 | crates/analytics/src/payments/metrics/retries_count.rs:59-71 | crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs:59-71 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:58-70 | crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs:60-71 | crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs:85-99 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:52-64 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs:67-79 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs:53-65 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:60-71 | crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs:59-71 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:55-67 | crates/analytics/src/payments/metrics/success_rate.rs:54-66 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs:58-70 | crates/analytics/src/refunds/distribution/sessionized_distribution/refund_reason.rs:57-69 | crates/analytics/src/refunds/metrics/refund_count.rs:51-63 | crates/analytics/src/refunds/metrics/refund_processed_amount.rs:56-67 | crates/analytics/src/refunds/metrics/refund_success_count.rs:55-67 | crates/analytics/src/refunds/metrics/refund_success_rate.rs:56-68 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:52-64 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_error_message.rs:81-95 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_processed_amount.rs:63-74 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_reason.rs:80-94 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_count.rs:55-67 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_success_rate.rs:56-68 — before extracting anything, compare `crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs` and `crates/analytics/src/auth_events/metrics/authentication_count.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 16) crates/analytics/src/payments/metrics/avg_ticket_size.rs:137— crates/analytics/src/payments/metrics/avg_ticket_size.rs:137-148 | crates/analytics/src/payments/metrics/connector_success_rate.rs:132-143 | crates/analytics/src/payments/metrics/debit_routing.rs:143-154 | crates/analytics/src/payments/metrics/payment_processed_amount.rs:137-148 | crates/analytics/src/payments/metrics/payment_success_count.rs:130-141 | crates/analytics/src/payments/metrics/retries_count.rs:127-138 | crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs:138-149 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:133-144 | crates/analytics/src/payments/metrics/sessionized_metrics/debit_routing.rs:143-154 | crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs:198-209 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs:155-166 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs:131-142 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:134-145 | crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs:127-138 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:127-138 | crates/analytics/src/payments/metrics/success_rate.rs:126-137 — before extracting anything, compare `crates/analytics/src/payments/metrics/avg_ticket_size.rs` and `crates/analytics/src/payments/metrics/connector_success_rate.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 13) crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:123— crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:123-134 | crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs:151-162 | crates/analytics/src/payment_intents/metrics/payments_success_rate.rs:127-138 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs:123-134 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs:153-164 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs:135-146 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs:136-147 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs:148-159 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs:133-144 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs:128-139 | crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs:140-151 | crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs:133-144 | crates/analytics/src/payment_intents/metrics/total_smart_retries.rs:128-139 — before extracting anything, compare `crates/analytics/src/payment_intents/metrics/payment_intent_count.rs` and `crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 11) crates/router/src/services/authentication.rs:4245— crates/router/src/services/authentication.rs:4245-4256 | crates/router/src/services/authentication.rs:4382-4393 | crates/router/src/services/authentication.rs:4471-4482 | crates/router/src/services/authentication.rs:4566-4577 | crates/router/src/services/authentication.rs:4654-4664 | crates/router/src/services/authentication.rs:4738-4749 | crates/router/src/services/authentication.rs:4808-4819 | crates/router/src/services/authentication.rs:4901-4912 | crates/router/src/services/authentication.rs:4991-5002 | crates/router/src/services/authentication.rs:5104-5115 | crates/router/src/services/authentication.rs:5192-5203 — all 11 copies are in the same file, so extract the block into one function there and call 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 × 10) crates/analytics/src/payments/metrics/connector_success_rate.rs:94— crates/analytics/src/payments/metrics/connector_success_rate.rs:94-105 | crates/analytics/src/payments/metrics/payment_count.rs:85-96 | crates/analytics/src/payments/metrics/retries_count.rs:89-100 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:95-106 | crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs:160-171 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:86-97 | crates/analytics/src/payments/metrics/sessionized_metrics/payments_distribution.rs:96-107 | crates/analytics/src/payments/metrics/sessionized_metrics/retries_count.rs:89-100 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:89-100 | crates/analytics/src/payments/metrics/success_rate.rs:88-99 — before extracting anything, compare `crates/analytics/src/payments/metrics/connector_success_rate.rs` and `crates/analytics/src/payments/metrics/payment_count.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 125 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 7) crates/router/src/core/fraud_check/flows/fulfillment_flow.rs:77— crates/router/src/core/fraud_check/flows/fulfillment_flow.rs:77-87 | crates/router/src/core/utils.rs:773-784 | crates/router/src/core/utils.rs:1334-1344 | crates/router/src/core/utils.rs:1453-1463 | crates/router/src/core/utils.rs:1570-1580 | crates/router/src/core/utils.rs:1770-1780 | crates/router/src/core/utils.rs:2028-2038 — before extracting anything, compare `crates/router/src/core/fraud_check/flows/fulfillment_flow.rs` and `crates/router/src/core/utils.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 6) crates/router/src/core/payment_methods/network_tokenization.rs:154— crates/router/src/core/payment_methods/network_tokenization.rs:154-164 | crates/router/src/core/payment_methods/network_tokenization.rs:326-336 | crates/router/src/core/payment_methods/network_tokenization.rs:581-592 | crates/router/src/core/payment_methods/network_tokenization.rs:861-872 | crates/router/src/core/payment_methods/network_tokenization.rs:929-940 | crates/router/src/core/payment_methods/network_tokenization.rs:1089-1100 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–12 lines × 5) crates/router/src/services/authentication.rs:4047— crates/router/src/services/authentication.rs:4047-4058 | crates/router/src/services/authentication.rs:5099-5110 | crates/router/src/services/authentication.rs:5189-5198 | crates/router/src/services/authentication.rs:5302-5313 | crates/router/src/services/authentication.rs:5385-5396 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–12 lines × 4) crates/hyperswitch_connectors/src/connectors/moneris.rs:236— crates/hyperswitch_connectors/src/connectors/moneris.rs:236-246 | crates/hyperswitch_connectors/src/connectors/payu.rs:298-309 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:318-328 | crates/hyperswitch_connectors/src/connectors/volt.rs:251-261 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/moneris.rs` and `crates/hyperswitch_connectors/src/connectors/payu.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 (5–12 lines × 4) crates/router/src/types/storage/refund.rs:159— crates/router/src/types/storage/refund.rs:159-170 | crates/router/src/types/storage/refund.rs:244-255 | crates/router/src/types/storage/refund.rs:327-338 | crates/router/src/types/storage/refund.rs:562-566 — 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–12 lines × 2) crates/storage_impl/src/payments/payment_attempt.rs:820— crates/storage_impl/src/payments/payment_attempt.rs:820-831 | crates/storage_impl/src/payments/payment_attempt.rs:928-936 — both copies are in the same file, so extract the block into 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 × 39) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:561— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:561-571 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:872-882 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:341-351 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1157-1167 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:859-869 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:987-997 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1493-1503 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1558-1568 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2040-2050 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2258-2268 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:115-125 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:116-126 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:643-653 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2997-3007 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3078-3088 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3868-3878 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4015-4025 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4103-4113 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:144-154 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:106-116 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:255-265 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:446-456 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:214-224 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:540-550 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:642-652 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1767-1777 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:849-859 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:410-420 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:83-93 | crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs:271-281 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:734-744 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:861-871 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:153-163 | crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs:137-147 | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:104-114 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:222-232 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:255-265 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1382-1392 | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs:241-251 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 18 separate duplicated blocks between them, totalling at least 160 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 (11 lines × 28) crates/analytics/src/frm/metrics/frm_triggered_attempts.rs:66— crates/analytics/src/frm/metrics/frm_triggered_attempts.rs:66-78 | crates/analytics/src/payment_intents/metrics/payment_intent_count.rs:73-83 | crates/analytics/src/payment_intents/metrics/payments_success_rate.rs:77-87 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs:73-83 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs:83-94 | crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs:77-88 | crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs:83-94 | crates/analytics/src/payment_intents/metrics/total_smart_retries.rs:77-88 | crates/analytics/src/payments/metrics/avg_ticket_size.rs:76-86 | crates/analytics/src/payments/metrics/connector_success_rate.rs:77-88 | crates/analytics/src/payments/metrics/payment_count.rs:69-79 | crates/analytics/src/payments/metrics/payment_success_count.rs:70-80 | crates/analytics/src/payments/metrics/sessionized_metrics/avg_ticket_size.rs:77-87 | crates/analytics/src/payments/metrics/sessionized_metrics/connector_success_rate.rs:78-89 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_count.rs:70-80 | crates/analytics/src/payments/metrics/sessionized_metrics/payment_success_count.rs:71-81 | crates/analytics/src/payments/metrics/sessionized_metrics/success_rate.rs:73-83 | crates/analytics/src/payments/metrics/success_rate.rs:72-82 | crates/analytics/src/refunds/metrics/refund_count.rs:69-79 | crates/analytics/src/refunds/metrics/sessionized_metrics/refund_count.rs:70-80 | crates/analytics/src/sdk_events/metrics/average_payment_time.rs:79-91 | crates/analytics/src/sdk_events/metrics/load_time.rs:79-91 | crates/analytics/src/sdk_events/metrics/payment_attempts.rs:74-86 | crates/analytics/src/sdk_events/metrics/payment_data_filled_count.rs:74-86 | crates/analytics/src/sdk_events/metrics/payment_method_selected_count.rs:74-86 | crates/analytics/src/sdk_events/metrics/payment_methods_call_count.rs:82-94 | crates/analytics/src/sdk_events/metrics/sdk_initiated_count.rs:74-86 | crates/analytics/src/sdk_events/metrics/sdk_rendered_count.rs:74-86 — before extracting anything, compare `crates/analytics/src/frm/metrics/frm_triggered_attempts.rs` and `crates/analytics/src/payment_intents/metrics/payment_intent_count.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) crates/router/src/core/payouts.rs:1922— crates/router/src/core/payouts.rs:1922-1932 | crates/router/src/core/payouts.rs:1964-1974 | crates/router/src/core/payouts.rs:2031-2041 | crates/router/src/core/payouts.rs:2244-2254 | crates/router/src/core/payouts.rs:2430-2440 | crates/router/src/core/payouts.rs:2492-2502 | crates/router/src/core/payouts.rs:2737-2747 | crates/router/src/core/payouts.rs:3080-3090 | crates/router/src/core/payouts.rs:3145-3155 | crates/router/src/core/payouts.rs:3263-3273 | crates/router/src/core/payouts.rs:3354-3364 — all 11 copies are in the same file, so extract the block into one function there and call 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 × 9) crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:182— crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs:182-193 | crates/router/src/core/payments/operations/payment_attempt_record.rs:130-141 | crates/router/src/core/payments/operations/payment_capture_v2.rs:157-168 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:170-183 | crates/router/src/core/payments/operations/payment_confirm_intent.rs:308-321 | crates/router/src/core/payments/operations/payment_get.rs:168-179 | crates/router/src/core/payments/operations/payment_session_intent.rs:131-144 | crates/router/src/core/payments/operations/payment_update_intent.rs:161-171 | crates/router/src/core/payments/operations/proxy_payments_intent.rs:161-172 — before extracting anything, compare `crates/router/src/core/payments/operations/external_vault_proxy_payment_intent.rs` and `crates/router/src/core/payments/operations/payment_attempt_record.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 9) crates/router/src/db/events.rs:1019— crates/router/src/db/events.rs:1019-1028 | crates/router/src/db/events.rs:1054-1063 | crates/router/src/db/events.rs:1090-1100 | crates/router/src/db/events.rs:1192-1201 | crates/router/src/db/events.rs:1228-1238 | crates/router/src/db/events.rs:1410-1419 | crates/router/src/db/events.rs:1449-1458 | crates/router/src/db/events.rs:1495-1505 | crates/storage_impl/src/business_profile.rs:529-539 — there are 9 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 9 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9–11 lines × 8) crates/hyperswitch_connectors/src/connectors/adyen.rs:578— crates/hyperswitch_connectors/src/connectors/adyen.rs:578-586 | crates/hyperswitch_connectors/src/connectors/adyen.rs:950-958 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:449-459 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:631-641 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:1000-1008 | crates/hyperswitch_connectors/src/connectors/paypal.rs:1937-1945 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:287-295 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:740-748 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 8) crates/hyperswitch_connectors/src/connectors/archipel.rs:275— crates/hyperswitch_connectors/src/connectors/archipel.rs:275-285 | crates/hyperswitch_connectors/src/connectors/archipel.rs:386-396 | crates/hyperswitch_connectors/src/connectors/archipel.rs:477-487 | crates/hyperswitch_connectors/src/connectors/archipel.rs:582-592 | crates/hyperswitch_connectors/src/connectors/archipel.rs:681-691 | crates/hyperswitch_connectors/src/connectors/archipel.rs:786-796 | crates/hyperswitch_connectors/src/connectors/archipel.rs:877-887 | crates/hyperswitch_connectors/src/connectors/archipel.rs:999-1009 — 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 (9–11 lines × 7) crates/hyperswitch_connectors/src/connectors/worldpay.rs:285— crates/hyperswitch_connectors/src/connectors/worldpay.rs:285-294 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:393-401 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:539-549 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:658-666 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:787-796 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:911-919 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:1024-1032 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–11 lines × 5) crates/router/src/core/payments/transformers.rs:2136— crates/router/src/core/payments/transformers.rs:2136-2146 | crates/router/src/core/payments/transformers.rs:5564-5573 | crates/router/src/core/payments/transformers.rs:7046-7055 | crates/router/src/core/payments/transformers.rs:7571-7580 | crates/router/src/core/utils.rs:1890-1899 — before extracting anything, compare `crates/router/src/core/payments/transformers.rs` and `crates/router/src/core/utils.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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–11 lines × 2) crates/router/src/core/webhooks/incoming.rs:128— crates/router/src/core/webhooks/incoming.rs:128-133 | crates/router/src/core/webhooks/incoming_v2.rs:126-136 — before extracting anything, compare `crates/router/src/core/webhooks/incoming.rs` and `crates/router/src/core/webhooks/incoming_v2.rs` as WHOLE FILES: this scan already matched 5 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 (8–11 lines × 2) crates/router/src/routes/refunds.rs:751— crates/router/src/routes/refunds.rs:751-758 | crates/router/src/routes/refunds.rs:808-818 — both copies are in the same file, so extract the block into 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–10 lines × 55) crates/hyperswitch_connectors/src/connectors/adyenplatform.rs:264— crates/hyperswitch_connectors/src/connectors/adyenplatform.rs:264-273 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:293-300 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:373-380 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:448-455 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:541-548 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:613-620 | crates/hyperswitch_connectors/src/connectors/ebanx.rs:218-227 | crates/hyperswitch_connectors/src/connectors/ebanx.rs:298-307 | crates/hyperswitch_connectors/src/connectors/ebanx.rs:372-381 | crates/hyperswitch_connectors/src/connectors/gpayments.rs:313-320 | crates/hyperswitch_connectors/src/connectors/gpayments.rs:486-493 | crates/hyperswitch_connectors/src/connectors/gpayments.rs:577-584 | crates/hyperswitch_connectors/src/connectors/netcetera.rs:320-327 | crates/hyperswitch_connectors/src/connectors/netcetera.rs:423-430 | crates/hyperswitch_connectors/src/connectors/nmi.rs:252-259 | crates/hyperswitch_connectors/src/connectors/nmi.rs:334-341 | crates/hyperswitch_connectors/src/connectors/nmi.rs:409-416 | crates/hyperswitch_connectors/src/connectors/nmi.rs:491-498 | crates/hyperswitch_connectors/src/connectors/nmi.rs:633-640 | crates/hyperswitch_connectors/src/connectors/nmi.rs:700-707 | crates/hyperswitch_connectors/src/connectors/nmi.rs:774-781 | crates/hyperswitch_connectors/src/connectors/payone.rs:350-359 | crates/hyperswitch_connectors/src/connectors/plaid.rs:244-251 | crates/hyperswitch_connectors/src/connectors/plaid.rs:321-328 | crates/hyperswitch_connectors/src/connectors/plaid.rs:401-408 | crates/hyperswitch_connectors/src/connectors/sanlam_payshield.rs:221-230 | crates/hyperswitch_connectors/src/connectors/sanlam_payshield.rs:308-317 | crates/hyperswitch_connectors/src/connectors/stripe.rs:360-369 | crates/hyperswitch_connectors/src/connectors/stripe.rs:550-559 | crates/hyperswitch_connectors/src/connectors/stripe.rs:920-929 | crates/hyperswitch_connectors/src/connectors/stripe.rs:935-944 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1324-1333 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1573-1582 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1746-1755 | crates/hyperswitch_connectors/src/connectors/threedsecureio.rs:312-319 | crates/hyperswitch_connectors/src/connectors/threedsecureio.rs:397-404 | crates/hyperswitch_connectors/src/connectors/trustly.rs:256-263 | crates/hyperswitch_connectors/src/connectors/trustly.rs:335-342 | crates/hyperswitch_connectors/src/connectors/trustly.rs:421-428 | crates/hyperswitch_connectors/src/connectors/trustly.rs:488-495 | crates/hyperswitch_connectors/src/connectors/trustly.rs:578-587 | crates/hyperswitch_connectors/src/connectors/trustly.rs:658-667 | crates/hyperswitch_connectors/src/connectors/trustly.rs:731-740 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:248-255 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:312-319 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:387-394 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:471-478 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:536-543 | crates/hyperswitch_connectors/src/connectors/wise.rs:292-301 | crates/hyperswitch_connectors/src/connectors/wise.rs:405-414 | crates/hyperswitch_connectors/src/connectors/wise.rs:477-486 | crates/hyperswitch_connectors/src/connectors/wise.rs:559-568 | crates/hyperswitch_connectors/src/connectors/wise.rs:634-643 | crates/hyperswitch_connectors/src/connectors/wise.rs:732-741 | crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs:488-497 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/dummyconnector.rs` and `crates/hyperswitch_connectors/src/connectors/stripe.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 39) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3105— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3105-3114 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:558-567 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:869-878 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:338-347 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:856-865 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:984-993 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1490-1499 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1555-1564 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2255-2264 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:112-121 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:113-122 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:442-451 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2994-3003 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3075-3084 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3865-3874 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4012-4021 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4100-4109 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:141-150 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:103-112 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:252-261 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:443-452 | crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs:226-235 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:211-220 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:639-648 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1764-1773 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:846-855 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:407-416 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:80-89 | crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs:268-277 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:731-740 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:858-867 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:150-159 | crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs:134-143 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:2399-2408 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:602-611 | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:101-110 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:219-228 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:252-261 | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs:238-247 — `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 38 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9–10 lines × 37) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3102— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3102-3110 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:555-563 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:866-874 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:335-343 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:853-861 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:981-989 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1487-1495 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1552-1560 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2252-2260 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:109-117 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:230-238 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:414-423 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:110-118 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:159-167 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:439-447 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2991-2999 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3072-3080 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3862-3870 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4009-4017 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4097-4105 | crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs:175-183 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:138-146 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:100-108 | crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs:223-231 | crates/hyperswitch_connectors/src/connectors/klarna.rs:1124-1132 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1761-1769 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:843-851 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:404-412 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:77-85 | crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs:265-273 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:728-736 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:855-863 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:147-155 | crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs:131-139 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:2396-2404 | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:98-106 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:249-257 — `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 38 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9–10 lines × 32) crates/hyperswitch_connectors/src/connectors/checkbook.rs:146— crates/hyperswitch_connectors/src/connectors/checkbook.rs:146-154 | crates/hyperswitch_connectors/src/connectors/citigate.rs:141-149 | crates/hyperswitch_connectors/src/connectors/custombilling.rs:131-139 | crates/hyperswitch_connectors/src/connectors/d24.rs:142-150 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:148-157 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:169-177 | crates/hyperswitch_connectors/src/connectors/envoy.rs:247-255 | crates/hyperswitch_connectors/src/connectors/etisalat.rs:160-168 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs:139-147 | crates/hyperswitch_connectors/src/connectors/getnet.rs:153-161 | crates/hyperswitch_connectors/src/connectors/givepayments.rs:140-148 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:151-159 | crates/hyperswitch_connectors/src/connectors/hyperpg.rs:134-142 | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs:139-147 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:144-152 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions.rs:150-158 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital.rs:174-182 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs:193-201 | crates/hyperswitch_connectors/src/connectors/katapult.rs:142-150 | crates/hyperswitch_connectors/src/connectors/merchante.rs:160-168 | crates/hyperswitch_connectors/src/connectors/mpgs.rs:142-150 | crates/hyperswitch_connectors/src/connectors/paybox.rs:149-157 | crates/hyperswitch_connectors/src/connectors/payconex.rs:141-149 | crates/hyperswitch_connectors/src/connectors/paynearme.rs:142-150 | crates/hyperswitch_connectors/src/connectors/paytm.rs:134-142 | crates/hyperswitch_connectors/src/connectors/phonepe.rs:134-142 | crates/hyperswitch_connectors/src/connectors/recurly.rs:352-360 | crates/hyperswitch_connectors/src/connectors/sift.rs:142-150 | crates/hyperswitch_connectors/src/connectors/stripebilling.rs:224-232 | crates/hyperswitch_connectors/src/connectors/thunes.rs:139-147 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:216-224 | crates/hyperswitch_connectors/src/connectors/worldpayraft.rs:140-148 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/checkbook.rs` and `crates/hyperswitch_connectors/src/connectors/citigate.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 27) crates/hyperswitch_connectors/src/connectors/adyen.rs:203— crates/hyperswitch_connectors/src/connectors/adyen.rs:203-212 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:277-286 | crates/hyperswitch_connectors/src/connectors/cashtocode.rs:176-185 | crates/hyperswitch_connectors/src/connectors/checkout.rs:213-222 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1066-1075 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1941-1950 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:246-255 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:181-190 | crates/hyperswitch_connectors/src/connectors/paypal.rs:230-239 | crates/hyperswitch_connectors/src/connectors/paypal.rs:591-600 | crates/hyperswitch_connectors/src/connectors/paypal.rs:726-735 | crates/hyperswitch_connectors/src/connectors/redsys.rs:152-161 | crates/hyperswitch_connectors/src/connectors/stripe.rs:217-226 | crates/hyperswitch_connectors/src/connectors/stripe.rs:431-440 | crates/hyperswitch_connectors/src/connectors/stripe.rs:621-630 | crates/hyperswitch_connectors/src/connectors/stripe.rs:812-821 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1033-1042 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1217-1226 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1395-1404 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1644-1653 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1817-1826 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2017-2026 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2180-2189 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2355-2364 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2487-2496 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2724-2733 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:397-406 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 16) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3099— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3099-3108 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3154-3162 | crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:210-219 | crates/hyperswitch_connectors/src/connectors/celero/transformers.rs:200-208 | crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs:172-181 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:135-144 | crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs:221-229 | crates/hyperswitch_connectors/src/connectors/klarna.rs:1122-1130 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:912-921 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1064-1073 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1758-1767 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:74-83 | crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs:262-271 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:725-734 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:2393-2402 | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:95-104 — `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/forte/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 15) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:524— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:524-533 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2459-2468 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:304-313 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1108-1117 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1998-2007 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:386-395 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:128-137 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:409-418 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2744-2753 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:574-583 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:812-821 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:375-384 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:124-133 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:1368-1377 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:1913-1922 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 18 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8–10 lines × 14) crates/hyperswitch_connectors/src/connectors/fiserv.rs:419— crates/hyperswitch_connectors/src/connectors/fiserv.rs:419-428 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:523-531 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:661-670 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:769-777 | crates/hyperswitch_connectors/src/connectors/fiserv.rs:882-890 | crates/hyperswitch_connectors/src/connectors/stripe.rs:736-745 | crates/hyperswitch_connectors/src/connectors/stripe.rs:956-964 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1141-1150 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1940-1948 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2103-2111 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:927-935 | crates/hyperswitch_connectors/src/connectors/xendit.rs:315-324 | crates/hyperswitch_connectors/src/connectors/xendit.rs:755-763 | crates/hyperswitch_connectors/src/connectors/xendit.rs:851-858 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/fiserv.rs` and `crates/hyperswitch_connectors/src/connectors/trustpay.rs` as WHOLE FILES: this scan already matched 7 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–10 lines × 13) crates/router/src/services/authentication.rs:3839— crates/router/src/services/authentication.rs:3839-3848 | crates/router/src/services/authentication.rs:4001-4009 | crates/router/src/services/authentication.rs:4041-4049 | crates/router/src/services/authentication.rs:4099-4107 | crates/router/src/services/authentication.rs:4138-4146 | crates/router/src/services/authentication.rs:4187-4195 | crates/router/src/services/authentication.rs:4227-4234 | crates/router/src/services/authentication.rs:4320-4327 | crates/router/src/services/authentication.rs:4514-4522 | crates/router/src/services/authentication.rs:4890-4898 | crates/router/src/services/authentication.rs:5093-5101 | crates/router/src/services/authentication.rs:5296-5304 | crates/router/src/services/authentication.rs:5379-5387 — 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 (8–10 lines × 12) crates/hyperswitch_connectors/src/connectors/airwallex.rs:991— crates/hyperswitch_connectors/src/connectors/airwallex.rs:991-998 | crates/hyperswitch_connectors/src/connectors/bambora.rs:725-734 | crates/hyperswitch_connectors/src/connectors/bluesnap.rs:996-1003 | crates/hyperswitch_connectors/src/connectors/braintree.rs:889-896 | crates/hyperswitch_connectors/src/connectors/dlocal.rs:598-605 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:902-911 | crates/hyperswitch_connectors/src/connectors/mollie.rs:739-748 | crates/hyperswitch_connectors/src/connectors/payu.rs:503-510 | crates/hyperswitch_connectors/src/connectors/payu.rs:693-700 | crates/hyperswitch_connectors/src/connectors/rapyd.rs:700-707 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:836-845 | crates/hyperswitch_connectors/src/connectors/zen.rs:468-476 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/airwallex.rs` and `crates/hyperswitch_connectors/src/connectors/bambora.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 12) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2455— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2455-2464 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:300-309 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1104-1113 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:382-391 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:124-133 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:405-414 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2740-2749 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:570-579 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:738-747 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:808-817 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:371-380 | crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs:664-673 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 18 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9–10 lines × 11) crates/hyperswitch_connectors/src/connectors/adyen.rs:1707— crates/hyperswitch_connectors/src/connectors/adyen.rs:1707-1716 | crates/hyperswitch_connectors/src/connectors/adyenplatform.rs:243-252 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1534-1543 | crates/hyperswitch_connectors/src/connectors/ebanx.rs:277-286 | crates/hyperswitch_connectors/src/connectors/gotyme_sanlam.rs:231-240 | crates/hyperswitch_connectors/src/connectors/loonio.rs:711-720 | crates/hyperswitch_connectors/src/connectors/payone.rs:330-338 | crates/hyperswitch_connectors/src/connectors/paypal.rs:782-791 | crates/hyperswitch_connectors/src/connectors/stripe.rs:3290-3299 | crates/hyperswitch_connectors/src/connectors/trustly.rs:638-647 | crates/hyperswitch_connectors/src/connectors/wise.rs:711-720 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 8) crates/analytics/src/api_event/core.rs:140— crates/analytics/src/api_event/core.rs:140-148 | crates/analytics/src/disputes/core.rs:76-85 | crates/analytics/src/frm/core.rs:70-78 | crates/analytics/src/payment_intents/core.rs:122-131 | crates/analytics/src/payments/core.rs:130-139 | crates/analytics/src/payments/core.rs:200-209 | crates/analytics/src/refunds/core.rs:125-134 | crates/analytics/src/refunds/core.rs:172-180 — `crates/analytics/src/api_event/core.rs` and `crates/analytics/src/disputes/core.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 43 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9–10 lines × 6) crates/router/src/routes/authentication.rs:103— crates/router/src/routes/authentication.rs:103-112 | crates/router/src/routes/authentication.rs:148-157 | crates/router/src/routes/authentication.rs:227-236 | crates/router/src/routes/authentication.rs:301-310 | crates/router/src/routes/payment_methods.rs:716-724 | crates/router/src/routes/payment_methods.rs:1216-1224 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7–10 lines × 3) crates/analytics/src/payment_intents/accumulator.rs:168— crates/analytics/src/payment_intents/accumulator.rs:168-177 | crates/analytics/src/payment_intents/accumulator.rs:298-304 | crates/analytics/src/payments/accumulator.rs:306-315 — `crates/analytics/src/payment_intents/accumulator.rs` and `crates/analytics/src/payments/accumulator.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 96 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6–10 lines × 2) crates/router/src/compatibility/stripe/payment_intents.rs:32— crates/router/src/compatibility/stripe/payment_intents.rs:32-41 | crates/router/src/compatibility/stripe/refunds.rs:23-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 both call sites, so a change lands once.
Duplicated block (7–10 lines × 2) crates/router/src/services/authentication.rs:5462— crates/router/src/services/authentication.rs:5462-5471 | crates/router/src/services/authentication.rs:5500-5506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 64) crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs:79— crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs:79-86 | crates/hyperswitch_connectors/src/connectors/affirm.rs:100-107 | crates/hyperswitch_connectors/src/connectors/archipel.rs:104-111 | crates/hyperswitch_connectors/src/connectors/billwerk.rs:97-104 | crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs:180-187 | crates/hyperswitch_connectors/src/connectors/breadpay.rs:104-111 | crates/hyperswitch_connectors/src/connectors/calida.rs:96-103 | crates/hyperswitch_connectors/src/connectors/celero.rs:92-99 | crates/hyperswitch_connectors/src/connectors/checkbook.rs:93-100 | crates/hyperswitch_connectors/src/connectors/citigate.rs:91-98 | crates/hyperswitch_connectors/src/connectors/coingate.rs:95-102 | crates/hyperswitch_connectors/src/connectors/ctp_mastercard.rs:60-67 | crates/hyperswitch_connectors/src/connectors/custombilling.rs:85-92 | crates/hyperswitch_connectors/src/connectors/d24.rs:89-96 | crates/hyperswitch_connectors/src/connectors/datatrans.rs:103-110 | crates/hyperswitch_connectors/src/connectors/digitalvirgo.rs:97-104 | crates/hyperswitch_connectors/src/connectors/elavon.rs:106-113 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:116-123 | crates/hyperswitch_connectors/src/connectors/envoy.rs:204-211 | crates/hyperswitch_connectors/src/connectors/etisalat.rs:92-99 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs:91-98 | crates/hyperswitch_connectors/src/connectors/gigadat.rs:118-125 | crates/hyperswitch_connectors/src/connectors/givepayments.rs:92-99 | crates/hyperswitch_connectors/src/connectors/globalpayments_heartland.rs:87-94 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:103-110 | crates/hyperswitch_connectors/src/connectors/gotyme_sanlam.rs:100-107 | crates/hyperswitch_connectors/src/connectors/hyperpg.rs:90-97 | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs:91-98 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:96-103 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions.rs:92-99 | crates/hyperswitch_connectors/src/connectors/inespay.rs:96-103 | crates/hyperswitch_connectors/src/connectors/interpayments.rs:75-82 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital.rs:114-121 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs:142-149 | crates/hyperswitch_connectors/src/connectors/katapult.rs:91-98 | crates/hyperswitch_connectors/src/connectors/loonio.rs:104-111 | crates/hyperswitch_connectors/src/connectors/merchante.rs:92-99 | crates/hyperswitch_connectors/src/connectors/mpgs.rs:91-98 | crates/hyperswitch_connectors/src/connectors/netcetera.rs:93-100 | crates/hyperswitch_connectors/src/connectors/nexinets.rs:97-104 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:119-126 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:99-106 | crates/hyperswitch_connectors/src/connectors/payconex.rs:91-98 | crates/hyperswitch_connectors/src/connectors/paynearme.rs:92-99 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:212-219 | crates/hyperswitch_connectors/src/connectors/paystack.rs:92-99 | crates/hyperswitch_connectors/src/connectors/paytm.rs:90-97 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:101-108 | crates/hyperswitch_connectors/src/connectors/phonepe.rs:90-97 | crates/hyperswitch_connectors/src/connectors/placetopay.rs:92-99 | crates/hyperswitch_connectors/src/connectors/plaid.rs:95-102 | crates/hyperswitch_connectors/src/connectors/prophetpay.rs:85-92 | crates/hyperswitch_connectors/src/connectors/saferpay.rs:84-91 | crates/hyperswitch_connectors/src/connectors/sift.rs:91-98 | crates/hyperswitch_connectors/src/connectors/signifyd.rs:107-115 | crates/hyperswitch_connectors/src/connectors/stripebilling.rs:170-177 | crates/hyperswitch_connectors/src/connectors/taxjar.rs:90-97 | crates/hyperswitch_connectors/src/connectors/thunes.rs:88-95 | crates/hyperswitch_connectors/src/connectors/trustly.rs:102-109 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:112-119 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:168-175 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:90-97 | crates/hyperswitch_connectors/src/connectors/worldpayraft.rs:92-99 | crates/hyperswitch_connectors/src/connectors/xendit.rs:105-112 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs` and `crates/hyperswitch_connectors/src/connectors/coingate.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 50) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:565— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:565-573 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:876-884 | crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:223-231 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:345-353 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1161-1169 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:863-871 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:991-999 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1497-1505 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1562-1570 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2044-2052 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2262-2270 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:119-127 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:241-249 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:426-434 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:120-128 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:647-655 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:170-178 | crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs:87-95 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3001-3009 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3082-3090 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3872-3880 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4019-4027 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4107-4115 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:342-350 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:432-440 | crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs:184-192 | crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:703-711 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:148-156 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:110-118 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:259-267 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:450-458 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:180-188 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:289-297 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:218-226 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:544-552 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:646-654 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1771-1779 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:853-861 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:414-422 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:87-95 | crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs:275-283 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:738-746 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:865-873 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:157-165 | crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs:141-149 | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:108-116 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:226-234 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:259-267 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1386-1394 | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs:245-253 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8–9 lines × 46) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:568— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:568-575 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:879-887 | crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:226-233 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:348-355 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1164-1172 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:866-873 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:994-1001 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1500-1507 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1565-1572 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2047-2054 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2265-2272 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:122-129 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:429-436 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:123-130 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:650-657 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:173-180 | crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs:90-97 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3004-3011 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3085-3092 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3875-3882 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4022-4029 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4110-4117 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:617-624 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:151-158 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:262-269 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:183-190 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:292-299 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:221-228 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:547-554 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:764-771 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:649-656 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:417-424 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:741-748 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1533-1540 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:160-167 | crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:387-394 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:198-205 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:327-334 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:137-144 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:297-304 | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:111-118 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:229-236 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:262-269 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1389-1396 | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs:248-255 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:723-730 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 38) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3103— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3103-3111 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:556-564 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:867-875 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:336-344 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:854-862 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:982-990 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1488-1496 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1553-1561 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2253-2261 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:110-118 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:111-119 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:160-168 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:440-448 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2992-3000 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3073-3081 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3863-3871 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4010-4018 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4098-4106 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:139-147 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:101-109 | crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs:224-232 | crates/hyperswitch_connectors/src/connectors/klarna.rs:1125-1133 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:209-217 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:637-645 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1762-1770 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:844-852 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:405-413 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:78-86 | crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs:266-274 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:729-737 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:856-864 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:148-156 | crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs:132-140 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:2397-2405 | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:99-107 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:217-225 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:250-258 | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs:236-244 — `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 38 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 23) crates/hyperswitch_connectors/src/connectors/affirm.rs:734— crates/hyperswitch_connectors/src/connectors/affirm.rs:734-742 | crates/hyperswitch_connectors/src/connectors/airwallex.rs:1043-1051 | crates/hyperswitch_connectors/src/connectors/authipay.rs:719-727 | crates/hyperswitch_connectors/src/connectors/bambora.rs:780-788 | crates/hyperswitch_connectors/src/connectors/bluesnap.rs:1064-1072 | crates/hyperswitch_connectors/src/connectors/coingate.rs:492-500 | crates/hyperswitch_connectors/src/connectors/deutschebank.rs:947-955 | crates/hyperswitch_connectors/src/connectors/dlocal.rs:652-660 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:828-836 | crates/hyperswitch_connectors/src/connectors/facilitapay.rs:772-780 | crates/hyperswitch_connectors/src/connectors/forte.rs:669-677 | crates/hyperswitch_connectors/src/connectors/helcim.rs:776-784 | crates/hyperswitch_connectors/src/connectors/iatapay.rs:631-639 | crates/hyperswitch_connectors/src/connectors/mollie.rs:797-805 | crates/hyperswitch_connectors/src/connectors/multisafepay.rs:486-494 | crates/hyperswitch_connectors/src/connectors/payload.rs:1004-1012 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:900-908 | crates/hyperswitch_connectors/src/connectors/shift4.rs:784-792 | crates/hyperswitch_connectors/src/connectors/square.rs:786-794 | crates/hyperswitch_connectors/src/connectors/stax.rs:823-831 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:1097-1105 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:930-938 | crates/hyperswitch_connectors/src/connectors/xendit.rs:825-833 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/affirm.rs` and `crates/hyperswitch_connectors/src/connectors/airwallex.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 22) crates/hyperswitch_connectors/src/connectors/aci.rs:423— crates/hyperswitch_connectors/src/connectors/aci.rs:423-431 | crates/hyperswitch_connectors/src/connectors/bambora.rs:407-415 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:607-615 | crates/hyperswitch_connectors/src/connectors/bitpay.rs:313-321 | crates/hyperswitch_connectors/src/connectors/checkout.rs:572-580 | crates/hyperswitch_connectors/src/connectors/cryptopay.rs:370-378 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1122-1130 | crates/hyperswitch_connectors/src/connectors/dummyconnector.rs:354-362 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:593-601 | crates/hyperswitch_connectors/src/connectors/globepay.rs:327-335 | crates/hyperswitch_connectors/src/connectors/gocardless.rs:569-577 | crates/hyperswitch_connectors/src/connectors/nexinets.rs:330-338 | crates/hyperswitch_connectors/src/connectors/noon.rs:397-405 | crates/hyperswitch_connectors/src/connectors/opayo.rs:303-311 | crates/hyperswitch_connectors/src/connectors/payu.rs:399-407 | crates/hyperswitch_connectors/src/connectors/stripe.rs:895-903 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:458-466 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:747-755 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:293-301 | crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs:280-288 | crates/hyperswitch_connectors/src/connectors/xendit.rs:486-494 | crates/hyperswitch_connectors/src/connectors/zen.rs:336-344 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/aci.rs` and `crates/hyperswitch_connectors/src/connectors/bambora.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 20) crates/hyperswitch_connectors/src/connectors/aci.rs:340— crates/hyperswitch_connectors/src/connectors/aci.rs:340-348 | crates/hyperswitch_connectors/src/connectors/adyen.rs:669-677 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:423-431 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:696-704 | crates/hyperswitch_connectors/src/connectors/braintree.rs:469-477 | crates/hyperswitch_connectors/src/connectors/checkout.rs:498-506 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:983-991 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:698-706 | crates/hyperswitch_connectors/src/connectors/nexinets.rs:416-424 | crates/hyperswitch_connectors/src/connectors/noon.rs:484-492 | crates/hyperswitch_connectors/src/connectors/opayo.rs:381-389 | crates/hyperswitch_connectors/src/connectors/payme.rs:752-760 | crates/hyperswitch_connectors/src/connectors/payu.rs:484-492 | crates/hyperswitch_connectors/src/connectors/powertranz.rs:431-439 | crates/hyperswitch_connectors/src/connectors/stripe.rs:707-715 | crates/hyperswitch_connectors/src/connectors/tsys.rs:349-357 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:637-645 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:368-376 | crates/hyperswitch_connectors/src/connectors/worldline.rs:403-411 | crates/hyperswitch_connectors/src/connectors/worldpaymodular.rs:363-371 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/aci.rs` and `crates/hyperswitch_connectors/src/connectors/adyen.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 17) crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:851— crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:851-859 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:979-987 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1485-1493 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1550-1558 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2250-2258 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:107-115 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:108-116 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2989-2997 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3070-3078 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3860-3868 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4007-4015 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4095-4103 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:98-106 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:853-861 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:834-842 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:145-153 | crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs:129-137 — `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 136 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8–9 lines × 14) crates/router/src/core/payments/operations/payment_response.rs:736— crates/router/src/core/payments/operations/payment_response.rs:736-743 | crates/router/src/core/payments/operations/payment_response.rs:1343-1351 | crates/router/src/core/payments/operations/payment_response.rs:1509-1516 | crates/router/src/core/payments/operations/payment_response.rs:1835-1842 | crates/router/src/core/payments/operations/payment_response.rs:1883-1890 | crates/router/src/core/payments/operations/payment_response.rs:1925-1932 | crates/router/src/core/payments/operations/payment_response.rs:1973-1980 | crates/router/src/core/payments/operations/payment_response.rs:2021-2028 | crates/router/src/core/payments/operations/payment_response.rs:2069-2076 | crates/router/src/core/payments/operations/payment_response.rs:2113-2120 | crates/router/src/core/payments/operations/payment_response.rs:2155-2162 | crates/router/src/core/payments/operations/payment_response.rs:2207-2214 | crates/router/src/core/payments/operations/payment_response.rs:2445-2453 | crates/router/src/core/payments/operations/payment_response.rs:4729-4737 — 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 (9 lines × 9) crates/router/src/db/events.rs:223— crates/router/src/db/events.rs:223-231 | crates/router/src/db/events.rs:243-251 | crates/router/src/db/events.rs:314-322 | crates/router/src/db/events.rs:703-711 | crates/router/src/db/relay.rs:57-65 | crates/router/src/db/relay.rs:83-91 | crates/router/src/db/relay.rs:102-110 | crates/router/src/db/relay.rs:126-134 | crates/storage_impl/src/tokenization.rs:62-70 — there are 9 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 9 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 7) crates/router/src/core/payments/transformers.rs:2074— crates/router/src/core/payments/transformers.rs:2074-2082 | crates/router/src/core/payments/transformers.rs:2411-2419 | crates/router/src/core/relay/utils.rs:39-48 | crates/router/src/core/relay/utils.rs:184-193 | crates/router/src/core/relay/utils.rs:323-332 | crates/router/src/core/relay/utils.rs:457-466 | crates/router/src/core/relay/utils.rs:589-598 — there are 7 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 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8–9 lines × 6) crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:210— crates/hyperswitch_connectors/src/connectors/aci/transformers.rs:210-218 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1273-1280 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:120-127 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:213-220 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1329-1336 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:500-507 — `crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/square/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 12 separate duplicated blocks between them, totalling at least 101 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 (5–9 lines × 7) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3188— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3188-3192 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3282-3290 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3817-3825 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3984-3992 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4084-4090 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4171-4178 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:6963-6971 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–9 lines × 3) crates/router/src/core/payment_methods/cards.rs:859— crates/router/src/core/payment_methods/cards.rs:859-867 | crates/router/src/core/payment_methods/cards.rs:966-974 | crates/router/src/core/payment_methods/cards.rs:1080-1086 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–9 lines × 2) crates/hyperswitch_domain_models/src/type_encryption.rs:694— crates/hyperswitch_domain_models/src/type_encryption.rs:694-702 | crates/hyperswitch_domain_models/src/type_encryption.rs:769-775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6–9 lines × 4) crates/router/src/core/authentication.rs:1584— crates/router/src/core/authentication.rs:1584-1591 | crates/router/src/core/fraud_check/flows/checkout_flow.rs:92-100 | crates/router/src/core/fraud_check/flows/sale_flow.rs:112-120 | crates/router/src/core/payments/operations/payment_response.rs:2708-2713 — before extracting anything, compare `crates/router/src/core/fraud_check/flows/checkout_flow.rs` and `crates/router/src/core/fraud_check/flows/sale_flow.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 60) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:566— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:566-573 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:877-884 | crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:224-231 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:346-353 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1162-1169 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:864-871 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:992-999 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1498-1505 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1563-1570 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2045-2052 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2263-2270 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:120-127 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:242-249 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:427-434 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:121-128 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:648-655 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:171-178 | crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs:88-95 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3002-3009 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3083-3090 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3873-3880 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4020-4027 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4108-4115 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:343-350 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:433-440 | crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs:185-192 | crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:704-711 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:149-156 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:111-118 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:260-267 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:451-458 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:181-188 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:290-297 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:219-226 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:545-552 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:647-654 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1772-1779 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:854-861 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:415-422 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:88-95 | crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs:276-283 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:489-496 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:739-746 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:866-873 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1531-1538 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:158-165 | crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs:142-149 | crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:385-392 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:196-203 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:325-332 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:135-142 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:295-302 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:1684-1691 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:5335-5342 | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:109-116 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:227-234 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:260-267 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1387-1394 | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs:246-253 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:721-728 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7–8 lines × 59) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:568— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:568-575 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:879-886 | crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:226-233 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:348-355 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1164-1171 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:866-873 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:994-1001 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1500-1507 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1565-1572 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2047-2054 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2265-2272 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:122-129 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:244-251 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:429-436 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:123-130 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:650-657 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:173-180 | crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs:90-97 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3004-3011 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3085-3092 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3875-3882 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4022-4029 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4110-4117 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:345-352 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:435-442 | crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs:187-194 | crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs:208-215 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:617-624 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:151-158 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:113-120 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:262-269 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:453-460 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:183-190 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:292-299 | crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs:216-223 | crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:143-150 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:221-228 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:547-554 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:764-771 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:649-656 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1774-1781 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:417-424 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:90-97 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:491-497 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:741-748 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:868-874 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1533-1540 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:160-167 | crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:387-394 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:198-205 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:327-334 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:137-144 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:297-304 | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:111-118 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:229-236 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:262-269 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1389-1396 | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs:248-255 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:723-730 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 58) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:567— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:567-574 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:878-885 | crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:225-232 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:347-354 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1163-1170 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:865-872 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:993-1000 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1499-1506 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1564-1571 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2046-2053 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2264-2271 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:121-128 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:243-250 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:428-435 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:122-129 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:649-656 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:172-179 | crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs:89-96 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3003-3010 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3084-3091 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3874-3881 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4021-4028 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4109-4116 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:344-351 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:434-441 | crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs:186-193 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:150-157 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:112-119 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:261-268 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:452-459 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:182-189 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:291-298 | crates/hyperswitch_connectors/src/connectors/klarna.rs:1136-1143 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:220-227 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:546-553 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:648-655 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1773-1780 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:416-423 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:89-96 | crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs:277-284 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:490-497 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:740-747 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:867-874 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1532-1539 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:159-166 | crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs:143-150 | crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:386-393 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:197-204 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:326-333 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:136-143 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:296-303 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:5336-5343 | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:110-117 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:228-235 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:261-268 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1388-1395 | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs:247-254 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:722-729 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 57) crates/hyperswitch_connectors/src/connectors/amazonpay.rs:689— crates/hyperswitch_connectors/src/connectors/amazonpay.rs:689-696 | crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:662-669 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1242-1249 | crates/hyperswitch_connectors/src/connectors/billwerk.rs:754-761 | crates/hyperswitch_connectors/src/connectors/boku.rs:605-612 | crates/hyperswitch_connectors/src/connectors/breadpay.rs:743-750 | crates/hyperswitch_connectors/src/connectors/celero.rs:670-677 | crates/hyperswitch_connectors/src/connectors/checkbook.rs:512-519 | crates/hyperswitch_connectors/src/connectors/citigate.rs:534-541 | crates/hyperswitch_connectors/src/connectors/custombilling.rs:521-528 | crates/hyperswitch_connectors/src/connectors/datatrans.rs:743-750 | crates/hyperswitch_connectors/src/connectors/elavon.rs:530-537 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:562-569 | crates/hyperswitch_connectors/src/connectors/envoy.rs:637-644 | crates/hyperswitch_connectors/src/connectors/etisalat.rs:553-560 | crates/hyperswitch_connectors/src/connectors/finix.rs:953-960 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs:545-552 | crates/hyperswitch_connectors/src/connectors/fiservemea.rs:736-743 | crates/hyperswitch_connectors/src/connectors/flexiti.rs:663-670 | crates/hyperswitch_connectors/src/connectors/getnet.rs:674-681 | crates/hyperswitch_connectors/src/connectors/givepayments.rs:536-543 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:559-566 | crates/hyperswitch_connectors/src/connectors/hipay.rs:697-704 | crates/hyperswitch_connectors/src/connectors/hyperpg.rs:524-531 | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs:534-541 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:534-541 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions.rs:563-570 | crates/hyperswitch_connectors/src/connectors/inespay.rs:562-569 | crates/hyperswitch_connectors/src/connectors/jpmorgan.rs:768-775 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital.rs:576-583 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs:593-600 | crates/hyperswitch_connectors/src/connectors/katapult.rs:535-542 | crates/hyperswitch_connectors/src/connectors/loonio.rs:609-616 | crates/hyperswitch_connectors/src/connectors/merchante.rs:553-560 | crates/hyperswitch_connectors/src/connectors/moneris.rs:753-760 | crates/hyperswitch_connectors/src/connectors/mpgs.rs:532-539 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:1159-1166 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:719-726 | crates/hyperswitch_connectors/src/connectors/payconex.rs:534-541 | crates/hyperswitch_connectors/src/connectors/paynearme.rs:535-542 | crates/hyperswitch_connectors/src/connectors/paysafe.rs:1046-1053 | crates/hyperswitch_connectors/src/connectors/paystack.rs:546-553 | crates/hyperswitch_connectors/src/connectors/paytm.rs:524-531 | crates/hyperswitch_connectors/src/connectors/phonepe.rs:524-531 | crates/hyperswitch_connectors/src/connectors/placetopay.rs:617-624 | crates/hyperswitch_connectors/src/connectors/prophetpay.rs:669-676 | crates/hyperswitch_connectors/src/connectors/razorpay.rs:673-680 | crates/hyperswitch_connectors/src/connectors/sift.rs:532-539 | crates/hyperswitch_connectors/src/connectors/silverflow.rs:747-754 | crates/hyperswitch_connectors/src/connectors/stripebilling.rs:614-621 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:843-850 | crates/hyperswitch_connectors/src/connectors/thunes.rs:521-528 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:678-685 | crates/hyperswitch_connectors/src/connectors/trustly.rs:470-477 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:717-724 | crates/hyperswitch_connectors/src/connectors/worldpayraft.rs:536-543 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:900-907 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/amazonpay.rs` and `crates/hyperswitch_connectors/src/connectors/bamboraapac.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 42) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3107— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3107-3115 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:560-568 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:871-879 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:340-348 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1156-1164 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:858-866 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:986-994 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1492-1500 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1557-1565 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2039-2047 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2257-2265 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:114-122 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:115-123 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:642-650 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2996-3004 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3077-3085 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3867-3875 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4014-4022 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4102-4110 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:143-151 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:105-113 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:254-262 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:445-453 | crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs:228-235 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:213-221 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:539-547 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:641-649 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1766-1774 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:848-856 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:409-417 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:82-90 | crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs:270-278 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:733-741 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:860-868 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:152-160 | crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs:136-144 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:2401-2409 | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:103-111 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:221-229 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:254-262 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1381-1389 | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs:240-248 — `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 38 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 31) crates/hyperswitch_connectors/src/connectors/adyen.rs:206— crates/hyperswitch_connectors/src/connectors/adyen.rs:206-213 | crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:280-287 | crates/hyperswitch_connectors/src/connectors/cashtocode.rs:179-186 | crates/hyperswitch_connectors/src/connectors/checkout.rs:216-223 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:543-550 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1069-1076 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1326-1333 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1481-1488 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1631-1638 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1789-1796 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1944-1951 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:184-191 | crates/hyperswitch_connectors/src/connectors/paypal.rs:594-601 | crates/hyperswitch_connectors/src/connectors/paypal.rs:729-736 | crates/hyperswitch_connectors/src/connectors/redsys.rs:155-162 | crates/hyperswitch_connectors/src/connectors/santander.rs:506-513 | crates/hyperswitch_connectors/src/connectors/stripe.rs:220-227 | crates/hyperswitch_connectors/src/connectors/stripe.rs:434-441 | crates/hyperswitch_connectors/src/connectors/stripe.rs:624-631 | crates/hyperswitch_connectors/src/connectors/stripe.rs:815-822 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1036-1043 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1220-1227 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1398-1405 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1647-1654 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1820-1827 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2020-2027 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2183-2190 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2358-2365 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2490-2497 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2727-2734 | crates/hyperswitch_connectors/src/connectors/trustpay.rs:400-407 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/adyen.rs` and `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 22) crates/hyperswitch_connectors/src/connectors/citigate/transformers.rs:54— crates/hyperswitch_connectors/src/connectors/citigate/transformers.rs:54-61 | crates/hyperswitch_connectors/src/connectors/elavon_pg/transformers.rs:54-61 | crates/hyperswitch_connectors/src/connectors/envoy/transformers.rs:69-76 | crates/hyperswitch_connectors/src/connectors/etisalat/transformers.rs:54-61 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub/transformers.rs:56-63 | crates/hyperswitch_connectors/src/connectors/givepayments/transformers.rs:56-63 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex/transformers.rs:56-63 | crates/hyperswitch_connectors/src/connectors/hyperpg/transformers.rs:54-61 | crates/hyperswitch_connectors/src/connectors/hyperwallet/transformers.rs:54-61 | crates/hyperswitch_connectors/src/connectors/ilixium/transformers.rs:54-61 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions/transformers.rs:56-63 | crates/hyperswitch_connectors/src/connectors/interpayments/transformers.rs:56-63 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital/transformers.rs:56-63 | crates/hyperswitch_connectors/src/connectors/katapult/transformers.rs:54-61 | crates/hyperswitch_connectors/src/connectors/mpgs/transformers.rs:52-59 | crates/hyperswitch_connectors/src/connectors/payconex/transformers.rs:54-61 | crates/hyperswitch_connectors/src/connectors/paynearme/transformers.rs:54-61 | crates/hyperswitch_connectors/src/connectors/paytm/transformers.rs:52-59 | crates/hyperswitch_connectors/src/connectors/phonepe/transformers.rs:54-61 | crates/hyperswitch_connectors/src/connectors/sift/transformers.rs:52-59 | crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs:189-196 | crates/hyperswitch_connectors/src/connectors/worldpayraft/transformers.rs:55-62 — `crates/hyperswitch_connectors/src/connectors/citigate/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/interpayments/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 36 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 (7–8 lines × 18) crates/router/src/services/authentication.rs:3838— crates/router/src/services/authentication.rs:3838-3845 | crates/router/src/services/authentication.rs:4000-4006 | crates/router/src/services/authentication.rs:4040-4046 | crates/router/src/services/authentication.rs:4098-4104 | crates/router/src/services/authentication.rs:4137-4143 | crates/router/src/services/authentication.rs:4186-4192 | crates/router/src/services/authentication.rs:4226-4232 | crates/router/src/services/authentication.rs:4319-4325 | crates/router/src/services/authentication.rs:4513-4519 | crates/router/src/services/authentication.rs:4550-4556 | crates/router/src/services/authentication.rs:4788-4794 | crates/router/src/services/authentication.rs:4889-4895 | crates/router/src/services/authentication.rs:5092-5098 | crates/router/src/services/authentication.rs:5177-5183 | crates/router/src/services/authentication.rs:5295-5301 | crates/router/src/services/authentication.rs:5378-5384 | crates/router/src/services/authentication.rs:5461-5468 | crates/router/src/services/authentication.rs:5499-5505 — 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 (7–8 lines × 12) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:543— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:543-549 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:2476-2482 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:323-329 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1126-1133 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:208-214 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:427-433 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:593-599 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:760-766 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:392-398 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:142-148 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:237-243 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1353-1359 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 18 separate duplicated blocks between them, totalling at least 160 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 (7–8 lines × 11) crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:410— crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:410-416 | crates/hyperswitch_connectors/src/connectors/bankofamerica.rs:539-545 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:761-767 | crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1378-1384 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:513-520 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1296-1303 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1451-1458 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1601-1608 | crates/hyperswitch_connectors/src/connectors/cybersource.rs:1759-1766 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:454-460 | crates/hyperswitch_connectors/src/connectors/wellsfargo.rs:877-883 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bankofamerica.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 319 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 10) crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:392— crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:392-399 | crates/hyperswitch_connectors/src/connectors/boku.rs:347-354 | crates/hyperswitch_connectors/src/connectors/celero.rs:335-342 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:468-475 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:622-629 | crates/hyperswitch_connectors/src/connectors/placetopay.rs:298-305 | crates/hyperswitch_connectors/src/connectors/prophetpay.rs:422-429 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:518-525 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:389-396 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:526-533 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bamboraapac.rs` and `crates/hyperswitch_connectors/src/connectors/boku.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 8) crates/analytics/src/sqlx.rs:250— crates/analytics/src/sqlx.rs:250-257 | crates/analytics/src/sqlx.rs:601-608 | crates/analytics/src/sqlx.rs:648-655 | crates/analytics/src/sqlx.rs:763-770 | crates/analytics/src/sqlx.rs:899-906 | crates/analytics/src/sqlx.rs:1123-1130 | crates/analytics/src/sqlx.rs:1330-1337 | crates/analytics/src/sqlx.rs:1440-1447 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6–8 lines × 7) crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1223— crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1223-1230 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1705-1710 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:1855-1860 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2293-2298 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2362-2369 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2430-2437 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2501-2506 — `crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 47 separate duplicated blocks between them, totalling at least 513 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 (7–8 lines × 4) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3195— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3195-3202 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3597-3603 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3730-3737 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:4175-4181 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6–8 lines × 2) crates/router/src/core/payment_methods/transformers.rs:375— crates/router/src/core/payment_methods/transformers.rs:375-382 | crates/router/src/core/payment_methods/transformers.rs:420-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 3) crates/router/src/core/payments/operations/payment_status.rs:314— crates/router/src/core/payments/operations/payment_status.rs:314-321 | crates/router/src/core/payments/operations/payment_status.rs:323-331 | crates/router/src/core/payments/operations/payment_status.rs:332-338 — all 3 copies are in the same file, so extract the block into one function there and call 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 × 61) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:567— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:567-573 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:878-884 | crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:225-231 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:347-353 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1163-1169 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:865-871 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:993-999 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1499-1505 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1564-1570 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2046-2052 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2264-2270 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:121-127 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:243-249 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:428-434 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:122-128 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:649-655 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:172-178 | crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs:89-95 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3003-3009 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3084-3090 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3874-3880 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4021-4027 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4109-4115 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:344-350 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:434-440 | crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs:186-192 | crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs:705-711 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:150-156 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:112-118 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:261-267 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:452-458 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:182-188 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:291-297 | crates/hyperswitch_connectors/src/connectors/klarna.rs:1136-1142 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:220-226 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:546-552 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:648-654 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1773-1779 | crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs:855-861 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:416-422 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:89-95 | crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs:277-283 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:490-496 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:740-746 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:867-873 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1532-1538 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:159-165 | crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs:143-149 | crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:386-392 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:197-203 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:326-332 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:136-142 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:296-302 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:1685-1691 | crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:5336-5342 | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:110-116 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:228-234 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:261-267 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1388-1394 | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs:247-253 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:722-728 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 60) crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:568— crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:568-574 | crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs:879-885 | crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:226-232 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:348-354 | crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs:1164-1170 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:866-872 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:994-1000 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1500-1506 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1565-1571 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2047-2053 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2265-2271 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:122-128 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:244-250 | crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs:429-435 | crates/hyperswitch_connectors/src/connectors/boku/transformers.rs:123-129 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:650-656 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:173-179 | crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs:90-96 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3004-3010 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3085-3091 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3875-3881 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4022-4028 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4110-4116 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:345-351 | crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs:435-441 | crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs:187-193 | crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs:208-214 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:617-623 | crates/hyperswitch_connectors/src/connectors/forte/transformers.rs:151-157 | crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs:113-119 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:262-268 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:453-459 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:183-189 | crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs:292-298 | crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs:216-222 | crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:143-149 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:221-227 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:547-553 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:764-770 | crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs:649-655 | crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs:1774-1780 | crates/hyperswitch_connectors/src/connectors/noon/transformers.rs:417-423 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:90-96 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:491-497 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:741-747 | crates/hyperswitch_connectors/src/connectors/payme/transformers.rs:868-874 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1533-1539 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:160-166 | crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs:144-150 | crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:387-393 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:198-204 | crates/hyperswitch_connectors/src/connectors/square/transformers.rs:327-333 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:137-143 | crates/hyperswitch_connectors/src/connectors/stax/transformers.rs:297-303 | crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs:111-117 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:229-235 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:262-268 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1389-1395 | crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs:248-254 | crates/hyperswitch_connectors/src/connectors/zen/transformers.rs:723-729 — `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 33) crates/hyperswitch_connectors/src/connectors/checkbook.rs:148— crates/hyperswitch_connectors/src/connectors/checkbook.rs:148-154 | crates/hyperswitch_connectors/src/connectors/citigate.rs:143-149 | crates/hyperswitch_connectors/src/connectors/custombilling.rs:133-139 | crates/hyperswitch_connectors/src/connectors/d24.rs:144-150 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:150-157 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:171-177 | crates/hyperswitch_connectors/src/connectors/envoy.rs:249-255 | crates/hyperswitch_connectors/src/connectors/etisalat.rs:162-168 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs:141-147 | crates/hyperswitch_connectors/src/connectors/getnet.rs:155-161 | crates/hyperswitch_connectors/src/connectors/givepayments.rs:142-148 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:153-159 | crates/hyperswitch_connectors/src/connectors/hyperpg.rs:136-142 | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs:141-147 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:146-152 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions.rs:152-158 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital.rs:176-182 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs:195-201 | crates/hyperswitch_connectors/src/connectors/katapult.rs:144-150 | crates/hyperswitch_connectors/src/connectors/merchante.rs:162-168 | crates/hyperswitch_connectors/src/connectors/mpgs.rs:144-150 | crates/hyperswitch_connectors/src/connectors/paybox.rs:151-157 | crates/hyperswitch_connectors/src/connectors/payconex.rs:143-149 | crates/hyperswitch_connectors/src/connectors/paynearme.rs:144-150 | crates/hyperswitch_connectors/src/connectors/paytm.rs:136-142 | crates/hyperswitch_connectors/src/connectors/phonepe.rs:136-142 | crates/hyperswitch_connectors/src/connectors/recurly.rs:354-360 | crates/hyperswitch_connectors/src/connectors/sift.rs:144-150 | crates/hyperswitch_connectors/src/connectors/stripebilling.rs:226-232 | crates/hyperswitch_connectors/src/connectors/thunes.rs:141-147 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:218-224 | crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs:143-149 | crates/hyperswitch_connectors/src/connectors/worldpayraft.rs:142-148 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/checkbook.rs` and `crates/hyperswitch_connectors/src/connectors/citigate.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 119 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 22) crates/hyperswitch_connectors/src/connectors/elavon.rs:211— crates/hyperswitch_connectors/src/connectors/elavon.rs:211-217 | crates/hyperswitch_connectors/src/connectors/elavon.rs:288-294 | crates/hyperswitch_connectors/src/connectors/elavon.rs:374-380 | crates/hyperswitch_connectors/src/connectors/elavon.rs:470-476 | crates/hyperswitch_connectors/src/connectors/elavon.rs:546-552 | crates/hyperswitch_connectors/src/connectors/envoy.rs:168-174 | crates/hyperswitch_connectors/src/connectors/fiuu.rs:690-696 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:267-273 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:365-371 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:611-617 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:696-702 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:787-793 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:881-887 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1048-1054 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1127-1133 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:1437-1443 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:648-654 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:734-740 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:829-835 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:1159-1165 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:1255-1261 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:1352-1358 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/elavon.rs` and `crates/hyperswitch_connectors/src/connectors/envoy.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 21) crates/router/src/services/authentication.rs:1553— crates/router/src/services/authentication.rs:1553-1559 | crates/router/src/services/authentication.rs:1592-1598 | crates/router/src/services/authentication.rs:1636-1642 | crates/router/src/services/authentication.rs:3839-3846 | crates/router/src/services/authentication.rs:4001-4007 | crates/router/src/services/authentication.rs:4041-4047 | crates/router/src/services/authentication.rs:4099-4105 | crates/router/src/services/authentication.rs:4138-4144 | crates/router/src/services/authentication.rs:4187-4193 | crates/router/src/services/authentication.rs:4227-4233 | crates/router/src/services/authentication.rs:4320-4326 | crates/router/src/services/authentication.rs:4514-4520 | crates/router/src/services/authentication.rs:4551-4557 | crates/router/src/services/authentication.rs:4789-4795 | crates/router/src/services/authentication.rs:4890-4896 | crates/router/src/services/authentication.rs:5093-5099 | crates/router/src/services/authentication.rs:5178-5184 | crates/router/src/services/authentication.rs:5296-5302 | crates/router/src/services/authentication.rs:5379-5385 | crates/router/src/services/authentication.rs:5462-5469 | crates/router/src/services/authentication.rs:5500-5506 — 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.
Duplicated block (7 lines × 14) crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:215— crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:215-222 | crates/hyperswitch_connectors/src/connectors/datatrans.rs:239-246 | crates/hyperswitch_connectors/src/connectors/finix.rs:417-424 | crates/hyperswitch_connectors/src/connectors/gocardless.rs:402-408 | crates/hyperswitch_connectors/src/connectors/mollie.rs:366-373 | crates/hyperswitch_connectors/src/connectors/nexixpay.rs:323-330 | crates/hyperswitch_connectors/src/connectors/novalnet.rs:299-306 | crates/hyperswitch_connectors/src/connectors/nuvei.rs:289-296 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:269-276 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:349-356 | crates/hyperswitch_connectors/src/connectors/worldpay.rs:267-274 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:250-257 | crates/hyperswitch_connectors/src/connectors/worldpayxml.rs:327-334 | crates/hyperswitch_connectors/src/connectors/zift.rs:116-123 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bamboraapac.rs` and `crates/hyperswitch_connectors/src/connectors/datatrans.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 6) crates/analytics/src/api_event/core.rs:98— crates/analytics/src/api_event/core.rs:98-104 | crates/analytics/src/disputes/core.rs:36-41 | crates/analytics/src/frm/core.rs:31-36 | crates/analytics/src/payment_intents/core.rs:78-84 | crates/analytics/src/payments/core.rs:58-64 | crates/analytics/src/refunds/core.rs:55-60 — `crates/analytics/src/api_event/core.rs` and `crates/analytics/src/disputes/core.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 43 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6–7 lines × 4) crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3254— crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3254-3260 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3402-3407 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:3799-3804 | crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs:6916-6922 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 30) crates/hyperswitch_connectors/src/connectors/affirm/transformers.rs:372— crates/hyperswitch_connectors/src/connectors/affirm/transformers.rs:372-377 | crates/hyperswitch_connectors/src/connectors/checkbook/transformers.rs:134-139 | crates/hyperswitch_connectors/src/connectors/citigate/transformers.rs:121-126 | crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs:113-118 | crates/hyperswitch_connectors/src/connectors/elavon_pg/transformers.rs:132-137 | crates/hyperswitch_connectors/src/connectors/envoy/transformers.rs:135-140 | crates/hyperswitch_connectors/src/connectors/etisalat/transformers.rs:127-132 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub/transformers.rs:130-135 | crates/hyperswitch_connectors/src/connectors/givepayments/transformers.rs:118-123 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex/transformers.rs:141-146 | crates/hyperswitch_connectors/src/connectors/hyperpg/transformers.rs:124-129 | crates/hyperswitch_connectors/src/connectors/hyperwallet/transformers.rs:116-121 | crates/hyperswitch_connectors/src/connectors/ilixium/transformers.rs:132-137 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions/transformers.rs:125-130 | crates/hyperswitch_connectors/src/connectors/interpayments/transformers.rs:118-123 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital/transformers.rs:140-145 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/transformers.rs:131-136 | crates/hyperswitch_connectors/src/connectors/katapult/transformers.rs:116-121 | crates/hyperswitch_connectors/src/connectors/merchante/transformers.rs:122-127 | crates/hyperswitch_connectors/src/connectors/mpgs/transformers.rs:114-119 | crates/hyperswitch_connectors/src/connectors/payconex/transformers.rs:121-126 | crates/hyperswitch_connectors/src/connectors/paynearme/transformers.rs:123-128 | crates/hyperswitch_connectors/src/connectors/paytm/transformers.rs:122-127 | crates/hyperswitch_connectors/src/connectors/phonepe/transformers.rs:124-129 | crates/hyperswitch_connectors/src/connectors/sift/transformers.rs:114-119 | crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs:150-155 | crates/hyperswitch_connectors/src/connectors/thunes/transformers.rs:128-133 | crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs:234-239 | crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs:149-154 | crates/hyperswitch_connectors/src/connectors/worldpayraft/transformers.rs:122-127 — `crates/hyperswitch_connectors/src/connectors/citigate/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/interpayments/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 36 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 7) crates/diesel_models/src/query/generics.rs:747— crates/diesel_models/src/query/generics.rs:747-752 | crates/diesel_models/src/query/generics.rs:796-801 | crates/diesel_models/src/query/generics.rs:945-950 | crates/diesel_models/src/query/generics.rs:982-987 | crates/diesel_models/src/query/generics.rs:1104-1109 | crates/diesel_models/src/query/generics.rs:1200-1205 | crates/diesel_models/src/query/generics.rs:1253-1258 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 8) crates/analytics/src/active_payments/accumulator.rs:29— crates/analytics/src/active_payments/accumulator.rs:29-33 | crates/analytics/src/auth_events/accumulator.rs:45-49 | crates/analytics/src/auth_events/accumulator.rs:61-65 | crates/analytics/src/frm/accumulator.rs:36-40 | crates/analytics/src/payment_intents/accumulator.rs:77-81 | crates/analytics/src/payments/accumulator.rs:331-335 | crates/analytics/src/refunds/accumulator.rs:167-171 | crates/analytics/src/sdk_events/accumulator.rs:43-47 — `crates/analytics/src/payment_intents/accumulator.rs` and `crates/analytics/src/payments/accumulator.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 96 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 (5 lines × 5) crates/diesel_models/src/query/generics.rs:694— crates/diesel_models/src/query/generics.rs:694-698 | crates/diesel_models/src/query/generics.rs:747-751 | crates/diesel_models/src/query/generics.rs:796-800 | crates/diesel_models/src/query/generics.rs:897-901 | crates/diesel_models/src/query/generics.rs:1104-1108 — 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 (420 lines × 4) crates/openapi/src/routes/customers.rs:27— crates/openapi/src/routes/customers.rs:27-446 | REDACTED:35-1088 | REDACTED:655-1632 | crates/openapi/src/routes/routing.rs:30-650 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 3162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (978 lines × 2) REDACTED:35— REDACTED:35-1088 | REDACTED:655-1632 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 3162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (621 lines × 3) REDACTED:35— REDACTED:35-1088 | REDACTED:655-1632 | crates/openapi/src/routes/routing.rs:30-650 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 3162 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 9) crates/api_models/src/analytics/active_payments.rs:57— crates/api_models/src/analytics/active_payments.rs:57-63 | crates/api_models/src/analytics/api_event.rs:132-138 | crates/api_models/src/analytics/auth_events.rs:330-336 | crates/api_models/src/analytics/disputes.rs:113-119 | crates/api_models/src/analytics/frm.rs:125-131 | crates/api_models/src/analytics/payment_intents.rs:245-251 | crates/api_models/src/analytics/payments.rs:360-366 | crates/api_models/src/analytics/refunds.rs:201-207 | crates/api_models/src/analytics/sdk_events.rs:198-204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 9 call sites, so a change lands once.
Duplicated block (7 lines × 43) REDACTED:516— REDACTED:516-523 | crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:704-710 | crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs:212-219 | crates/hyperswitch_connectors/src/connectors/blackhawknetwork/transformers.rs:320-327 | crates/hyperswitch_connectors/src/connectors/breadpay/transformers.rs:303-310 | crates/hyperswitch_connectors/src/connectors/calida/transformers.rs:329-336 | crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs:356-363 | crates/hyperswitch_connectors/src/connectors/citigate/transformers.rs:170-177 | crates/hyperswitch_connectors/src/connectors/coinbase/transformers.rs:220-226 | crates/hyperswitch_connectors/src/connectors/custombilling/transformers.rs:164-171 | crates/hyperswitch_connectors/src/connectors/digitalvirgo/transformers.rs:297-303 | crates/hyperswitch_connectors/src/connectors/elavon_pg/transformers.rs:181-188 | crates/hyperswitch_connectors/src/connectors/envoy/transformers.rs:184-191 | crates/hyperswitch_connectors/src/connectors/etisalat/transformers.rs:176-183 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub/transformers.rs:183-190 | crates/hyperswitch_connectors/src/connectors/flexiti/transformers.rs:331-338 | crates/hyperswitch_connectors/src/connectors/givepayments/transformers.rs:167-174 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex/transformers.rs:194-201 | crates/hyperswitch_connectors/src/connectors/hyperpg/transformers.rs:173-180 | crates/hyperswitch_connectors/src/connectors/hyperwallet/transformers.rs:165-172 | crates/hyperswitch_connectors/src/connectors/ilixium/transformers.rs:181-188 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions/transformers.rs:178-185 | crates/hyperswitch_connectors/src/connectors/interpayments/transformers.rs:169-176 | crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs:626-632 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital/transformers.rs:193-200 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver/transformers.rs:184-191 | crates/hyperswitch_connectors/src/connectors/katapult/transformers.rs:165-172 | crates/hyperswitch_connectors/src/connectors/loonio/transformers.rs:391-398 | crates/hyperswitch_connectors/src/connectors/merchante/transformers.rs:171-178 | crates/hyperswitch_connectors/src/connectors/mpgs/transformers.rs:163-170 | crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs:1056-1062 | crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs:206-213 | crates/hyperswitch_connectors/src/connectors/payconex/transformers.rs:170-177 | crates/hyperswitch_connectors/src/connectors/paynearme/transformers.rs:172-179 | crates/hyperswitch_connectors/src/connectors/paytm/transformers.rs:171-178 | crates/hyperswitch_connectors/src/connectors/phonepe/transformers.rs:173-180 | crates/hyperswitch_connectors/src/connectors/sift/transformers.rs:163-170 | crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs:201-208 | crates/hyperswitch_connectors/src/connectors/thunes/transformers.rs:177-184 | crates/hyperswitch_connectors/src/connectors/tokenio/transformers.rs:526-533 | crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs:283-290 | crates/hyperswitch_connectors/src/connectors/trustly/transformers.rs:198-205 | crates/hyperswitch_connectors/src/connectors/worldpayraft/transformers.rs:171-177 — `crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 64 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 (7 lines × 8) crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:95— crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:95-101 | crates/hyperswitch_connectors/src/connectors/fiuu.rs:215-221 | crates/hyperswitch_connectors/src/connectors/globepay.rs:92-98 | crates/hyperswitch_connectors/src/connectors/gpayments.rs:106-112 | crates/hyperswitch_connectors/src/connectors/paybox.rs:106-112 | crates/hyperswitch_connectors/src/connectors/tokenio.rs:256-264 | crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs:115-121 | crates/hyperswitch_connectors/src/connectors/zsl.rs:83-89 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bamboraapac.rs` and `crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 13) crates/hyperswitch_connectors/src/connectors/blackhawknetwork/transformers.rs:79— crates/hyperswitch_connectors/src/connectors/blackhawknetwork/transformers.rs:79-87 | crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs:120-128 | crates/hyperswitch_connectors/src/connectors/dwolla/transformers.rs:85-93 | crates/hyperswitch_connectors/src/connectors/flexiti/transformers.rs:171-179 | crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs:78-86 | crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs:239-247 | crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs:88-96 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1779-1787 | crates/hyperswitch_connectors/src/connectors/payu/transformers.rs:353-361 | crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs:288-296 | crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs:145-153 | crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs:465-473 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:282-290 — `crates/hyperswitch_connectors/src/connectors/flexiti/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/truelayer/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 24) crates/router/src/db/api_keys.rs:58— crates/router/src/db/api_keys.rs:58-64 | crates/router/src/db/authorization.rs:39-45 | crates/router/src/db/batch_blocklist_job.rs:135-140 | crates/router/src/db/blocklist.rs:189-195 | crates/router/src/db/blocklist_fingerprint.rs:33-39 | crates/router/src/db/blocklist_lookup.rs:39-45 | crates/router/src/db/dispute.rs:99-105 | crates/router/src/db/dynamic_routing_stats.rs:40-46 | crates/router/src/db/file.rs:43-48 | crates/router/src/db/fraud_check.rs:37-42 | crates/router/src/db/generic_link.rs:90-96 | crates/router/src/db/locker_mock_up.rs:46-51 | crates/router/src/db/mandate.rs:511-517 | crates/router/src/db/payment_link.rs:56-62 | crates/router/src/db/refund.rs:211-216 | crates/router/src/db/refund.rs:802-807 | crates/router/src/db/reverse_lookup.rs:46-51 | crates/router/src/db/role.rs:80-85 | crates/router/src/db/routing_algorithm.rs:95-101 | crates/router/src/db/unified_translations.rs:46-52 | crates/router/src/db/user.rs:77-83 | crates/router/src/db/user/theme.rs:56-62 | crates/router/src/db/user_authentication_method.rs:52-58 | crates/router/src/db/user_role.rs:112-119 — before extracting anything, compare `crates/router/src/db/dispute.rs` and `crates/router/src/db/mandate.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 6) crates/router/src/services/api.rs:954— crates/router/src/services/api.rs:954-979 | crates/router/src/services/api.rs:1006-1031 | crates/router/src/services/api.rs:1118-1143 | crates/router/src/services/api.rs:1170-1195 | crates/router/src/services/api.rs:1213-1238 | crates/router/src/services/api.rs:1784-1809 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 22) crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:228— crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs:228-238 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1502-1512 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:1567-1577 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2049-2059 | crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs:2267-2277 | crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs:124-134 | crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:652-662 | crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs:175-185 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:2803-2813 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3006-3016 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:3087-3097 | crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs:4112-4122 | crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs:619-628 | crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs:264-274 | crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs:223-233 | crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs:1535-1545 | crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs:162-172 | crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs:389-399 | crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs:613-623 | crates/hyperswitch_connectors/src/connectors/volt/transformers.rs:231-241 | crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs:1391-1401 | crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs:213-223 — `crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs` and `crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 17) crates/hyperswitch_connectors/src/connectors/bambora.rs:144— crates/hyperswitch_connectors/src/connectors/bambora.rs:144-152 | crates/hyperswitch_connectors/src/connectors/coinbase.rs:139-147 | crates/hyperswitch_connectors/src/connectors/cryptopay.rs:186-194 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:140-148 | crates/hyperswitch_connectors/src/connectors/globepay.rs:147-155 | crates/hyperswitch_connectors/src/connectors/iatapay.rs:290-298 | crates/hyperswitch_connectors/src/connectors/itaubank.rs:291-299 | crates/hyperswitch_connectors/src/connectors/moneris.rs:276-282 | crates/hyperswitch_connectors/src/connectors/opayo.rs:130-138 | crates/hyperswitch_connectors/src/connectors/payu.rs:131-139 | crates/hyperswitch_connectors/src/connectors/payu.rs:338-346 | crates/hyperswitch_connectors/src/connectors/placetopay.rs:125-133 | crates/hyperswitch_connectors/src/connectors/shift4.rs:134-143 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:298-306 | crates/hyperswitch_connectors/src/connectors/vgs.rs:253-261 | crates/hyperswitch_connectors/src/connectors/volt.rs:291-299 | crates/hyperswitch_connectors/src/connectors/zen.rs:137-146 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bambora.rs` and `crates/hyperswitch_connectors/src/connectors/coinbase.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 14) crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:253— crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs:253-262 | crates/hyperswitch_connectors/src/connectors/stripe.rs:396-405 | crates/hyperswitch_connectors/src/connectors/stripe.rs:586-595 | crates/hyperswitch_connectors/src/connectors/stripe.rs:777-786 | crates/hyperswitch_connectors/src/connectors/stripe.rs:998-1007 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1182-1191 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1360-1369 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1609-1618 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1782-1791 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1982-1991 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2145-2154 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2320-2329 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2452-2461 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2689-2698 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs` and `crates/hyperswitch_connectors/src/connectors/stripe.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 56) crates/hyperswitch_connectors/src/connectors/affirm.rs:152— crates/hyperswitch_connectors/src/connectors/affirm.rs:152-160 | crates/hyperswitch_connectors/src/connectors/amazonpay.rs:305-313 | crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs:220-228 | crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs:441-448 | crates/hyperswitch_connectors/src/connectors/breadpay.rs:157-165 | crates/hyperswitch_connectors/src/connectors/chargebee.rs:349-357 | crates/hyperswitch_connectors/src/connectors/checkbook.rs:144-152 | crates/hyperswitch_connectors/src/connectors/citigate.rs:139-147 | crates/hyperswitch_connectors/src/connectors/custombilling.rs:129-137 | crates/hyperswitch_connectors/src/connectors/d24.rs:140-148 | crates/hyperswitch_connectors/src/connectors/datatrans.rs:170-176 | crates/hyperswitch_connectors/src/connectors/deutschebank.rs:162-170 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:146-154 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:167-175 | crates/hyperswitch_connectors/src/connectors/envoy.rs:246-253 | crates/hyperswitch_connectors/src/connectors/etisalat.rs:158-166 | crates/hyperswitch_connectors/src/connectors/finix.rs:337-344 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs:137-145 | crates/hyperswitch_connectors/src/connectors/flexiti.rs:150-158 | crates/hyperswitch_connectors/src/connectors/getnet.rs:151-159 | crates/hyperswitch_connectors/src/connectors/gigadat.rs:170-178 | crates/hyperswitch_connectors/src/connectors/givepayments.rs:138-146 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:342-350 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:149-157 | crates/hyperswitch_connectors/src/connectors/gotyme_sanlam.rs:152-161 | crates/hyperswitch_connectors/src/connectors/hipay.rs:242-249 | crates/hyperswitch_connectors/src/connectors/hyperpg.rs:132-140 | crates/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs:237-245 | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs:137-145 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:142-150 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions.rs:148-156 | crates/hyperswitch_connectors/src/connectors/inespay.rs:148-156 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital.rs:172-180 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs:191-199 | crates/hyperswitch_connectors/src/connectors/katapult.rs:140-148 | crates/hyperswitch_connectors/src/connectors/loonio.rs:156-165 | crates/hyperswitch_connectors/src/connectors/merchante.rs:158-166 | crates/hyperswitch_connectors/src/connectors/mpgs.rs:140-148 | crates/hyperswitch_connectors/src/connectors/paybox.rs:147-155 | crates/hyperswitch_connectors/src/connectors/payconex.rs:139-147 | crates/hyperswitch_connectors/src/connectors/paynearme.rs:140-148 | crates/hyperswitch_connectors/src/connectors/paytm.rs:133-140 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:152-160 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:767-775 | crates/hyperswitch_connectors/src/connectors/phonepe.rs:132-140 | crates/hyperswitch_connectors/src/connectors/recurly.rs:350-358 | crates/hyperswitch_connectors/src/connectors/sift.rs:140-148 | crates/hyperswitch_connectors/src/connectors/silverflow.rs:236-244 | crates/hyperswitch_connectors/src/connectors/stripebilling.rs:222-230 | crates/hyperswitch_connectors/src/connectors/taxjar.rs:136-144 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:279-287 | crates/hyperswitch_connectors/src/connectors/thunes.rs:137-145 | crates/hyperswitch_connectors/src/connectors/tokenio.rs:298-306 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:189-197 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:214-222 | crates/hyperswitch_connectors/src/connectors/worldpayraft.rs:138-146 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/affirm.rs` and `crates/hyperswitch_connectors/src/connectors/amazonpay.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 × 19) crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:133— crates/hyperswitch_connectors/src/connectors/bamboraapac.rs:133-140 | crates/hyperswitch_connectors/src/connectors/cashtocode.rs:158-166 | crates/hyperswitch_connectors/src/connectors/paypal.rs:575-581 | crates/hyperswitch_connectors/src/connectors/paypal.rs:710-716 | crates/hyperswitch_connectors/src/connectors/rapyd.rs:137-142 | crates/hyperswitch_connectors/src/connectors/stripe.rs:396-403 | crates/hyperswitch_connectors/src/connectors/stripe.rs:586-593 | crates/hyperswitch_connectors/src/connectors/stripe.rs:777-784 | crates/hyperswitch_connectors/src/connectors/stripe.rs:998-1005 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1182-1189 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1360-1367 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1609-1616 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1782-1789 | crates/hyperswitch_connectors/src/connectors/stripe.rs:1982-1989 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2145-2152 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2320-2327 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2452-2459 | crates/hyperswitch_connectors/src/connectors/stripe.rs:2689-2696 | crates/hyperswitch_connectors/src/connectors/threedsecureio.rs:144-149 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/bamboraapac.rs` and `crates/hyperswitch_connectors/src/connectors/rapyd.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 59) crates/hyperswitch_connectors/src/connectors/affirm.rs:152— crates/hyperswitch_connectors/src/connectors/affirm.rs:152-160 | crates/hyperswitch_connectors/src/connectors/amazonpay.rs:305-313 | crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs:220-228 | crates/hyperswitch_connectors/src/connectors/blackhawknetwork.rs:441-448 | crates/hyperswitch_connectors/src/connectors/breadpay.rs:157-165 | crates/hyperswitch_connectors/src/connectors/calida.rs:142-150 | crates/hyperswitch_connectors/src/connectors/chargebee.rs:349-357 | crates/hyperswitch_connectors/src/connectors/checkbook.rs:144-152 | crates/hyperswitch_connectors/src/connectors/citigate.rs:139-147 | crates/hyperswitch_connectors/src/connectors/custombilling.rs:129-137 | crates/hyperswitch_connectors/src/connectors/d24.rs:140-148 | crates/hyperswitch_connectors/src/connectors/datatrans.rs:170-176 | crates/hyperswitch_connectors/src/connectors/deutschebank.rs:162-170 | crates/hyperswitch_connectors/src/connectors/dwolla.rs:146-154 | crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:167-175 | crates/hyperswitch_connectors/src/connectors/envoy.rs:245-253 | crates/hyperswitch_connectors/src/connectors/etisalat.rs:158-166 | crates/hyperswitch_connectors/src/connectors/finix.rs:336-344 | crates/hyperswitch_connectors/src/connectors/fiservcommercehub.rs:137-145 | crates/hyperswitch_connectors/src/connectors/flexiti.rs:150-158 | crates/hyperswitch_connectors/src/connectors/getnet.rs:151-159 | crates/hyperswitch_connectors/src/connectors/gigadat.rs:170-178 | crates/hyperswitch_connectors/src/connectors/givepayments.rs:138-146 | crates/hyperswitch_connectors/src/connectors/globalpay.rs:342-350 | crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:149-157 | crates/hyperswitch_connectors/src/connectors/gotyme_sanlam.rs:152-160 | crates/hyperswitch_connectors/src/connectors/hipay.rs:241-249 | crates/hyperswitch_connectors/src/connectors/hyperpg.rs:132-140 | crates/hyperswitch_connectors/src/connectors/hyperswitch_vault.rs:237-245 | crates/hyperswitch_connectors/src/connectors/hyperwallet.rs:137-145 | crates/hyperswitch_connectors/src/connectors/ilixium.rs:142-150 | crates/hyperswitch_connectors/src/connectors/imerchantsolutions.rs:148-156 | crates/hyperswitch_connectors/src/connectors/inespay.rs:148-156 | crates/hyperswitch_connectors/src/connectors/jpmorgan_orbital.rs:172-180 | crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs:191-199 | crates/hyperswitch_connectors/src/connectors/katapult.rs:140-148 | crates/hyperswitch_connectors/src/connectors/loonio.rs:156-164 | crates/hyperswitch_connectors/src/connectors/merchante.rs:158-166 | crates/hyperswitch_connectors/src/connectors/mpgs.rs:140-148 | crates/hyperswitch_connectors/src/connectors/nordea.rs:395-403 | crates/hyperswitch_connectors/src/connectors/paybox.rs:147-155 | crates/hyperswitch_connectors/src/connectors/payconex.rs:139-147 | crates/hyperswitch_connectors/src/connectors/paynearme.rs:140-148 | crates/hyperswitch_connectors/src/connectors/paytm.rs:132-140 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:152-160 | crates/hyperswitch_connectors/src/connectors/peachpayments.rs:767-775 | crates/hyperswitch_connectors/src/connectors/phonepe.rs:132-140 | crates/hyperswitch_connectors/src/connectors/recurly.rs:350-358 | crates/hyperswitch_connectors/src/connectors/sift.rs:140-148 | crates/hyperswitch_connectors/src/connectors/silverflow.rs:236-244 | crates/hyperswitch_connectors/src/connectors/stripebilling.rs:222-230 | crates/hyperswitch_connectors/src/connectors/taxjar.rs:136-144 | crates/hyperswitch_connectors/src/connectors/tesouro.rs:279-287 | crates/hyperswitch_connectors/src/connectors/thunes.rs:137-145 | crates/hyperswitch_connectors/src/connectors/tokenio.rs:298-306 | crates/hyperswitch_connectors/src/connectors/truelayer.rs:189-197 | crates/hyperswitch_connectors/src/connectors/trustpayments.rs:214-222 | crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs:142-150 | crates/hyperswitch_connectors/src/connectors/worldpayraft.rs:138-146 — before extracting anything, compare `crates/hyperswitch_connectors/src/connectors/affirm.rs` and `crates/hyperswitch_connectors/src/connectors/amazonpay.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Unstable project subscriptions — subscriptions has instability 0.90 with 1 dependents.
P12 · CI test-gate honesty· Coverage collected but not gated · ×1
Coverage collected but not gated — CI collects a coverage report but no step enforces a minimum — coverage could halve and CI stays green. Add a step that fails the build when coverage drops below a floor (your coverage tool's minimum-threshold flag, or a coverage-gate action) so the number guards something. What was searched, so you can tell an absence from a miss: this repository's CI files AND its coverage configuration — the well-known coverage and test-runner config files, read at the repository root and inside workspace package directories two levels down, so a floor declared beside the tests rather than in the pipeline is credited — matched against the threshold settings this check knows by name. A floor set in your coverage service's web UI rather than in a committed file, or under a setting whose name is not one of those, is not seen here.
Type Safety — 5 typed · 2305 plain JS — the untyped files are crates/router/src/core/generic_link/payment_method_collect/initiate/script.js, crates/router/src/core/generic_link/payment_method_collect/status/script.js, crates/router/src/core/generic_link/payout_link/initiate/script.js, crates/router/src/core/generic_link/payout_link/status/script.js, crates/router/src/core/payment_link/locale.js, REDACTED (+2299 more).
R10 · Code Duplication· Duplicated block with local edits (174 matched lines × 2 locations) · ×1
Duplicated block with local edits (174 matched lines × 2 locations) REDACTED:102— REDACTED:102 · REDACTED:15 — the two spans are one implementation copied and then locally edited — 1109 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (76 matched lines × 2 locations) · ×1
Duplicated block with local edits (76 matched lines × 2 locations) crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:14— crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:14 · crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js:33 — the two spans are one implementation copied and then locally edited — 432 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 (56 lines × 2 locations) crates/router/src/core/generic_link/payout_link/initiate/script.js:39— crates/router/src/core/generic_link/payout_link/initiate/script.js:39 · REDACTED:611 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (17 lines × 2 locations) postman/collection-dir/adyen_uk/event.prerequest.js:18— postman/collection-dir/adyen_uk/event.prerequest.js:18 · postman/collection-dir/paypal/event.prerequest.js:13 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (15 lines × 2 locations) loadtest/k6/payment-confirm.js:10— loadtest/k6/payment-confirm.js:10 · REDACTED:10 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (14 lines × 2 locations) crates/router/src/services/redirection/assets/redirect_error_logs_push.js:67— crates/router/src/services/redirection/assets/redirect_error_logs_push.js:67 · crates/router/src/services/redirection/assets/redirect_error_logs_push.js:82 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (10 lines × 3 locations) crates/router/src/core/generic_link/payout_link/status/script.js:27— crates/router/src/core/generic_link/payout_link/status/script.js:27 · REDACTED:547 · REDACTED:359 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Complex function (anonymous) (cyclomatic 61, cognitive 48) cypress-tests/cypress/support/redirectionHandler.js:2394— (anonymous) has cyclomatic complexity 61 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 52, cognitive 141) cypress-tests/cypress/support/commands.js:3576— (anonymous) has cyclomatic complexity 52 and cognitive complexity 141; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 52, cognitive 108) cypress-tests/cypress/support/commands.js:5733— (anonymous) has cyclomatic complexity 52 and cognitive complexity 108; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 39, cognitive 88) cypress-tests/cypress/support/commands.js:5160— (anonymous) has cyclomatic complexity 39 and cognitive complexity 88; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 35, cognitive 104) cypress-tests/cypress/support/commands.js:4513— (anonymous) has cyclomatic complexity 35 and cognitive complexity 104; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function determineAffirmStep (cyclomatic 33, cognitive 22) cypress-tests/cypress/support/redirectionHandler.js:963— determineAffirmStep has cyclomatic complexity 33 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function bankRedirectRedirection (cyclomatic 30, cognitive 31) cypress-tests/cypress/support/redirectionHandler.js:1465— bankRedirectRedirection has cyclomatic complexity 30 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 25, cognitive 56) cypress-tests/cypress/support/commands.js:4010— (anonymous) has cyclomatic complexity 25 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function validateConfigValue (cyclomatic 25, cognitive 34) cypress-tests/cypress/utils/featureFlags.js:32— validateConfigValue has cyclomatic complexity 25 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function renderStatusDetails (cyclomatic 24, cognitive 26) REDACTED:188— renderStatusDetails has cyclomatic complexity 24 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function renderStatusDetails (cyclomatic 23, cognitive 10) crates/router/src/core/generic_link/payout_link/status/script.js:48— renderStatusDetails has cyclomatic complexity 23 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function bankRedirectRedirection (cyclomatic 23, cognitive 9) cypress-tests-v2/cypress/support/redirectionHandler.js:100— bankRedirectRedirection has cyclomatic complexity 23 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 22, cognitive 59) cypress-tests/cypress/support/commands.js:6298— (anonymous) has cyclomatic complexity 22 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function initializeEventListeners (cyclomatic 22, cognitive 29) REDACTED:326— initializeEventListeners has cyclomatic complexity 22 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 22, cognitive 27) cypress-tests/cypress/support/commands.js:12354— (anonymous) has cyclomatic complexity 22 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 21, cognitive 52) cypress-tests/cypress/support/commands.js:4788— (anonymous) has cyclomatic complexity 21 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function initializeSDK (cyclomatic 21, cognitive 20) crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:10— initializeSDK has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
REDACTED: 1118 lines of code REDACTED:1— REDACTED has 1118 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· cypress-tests/dashboard/dashboard.js · ×1
cypress-tests/dashboard/dashboard.js: 873 lines of code cypress-tests/dashboard/dashboard.js:1— cypress-tests/dashboard/dashboard.js has 873 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· crates/router/src/core/payment_link/locale.js · ×1
crates/router/src/core/payment_link/locale.js: 637 lines of code crates/router/src/core/payment_link/locale.js:1— crates/router/src/core/payment_link/locale.js has 637 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Weak cipher crates/common_utils/src/crypto.rs:657— DES / 3DES / RC4 / RC2 / Blowfish is deprecated or broken. Use an AEAD — `aes_gcm::Aes256Gcm` or `chacha20poly1305::ChaCha20Poly1305` (RustCrypto), or ring's `aead::AES_256_GCM` — with a fresh nonce per message; it authenticates as it encrypts.
X2 · Cancellation propagation· Async function without AbortSignal · ×1
Async function without AbortSignal: postLog crates/router/src/services/redirection/assets/redirect_error_logs_push.js:49— `postLog` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
No direct assertions: User login cypress-tests-v2/cypress/e2e/spec/Routing/0000-Coreflows.cy.js:21— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: List MCA call cypress-tests-v2/cypress/e2e/spec/Routing/0000-Coreflows.cy.js:39— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Routing algorithm create call cypress-tests-v2/cypress/e2e/spec/Routing/0000-Coreflows.cy.js:55— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Routing algorithm activate call cypress-tests-v2/cypress/e2e/spec/Routing/0000-Coreflows.cy.js:97— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Routing algorithm activation retrieve call cypress-tests-v2/cypress/e2e/spec/Routing/0000-Coreflows.cy.js:100— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Routing algorithm deactivate call cypress-tests-v2/cypress/e2e/spec/Routing/0000-Coreflows.cy.js:103— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Routing algorithm retrieve call cypress-tests-v2/cypress/e2e/spec/Routing/0000-Coreflows.cy.js:106— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Routing algorithm default fallback update call cypress-tests-v2/cypress/e2e/spec/Routing/0000-Coreflows.cy.js:109— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Routing algorithm fallback retrieve call cypress-tests-v2/cypress/e2e/spec/Routing/0000-Coreflows.cy.js:119— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: passes cypress-tests-v2/cypress/e2e/spec/Routing/0001-PriorityRouting.cy.js:2— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: passes cypress-tests-v2/cypress/e2e/spec/Payout/0000-CoreFlows.cy.js:2— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: passes cypress-tests-v2/cypress/e2e/spec/PaymentMethodList/0000-PaymentmethodList.cy.js:2— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Organization create call cypress-tests-v2/cypress/e2e/spec/Payment/0000-CoreFlows.cy.js:19— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Organization retrieve call cypress-tests-v2/cypress/e2e/spec/Payment/0000-CoreFlows.cy.js:25— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Organization update call cypress-tests-v2/cypress/e2e/spec/Payment/0000-CoreFlows.cy.js:28— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Merchant account create call cypress-tests-v2/cypress/e2e/spec/Payment/0000-CoreFlows.cy.js:47— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Merchant account retrieve call cypress-tests-v2/cypress/e2e/spec/Payment/0000-CoreFlows.cy.js:53— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Merchant account update call cypress-tests-v2/cypress/e2e/spec/Payment/0000-CoreFlows.cy.js:56— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Second merchant account create call cypress-tests-v2/cypress/e2e/spec/Payment/0000-CoreFlows.cy.js:62— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: List merchant accounts call cypress-tests-v2/cypress/e2e/spec/Payment/0000-CoreFlows.cy.js:68— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Business profile create call cypress-tests-v2/cypress/e2e/spec/Payment/0000-CoreFlows.cy.js:84— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Business profile retrieve call cypress-tests-v2/cypress/e2e/spec/Payment/0000-CoreFlows.cy.js:90— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Business profile update call cypress-tests-v2/cypress/e2e/spec/Payment/0000-CoreFlows.cy.js:93— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: Second business profile create call cypress-tests-v2/cypress/e2e/spec/Payment/0000-CoreFlows.cy.js:99— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
No direct assertions: List business profiles cypress-tests-v2/cypress/e2e/spec/Payment/0000-CoreFlows.cy.js:106— No conventional assertion call was detected, and 44 of 44 tests in `cypress-tests-v2` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
Orphaned file crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/hyperswitch_connectors/src/connectors/payone.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/pm_auth/src/connector/plaid/transformers.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/router_env/src/logger/formatter.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/pm_auth/src/connector/plaid.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/router/src/db/user/theme.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/router/src/routes/dummy_connector/types.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/analytics/src/payment_intents/accumulator.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/router/src/db/ephemeral_key.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/router/src/types/domain/address.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/router_derive/src/macros/to_encryptable.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/external_services/src/grpc_client/dynamic_routing/success_rate_client.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/smithy-core/src/generator.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/openapi/src/routes/merchant_account.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/router/src/utils/user/theme.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/router_derive/src/macros/api_error.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/router_derive/src/macros/generate_schema.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/analytics/src/refunds/accumulator.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/hyperswitch_constraint_graph/src/builder.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/router/src/compatibility/stripe/customers/types.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/router/src/db/locker_mock_up.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/router_derive/src/macros/api_error/helpers.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/events/src/lib.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/router/src/db/reverse_lookup.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/external_services/src/hashicorp_vault/core.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Interpolated log message defeats structured logging crates/subscriptions/src/webhooks.rs:104— `info!` at line 104 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/subscriptions/src/workflows/invoice_sync.rs:178— `error!` at line 178 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/subscriptions/src/workflows/invoice_sync.rs:312— `info!` at line 312 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/subscriptions/src/workflows/invoice_sync.rs:328— `info!` at line 328 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/storage_impl/src/redis/pub_sub.rs:100— `debug!` at line 100 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/storage_impl/src/redis/pub_sub.rs:103— `debug!` at line 103 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/storage_impl/src/redis/pub_sub.rs:125— `debug!` at line 125 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/storage_impl/src/payouts/payout_attempt.rs:618— `error!` at line 618 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/smithy-generator/src/main.rs:18— `info!` at line 18 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/smithy-generator/src/main.rs:29— `info!` at line 29 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/smithy-generator/src/main.rs:31— `info!` at line 31 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/smithy-generator/src/main.rs:41— `info!` at line 41 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/smithy-generator/src/main.rs:46— `info!` at line 46 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/smithy-generator/src/main.rs:53— `info!` at line 53 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/scheduler/src/consumer.rs:102— `debug!` at line 102 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/scheduler/src/consumer.rs:106— `info!` at line 106 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/scheduler/src/consumer.rs:114— `info!` at line 114 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/scheduler/src/consumer.rs:194— `info!` at line 194 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/scheduler/src/producer.rs:50— `error!` at line 50 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/scheduler/src/utils.rs:31— `info!` at line 31 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/scheduler/src/utils.rs:77— `debug!` at line 77 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/scheduler/src/utils.rs:87— `debug!` at line 87 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/scheduler/src/utils.rs:135— `debug!` at line 135 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/scheduler/src/utils.rs:326— `info!` at line 326 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging crates/router_env/src/request_id.rs:949— `error!` at line 949 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Duplicated predicate crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:39— `colorIconCardCvcError !== null && typeof colorIconCardCvcError === "string"` appears character-identically in 2 files — crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js, crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:36— `labelType !== null && typeof labelType === "string"` appears character-identically in 2 files — crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js, crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/router/src/core/generic_link/payout_link/initiate/script.js:67— `navigator.language || navigator.userLanguage` appears character-identically in 2 files — crates/router/src/core/generic_link/payout_link/initiate/script.js, REDACTED. 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 postman/collection-dir/adyen_uk/event.prerequest.js:4— `path.match(/\/payments$/) && isPostRequest` appears character-identically in 2 files — postman/collection-dir/adyen_uk/event.prerequest.js, postman/collection-dir/paypal/event.prerequest.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:80— `paymentDetails.sdk_layout === "spaced_accordion" || paymentDetails.sdk_layout === "accordion"` appears character-identically in 2 files — crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js, crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:22— `paymentDetails.theme || "rgb(0, 109, 249)"` appears character-identically in 2 files — crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js, crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:118— `paymentMethodsHeaderText !== null && typeof paymentMethodsHeaderText === "string"` appears character-identically in 2 files — crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js, crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:90— `paymentMethodsSeparatorText !== null && typeof paymentMethodsSeparatorText === "string"` appears character-identically in 2 files — crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js, crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js:112— `showCardTerms !== null && typeof showCardTerms === "string"` appears character-identically in 2 files — crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js, crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs:4143— `(self.customer_acceptance.is_some() || self.setup_mandate_details.is_some()) && self.setup_future_usage == Some(FutureUsage::OffSession)` appears character-identically in 2 files — crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs, crates/hyperswitch_connectors/src/utils.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/router/src/core/refunds.rs:254— `add_access_token_result.connector_supports_access_token && router_data.access_token.is_none()` appears character-identically in 2 files — crates/router/src/core/refunds.rs, crates/router/src/core/refunds_v2.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/hyperswitch_connectors/src/connectors/barclaycard.rs:1536— `auth_type == common_enums::AuthenticationType::ThreeDs && request_data.is_card()` appears character-identically in 2 files — crates/hyperswitch_connectors/src/connectors/barclaycard.rs, crates/hyperswitch_connectors/src/connectors/saferpay.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/hyperswitch_connectors/src/connectors/nexixpay.rs:79— `auth_type.is_three_ds() && request.is_card() && (request.connector_mandate_id().is_none() && request.get_optional_network_transaction_id().i…` appears character-identically in 2 files — crates/hyperswitch_connectors/src/connectors/nexixpay.rs, crates/hyperswitch_connectors/src/connectors/paysafe.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/hyperswitch_connectors/src/connectors/elavon_pg.rs:740— `auth_type.is_three_ds() && request_data.is_card()` appears character-identically in 7 files — crates/hyperswitch_connectors/src/connectors/elavon_pg.rs, crates/hyperswitch_connectors/src/connectors/ilixium.rs, crates/hyperswitch_connectors/src/connectors/moneris.rs, crates/hyperswitch_connectors/src/connectors/nmi.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs:730— `auth_type.is_three_ds() && request_data.is_card() && request_data.authentication_data.is_none()` appears character-identically in 2 files — crates/hyperswitch_connectors/src/connectors/globalpayments_realex.rs, crates/hyperswitch_connectors/src/connectors/paydotcom.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/router/src/core/payments/operations/payment_confirm.rs:1705— `authentication_store .authentication .is_separate_authn_required() || authentication_store .authentication .authentication_status .is_failed…` appears character-identically in 2 files — crates/router/src/core/payments/operations/payment_confirm.rs, crates/router/src/core/payments/operations/payment_confirm_external_vault_proxy.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/payment_methods/src/core/migration/payment_methods.rs:313— `card_details.card_issuer.is_some() && card_details.card_network.is_some() && card_details.card_type.is_some() && card_details.card_issuing_c…` appears character-identically in 2 files — crates/payment_methods/src/core/migration/payment_methods.rs, crates/payment_methods/src/helpers.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/api_models/src/payment_methods.rs:4880— `card_update.card_holder_name.is_some() || card_update.nick_name.is_some()` appears character-identically in 2 files — crates/api_models/src/payment_methods.rs, crates/hyperswitch_domain_models/src/payment_methods.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/payment_methods/src/core/migration/payment_methods.rs:785— `customer.default_payment_method_id.is_none() && req.payment_method.is_some()` appears character-identically in 2 files — crates/payment_methods/src/core/migration/payment_methods.rs, crates/router/src/core/payment_methods/cards.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/hyperswitch_connectors/src/connectors/getnet.rs:182— `data.encoded_data.is_some() || data .connector_transaction_id .get_connector_transaction_id() .is_ok()` appears character-identically in 4 files — crates/hyperswitch_connectors/src/connectors/getnet.rs, crates/hyperswitch_connectors/src/connectors/jpmorgan.rs, crates/hyperswitch_connectors/src/connectors/novalnet.rs, crates/hyperswitch_connectors/src/connectors/payjustnow.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/hyperswitch_connectors/src/connectors/barclaycard.rs:716— `data.is_three_ds() && data.request.is_card()` appears character-identically in 3 files — crates/hyperswitch_connectors/src/connectors/barclaycard.rs, crates/hyperswitch_connectors/src/connectors/bluesnap.rs, crates/hyperswitch_connectors/src/connectors/deutschebank.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/hyperswitch_connectors/src/connectors/nuvei.rs:1751— `is_config_enabled_to_send_payment_id_as_connector_request_id && payment_intent.is_payment_id_from_merchant.unwrap_or(false)` appears character-identically in 5 files — crates/hyperswitch_connectors/src/connectors/nuvei.rs, crates/hyperswitch_connectors/src/connectors/redsys.rs, crates/hyperswitch_connectors/src/connectors/santander.rs, crates/hyperswitch_connectors/src/connectors/tesouro.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/router/src/core/payments/operations/payment_create.rs:842— `is_tax_connector_enabled && !skip_external_tax_calculation` appears character-identically in 3 files — crates/router/src/core/payments/operations/payment_create.rs, crates/router/src/core/payments/operations/payment_update.rs, crates/router/src/core/payments/operations/tax_calculation.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs:417— `item.router_data.is_three_ds() && item.router_data.request.authentication_data.is_none()` appears character-identically in 3 files — crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs, crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs, crates/hyperswitch_connectors/src/connectors/zift/transformers.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/router/src/core/payments/operations/payment_complete_authorize.rs:320— `payment_attempt.mandate_details.is_some() || request.mandate_data.is_some()` appears character-identically in 3 files — crates/router/src/core/payments/operations/payment_complete_authorize.rs, crates/router/src/core/payments/operations/payment_confirm.rs, crates/router/src/core/payments/operations/payment_update.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 8 significant file(s) lose their only recent owner: crates/api_models/src/cards_info.rs, crates/router/src/workflows/blocklist_profile_clone.rs, crates/router/src/db/batch_blocklist_job.rs, crates/router/src/workflows/blocklist_export.rs, crates/router/src/core/blocklist/clone.rs, crates/router/src/core/blocklist.rs, crates/router/src/routes/card_issuer.rs, crates/diesel_models/src/batch_blocklist_job.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 6 significant file(s) lose their only recent owner: crates/router/src/core/offer_engine/notify.rs, crates/router/src/db/authorization.rs, crates/router/src/core/offer_engine/config.rs, crates/router/src/core/offer_engine/apply.rs, crates/router/src/core/offer_engine/eligibility.rs, crates/router/src/core/offer_engine/connectivity.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 4 significant file(s) lose their only recent owner: crates/external_services/src/grpc_client/deja_transport.rs, crates/external_services/src/http_client/boundary.rs, crates/router/src/services/kafka/deja_record_sink.rs, crates/router/src/deja_boot.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 3 significant file(s) lose their only recent owner: crates/hyperswitch_connectors/src/connectors/merchante.rs, crates/hyperswitch_connectors/src/connectors/etisalat.rs, crates/hyperswitch_connectors/src/connectors/worldpayraft.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 3 significant file(s) lose their only recent owner: crates/hyperswitch_domain_models/src/revenue_recovery/retry_stats_cluster_key.rs, crates/hyperswitch_domain_models/src/revenue_recovery/retry_stats_document.rs, crates/router/src/core/revenue_recovery/retry_stats/migration.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 3 significant file(s) lose their only recent owner: crates/router/src/core/payments/server_integration.rs, crates/router/src/workflows/network_tokenization.rs, crates/payment_methods/src/client/session.rs. Pair on, review, or document these before any departure.
Classify ADR enforcement: Hyperswitch RFC Process docs/rfcs/guidelines.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: 001-compile-time-perf docs/rfcs/text/001-compile-time-perf.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
README/code drift cypress-tests/README.md:282— cypress-tests/README.md links to `cypress/e2e/PaymentUtils/Stripe.js`, but `cypress-tests/cypress/e2e/PaymentUtils/Stripe.js` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift cypress-tests/README.md:283— cypress-tests/README.md links to `cypress-tests/cypress/e2e/PayoutUtils/Adyen.js`, but `cypress-tests/cypress-tests/cypress/e2e/PayoutUtils/Adyen.js` 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.
Partial audit-trail evidence — An audit mechanism is present, but the trail is not yet complete — missing: a write-side hook every change flows through (a SeaORM ActiveModelBehavior hook or a database trigger recording each change, or an event-sourced store), per-entity coverage (an event-sourced aggregate, or a hook on each entity that needs a who-changed-what trail).
C4 · Data Retention· Partial data-retention evidence · ×1
Partial data-retention evidence — A retention mechanism is present, but the data-lifecycle is not yet complete — missing: a scheduled purge / cleanup job (a scheduled task that deletes rows past their retention — diesel::delete(….filter(created_at.lt(cutoff))), purge_expired… / delete_old…), a documented retention period / data-expiry.
D10 · Test Quality· Test project verifies nothing · ×1
Test project verifies nothing: cypress-tests-v2 cypress-tests-v2/cypress/e2e/spec/Routing/0000-Coreflows.cy.js:21— No conventional assertion call was detected in 44 of 44 tests in `cypress-tests-v2` — the project as a whole, not one method. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a suite that genuinely checks nothing. If it is the latter, this project passes unconditionally and cannot fail.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 11 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (46 single-owned of 1461 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1461 of the 1999 production source files in this repository met that bar). They are anonymized user #7 (2 file(s)), anonymized user #8 (2 file(s)), anonymized user #9 (2 file(s)), anonymized user #10 (2 file(s)), anonymized user #11 (2 file(s)), anonymized user #12 (2 file(s)) (+5 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: crates/hyperswitch_connectors/src/connectors/santander/responses.rs, crates/hyperswitch_connectors/src/connectors/santander/requests.rs, crates/router/src/core/superposition_proxy.rs, crates/openapi/src/routes/revenue_recovery.rs, crates/hyperswitch_connectors/src/connectors/absa_sanlam.rs, crates/hyperswitch_connectors/src/connectors/sanlam_payshield/transformers.rs, crates/router/src/routes/customers/migrate.rs, crates/router/src/core/payment_methods/backward_compat.rs (+11 more).
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 10 of 41 project(s) overshoot their size bounds, lowering Project Cohesion to 5.2/10. The most over is `crates/router` (348203 LoC, 1741 module-visible types across 89 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 172 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs, crates/router/src/types/domain/address.rs, crates/hyperswitch_connectors/src/connectors/payone.rs, crates/pm_auth/src/connector/plaid/transformers.rs, crates/router_env/src/logger/formatter.rs, crates/pm_auth/src/connector/plaid.rs, crates/router/src/db/user/theme.rs, crates/router/src/routes/dummy_connector/types.rs (and 164 more) (187 orphaned of 1461 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1461 of the 1999 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D9 · Test Distribution· Inverted test pyramid · ×1
Inverted test pyramid — Only 15 % of tests are unit tests (785 unit vs 2735 integration, 0 BDD); a broader unit base gives faster, more localised feedback.
P10 · Library API & versioning· Large public API surface · ×1
Large public API surface — 10937/11817 types (93%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
Logging is not universal — Only 24/29 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/config_importer`, `crates/hsdev`, `crates/openapi`, `crates/test_utils`, `cypress-tests/mitm-proxy`.
R8 · Dependency Hygiene· Test-only dependency 'cors' in production deps · ×1
Test-only dependency 'cors' in production deps cypress-tests/package.json:34— Only test files import it (first: REDACTED:4) — move it to devDependencies.
Security headers incomplete — Set: Content-Security-Policy, Strict-Transport-Security. Missing: X-Content-Type-Options, X-Frame-Options — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each.(−1.0 on this card.) The server: `HttpServer::new(` (crates/router/src/lib.rs:431).
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 0/1 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Silent fallback default on parse failure cypress-tests/mitm-proxy/redirect_proxy.py:235— `_read_json_body` returns `{}` when `json.JSONDecodeError` 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 Err crates/router/src/core/merchant_connector_webhook_management/transformers.rs:304— `construct_connector_webhook_registration_details` turns every `Err` into `true` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default in catch cypress-tests/cypress/support/redirectionHandler.js:4924— `waitForRedirect` swallows every exception into `return false` — 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.
Outdated: actix-http — `actix-http` is locked at 3.11.0 but 3.20.0 is the current stable release on crates.io, and it already satisfies the `"3.11.0"` requirement declared in crates/router/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p actix-http` and commit the updated REDACTED.
Outdated: actix-rt — `actix-rt` is locked at 2.10.0 but 2.15.0 is the current stable release on crates.io, and it already satisfies the `"2.10.0"` requirement declared in crates/router/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p actix-rt` and commit the updated REDACTED.
Outdated: actix-web — `actix-web` is locked at 4.11.0 but 4.18.1 is the current stable release on crates.io, and it already satisfies the `"4.11.0"` requirement declared in crates/analytics/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p actix-web` and commit the updated REDACTED.
Outdated: anyhow — `anyhow` is locked at 1.0.98 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1.0.98"` requirement declared in crates/config_importer/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
Outdated: aws-config — `aws-config` is locked at 1.6.0 but 1.13.0 is the current stable release on crates.io, and it already satisfies the `"1.6.0"` requirement declared in crates/analytics/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-config` and commit the updated REDACTED.
Outdated: aws-sdk-kms — `aws-sdk-kms` is locked at 1.51.0 but 1.126.0 is the current stable release on crates.io, and it already satisfies the `"1.51.0"` requirement declared in crates/cloud_services/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-sdk-kms` and commit the updated REDACTED.
Outdated: aws-sdk-lambda — `aws-sdk-lambda` is locked at 1.60.0 but 1.154.0 is the current stable release on crates.io, and it already satisfies the `"1.60.0"` requirement declared in crates/analytics/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-sdk-lambda` and commit the updated REDACTED.
Outdated: aws-sdk-s3 — `aws-sdk-s3` is locked at 1.79.0 but 1.155.0 is the current stable release on crates.io, and it already satisfies the `"1.79.0"` requirement declared in crates/cloud_services/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-sdk-s3` and commit the updated REDACTED.
Outdated: aws-sdk-sesv2 — `aws-sdk-sesv2` is locked at 1.57.0 but 1.143.0 is the current stable release on crates.io, and it already satisfies the `"1.57.0"` requirement declared in crates/cloud_services/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-sdk-sesv2` and commit the updated REDACTED.
Outdated: aws-sdk-sts — `aws-sdk-sts` is locked at 1.63.0 but 1.122.0 is the current stable release on crates.io, and it already satisfies the `"1.51.0"` requirement declared in crates/cloud_services/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-sdk-sts` and commit the updated REDACTED.
Outdated: aws-smithy-runtime — `aws-smithy-runtime` is locked at 1.8.3 but 1.16.1 is the current stable release on crates.io, and it already satisfies the `"1.8.3"` requirement declared in crates/cloud_services/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-smithy-runtime` and commit the updated REDACTED.
Outdated: aws-smithy-runtime-api — `aws-smithy-runtime-api` is locked at 1.8.0 but 1.19.1 is the current stable release on crates.io, and it already satisfies the `"1.7"` requirement declared in crates/cloud_services/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-smithy-runtime-api` and commit the updated REDACTED.
Outdated: aws-smithy-types — `aws-smithy-types` is locked at 1.3.1 but 1.9.0 is the current stable release on crates.io, and it already satisfies the `"1.3.1"` requirement declared in crates/analytics/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-smithy-types` and commit the updated REDACTED.
Outdated: bigdecimal — `bigdecimal` is locked at 0.4.8 but 0.4.11 is the current stable release on crates.io, and it already satisfies the `"0.4.8"` requirement declared in crates/analytics/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bigdecimal` and commit the updated REDACTED.
Outdated: blake3 — `blake3` is locked at 1.8.2 but 1.8.7 is the current stable release on crates.io, and it already satisfies the `"1.8.2"` requirement declared in crates/common_utils/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p blake3` and commit the updated REDACTED.
Outdated: bytes — `bytes` is locked at 1.10.1 but 1.12.1 is the current stable release on crates.io, and it already satisfies the `"1.10.1"` requirement declared in crates/common_utils/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bytes` and commit the updated REDACTED.
Outdated: chrono — `chrono` is locked at 0.4.38 but 0.4.45 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in crates/hyperswitch_connectors/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p chrono` and commit the updated REDACTED.
Outdated: clap — `clap` is locked at 4.5.38 but 4.6.7 is the current stable release on crates.io, and it already satisfies the `"4.5.38"` requirement declared in crates/config_importer/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
Outdated: cookie — `cookie` is locked at 0.18.1 but 0.18.2 is the current stable release on crates.io, and it already satisfies the `"0.18.1"` requirement declared in crates/router/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p cookie` and commit the updated REDACTED.
Outdated: crc — `crc` is locked at 3.2.1 but 3.4.0 is the current stable release on crates.io, and it already satisfies the `"3"` requirement declared in crates/hyperswitch_connectors/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crc` and commit the updated REDACTED.
Outdated: crc32fast — `crc32fast` is locked at 1.4.2 but 1.5.3 is the current stable release on crates.io, and it already satisfies the `"1.4.2"` requirement declared in crates/storage_impl/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crc32fast` and commit the updated REDACTED.
Outdated: csv — `csv` is locked at 1.3.1 but 1.4.0 is the current stable release on crates.io, and it already satisfies the `"1.3"` requirement declared in crates/api_models/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p csv` and commit the updated REDACTED.
Outdated: diesel — `diesel` is locked at 2.3.12 but 2.3.14 is the current stable release on crates.io, and it already satisfies the `"2.3.12"` requirement declared in crates/common_enums/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p diesel` and commit the updated REDACTED.
Outdated: dyn-clone — `dyn-clone` is locked at 1.0.19 but 1.0.20 is the current stable release on crates.io, and it already satisfies the `"1.0.19"` requirement declared in crates/external_services/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p dyn-clone` and commit the updated REDACTED.
Outdated: encoding_rs — `encoding_rs` is locked at 0.8.35 but 0.8.42 is the current stable release on crates.io, and it already satisfies the `"0.8.35"` requirement declared in crates/hyperswitch_connectors/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p encoding_rs` and commit the updated REDACTED.
Skipped (documented): create-ucs-configs-call-test cypress-tests/cypress/e2e/spec/Payout/00004-BankTransfer.cy.js:206— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): fulfill-venmo-wallet-payout-call-test cypress-tests/cypress/e2e/spec/Payout/00010-WalletPayout.cy.js:122— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): cit-capture-call-test cypress-tests/cypress/e2e/spec/Payment/11-CreateSingleuseMandate.cy.js:252— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Retrieve payment cypress-tests/cypress/e2e/spec/Payment/11-CreateSingleuseMandate.cy.js:266— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Confirm No 3DS MIT cypress-tests/cypress/e2e/spec/Payment/11-CreateSingleuseMandate.cy.js:277— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): MIT for Mandates Call cypress-tests/cypress/e2e/spec/Payment/12-CreateMultiuseMandate.cy.js:275— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): MIT for Mandates Call - 2nd Attempt cypress-tests/cypress/e2e/spec/Payment/12-CreateMultiuseMandate.cy.js:295— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Refund Payment cypress-tests/cypress/e2e/spec/Payment/12-CreateMultiuseMandate.cy.js:315— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Sync Refund Payment cypress-tests/cypress/e2e/spec/Payment/12-CreateMultiuseMandate.cy.js:329— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Create Customer cypress-tests/cypress/e2e/spec/Payment/15-ZeroAuthMandate.cy.js:317— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Confirm No 3DS CIT cypress-tests/cypress/e2e/spec/Payment/15-ZeroAuthMandate.cy.js:330— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): retrieve-payment-call-test cypress-tests/cypress/e2e/spec/Payment/15-ZeroAuthMandate.cy.js:357— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Confirm No 3DS MIT cypress-tests/cypress/e2e/spec/Payment/15-ZeroAuthMandate.cy.js:374— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): mit-capture-call-test cypress-tests/cypress/e2e/spec/Payment/15-ZeroAuthMandate.cy.js:400— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): retrieve-payment-call-test cypress-tests/cypress/e2e/spec/Payment/15-ZeroAuthMandate.cy.js:417— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Create Customer -> Create and Confirm Payment -> Retrieve Payment -> List Customer PMs -> Create Payment Intent -> Save Card Confirm cypress-tests/cypress/e2e/spec/Payment/40-ExternalVault.cy.js:65— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Create Customer -> Create and Confirm Payment -> Retrieve Payment -> List Customer PMs -> Create Payment Intent -> Save Card Confirm -> Retrieve Payment -> Capture -> Retrieve after Capture cypress-tests/cypress/e2e/spec/Payment/40-ExternalVault.cy.js:168— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): Create Customer -> Create and Confirm Payment -> Retrieve Payment -> List Customer PMs -> Create Payment Intent -> Save Card Confirm cypress-tests/cypress/e2e/spec/Payment/40-ExternalVault.cy.js:323— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): should verify vault product_type persists on retrieve cypress-tests/cypress/e2e/spec/Misc/00003-ProductType.cy.js:38— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): should verify recon product_type persists on retrieve cypress-tests/cypress/e2e/spec/Misc/00003-ProductType.cy.js:63— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): should verify recovery product_type persists on retrieve cypress-tests/cypress/e2e/spec/Misc/00003-ProductType.cy.js:88— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): should verify cost_observability product_type persists on retrieve cypress-tests/cypress/e2e/spec/Misc/00003-ProductType.cy.js:113— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): should verify dynamic_routing product_type persists on retrieve cypress-tests/cypress/e2e/spec/Misc/00003-ProductType.cy.js:138— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): should verify orchestration product_type persists on retrieve cypress-tests/cypress/e2e/spec/Misc/00003-ProductType.cy.js:161— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Off the main sequence: common_enums — common_enums: abstractness 0.13, instability 0.13, distance 0.74 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: common_utils — common_utils: abstractness 0.19, instability 0.07, distance 0.73 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 2 file(s) — `crates/router/src/core/payments.rs`, `crates/router/src/core/payments/routing.rs` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a17558-61a2-7113-b916-8641c127a698 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 2042 · Warnings: 5776 · Recommendations: 1880 · Info: 100 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 25-10-2026 @ 23:14 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.